` parent tag\n * when the URL is either '/user/jim' or '/user/bob'.\n *\n * ```html\n *
\n * ```\n *\n * The `RouterLinkActive` directive can also be used to set the aria-current attribute\n * to provide an alternative distinction for active elements to visually impaired users.\n *\n * For example, the following code adds the 'active' class to the Home Page link when it is\n * indeed active and in such case also sets its aria-current attribute to 'page':\n *\n * ```html\n *
Home Page\n * ```\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\nclass RouterLinkActive {\n router;\n element;\n renderer;\n cdr;\n link;\n links;\n classes = [];\n routerEventsSubscription;\n linkInputChangesSubscription;\n _isActive = false;\n get isActive() {\n return this._isActive;\n }\n /**\n * Options to configure how to determine if the router link is active.\n *\n * These options are passed to the `Router.isActive()` function.\n *\n * @see {@link Router#isActive}\n */\n routerLinkActiveOptions = {\n exact: false\n };\n /**\n * Aria-current attribute to apply when the router link is active.\n *\n * Possible values: `'page'` | `'step'` | `'location'` | `'date'` | `'time'` | `true` | `false`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current}\n */\n ariaCurrentWhenActive;\n /**\n *\n * You can use the output `isActiveChange` to get notified each time the link becomes\n * active or inactive.\n *\n * Emits:\n * true -> Route is active\n * false -> Route is inactive\n *\n * ```html\n *
Bob\n * ```\n */\n isActiveChange = new EventEmitter();\n constructor(router, element, renderer, cdr, link) {\n this.router = router;\n this.element = element;\n this.renderer = renderer;\n this.cdr = cdr;\n this.link = link;\n this.routerEventsSubscription = router.events.subscribe(s => {\n if (s instanceof NavigationEnd) {\n this.update();\n }\n });\n }\n /** @docs-private */\n ngAfterContentInit() {\n // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).\n of(this.links.changes, of(null)).pipe(mergeAll()).subscribe(_ => {\n this.update();\n this.subscribeToEachLinkOnChanges();\n });\n }\n subscribeToEachLinkOnChanges() {\n this.linkInputChangesSubscription?.unsubscribe();\n const allLinkChanges = [...this.links.toArray(), this.link].filter(link => !!link).map(link => link.onChanges);\n this.linkInputChangesSubscription = from(allLinkChanges).pipe(mergeAll()).subscribe(link => {\n if (this._isActive !== this.isLinkActive(this.router)(link)) {\n this.update();\n }\n });\n }\n set routerLinkActive(data) {\n const classes = Array.isArray(data) ? data : data.split(' ');\n this.classes = classes.filter(c => !!c);\n }\n /** @docs-private */\n ngOnChanges(changes) {\n this.update();\n }\n /** @docs-private */\n ngOnDestroy() {\n this.routerEventsSubscription.unsubscribe();\n this.linkInputChangesSubscription?.unsubscribe();\n }\n update() {\n if (!this.links || !this.router.navigated) return;\n queueMicrotask(() => {\n const hasActiveLinks = this.hasActiveLinks();\n this.classes.forEach(c => {\n if (hasActiveLinks) {\n this.renderer.addClass(this.element.nativeElement, c);\n } else {\n this.renderer.removeClass(this.element.nativeElement, c);\n }\n });\n if (hasActiveLinks && this.ariaCurrentWhenActive !== undefined) {\n this.renderer.setAttribute(this.element.nativeElement, 'aria-current', this.ariaCurrentWhenActive.toString());\n } else {\n this.renderer.removeAttribute(this.element.nativeElement, 'aria-current');\n }\n // Only emit change if the active state changed.\n if (this._isActive !== hasActiveLinks) {\n this._isActive = hasActiveLinks;\n this.cdr.markForCheck();\n // Emit on isActiveChange after classes are updated\n this.isActiveChange.emit(hasActiveLinks);\n }\n });\n }\n isLinkActive(router) {\n const options = isActiveMatchOptions(this.routerLinkActiveOptions) ? this.routerLinkActiveOptions :\n // While the types should disallow `undefined` here, it's possible without strict inputs\n this.routerLinkActiveOptions.exact || false;\n return link => {\n const urlTree = link.urlTree;\n return urlTree ? router.isActive(urlTree, options) : false;\n };\n }\n hasActiveLinks() {\n const isActiveCheckFn = this.isLinkActive(this.router);\n return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);\n }\n static ɵfac = function RouterLinkActive_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || RouterLinkActive)(i0.ɵɵdirectiveInject(Router), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(RouterLink, 8));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: RouterLinkActive,\n selectors: [[\"\", \"routerLinkActive\", \"\"]],\n contentQueries: function RouterLinkActive_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, RouterLink, 5);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.links = _t);\n }\n },\n inputs: {\n routerLinkActiveOptions: \"routerLinkActiveOptions\",\n ariaCurrentWhenActive: \"ariaCurrentWhenActive\",\n routerLinkActive: \"routerLinkActive\"\n },\n outputs: {\n isActiveChange: \"isActiveChange\"\n },\n exportAs: [\"routerLinkActive\"],\n features: [i0.ɵɵNgOnChangesFeature]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(RouterLinkActive, [{\n type: Directive,\n args: [{\n selector: '[routerLinkActive]',\n exportAs: 'routerLinkActive'\n }]\n }], () => [{\n type: Router\n }, {\n type: i0.ElementRef\n }, {\n type: i0.Renderer2\n }, {\n type: i0.ChangeDetectorRef\n }, {\n type: RouterLink,\n decorators: [{\n type: Optional\n }]\n }], {\n links: [{\n type: ContentChildren,\n args: [RouterLink, {\n descendants: true\n }]\n }],\n routerLinkActiveOptions: [{\n type: Input\n }],\n ariaCurrentWhenActive: [{\n type: Input\n }],\n isActiveChange: [{\n type: Output\n }],\n routerLinkActive: [{\n type: Input\n }]\n });\n})();\n/**\n * Use instead of `'paths' in options` to be compatible with property renaming\n */\nfunction isActiveMatchOptions(options) {\n return !!options.paths;\n}\n\n/**\n * @description\n *\n * Provides a preloading strategy.\n *\n * @publicApi\n */\nclass PreloadingStrategy {}\n/**\n * @description\n *\n * Provides a preloading strategy that preloads all modules as quickly as possible.\n *\n * ```ts\n * RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})\n * ```\n *\n * @publicApi\n */\nclass PreloadAllModules {\n preload(route, fn) {\n return fn().pipe(catchError(() => of(null)));\n }\n static ɵfac = function PreloadAllModules_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PreloadAllModules)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PreloadAllModules,\n factory: PreloadAllModules.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PreloadAllModules, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * @description\n *\n * Provides a preloading strategy that does not preload any modules.\n *\n * This strategy is enabled by default.\n *\n * @publicApi\n */\nclass NoPreloading {\n preload(route, fn) {\n return of(null);\n }\n static ɵfac = function NoPreloading_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NoPreloading)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NoPreloading,\n factory: NoPreloading.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NoPreloading, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * The preloader optimistically loads all router configurations to\n * make navigations into lazily-loaded sections of the application faster.\n *\n * The preloader runs in the background. When the router bootstraps, the preloader\n * starts listening to all navigation events. After every such event, the preloader\n * will check if any configurations can be loaded lazily.\n *\n * If a route is protected by `canLoad` guards, the preloaded will not load it.\n *\n * @publicApi\n */\nclass RouterPreloader {\n router;\n injector;\n preloadingStrategy;\n loader;\n subscription;\n constructor(router, injector, preloadingStrategy, loader) {\n this.router = router;\n this.injector = injector;\n this.preloadingStrategy = preloadingStrategy;\n this.loader = loader;\n }\n setUpPreloading() {\n this.subscription = this.router.events.pipe(filter(e => e instanceof NavigationEnd), concatMap(() => this.preload())).subscribe(() => {});\n }\n preload() {\n return this.processRoutes(this.injector, this.router.config);\n }\n /** @docs-private */\n ngOnDestroy() {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n }\n processRoutes(injector, routes) {\n const res = [];\n for (const route of routes) {\n if (route.providers && !route._injector) {\n route._injector = createEnvironmentInjector(route.providers, injector, `Route: ${route.path}`);\n }\n const injectorForCurrentRoute = route._injector ?? injector;\n const injectorForChildren = route._loadedInjector ?? injectorForCurrentRoute;\n // Note that `canLoad` is only checked as a condition that prevents `loadChildren` and not\n // `loadComponent`. `canLoad` guards only block loading of child routes by design. This\n // happens as a consequence of needing to descend into children for route matching immediately\n // while component loading is deferred until route activation. Because `canLoad` guards can\n // have side effects, we cannot execute them here so we instead skip preloading altogether\n // when present. Lastly, it remains to be decided whether `canLoad` should behave this way\n // at all. Code splitting and lazy loading is separate from client-side authorization checks\n // and should not be used as a security measure to prevent loading of code.\n if (route.loadChildren && !route._loadedRoutes && route.canLoad === undefined || route.loadComponent && !route._loadedComponent) {\n res.push(this.preloadConfig(injectorForCurrentRoute, route));\n }\n if (route.children || route._loadedRoutes) {\n res.push(this.processRoutes(injectorForChildren, route.children ?? route._loadedRoutes));\n }\n }\n return from(res).pipe(mergeAll());\n }\n preloadConfig(injector, route) {\n return this.preloadingStrategy.preload(route, () => {\n let loadedChildren$;\n if (route.loadChildren && route.canLoad === undefined) {\n loadedChildren$ = this.loader.loadChildren(injector, route);\n } else {\n loadedChildren$ = of(null);\n }\n const recursiveLoadChildren$ = loadedChildren$.pipe(mergeMap(config => {\n if (config === null) {\n return of(void 0);\n }\n route._loadedRoutes = config.routes;\n route._loadedInjector = config.injector;\n // If the loaded config was a module, use that as the module/module injector going\n // forward. Otherwise, continue using the current module/module injector.\n return this.processRoutes(config.injector ?? injector, config.routes);\n }));\n if (route.loadComponent && !route._loadedComponent) {\n const loadComponent$ = this.loader.loadComponent(injector, route);\n return from([recursiveLoadChildren$, loadComponent$]).pipe(mergeAll());\n } else {\n return recursiveLoadChildren$;\n }\n });\n }\n static ɵfac = function RouterPreloader_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || RouterPreloader)(i0.ɵɵinject(Router), i0.ɵɵinject(i0.EnvironmentInjector), i0.ɵɵinject(PreloadingStrategy), i0.ɵɵinject(RouterConfigLoader));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: RouterPreloader,\n factory: RouterPreloader.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(RouterPreloader, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [{\n type: Router\n }, {\n type: i0.EnvironmentInjector\n }, {\n type: PreloadingStrategy\n }, {\n type: RouterConfigLoader\n }], null);\n})();\nconst ROUTER_SCROLLER = new InjectionToken('');\nclass RouterScroller {\n urlSerializer;\n transitions;\n viewportScroller;\n zone;\n options;\n routerEventsSubscription;\n scrollEventsSubscription;\n lastId = 0;\n lastSource = IMPERATIVE_NAVIGATION;\n restoredId = 0;\n store = {};\n /** @docs-private */\n constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) {\n this.urlSerializer = urlSerializer;\n this.transitions = transitions;\n this.viewportScroller = viewportScroller;\n this.zone = zone;\n this.options = options;\n // Default both options to 'disabled'\n options.scrollPositionRestoration ||= 'disabled';\n options.anchorScrolling ||= 'disabled';\n }\n init() {\n // we want to disable the automatic scrolling because having two places\n // responsible for scrolling results race conditions, especially given\n // that browser don't implement this behavior consistently\n if (this.options.scrollPositionRestoration !== 'disabled') {\n this.viewportScroller.setHistoryScrollRestoration('manual');\n }\n this.routerEventsSubscription = this.createScrollEvents();\n this.scrollEventsSubscription = this.consumeScrollEvents();\n }\n createScrollEvents() {\n return this.transitions.events.subscribe(e => {\n if (e instanceof NavigationStart) {\n // store the scroll position of the current stable navigations.\n this.store[this.lastId] = this.viewportScroller.getScrollPosition();\n this.lastSource = e.navigationTrigger;\n this.restoredId = e.restoredState ? e.restoredState.navigationId : 0;\n } else if (e instanceof NavigationEnd) {\n this.lastId = e.id;\n this.scheduleScrollEvent(e, this.urlSerializer.parse(e.urlAfterRedirects).fragment);\n } else if (e instanceof NavigationSkipped && e.code === NavigationSkippedCode.IgnoredSameUrlNavigation) {\n this.lastSource = undefined;\n this.restoredId = 0;\n this.scheduleScrollEvent(e, this.urlSerializer.parse(e.url).fragment);\n }\n });\n }\n consumeScrollEvents() {\n return this.transitions.events.subscribe(e => {\n if (!(e instanceof Scroll)) return;\n // a popstate event. The pop state event will always ignore anchor scrolling.\n if (e.position) {\n if (this.options.scrollPositionRestoration === 'top') {\n this.viewportScroller.scrollToPosition([0, 0]);\n } else if (this.options.scrollPositionRestoration === 'enabled') {\n this.viewportScroller.scrollToPosition(e.position);\n }\n // imperative navigation \"forward\"\n } else {\n if (e.anchor && this.options.anchorScrolling === 'enabled') {\n this.viewportScroller.scrollToAnchor(e.anchor);\n } else if (this.options.scrollPositionRestoration !== 'disabled') {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n }\n });\n }\n scheduleScrollEvent(routerEvent, anchor) {\n this.zone.runOutsideAngular(async () => {\n // The scroll event needs to be delayed until after change detection. Otherwise, we may\n // attempt to restore the scroll position before the router outlet has fully rendered the\n // component by executing its update block of the template function.\n //\n // #57109 (we need to wait at least a macrotask before scrolling. AfterNextRender resolves in microtask event loop with Zones)\n // We could consider _also_ waiting for a render promise though one should have already happened or been scheduled by this point\n // and should definitely happen before rAF/setTimeout.\n // #53985 (cannot rely solely on setTimeout because a frame may paint before the timeout)\n await new Promise(resolve => {\n setTimeout(resolve);\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(resolve);\n }\n });\n this.zone.run(() => {\n this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));\n });\n });\n }\n /** @docs-private */\n ngOnDestroy() {\n this.routerEventsSubscription?.unsubscribe();\n this.scrollEventsSubscription?.unsubscribe();\n }\n static ɵfac = function RouterScroller_Factory(__ngFactoryType__) {\n i0.ɵɵinvalidFactory();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: RouterScroller,\n factory: RouterScroller.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(RouterScroller, [{\n type: Injectable\n }], () => [{\n type: UrlSerializer\n }, {\n type: NavigationTransitions\n }, {\n type: i3.ViewportScroller\n }, {\n type: i0.NgZone\n }, {\n type: undefined\n }], null);\n})();\n\n/**\n * Sets up providers necessary to enable `Router` functionality for the application.\n * Allows to configure a set of routes as well as extra features that should be enabled.\n *\n * @usageNotes\n *\n * Basic example of how you can add a Router to your application:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent, {\n * providers: [provideRouter(appRoutes)]\n * });\n * ```\n *\n * You can also enable optional features in the Router by adding functions from the `RouterFeatures`\n * type:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes,\n * withDebugTracing(),\n * withRouterConfig({paramsInheritanceStrategy: 'always'}))\n * ]\n * }\n * );\n * ```\n *\n * @see {@link RouterFeatures}\n *\n * @publicApi\n * @param routes A set of `Route`s to use for the application routing table.\n * @param features Optional features to configure additional router behaviors.\n * @returns A set of providers to setup a Router.\n */\nfunction provideRouter(routes, ...features) {\n return makeEnvironmentProviders([{\n provide: ROUTES,\n multi: true,\n useValue: routes\n }, typeof ngDevMode === 'undefined' || ngDevMode ? {\n provide: ROUTER_IS_PROVIDED,\n useValue: true\n } : [], {\n provide: ActivatedRoute,\n useFactory: rootRoute,\n deps: [Router]\n }, {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: getBootstrapListener\n }, features.map(feature => feature.ɵproviders)]);\n}\nfunction rootRoute(router) {\n return router.routerState.root;\n}\n/**\n * Helper function to create an object that represents a Router feature.\n */\nfunction routerFeature(kind, providers) {\n return {\n ɵkind: kind,\n ɵproviders: providers\n };\n}\n/**\n * An Injection token used to indicate whether `provideRouter` or `RouterModule.forRoot` was ever\n * called.\n */\nconst ROUTER_IS_PROVIDED = new InjectionToken('', {\n providedIn: 'root',\n factory: () => false\n});\nconst routerIsProvidedDevModeCheck = {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory() {\n return () => {\n if (!inject(ROUTER_IS_PROVIDED)) {\n console.warn('`provideRoutes` was called without `provideRouter` or `RouterModule.forRoot`. ' + 'This is likely a mistake.');\n }\n };\n }\n};\n/**\n * Registers a DI provider for a set of routes.\n * @param routes The route configuration to provide.\n *\n * @usageNotes\n *\n * ```ts\n * @NgModule({\n * providers: [provideRoutes(ROUTES)]\n * })\n * class LazyLoadedChildModule {}\n * ```\n *\n * @deprecated If necessary, provide routes using the `ROUTES` `InjectionToken`.\n * @see {@link ROUTES}\n * @publicApi\n */\nfunction provideRoutes(routes) {\n return [{\n provide: ROUTES,\n multi: true,\n useValue: routes\n }, typeof ngDevMode === 'undefined' || ngDevMode ? routerIsProvidedDevModeCheck : []];\n}\n/**\n * Enables customizable scrolling behavior for router navigations.\n *\n * @usageNotes\n *\n * Basic example of how you can enable scrolling feature:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withInMemoryScrolling())\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n * @see {@link ViewportScroller}\n *\n * @publicApi\n * @param options Set of configuration parameters to customize scrolling behavior, see\n * `InMemoryScrollingOptions` for additional information.\n * @returns A set of providers for use with `provideRouter`.\n */\nfunction withInMemoryScrolling(options = {}) {\n const providers = [{\n provide: ROUTER_SCROLLER,\n useFactory: () => {\n const viewportScroller = inject(ViewportScroller);\n const zone = inject(NgZone);\n const transitions = inject(NavigationTransitions);\n const urlSerializer = inject(UrlSerializer);\n return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, options);\n }\n }];\n return routerFeature(4 /* RouterFeatureKind.InMemoryScrollingFeature */, providers);\n}\nfunction getBootstrapListener() {\n const injector = inject(Injector);\n return bootstrappedComponentRef => {\n const ref = injector.get(ApplicationRef);\n if (bootstrappedComponentRef !== ref.components[0]) {\n return;\n }\n const router = injector.get(Router);\n const bootstrapDone = injector.get(BOOTSTRAP_DONE);\n if (injector.get(INITIAL_NAVIGATION) === 1 /* InitialNavigation.EnabledNonBlocking */) {\n router.initialNavigation();\n }\n injector.get(ROUTER_PRELOADER, null, {\n optional: true\n })?.setUpPreloading();\n injector.get(ROUTER_SCROLLER, null, {\n optional: true\n })?.init();\n router.resetRootComponentType(ref.componentTypes[0]);\n if (!bootstrapDone.closed) {\n bootstrapDone.next();\n bootstrapDone.complete();\n bootstrapDone.unsubscribe();\n }\n };\n}\n/**\n * A subject used to indicate that the bootstrapping phase is done. When initial navigation is\n * `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing\n * to the activation phase.\n */\nconst BOOTSTRAP_DONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'bootstrap done indicator' : '', {\n factory: () => {\n return new Subject();\n }\n});\nconst INITIAL_NAVIGATION = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'initial navigation' : '', {\n providedIn: 'root',\n factory: () => 1 /* InitialNavigation.EnabledNonBlocking */\n});\n/**\n * Configures initial navigation to start before the root component is created.\n *\n * The bootstrap is blocked until the initial navigation is complete. This should be set in case\n * you use [server-side rendering](guide/ssr), but do not enable [hydration](guide/hydration) for\n * your application.\n *\n * @usageNotes\n *\n * Basic example of how you can enable this navigation behavior:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withEnabledBlockingInitialNavigation())\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n *\n * @publicApi\n * @returns A set of providers for use with `provideRouter`.\n */\nfunction withEnabledBlockingInitialNavigation() {\n const providers = [{\n provide: INITIAL_NAVIGATION,\n useValue: 0 /* InitialNavigation.EnabledBlocking */\n }, provideAppInitializer(() => {\n const injector = inject(Injector);\n const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve());\n return locationInitialized.then(() => {\n return new Promise(resolve => {\n const router = injector.get(Router);\n const bootstrapDone = injector.get(BOOTSTRAP_DONE);\n afterNextNavigation(router, () => {\n // Unblock APP_INITIALIZER in case the initial navigation was canceled or errored\n // without a redirect.\n resolve(true);\n });\n injector.get(NavigationTransitions).afterPreactivation = () => {\n // Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we\n // assume activation will complete successfully (even though this is not\n // guaranteed).\n resolve(true);\n return bootstrapDone.closed ? of(void 0) : bootstrapDone;\n };\n router.initialNavigation();\n });\n });\n })];\n return routerFeature(2 /* RouterFeatureKind.EnabledBlockingInitialNavigationFeature */, providers);\n}\n/**\n * Disables initial navigation.\n *\n * Use if there is a reason to have more control over when the router starts its initial navigation\n * due to some complex initialization logic.\n *\n * @usageNotes\n *\n * Basic example of how you can disable initial navigation:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withDisabledInitialNavigation())\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n *\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withDisabledInitialNavigation() {\n const providers = [provideAppInitializer(() => {\n inject(Router).setUpLocationChangeListener();\n }), {\n provide: INITIAL_NAVIGATION,\n useValue: 2 /* InitialNavigation.Disabled */\n }];\n return routerFeature(3 /* RouterFeatureKind.DisabledInitialNavigationFeature */, providers);\n}\n/**\n * Enables logging of all internal navigation events to the console.\n * Extra logging might be useful for debugging purposes to inspect Router event sequence.\n *\n * @usageNotes\n *\n * Basic example of how you can enable debug tracing:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withDebugTracing())\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n *\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withDebugTracing() {\n let providers = [];\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n providers = [{\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const router = inject(Router);\n return () => router.events.subscribe(e => {\n // tslint:disable:no-console\n console.group?.(`Router Event: ${e.constructor.name}`);\n console.log(stringifyEvent(e));\n console.log(e);\n console.groupEnd?.();\n // tslint:enable:no-console\n });\n }\n }];\n } else {\n providers = [];\n }\n return routerFeature(1 /* RouterFeatureKind.DebugTracingFeature */, providers);\n}\nconst ROUTER_PRELOADER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'router preloader' : '');\n/**\n * Allows to configure a preloading strategy to use. The strategy is configured by providing a\n * reference to a class that implements a `PreloadingStrategy`.\n *\n * @usageNotes\n *\n * Basic example of how you can configure preloading:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withPreloading(PreloadAllModules))\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n *\n * @param preloadingStrategy A reference to a class that implements a `PreloadingStrategy` that\n * should be used.\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withPreloading(preloadingStrategy) {\n const providers = [{\n provide: ROUTER_PRELOADER,\n useExisting: RouterPreloader\n }, {\n provide: PreloadingStrategy,\n useExisting: preloadingStrategy\n }];\n return routerFeature(0 /* RouterFeatureKind.PreloadingFeature */, providers);\n}\n/**\n * Allows to provide extra parameters to configure Router.\n *\n * @usageNotes\n *\n * Basic example of how you can provide extra configuration options:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withRouterConfig({\n * onSameUrlNavigation: 'reload'\n * }))\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n *\n * @param options A set of parameters to configure Router, see `RouterConfigOptions` for\n * additional information.\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withRouterConfig(options) {\n const providers = [{\n provide: ROUTER_CONFIGURATION,\n useValue: options\n }];\n return routerFeature(5 /* RouterFeatureKind.RouterConfigurationFeature */, providers);\n}\n/**\n * Provides the location strategy that uses the URL fragment instead of the history API.\n *\n * @usageNotes\n *\n * Basic example of how you can use the hash location option:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withHashLocation())\n * ]\n * }\n * );\n * ```\n *\n * @see {@link provideRouter}\n * @see {@link /api/common/HashLocationStrategy HashLocationStrategy}\n *\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withHashLocation() {\n const providers = [{\n provide: LocationStrategy,\n useClass: HashLocationStrategy\n }];\n return routerFeature(6 /* RouterFeatureKind.RouterHashLocationFeature */, providers);\n}\n/**\n * Provides a function which is called when a navigation error occurs.\n *\n * This function is run inside application's [injection context](guide/di/dependency-injection-context)\n * so you can use the [`inject`](api/core/inject) function.\n *\n * This function can return a `RedirectCommand` to convert the error to a redirect, similar to returning\n * a `UrlTree` or `RedirectCommand` from a guard. This will also prevent the `Router` from emitting\n * `NavigationError`; it will instead emit `NavigationCancel` with code NavigationCancellationCode.Redirect.\n * Return values other than `RedirectCommand` are ignored and do not change any behavior with respect to\n * how the `Router` handles the error.\n *\n * @usageNotes\n *\n * Basic example of how you can use the error handler option:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withNavigationErrorHandler((e: NavigationError) =>\n * inject(MyErrorTracker).trackError(e)))\n * ]\n * }\n * );\n * ```\n *\n * @see {@link NavigationError}\n * @see {@link /api/core/inject inject}\n * @see {@link runInInjectionContext}\n *\n * @returns A set of providers for use with `provideRouter`.\n *\n * @publicApi\n */\nfunction withNavigationErrorHandler(handler) {\n const providers = [{\n provide: NAVIGATION_ERROR_HANDLER,\n useValue: handler\n }];\n return routerFeature(7 /* RouterFeatureKind.NavigationErrorHandlerFeature */, providers);\n}\n/**\n * Enables binding information from the `Router` state directly to the inputs of the component in\n * `Route` configurations.\n *\n * @usageNotes\n *\n * Basic example of how you can enable the feature:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withComponentInputBinding())\n * ]\n * }\n * );\n * ```\n *\n * The router bindings information from any of the following sources:\n *\n * - query parameters\n * - path and matrix parameters\n * - static route data\n * - data from resolvers\n *\n * Duplicate keys are resolved in the same order from above, from least to greatest,\n * meaning that resolvers have the highest precedence and override any of the other information\n * from the route.\n *\n * Importantly, when an input does not have an item in the route data with a matching key, this\n * input is set to `undefined`. This prevents previous information from being\n * retained if the data got removed from the route (i.e. if a query parameter is removed).\n * Default values can be provided with a resolver on the route to ensure the value is always present\n * or an input and use an input transform in the component.\n *\n * @see {@link /guide/components/inputs#input-transforms Input Transforms}\n * @returns A set of providers for use with `provideRouter`.\n */\nfunction withComponentInputBinding() {\n const providers = [RoutedComponentInputBinder, {\n provide: INPUT_BINDER,\n useExisting: RoutedComponentInputBinder\n }];\n return routerFeature(8 /* RouterFeatureKind.ComponentInputBindingFeature */, providers);\n}\n/**\n * Enables view transitions in the Router by running the route activation and deactivation inside of\n * `document.startViewTransition`.\n *\n * Note: The View Transitions API is not available in all browsers. If the browser does not support\n * view transitions, the Router will not attempt to start a view transition and continue processing\n * the navigation as usual.\n *\n * @usageNotes\n *\n * Basic example of how you can enable the feature:\n * ```ts\n * const appRoutes: Routes = [];\n * bootstrapApplication(AppComponent,\n * {\n * providers: [\n * provideRouter(appRoutes, withViewTransitions())\n * ]\n * }\n * );\n * ```\n *\n * @returns A set of providers for use with `provideRouter`.\n * @see https://developer.chrome.com/docs/web-platform/view-transitions/\n * @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API\n * @developerPreview 19.0\n */\nfunction withViewTransitions(options) {\n _performanceMarkFeature('NgRouterViewTransitions');\n const providers = [{\n provide: CREATE_VIEW_TRANSITION,\n useValue: createViewTransition\n }, {\n provide: VIEW_TRANSITION_OPTIONS,\n useValue: {\n skipNextTransition: !!options?.skipInitialTransition,\n ...options\n }\n }];\n return routerFeature(9 /* RouterFeatureKind.ViewTransitionsFeature */, providers);\n}\n\n/**\n * The directives defined in the `RouterModule`.\n */\nconst ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent];\n/**\n * @docsNotRequired\n */\nconst ROUTER_FORROOT_GUARD = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'router duplicate forRoot guard' : '');\n// TODO(atscott): All of these except `ActivatedRoute` are `providedIn: 'root'`. They are only kept\n// here to avoid a breaking change whereby the provider order matters based on where the\n// `RouterModule`/`RouterTestingModule` is imported. These can/should be removed as a \"breaking\"\n// change in a major version.\nconst ROUTER_PROVIDERS = [Location, {\n provide: UrlSerializer,\n useClass: DefaultUrlSerializer\n}, Router, ChildrenOutletContexts, {\n provide: ActivatedRoute,\n useFactory: rootRoute,\n deps: [Router]\n}, RouterConfigLoader,\n// Only used to warn when `provideRoutes` is used without `RouterModule` or `provideRouter`. Can\n// be removed when `provideRoutes` is removed.\ntypeof ngDevMode === 'undefined' || ngDevMode ? {\n provide: ROUTER_IS_PROVIDED,\n useValue: true\n} : []];\n/**\n * @description\n *\n * Adds directives and providers for in-app navigation among views defined in an application.\n * Use the Angular `Router` service to declaratively specify application states and manage state\n * transitions.\n *\n * You can import this NgModule multiple times, once for each lazy-loaded bundle.\n * However, only one `Router` service can be active.\n * To ensure this, there are two ways to register routes when importing this module:\n *\n * * The `forRoot()` method creates an `NgModule` that contains all the directives, the given\n * routes, and the `Router` service itself.\n * * The `forChild()` method creates an `NgModule` that contains all the directives and the given\n * routes, but does not include the `Router` service.\n *\n * @see [Routing and Navigation guide](guide/routing/common-router-tasks) for an\n * overview of how the `Router` service should be used.\n *\n * @publicApi\n */\nclass RouterModule {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n inject(ROUTER_FORROOT_GUARD, {\n optional: true\n });\n }\n }\n /**\n * Creates and configures a module with all the router providers and directives.\n * Optionally sets up an application listener to perform an initial navigation.\n *\n * When registering the NgModule at the root, import as follows:\n *\n * ```ts\n * @NgModule({\n * imports: [RouterModule.forRoot(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param routes An array of `Route` objects that define the navigation paths for the application.\n * @param config An `ExtraOptions` configuration object that controls how navigation is performed.\n * @return The new `NgModule`.\n *\n */\n static forRoot(routes, config) {\n return {\n ngModule: RouterModule,\n providers: [ROUTER_PROVIDERS, typeof ngDevMode === 'undefined' || ngDevMode ? config?.enableTracing ? withDebugTracing().ɵproviders : [] : [], {\n provide: ROUTES,\n multi: true,\n useValue: routes\n }, typeof ngDevMode === 'undefined' || ngDevMode ? {\n provide: ROUTER_FORROOT_GUARD,\n useFactory: provideForRootGuard,\n deps: [[Router, new Optional(), new SkipSelf()]]\n } : [], config?.errorHandler ? {\n provide: NAVIGATION_ERROR_HANDLER,\n useValue: config.errorHandler\n } : [], {\n provide: ROUTER_CONFIGURATION,\n useValue: config ? config : {}\n }, config?.useHash ? provideHashLocationStrategy() : providePathLocationStrategy(), provideRouterScroller(), config?.preloadingStrategy ? withPreloading(config.preloadingStrategy).ɵproviders : [], config?.initialNavigation ? provideInitialNavigation(config) : [], config?.bindToComponentInputs ? withComponentInputBinding().ɵproviders : [], config?.enableViewTransitions ? withViewTransitions().ɵproviders : [], provideRouterInitializer()]\n };\n }\n /**\n * Creates a module with all the router directives and a provider registering routes,\n * without creating a new Router service.\n * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:\n *\n * ```ts\n * @NgModule({\n * imports: [RouterModule.forChild(ROUTES)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param routes An array of `Route` objects that define the navigation paths for the submodule.\n * @return The new NgModule.\n *\n */\n static forChild(routes) {\n return {\n ngModule: RouterModule,\n providers: [{\n provide: ROUTES,\n multi: true,\n useValue: routes\n }]\n };\n }\n static ɵfac = function RouterModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || RouterModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: RouterModule,\n imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],\n exports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent]\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(RouterModule, [{\n type: NgModule,\n args: [{\n imports: ROUTER_DIRECTIVES,\n exports: ROUTER_DIRECTIVES\n }]\n }], () => [], null);\n})();\n/**\n * For internal use by `RouterModule` only. Note that this differs from `withInMemoryRouterScroller`\n * because it reads from the `ExtraOptions` which should not be used in the standalone world.\n */\nfunction provideRouterScroller() {\n return {\n provide: ROUTER_SCROLLER,\n useFactory: () => {\n const viewportScroller = inject(ViewportScroller);\n const zone = inject(NgZone);\n const config = inject(ROUTER_CONFIGURATION);\n const transitions = inject(NavigationTransitions);\n const urlSerializer = inject(UrlSerializer);\n if (config.scrollOffset) {\n viewportScroller.setOffset(config.scrollOffset);\n }\n return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config);\n }\n };\n}\n// Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` should\n// provide hash location directly via `{provide: LocationStrategy, useClass: HashLocationStrategy}`.\nfunction provideHashLocationStrategy() {\n return {\n provide: LocationStrategy,\n useClass: HashLocationStrategy\n };\n}\n// Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` does not\n// need this at all because `PathLocationStrategy` is the default factory for `LocationStrategy`.\nfunction providePathLocationStrategy() {\n return {\n provide: LocationStrategy,\n useClass: PathLocationStrategy\n };\n}\nfunction provideForRootGuard(router) {\n if (router) {\n throw new _RuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `The Router was provided more than once. This can happen if 'forRoot' is used outside of the root injector.` + ` Lazy loaded modules should use RouterModule.forChild() instead.`);\n }\n return 'guarded';\n}\n// Note: For internal use only with `RouterModule`. Standalone router setup with `provideRouter`\n// users call `withXInitialNavigation` directly.\nfunction provideInitialNavigation(config) {\n return [config.initialNavigation === 'disabled' ? withDisabledInitialNavigation().ɵproviders : [], config.initialNavigation === 'enabledBlocking' ? withEnabledBlockingInitialNavigation().ɵproviders : []];\n}\n// TODO(atscott): This should not be in the public API\n/**\n * A DI token for the router initializer that\n * is called after the app is bootstrapped.\n *\n * @publicApi\n */\nconst ROUTER_INITIALIZER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Router Initializer' : '');\nfunction provideRouterInitializer() {\n return [\n // ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just\n // have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.\n {\n provide: ROUTER_INITIALIZER,\n useFactory: getBootstrapListener\n }, {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useExisting: ROUTER_INITIALIZER\n }];\n}\nexport { NoPreloading, PreloadAllModules, PreloadingStrategy, ROUTER_INITIALIZER, ROUTER_PROVIDERS, RouterLink, RouterLinkActive, RouterModule, RouterPreloader, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions };\n", "/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nexport { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, EventType, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationError, NavigationSkipped, NavigationSkippedCode, NavigationStart, OutletContext, PRIMARY_OUTLET, ROUTER_CONFIGURATION, ROUTER_OUTLET_DATA, ROUTES, RedirectCommand, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterOutlet, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, ɵEmptyOutletComponent, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren } from './router2.mjs';\nexport { NoPreloading, PreloadAllModules, PreloadingStrategy, ROUTER_INITIALIZER, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterPreloader, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS } from './router_module.mjs';\nimport { inject, Version } from '@angular/core';\nimport '@angular/common';\nimport 'rxjs';\nimport 'rxjs/operators';\nimport '@angular/platform-browser';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nfunction mapToCanMatch(providers) {\n return providers.map((provider) => (...params) => inject(provider).canMatch(...params));\n}\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nfunction mapToCanActivate(providers) {\n return providers.map((provider) => (...params) => inject(provider).canActivate(...params));\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nfunction mapToCanActivateChild(providers) {\n return providers.map((provider) => (...params) => inject(provider).canActivateChild(...params));\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nfunction mapToCanDeactivate(providers) {\n return providers.map((provider) => (...params) => inject(provider).canDeactivate(...params));\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nfunction mapToResolve(provider) {\n return (...params) => inject(provider).resolve(...params);\n}\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n/**\n * @publicApi\n */\nconst VERSION = new Version('20.1.7');\n\nexport { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };\n\n"],
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAM,iBAAiB;AAMvB,IAAM,gBAA+B,OAAO,YAAY;AACxD,IAAM,cAAN,MAAkB;AAAA,EAChB;AAAA,EACA,YAAY,QAAQ;AAClB,SAAK,SAAS,UAAU,CAAC;AAAA,EAC3B;AAAA,EACA,IAAI,MAAM;AACR,WAAO,OAAO,UAAU,eAAe,KAAK,KAAK,QAAQ,IAAI;AAAA,EAC/D;AAAA,EACA,IAAI,MAAM;AACR,QAAI,KAAK,IAAI,IAAI,GAAG;AAClB,YAAM,IAAI,KAAK,OAAO,IAAI;AAC1B,aAAO,MAAM,QAAQ,CAAC,IAA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P;AACA,SAAO;AACT;AAGA,SAAS,yBAAyB,QAAQ;AACxC,SAAO,CAAC,OAAO,sBAAsB,aAAa,8BAA8B,EAAE,aAAa,CAAC,GAAG,OAAO,sBAAsB,oBAAoB,qCAAqC,EAAE,aAAa,CAAC,CAAC;AAC5M;AAQA,IAAM,qBAAqB,IAAI,eAAe,OAAO,cAAc,eAAe,YAAY,uBAAuB,EAAE;AACvH,SAAS,2BAA2B;AAClC,SAAO;AAAA;AAAA;AAAA,IAGP;AAAA,MACE,SAAS;AAAA,MACT,YAAY;AAAA,IACd;AAAA,IAAG;AAAA,MACD,SAAS;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EAAC;AACH;;;ACxwDA,SAAS,cAAc,WAAW;AAC9B,SAAO,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,OAAO,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;AAC1F;AAUA,SAAS,iBAAiB,WAAW;AACjC,SAAO,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,OAAO,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC;AAC7F;AAUA,SAAS,sBAAsB,WAAW;AACtC,SAAO,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,OAAO,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAClG;AAUA,SAAS,mBAAmB,WAAW;AACnC,SAAO,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,OAAO,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;AAC/F;AAUA,SAAS,aAAa,UAAU;AAC5B,SAAO,IAAI,WAAW,OAAO,QAAQ,EAAE,QAAQ,GAAG,MAAM;AAC5D;AAUA,IAAM,UAAU,IAAI,QAAQ,QAAQ;",
+ "names": ["last", "tree", "match", "res", "commands", "noMatch", "EventType", "NavigationCancellationCode", "NavigationSkippedCode", "t", "c", "node", "map", "contexts", "canActivate", "s", "input", "from", "e"]
+}
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/_metadata.json b/.angular/cache/20.1.6/TFTPaths/vite/deps/_metadata.json
new file mode 100644
index 0000000..1db0df2
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/_metadata.json
@@ -0,0 +1,97 @@
+{
+ "hash": "7db7c7ac",
+ "configHash": "8521c03c",
+ "lockfileHash": "d7cc9b13",
+ "browserHash": "0b4f96b6",
+ "optimized": {
+ "@angular/common": {
+ "src": "../../../../../../node_modules/@angular/common/fesm2022/common.mjs",
+ "file": "@angular_common.js",
+ "fileHash": "509bace1",
+ "needsInterop": false
+ },
+ "@angular/compiler": {
+ "src": "../../../../../../node_modules/@angular/compiler/fesm2022/compiler.mjs",
+ "file": "@angular_compiler.js",
+ "fileHash": "e5d52a5d",
+ "needsInterop": false
+ },
+ "@angular/core": {
+ "src": "../../../../../../node_modules/@angular/core/fesm2022/core.mjs",
+ "file": "@angular_core.js",
+ "fileHash": "4df09a4a",
+ "needsInterop": false
+ },
+ "@angular/forms": {
+ "src": "../../../../../../node_modules/@angular/forms/fesm2022/forms.mjs",
+ "file": "@angular_forms.js",
+ "fileHash": "de475f19",
+ "needsInterop": false
+ },
+ "@angular/platform-browser": {
+ "src": "../../../../../../node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs",
+ "file": "@angular_platform-browser.js",
+ "fileHash": "e59614c2",
+ "needsInterop": false
+ },
+ "@angular/platform-browser-dynamic": {
+ "src": "../../../../../../node_modules/@angular/platform-browser-dynamic/fesm2022/platform-browser-dynamic.mjs",
+ "file": "@angular_platform-browser-dynamic.js",
+ "fileHash": "d6f09bb4",
+ "needsInterop": false
+ },
+ "@angular/router": {
+ "src": "../../../../../../node_modules/@angular/router/fesm2022/router.mjs",
+ "file": "@angular_router.js",
+ "fileHash": "814002e0",
+ "needsInterop": false
+ },
+ "lodash": {
+ "src": "../../../../../../node_modules/lodash/lodash.js",
+ "file": "lodash.js",
+ "fileHash": "a623b1f0",
+ "needsInterop": true
+ },
+ "rxjs": {
+ "src": "../../../../../../node_modules/rxjs/_esm5/index.js",
+ "file": "rxjs.js",
+ "fileHash": "86bab98a",
+ "needsInterop": false
+ },
+ "tslib": {
+ "src": "../../../../../../node_modules/tslib/tslib.es6.js",
+ "file": "tslib.js",
+ "fileHash": "1d13b381",
+ "needsInterop": false
+ },
+ "zone.js": {
+ "src": "../../../../../../node_modules/zone.js/fesm2015/zone.js",
+ "file": "zone__js.js",
+ "fileHash": "9eec7157",
+ "needsInterop": true
+ }
+ },
+ "chunks": {
+ "chunk-MIBI5X5V": {
+ "file": "chunk-MIBI5X5V.js"
+ },
+ "chunk-WA5MBXOM": {
+ "file": "chunk-WA5MBXOM.js"
+ },
+ "chunk-J7WYVKQ5": {
+ "file": "chunk-J7WYVKQ5.js"
+ },
+ "chunk-T7UM462Y": {
+ "file": "chunk-T7UM462Y.js"
+ },
+ "chunk-6OOPNYDU": {
+ "file": "chunk-6OOPNYDU.js"
+ },
+ "chunk-7PMVITZM": {
+ "file": "chunk-7PMVITZM.js"
+ },
+ "chunk-3OV72XIM": {
+ "file": "chunk-3OV72XIM.js"
+ }
+ }
+}
\ No newline at end of file
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js
new file mode 100644
index 0000000..1fda6a2
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js
@@ -0,0 +1,63 @@
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getOwnPropSymbols = Object.getOwnPropertySymbols;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __propIsEnum = Object.prototype.propertyIsEnumerable;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __spreadValues = (a, b) => {
+ for (var prop in b ||= {})
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+var __objRest = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+var __commonJS = (cb, mod) => function __require() {
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
+var __async = (__this, __arguments, generator) => {
+ return new Promise((resolve, reject) => {
+ var fulfilled = (value) => {
+ try {
+ step(generator.next(value));
+ } catch (e) {
+ reject(e);
+ }
+ };
+ var rejected = (value) => {
+ try {
+ step(generator.throw(value));
+ } catch (e) {
+ reject(e);
+ }
+ };
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
+ step((generator = generator.apply(__this, __arguments)).next());
+ });
+};
+
+export {
+ __spreadValues,
+ __spreadProps,
+ __objRest,
+ __commonJS,
+ __async
+};
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js.map b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js.map
new file mode 100644
index 0000000..9865211
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-3OV72XIM.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": [],
+ "sourcesContent": [],
+ "mappings": "",
+ "names": []
+}
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js
new file mode 100644
index 0000000..c835689
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js
@@ -0,0 +1,3853 @@
+import {
+ __extends
+} from "./chunk-7PMVITZM.js";
+
+// node_modules/rxjs/_esm5/internal/util/isFunction.js
+function isFunction(x) {
+ return typeof x === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/config.js
+var _enable_super_gross_mode_that_will_cause_bad_things = false;
+var config = {
+ Promise: void 0,
+ set useDeprecatedSynchronousErrorHandling(value) {
+ if (value) {
+ var error = new Error();
+ console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n" + error.stack);
+ } else if (_enable_super_gross_mode_that_will_cause_bad_things) {
+ console.log("RxJS: Back to a better error behavior. Thank you. <3");
+ }
+ _enable_super_gross_mode_that_will_cause_bad_things = value;
+ },
+ get useDeprecatedSynchronousErrorHandling() {
+ return _enable_super_gross_mode_that_will_cause_bad_things;
+ }
+};
+
+// node_modules/rxjs/_esm5/internal/util/hostReportError.js
+function hostReportError(err) {
+ setTimeout(function() {
+ throw err;
+ }, 0);
+}
+
+// node_modules/rxjs/_esm5/internal/Observer.js
+var empty = {
+ closed: true,
+ next: function(value) {
+ },
+ error: function(err) {
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ throw err;
+ } else {
+ hostReportError(err);
+ }
+ },
+ complete: function() {
+ }
+};
+
+// node_modules/rxjs/_esm5/internal/util/isArray.js
+var isArray = function() {
+ return Array.isArray || function(x) {
+ return x && typeof x.length === "number";
+ };
+}();
+
+// node_modules/rxjs/_esm5/internal/util/isObject.js
+function isObject(x) {
+ return x !== null && typeof x === "object";
+}
+
+// node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js
+var UnsubscriptionErrorImpl = function() {
+ function UnsubscriptionErrorImpl2(errors) {
+ Error.call(this);
+ this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
+ return i + 1 + ") " + err.toString();
+ }).join("\n ") : "";
+ this.name = "UnsubscriptionError";
+ this.errors = errors;
+ return this;
+ }
+ UnsubscriptionErrorImpl2.prototype = Object.create(Error.prototype);
+ return UnsubscriptionErrorImpl2;
+}();
+var UnsubscriptionError = UnsubscriptionErrorImpl;
+
+// node_modules/rxjs/_esm5/internal/Subscription.js
+var Subscription = function() {
+ function Subscription2(unsubscribe) {
+ this.closed = false;
+ this._parentOrParents = null;
+ this._subscriptions = null;
+ if (unsubscribe) {
+ this._ctorUnsubscribe = true;
+ this._unsubscribe = unsubscribe;
+ }
+ }
+ Subscription2.prototype.unsubscribe = function() {
+ var errors;
+ if (this.closed) {
+ return;
+ }
+ var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
+ this.closed = true;
+ this._parentOrParents = null;
+ this._subscriptions = null;
+ if (_parentOrParents instanceof Subscription2) {
+ _parentOrParents.remove(this);
+ } else if (_parentOrParents !== null) {
+ for (var index = 0; index < _parentOrParents.length; ++index) {
+ var parent_1 = _parentOrParents[index];
+ parent_1.remove(this);
+ }
+ }
+ if (isFunction(_unsubscribe)) {
+ if (_ctorUnsubscribe) {
+ this._unsubscribe = void 0;
+ }
+ try {
+ _unsubscribe.call(this);
+ } catch (e) {
+ errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
+ }
+ }
+ if (isArray(_subscriptions)) {
+ var index = -1;
+ var len = _subscriptions.length;
+ while (++index < len) {
+ var sub = _subscriptions[index];
+ if (isObject(sub)) {
+ try {
+ sub.unsubscribe();
+ } catch (e) {
+ errors = errors || [];
+ if (e instanceof UnsubscriptionError) {
+ errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
+ } else {
+ errors.push(e);
+ }
+ }
+ }
+ }
+ }
+ if (errors) {
+ throw new UnsubscriptionError(errors);
+ }
+ };
+ Subscription2.prototype.add = function(teardown) {
+ var subscription = teardown;
+ if (!teardown) {
+ return Subscription2.EMPTY;
+ }
+ switch (typeof teardown) {
+ case "function":
+ subscription = new Subscription2(teardown);
+ case "object":
+ if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== "function") {
+ return subscription;
+ } else if (this.closed) {
+ subscription.unsubscribe();
+ return subscription;
+ } else if (!(subscription instanceof Subscription2)) {
+ var tmp = subscription;
+ subscription = new Subscription2();
+ subscription._subscriptions = [tmp];
+ }
+ break;
+ default: {
+ throw new Error("unrecognized teardown " + teardown + " added to Subscription.");
+ }
+ }
+ var _parentOrParents = subscription._parentOrParents;
+ if (_parentOrParents === null) {
+ subscription._parentOrParents = this;
+ } else if (_parentOrParents instanceof Subscription2) {
+ if (_parentOrParents === this) {
+ return subscription;
+ }
+ subscription._parentOrParents = [_parentOrParents, this];
+ } else if (_parentOrParents.indexOf(this) === -1) {
+ _parentOrParents.push(this);
+ } else {
+ return subscription;
+ }
+ var subscriptions = this._subscriptions;
+ if (subscriptions === null) {
+ this._subscriptions = [subscription];
+ } else {
+ subscriptions.push(subscription);
+ }
+ return subscription;
+ };
+ Subscription2.prototype.remove = function(subscription) {
+ var subscriptions = this._subscriptions;
+ if (subscriptions) {
+ var subscriptionIndex = subscriptions.indexOf(subscription);
+ if (subscriptionIndex !== -1) {
+ subscriptions.splice(subscriptionIndex, 1);
+ }
+ }
+ };
+ Subscription2.EMPTY = function(empty3) {
+ empty3.closed = true;
+ return empty3;
+ }(new Subscription2());
+ return Subscription2;
+}();
+function flattenUnsubscriptionErrors(errors) {
+ return errors.reduce(function(errs, err) {
+ return errs.concat(err instanceof UnsubscriptionError ? err.errors : err);
+ }, []);
+}
+
+// node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js
+var rxSubscriber = function() {
+ return typeof Symbol === "function" ? Symbol("rxSubscriber") : "@@rxSubscriber_" + Math.random();
+}();
+
+// node_modules/rxjs/_esm5/internal/Subscriber.js
+var Subscriber = function(_super) {
+ __extends(Subscriber2, _super);
+ function Subscriber2(destinationOrNext, error, complete) {
+ var _this = _super.call(this) || this;
+ _this.syncErrorValue = null;
+ _this.syncErrorThrown = false;
+ _this.syncErrorThrowable = false;
+ _this.isStopped = false;
+ switch (arguments.length) {
+ case 0:
+ _this.destination = empty;
+ break;
+ case 1:
+ if (!destinationOrNext) {
+ _this.destination = empty;
+ break;
+ }
+ if (typeof destinationOrNext === "object") {
+ if (destinationOrNext instanceof Subscriber2) {
+ _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
+ _this.destination = destinationOrNext;
+ destinationOrNext.add(_this);
+ } else {
+ _this.syncErrorThrowable = true;
+ _this.destination = new SafeSubscriber(_this, destinationOrNext);
+ }
+ break;
+ }
+ default:
+ _this.syncErrorThrowable = true;
+ _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
+ break;
+ }
+ return _this;
+ }
+ Subscriber2.prototype[rxSubscriber] = function() {
+ return this;
+ };
+ Subscriber2.create = function(next, error, complete) {
+ var subscriber = new Subscriber2(next, error, complete);
+ subscriber.syncErrorThrowable = false;
+ return subscriber;
+ };
+ Subscriber2.prototype.next = function(value) {
+ if (!this.isStopped) {
+ this._next(value);
+ }
+ };
+ Subscriber2.prototype.error = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this._error(err);
+ }
+ };
+ Subscriber2.prototype.complete = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this._complete();
+ }
+ };
+ Subscriber2.prototype.unsubscribe = function() {
+ if (this.closed) {
+ return;
+ }
+ this.isStopped = true;
+ _super.prototype.unsubscribe.call(this);
+ };
+ Subscriber2.prototype._next = function(value) {
+ this.destination.next(value);
+ };
+ Subscriber2.prototype._error = function(err) {
+ this.destination.error(err);
+ this.unsubscribe();
+ };
+ Subscriber2.prototype._complete = function() {
+ this.destination.complete();
+ this.unsubscribe();
+ };
+ Subscriber2.prototype._unsubscribeAndRecycle = function() {
+ var _parentOrParents = this._parentOrParents;
+ this._parentOrParents = null;
+ this.unsubscribe();
+ this.closed = false;
+ this.isStopped = false;
+ this._parentOrParents = _parentOrParents;
+ return this;
+ };
+ return Subscriber2;
+}(Subscription);
+var SafeSubscriber = function(_super) {
+ __extends(SafeSubscriber2, _super);
+ function SafeSubscriber2(_parentSubscriber, observerOrNext, error, complete) {
+ var _this = _super.call(this) || this;
+ _this._parentSubscriber = _parentSubscriber;
+ var next;
+ var context = _this;
+ if (isFunction(observerOrNext)) {
+ next = observerOrNext;
+ } else if (observerOrNext) {
+ next = observerOrNext.next;
+ error = observerOrNext.error;
+ complete = observerOrNext.complete;
+ if (observerOrNext !== empty) {
+ context = Object.create(observerOrNext);
+ if (isFunction(context.unsubscribe)) {
+ _this.add(context.unsubscribe.bind(context));
+ }
+ context.unsubscribe = _this.unsubscribe.bind(_this);
+ }
+ }
+ _this._context = context;
+ _this._next = next;
+ _this._error = error;
+ _this._complete = complete;
+ return _this;
+ }
+ SafeSubscriber2.prototype.next = function(value) {
+ if (!this.isStopped && this._next) {
+ var _parentSubscriber = this._parentSubscriber;
+ if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
+ this.__tryOrUnsub(this._next, value);
+ } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
+ this.unsubscribe();
+ }
+ }
+ };
+ SafeSubscriber2.prototype.error = function(err) {
+ if (!this.isStopped) {
+ var _parentSubscriber = this._parentSubscriber;
+ var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;
+ if (this._error) {
+ if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
+ this.__tryOrUnsub(this._error, err);
+ this.unsubscribe();
+ } else {
+ this.__tryOrSetError(_parentSubscriber, this._error, err);
+ this.unsubscribe();
+ }
+ } else if (!_parentSubscriber.syncErrorThrowable) {
+ this.unsubscribe();
+ if (useDeprecatedSynchronousErrorHandling) {
+ throw err;
+ }
+ hostReportError(err);
+ } else {
+ if (useDeprecatedSynchronousErrorHandling) {
+ _parentSubscriber.syncErrorValue = err;
+ _parentSubscriber.syncErrorThrown = true;
+ } else {
+ hostReportError(err);
+ }
+ this.unsubscribe();
+ }
+ }
+ };
+ SafeSubscriber2.prototype.complete = function() {
+ var _this = this;
+ if (!this.isStopped) {
+ var _parentSubscriber = this._parentSubscriber;
+ if (this._complete) {
+ var wrappedComplete = function() {
+ return _this._complete.call(_this._context);
+ };
+ if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
+ this.__tryOrUnsub(wrappedComplete);
+ this.unsubscribe();
+ } else {
+ this.__tryOrSetError(_parentSubscriber, wrappedComplete);
+ this.unsubscribe();
+ }
+ } else {
+ this.unsubscribe();
+ }
+ }
+ };
+ SafeSubscriber2.prototype.__tryOrUnsub = function(fn, value) {
+ try {
+ fn.call(this._context, value);
+ } catch (err) {
+ this.unsubscribe();
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ throw err;
+ } else {
+ hostReportError(err);
+ }
+ }
+ };
+ SafeSubscriber2.prototype.__tryOrSetError = function(parent, fn, value) {
+ if (!config.useDeprecatedSynchronousErrorHandling) {
+ throw new Error("bad call");
+ }
+ try {
+ fn.call(this._context, value);
+ } catch (err) {
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ parent.syncErrorValue = err;
+ parent.syncErrorThrown = true;
+ return true;
+ } else {
+ hostReportError(err);
+ return true;
+ }
+ }
+ return false;
+ };
+ SafeSubscriber2.prototype._unsubscribe = function() {
+ var _parentSubscriber = this._parentSubscriber;
+ this._context = null;
+ this._parentSubscriber = null;
+ _parentSubscriber.unsubscribe();
+ };
+ return SafeSubscriber2;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/util/canReportError.js
+function canReportError(observer) {
+ while (observer) {
+ var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
+ if (closed_1 || isStopped) {
+ return false;
+ } else if (destination && destination instanceof Subscriber) {
+ observer = destination;
+ } else {
+ observer = null;
+ }
+ }
+ return true;
+}
+
+// node_modules/rxjs/_esm5/internal/util/toSubscriber.js
+function toSubscriber(nextOrObserver, error, complete) {
+ if (nextOrObserver) {
+ if (nextOrObserver instanceof Subscriber) {
+ return nextOrObserver;
+ }
+ if (nextOrObserver[rxSubscriber]) {
+ return nextOrObserver[rxSubscriber]();
+ }
+ }
+ if (!nextOrObserver && !error && !complete) {
+ return new Subscriber(empty);
+ }
+ return new Subscriber(nextOrObserver, error, complete);
+}
+
+// node_modules/rxjs/_esm5/internal/symbol/observable.js
+var observable = function() {
+ return typeof Symbol === "function" && Symbol.observable || "@@observable";
+}();
+
+// node_modules/rxjs/_esm5/internal/util/identity.js
+function identity(x) {
+ return x;
+}
+
+// node_modules/rxjs/_esm5/internal/util/pipe.js
+function pipe() {
+ var fns = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ fns[_i] = arguments[_i];
+ }
+ return pipeFromArray(fns);
+}
+function pipeFromArray(fns) {
+ if (fns.length === 0) {
+ return identity;
+ }
+ if (fns.length === 1) {
+ return fns[0];
+ }
+ return function piped(input) {
+ return fns.reduce(function(prev, fn) {
+ return fn(prev);
+ }, input);
+ };
+}
+
+// node_modules/rxjs/_esm5/internal/Observable.js
+var Observable = function() {
+ function Observable2(subscribe) {
+ this._isScalar = false;
+ if (subscribe) {
+ this._subscribe = subscribe;
+ }
+ }
+ Observable2.prototype.lift = function(operator) {
+ var observable2 = new Observable2();
+ observable2.source = this;
+ observable2.operator = operator;
+ return observable2;
+ };
+ Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
+ var operator = this.operator;
+ var sink = toSubscriber(observerOrNext, error, complete);
+ if (operator) {
+ sink.add(operator.call(sink, this.source));
+ } else {
+ sink.add(this.source || config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink));
+ }
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ if (sink.syncErrorThrowable) {
+ sink.syncErrorThrowable = false;
+ if (sink.syncErrorThrown) {
+ throw sink.syncErrorValue;
+ }
+ }
+ }
+ return sink;
+ };
+ Observable2.prototype._trySubscribe = function(sink) {
+ try {
+ return this._subscribe(sink);
+ } catch (err) {
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ sink.syncErrorThrown = true;
+ sink.syncErrorValue = err;
+ }
+ if (canReportError(sink)) {
+ sink.error(err);
+ } else {
+ console.warn(err);
+ }
+ }
+ };
+ Observable2.prototype.forEach = function(next, promiseCtor) {
+ var _this = this;
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor(function(resolve, reject) {
+ var subscription;
+ subscription = _this.subscribe(function(value) {
+ try {
+ next(value);
+ } catch (err) {
+ reject(err);
+ if (subscription) {
+ subscription.unsubscribe();
+ }
+ }
+ }, reject, resolve);
+ });
+ };
+ Observable2.prototype._subscribe = function(subscriber) {
+ var source = this.source;
+ return source && source.subscribe(subscriber);
+ };
+ Observable2.prototype[observable] = function() {
+ return this;
+ };
+ Observable2.prototype.pipe = function() {
+ var operations = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ operations[_i] = arguments[_i];
+ }
+ if (operations.length === 0) {
+ return this;
+ }
+ return pipeFromArray(operations)(this);
+ };
+ Observable2.prototype.toPromise = function(promiseCtor) {
+ var _this = this;
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor(function(resolve, reject) {
+ var value;
+ _this.subscribe(function(x) {
+ return value = x;
+ }, function(err) {
+ return reject(err);
+ }, function() {
+ return resolve(value);
+ });
+ });
+ };
+ Observable2.create = function(subscribe) {
+ return new Observable2(subscribe);
+ };
+ return Observable2;
+}();
+function getPromiseCtor(promiseCtor) {
+ if (!promiseCtor) {
+ promiseCtor = config.Promise || Promise;
+ }
+ if (!promiseCtor) {
+ throw new Error("no Promise impl found");
+ }
+ return promiseCtor;
+}
+
+// node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js
+var ObjectUnsubscribedErrorImpl = function() {
+ function ObjectUnsubscribedErrorImpl2() {
+ Error.call(this);
+ this.message = "object unsubscribed";
+ this.name = "ObjectUnsubscribedError";
+ return this;
+ }
+ ObjectUnsubscribedErrorImpl2.prototype = Object.create(Error.prototype);
+ return ObjectUnsubscribedErrorImpl2;
+}();
+var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
+
+// node_modules/rxjs/_esm5/internal/SubjectSubscription.js
+var SubjectSubscription = function(_super) {
+ __extends(SubjectSubscription2, _super);
+ function SubjectSubscription2(subject, subscriber) {
+ var _this = _super.call(this) || this;
+ _this.subject = subject;
+ _this.subscriber = subscriber;
+ _this.closed = false;
+ return _this;
+ }
+ SubjectSubscription2.prototype.unsubscribe = function() {
+ if (this.closed) {
+ return;
+ }
+ this.closed = true;
+ var subject = this.subject;
+ var observers = subject.observers;
+ this.subject = null;
+ if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
+ return;
+ }
+ var subscriberIndex = observers.indexOf(this.subscriber);
+ if (subscriberIndex !== -1) {
+ observers.splice(subscriberIndex, 1);
+ }
+ };
+ return SubjectSubscription2;
+}(Subscription);
+
+// node_modules/rxjs/_esm5/internal/Subject.js
+var SubjectSubscriber = function(_super) {
+ __extends(SubjectSubscriber2, _super);
+ function SubjectSubscriber2(destination) {
+ var _this = _super.call(this, destination) || this;
+ _this.destination = destination;
+ return _this;
+ }
+ return SubjectSubscriber2;
+}(Subscriber);
+var Subject = function(_super) {
+ __extends(Subject2, _super);
+ function Subject2() {
+ var _this = _super.call(this) || this;
+ _this.observers = [];
+ _this.closed = false;
+ _this.isStopped = false;
+ _this.hasError = false;
+ _this.thrownError = null;
+ return _this;
+ }
+ Subject2.prototype[rxSubscriber] = function() {
+ return new SubjectSubscriber(this);
+ };
+ Subject2.prototype.lift = function(operator) {
+ var subject = new AnonymousSubject(this, this);
+ subject.operator = operator;
+ return subject;
+ };
+ Subject2.prototype.next = function(value) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ if (!this.isStopped) {
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].next(value);
+ }
+ }
+ };
+ Subject2.prototype.error = function(err) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ this.hasError = true;
+ this.thrownError = err;
+ this.isStopped = true;
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].error(err);
+ }
+ this.observers.length = 0;
+ };
+ Subject2.prototype.complete = function() {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ this.isStopped = true;
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].complete();
+ }
+ this.observers.length = 0;
+ };
+ Subject2.prototype.unsubscribe = function() {
+ this.isStopped = true;
+ this.closed = true;
+ this.observers = null;
+ };
+ Subject2.prototype._trySubscribe = function(subscriber) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ } else {
+ return _super.prototype._trySubscribe.call(this, subscriber);
+ }
+ };
+ Subject2.prototype._subscribe = function(subscriber) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ } else if (this.hasError) {
+ subscriber.error(this.thrownError);
+ return Subscription.EMPTY;
+ } else if (this.isStopped) {
+ subscriber.complete();
+ return Subscription.EMPTY;
+ } else {
+ this.observers.push(subscriber);
+ return new SubjectSubscription(this, subscriber);
+ }
+ };
+ Subject2.prototype.asObservable = function() {
+ var observable2 = new Observable();
+ observable2.source = this;
+ return observable2;
+ };
+ Subject2.create = function(destination, source) {
+ return new AnonymousSubject(destination, source);
+ };
+ return Subject2;
+}(Observable);
+var AnonymousSubject = function(_super) {
+ __extends(AnonymousSubject2, _super);
+ function AnonymousSubject2(destination, source) {
+ var _this = _super.call(this) || this;
+ _this.destination = destination;
+ _this.source = source;
+ return _this;
+ }
+ AnonymousSubject2.prototype.next = function(value) {
+ var destination = this.destination;
+ if (destination && destination.next) {
+ destination.next(value);
+ }
+ };
+ AnonymousSubject2.prototype.error = function(err) {
+ var destination = this.destination;
+ if (destination && destination.error) {
+ this.destination.error(err);
+ }
+ };
+ AnonymousSubject2.prototype.complete = function() {
+ var destination = this.destination;
+ if (destination && destination.complete) {
+ this.destination.complete();
+ }
+ };
+ AnonymousSubject2.prototype._subscribe = function(subscriber) {
+ var source = this.source;
+ if (source) {
+ return this.source.subscribe(subscriber);
+ } else {
+ return Subscription.EMPTY;
+ }
+ };
+ return AnonymousSubject2;
+}(Subject);
+
+// node_modules/rxjs/_esm5/internal/operators/refCount.js
+function refCount() {
+ return function refCountOperatorFunction(source) {
+ return source.lift(new RefCountOperator(source));
+ };
+}
+var RefCountOperator = function() {
+ function RefCountOperator3(connectable) {
+ this.connectable = connectable;
+ }
+ RefCountOperator3.prototype.call = function(subscriber, source) {
+ var connectable = this.connectable;
+ connectable._refCount++;
+ var refCounter = new RefCountSubscriber(subscriber, connectable);
+ var subscription = source.subscribe(refCounter);
+ if (!refCounter.closed) {
+ refCounter.connection = connectable.connect();
+ }
+ return subscription;
+ };
+ return RefCountOperator3;
+}();
+var RefCountSubscriber = function(_super) {
+ __extends(RefCountSubscriber3, _super);
+ function RefCountSubscriber3(destination, connectable) {
+ var _this = _super.call(this, destination) || this;
+ _this.connectable = connectable;
+ return _this;
+ }
+ RefCountSubscriber3.prototype._unsubscribe = function() {
+ var connectable = this.connectable;
+ if (!connectable) {
+ this.connection = null;
+ return;
+ }
+ this.connectable = null;
+ var refCount2 = connectable._refCount;
+ if (refCount2 <= 0) {
+ this.connection = null;
+ return;
+ }
+ connectable._refCount = refCount2 - 1;
+ if (refCount2 > 1) {
+ this.connection = null;
+ return;
+ }
+ var connection = this.connection;
+ var sharedConnection = connectable._connection;
+ this.connection = null;
+ if (sharedConnection && (!connection || sharedConnection === connection)) {
+ sharedConnection.unsubscribe();
+ }
+ };
+ return RefCountSubscriber3;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js
+var ConnectableObservable = function(_super) {
+ __extends(ConnectableObservable2, _super);
+ function ConnectableObservable2(source, subjectFactory) {
+ var _this = _super.call(this) || this;
+ _this.source = source;
+ _this.subjectFactory = subjectFactory;
+ _this._refCount = 0;
+ _this._isComplete = false;
+ return _this;
+ }
+ ConnectableObservable2.prototype._subscribe = function(subscriber) {
+ return this.getSubject().subscribe(subscriber);
+ };
+ ConnectableObservable2.prototype.getSubject = function() {
+ var subject = this._subject;
+ if (!subject || subject.isStopped) {
+ this._subject = this.subjectFactory();
+ }
+ return this._subject;
+ };
+ ConnectableObservable2.prototype.connect = function() {
+ var connection = this._connection;
+ if (!connection) {
+ this._isComplete = false;
+ connection = this._connection = new Subscription();
+ connection.add(this.source.subscribe(new ConnectableSubscriber(this.getSubject(), this)));
+ if (connection.closed) {
+ this._connection = null;
+ connection = Subscription.EMPTY;
+ }
+ }
+ return connection;
+ };
+ ConnectableObservable2.prototype.refCount = function() {
+ return refCount()(this);
+ };
+ return ConnectableObservable2;
+}(Observable);
+var connectableObservableDescriptor = function() {
+ var connectableProto = ConnectableObservable.prototype;
+ return {
+ operator: { value: null },
+ _refCount: { value: 0, writable: true },
+ _subject: { value: null, writable: true },
+ _connection: { value: null, writable: true },
+ _subscribe: { value: connectableProto._subscribe },
+ _isComplete: { value: connectableProto._isComplete, writable: true },
+ getSubject: { value: connectableProto.getSubject },
+ connect: { value: connectableProto.connect },
+ refCount: { value: connectableProto.refCount }
+ };
+}();
+var ConnectableSubscriber = function(_super) {
+ __extends(ConnectableSubscriber2, _super);
+ function ConnectableSubscriber2(destination, connectable) {
+ var _this = _super.call(this, destination) || this;
+ _this.connectable = connectable;
+ return _this;
+ }
+ ConnectableSubscriber2.prototype._error = function(err) {
+ this._unsubscribe();
+ _super.prototype._error.call(this, err);
+ };
+ ConnectableSubscriber2.prototype._complete = function() {
+ this.connectable._isComplete = true;
+ this._unsubscribe();
+ _super.prototype._complete.call(this);
+ };
+ ConnectableSubscriber2.prototype._unsubscribe = function() {
+ var connectable = this.connectable;
+ if (connectable) {
+ this.connectable = null;
+ var connection = connectable._connection;
+ connectable._refCount = 0;
+ connectable._subject = null;
+ connectable._connection = null;
+ if (connection) {
+ connection.unsubscribe();
+ }
+ }
+ };
+ return ConnectableSubscriber2;
+}(SubjectSubscriber);
+var RefCountOperator2 = function() {
+ function RefCountOperator3(connectable) {
+ this.connectable = connectable;
+ }
+ RefCountOperator3.prototype.call = function(subscriber, source) {
+ var connectable = this.connectable;
+ connectable._refCount++;
+ var refCounter = new RefCountSubscriber2(subscriber, connectable);
+ var subscription = source.subscribe(refCounter);
+ if (!refCounter.closed) {
+ refCounter.connection = connectable.connect();
+ }
+ return subscription;
+ };
+ return RefCountOperator3;
+}();
+var RefCountSubscriber2 = function(_super) {
+ __extends(RefCountSubscriber3, _super);
+ function RefCountSubscriber3(destination, connectable) {
+ var _this = _super.call(this, destination) || this;
+ _this.connectable = connectable;
+ return _this;
+ }
+ RefCountSubscriber3.prototype._unsubscribe = function() {
+ var connectable = this.connectable;
+ if (!connectable) {
+ this.connection = null;
+ return;
+ }
+ this.connectable = null;
+ var refCount2 = connectable._refCount;
+ if (refCount2 <= 0) {
+ this.connection = null;
+ return;
+ }
+ connectable._refCount = refCount2 - 1;
+ if (refCount2 > 1) {
+ this.connection = null;
+ return;
+ }
+ var connection = this.connection;
+ var sharedConnection = connectable._connection;
+ this.connection = null;
+ if (sharedConnection && (!connection || sharedConnection === connection)) {
+ sharedConnection.unsubscribe();
+ }
+ };
+ return RefCountSubscriber3;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/operators/groupBy.js
+var GroupByOperator = function() {
+ function GroupByOperator2(keySelector, elementSelector, durationSelector, subjectSelector) {
+ this.keySelector = keySelector;
+ this.elementSelector = elementSelector;
+ this.durationSelector = durationSelector;
+ this.subjectSelector = subjectSelector;
+ }
+ GroupByOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
+ };
+ return GroupByOperator2;
+}();
+var GroupBySubscriber = function(_super) {
+ __extends(GroupBySubscriber2, _super);
+ function GroupBySubscriber2(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
+ var _this = _super.call(this, destination) || this;
+ _this.keySelector = keySelector;
+ _this.elementSelector = elementSelector;
+ _this.durationSelector = durationSelector;
+ _this.subjectSelector = subjectSelector;
+ _this.groups = null;
+ _this.attemptedToUnsubscribe = false;
+ _this.count = 0;
+ return _this;
+ }
+ GroupBySubscriber2.prototype._next = function(value) {
+ var key;
+ try {
+ key = this.keySelector(value);
+ } catch (err) {
+ this.error(err);
+ return;
+ }
+ this._group(value, key);
+ };
+ GroupBySubscriber2.prototype._group = function(value, key) {
+ var groups = this.groups;
+ if (!groups) {
+ groups = this.groups = /* @__PURE__ */ new Map();
+ }
+ var group = groups.get(key);
+ var element;
+ if (this.elementSelector) {
+ try {
+ element = this.elementSelector(value);
+ } catch (err) {
+ this.error(err);
+ }
+ } else {
+ element = value;
+ }
+ if (!group) {
+ group = this.subjectSelector ? this.subjectSelector() : new Subject();
+ groups.set(key, group);
+ var groupedObservable = new GroupedObservable(key, group, this);
+ this.destination.next(groupedObservable);
+ if (this.durationSelector) {
+ var duration = void 0;
+ try {
+ duration = this.durationSelector(new GroupedObservable(key, group));
+ } catch (err) {
+ this.error(err);
+ return;
+ }
+ this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
+ }
+ }
+ if (!group.closed) {
+ group.next(element);
+ }
+ };
+ GroupBySubscriber2.prototype._error = function(err) {
+ var groups = this.groups;
+ if (groups) {
+ groups.forEach(function(group, key) {
+ group.error(err);
+ });
+ groups.clear();
+ }
+ this.destination.error(err);
+ };
+ GroupBySubscriber2.prototype._complete = function() {
+ var groups = this.groups;
+ if (groups) {
+ groups.forEach(function(group, key) {
+ group.complete();
+ });
+ groups.clear();
+ }
+ this.destination.complete();
+ };
+ GroupBySubscriber2.prototype.removeGroup = function(key) {
+ this.groups.delete(key);
+ };
+ GroupBySubscriber2.prototype.unsubscribe = function() {
+ if (!this.closed) {
+ this.attemptedToUnsubscribe = true;
+ if (this.count === 0) {
+ _super.prototype.unsubscribe.call(this);
+ }
+ }
+ };
+ return GroupBySubscriber2;
+}(Subscriber);
+var GroupDurationSubscriber = function(_super) {
+ __extends(GroupDurationSubscriber2, _super);
+ function GroupDurationSubscriber2(key, group, parent) {
+ var _this = _super.call(this, group) || this;
+ _this.key = key;
+ _this.group = group;
+ _this.parent = parent;
+ return _this;
+ }
+ GroupDurationSubscriber2.prototype._next = function(value) {
+ this.complete();
+ };
+ GroupDurationSubscriber2.prototype._unsubscribe = function() {
+ var _a = this, parent = _a.parent, key = _a.key;
+ this.key = this.parent = null;
+ if (parent) {
+ parent.removeGroup(key);
+ }
+ };
+ return GroupDurationSubscriber2;
+}(Subscriber);
+var GroupedObservable = function(_super) {
+ __extends(GroupedObservable2, _super);
+ function GroupedObservable2(key, groupSubject, refCountSubscription) {
+ var _this = _super.call(this) || this;
+ _this.key = key;
+ _this.groupSubject = groupSubject;
+ _this.refCountSubscription = refCountSubscription;
+ return _this;
+ }
+ GroupedObservable2.prototype._subscribe = function(subscriber) {
+ var subscription = new Subscription();
+ var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
+ if (refCountSubscription && !refCountSubscription.closed) {
+ subscription.add(new InnerRefCountSubscription(refCountSubscription));
+ }
+ subscription.add(groupSubject.subscribe(subscriber));
+ return subscription;
+ };
+ return GroupedObservable2;
+}(Observable);
+var InnerRefCountSubscription = function(_super) {
+ __extends(InnerRefCountSubscription2, _super);
+ function InnerRefCountSubscription2(parent) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ parent.count++;
+ return _this;
+ }
+ InnerRefCountSubscription2.prototype.unsubscribe = function() {
+ var parent = this.parent;
+ if (!parent.closed && !this.closed) {
+ _super.prototype.unsubscribe.call(this);
+ parent.count -= 1;
+ if (parent.count === 0 && parent.attemptedToUnsubscribe) {
+ parent.unsubscribe();
+ }
+ }
+ };
+ return InnerRefCountSubscription2;
+}(Subscription);
+
+// node_modules/rxjs/_esm5/internal/BehaviorSubject.js
+var BehaviorSubject = function(_super) {
+ __extends(BehaviorSubject2, _super);
+ function BehaviorSubject2(_value) {
+ var _this = _super.call(this) || this;
+ _this._value = _value;
+ return _this;
+ }
+ Object.defineProperty(BehaviorSubject2.prototype, "value", {
+ get: function() {
+ return this.getValue();
+ },
+ enumerable: true,
+ configurable: true
+ });
+ BehaviorSubject2.prototype._subscribe = function(subscriber) {
+ var subscription = _super.prototype._subscribe.call(this, subscriber);
+ if (subscription && !subscription.closed) {
+ subscriber.next(this._value);
+ }
+ return subscription;
+ };
+ BehaviorSubject2.prototype.getValue = function() {
+ if (this.hasError) {
+ throw this.thrownError;
+ } else if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ } else {
+ return this._value;
+ }
+ };
+ BehaviorSubject2.prototype.next = function(value) {
+ _super.prototype.next.call(this, this._value = value);
+ };
+ return BehaviorSubject2;
+}(Subject);
+
+// node_modules/rxjs/_esm5/internal/scheduler/Action.js
+var Action = function(_super) {
+ __extends(Action2, _super);
+ function Action2(scheduler, work) {
+ return _super.call(this) || this;
+ }
+ Action2.prototype.schedule = function(state, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ return this;
+ };
+ return Action2;
+}(Subscription);
+
+// node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js
+var AsyncAction = function(_super) {
+ __extends(AsyncAction2, _super);
+ function AsyncAction2(scheduler, work) {
+ var _this = _super.call(this, scheduler, work) || this;
+ _this.scheduler = scheduler;
+ _this.work = work;
+ _this.pending = false;
+ return _this;
+ }
+ AsyncAction2.prototype.schedule = function(state, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (this.closed) {
+ return this;
+ }
+ this.state = state;
+ var id = this.id;
+ var scheduler = this.scheduler;
+ if (id != null) {
+ this.id = this.recycleAsyncId(scheduler, id, delay);
+ }
+ this.pending = true;
+ this.delay = delay;
+ this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
+ return this;
+ };
+ AsyncAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ return setInterval(scheduler.flush.bind(scheduler, this), delay);
+ };
+ AsyncAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && this.delay === delay && this.pending === false) {
+ return id;
+ }
+ clearInterval(id);
+ return void 0;
+ };
+ AsyncAction2.prototype.execute = function(state, delay) {
+ if (this.closed) {
+ return new Error("executing a cancelled action");
+ }
+ this.pending = false;
+ var error = this._execute(state, delay);
+ if (error) {
+ return error;
+ } else if (this.pending === false && this.id != null) {
+ this.id = this.recycleAsyncId(this.scheduler, this.id, null);
+ }
+ };
+ AsyncAction2.prototype._execute = function(state, delay) {
+ var errored = false;
+ var errorValue = void 0;
+ try {
+ this.work(state);
+ } catch (e) {
+ errored = true;
+ errorValue = !!e && e || new Error(e);
+ }
+ if (errored) {
+ this.unsubscribe();
+ return errorValue;
+ }
+ };
+ AsyncAction2.prototype._unsubscribe = function() {
+ var id = this.id;
+ var scheduler = this.scheduler;
+ var actions = scheduler.actions;
+ var index = actions.indexOf(this);
+ this.work = null;
+ this.state = null;
+ this.pending = false;
+ this.scheduler = null;
+ if (index !== -1) {
+ actions.splice(index, 1);
+ }
+ if (id != null) {
+ this.id = this.recycleAsyncId(scheduler, id, null);
+ }
+ this.delay = null;
+ };
+ return AsyncAction2;
+}(Action);
+
+// node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js
+var QueueAction = function(_super) {
+ __extends(QueueAction2, _super);
+ function QueueAction2(scheduler, work) {
+ var _this = _super.call(this, scheduler, work) || this;
+ _this.scheduler = scheduler;
+ _this.work = work;
+ return _this;
+ }
+ QueueAction2.prototype.schedule = function(state, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay > 0) {
+ return _super.prototype.schedule.call(this, state, delay);
+ }
+ this.delay = delay;
+ this.state = state;
+ this.scheduler.flush(this);
+ return this;
+ };
+ QueueAction2.prototype.execute = function(state, delay) {
+ return delay > 0 || this.closed ? _super.prototype.execute.call(this, state, delay) : this._execute(state, delay);
+ };
+ QueueAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && delay > 0 || delay === null && this.delay > 0) {
+ return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
+ }
+ return scheduler.flush(this);
+ };
+ return QueueAction2;
+}(AsyncAction);
+
+// node_modules/rxjs/_esm5/internal/Scheduler.js
+var Scheduler = function() {
+ function Scheduler2(SchedulerAction, now) {
+ if (now === void 0) {
+ now = Scheduler2.now;
+ }
+ this.SchedulerAction = SchedulerAction;
+ this.now = now;
+ }
+ Scheduler2.prototype.schedule = function(work, delay, state) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ return new this.SchedulerAction(this, work).schedule(state, delay);
+ };
+ Scheduler2.now = function() {
+ return Date.now();
+ };
+ return Scheduler2;
+}();
+
+// node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js
+var AsyncScheduler = function(_super) {
+ __extends(AsyncScheduler2, _super);
+ function AsyncScheduler2(SchedulerAction, now) {
+ if (now === void 0) {
+ now = Scheduler.now;
+ }
+ var _this = _super.call(this, SchedulerAction, function() {
+ if (AsyncScheduler2.delegate && AsyncScheduler2.delegate !== _this) {
+ return AsyncScheduler2.delegate.now();
+ } else {
+ return now();
+ }
+ }) || this;
+ _this.actions = [];
+ _this.active = false;
+ _this.scheduled = void 0;
+ return _this;
+ }
+ AsyncScheduler2.prototype.schedule = function(work, delay, state) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (AsyncScheduler2.delegate && AsyncScheduler2.delegate !== this) {
+ return AsyncScheduler2.delegate.schedule(work, delay, state);
+ } else {
+ return _super.prototype.schedule.call(this, work, delay, state);
+ }
+ };
+ AsyncScheduler2.prototype.flush = function(action) {
+ var actions = this.actions;
+ if (this.active) {
+ actions.push(action);
+ return;
+ }
+ var error;
+ this.active = true;
+ do {
+ if (error = action.execute(action.state, action.delay)) {
+ break;
+ }
+ } while (action = actions.shift());
+ this.active = false;
+ if (error) {
+ while (action = actions.shift()) {
+ action.unsubscribe();
+ }
+ throw error;
+ }
+ };
+ return AsyncScheduler2;
+}(Scheduler);
+
+// node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js
+var QueueScheduler = function(_super) {
+ __extends(QueueScheduler2, _super);
+ function QueueScheduler2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ return QueueScheduler2;
+}(AsyncScheduler);
+
+// node_modules/rxjs/_esm5/internal/scheduler/queue.js
+var queueScheduler = new QueueScheduler(QueueAction);
+var queue = queueScheduler;
+
+// node_modules/rxjs/_esm5/internal/observable/empty.js
+var EMPTY = new Observable(function(subscriber) {
+ return subscriber.complete();
+});
+function empty2(scheduler) {
+ return scheduler ? emptyScheduled(scheduler) : EMPTY;
+}
+function emptyScheduled(scheduler) {
+ return new Observable(function(subscriber) {
+ return scheduler.schedule(function() {
+ return subscriber.complete();
+ });
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/util/isScheduler.js
+function isScheduler(value) {
+ return value && typeof value.schedule === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/util/subscribeToArray.js
+var subscribeToArray = function(array) {
+ return function(subscriber) {
+ for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
+ subscriber.next(array[i]);
+ }
+ subscriber.complete();
+ };
+};
+
+// node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js
+function scheduleArray(input, scheduler) {
+ return new Observable(function(subscriber) {
+ var sub = new Subscription();
+ var i = 0;
+ sub.add(scheduler.schedule(function() {
+ if (i === input.length) {
+ subscriber.complete();
+ return;
+ }
+ subscriber.next(input[i++]);
+ if (!subscriber.closed) {
+ sub.add(this.schedule());
+ }
+ }));
+ return sub;
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/fromArray.js
+function fromArray(input, scheduler) {
+ if (!scheduler) {
+ return new Observable(subscribeToArray(input));
+ } else {
+ return scheduleArray(input, scheduler);
+ }
+}
+
+// node_modules/rxjs/_esm5/internal/observable/of.js
+function of() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ var scheduler = args[args.length - 1];
+ if (isScheduler(scheduler)) {
+ args.pop();
+ return scheduleArray(args, scheduler);
+ } else {
+ return fromArray(args);
+ }
+}
+
+// node_modules/rxjs/_esm5/internal/observable/throwError.js
+function throwError(error, scheduler) {
+ if (!scheduler) {
+ return new Observable(function(subscriber) {
+ return subscriber.error(error);
+ });
+ } else {
+ return new Observable(function(subscriber) {
+ return scheduler.schedule(dispatch, 0, { error, subscriber });
+ });
+ }
+}
+function dispatch(_a) {
+ var error = _a.error, subscriber = _a.subscriber;
+ subscriber.error(error);
+}
+
+// node_modules/rxjs/_esm5/internal/Notification.js
+var NotificationKind;
+(function(NotificationKind2) {
+ NotificationKind2["NEXT"] = "N";
+ NotificationKind2["ERROR"] = "E";
+ NotificationKind2["COMPLETE"] = "C";
+})(NotificationKind || (NotificationKind = {}));
+var Notification = function() {
+ function Notification2(kind, value, error) {
+ this.kind = kind;
+ this.value = value;
+ this.error = error;
+ this.hasValue = kind === "N";
+ }
+ Notification2.prototype.observe = function(observer) {
+ switch (this.kind) {
+ case "N":
+ return observer.next && observer.next(this.value);
+ case "E":
+ return observer.error && observer.error(this.error);
+ case "C":
+ return observer.complete && observer.complete();
+ }
+ };
+ Notification2.prototype.do = function(next, error, complete) {
+ var kind = this.kind;
+ switch (kind) {
+ case "N":
+ return next && next(this.value);
+ case "E":
+ return error && error(this.error);
+ case "C":
+ return complete && complete();
+ }
+ };
+ Notification2.prototype.accept = function(nextOrObserver, error, complete) {
+ if (nextOrObserver && typeof nextOrObserver.next === "function") {
+ return this.observe(nextOrObserver);
+ } else {
+ return this.do(nextOrObserver, error, complete);
+ }
+ };
+ Notification2.prototype.toObservable = function() {
+ var kind = this.kind;
+ switch (kind) {
+ case "N":
+ return of(this.value);
+ case "E":
+ return throwError(this.error);
+ case "C":
+ return empty2();
+ }
+ throw new Error("unexpected notification kind value");
+ };
+ Notification2.createNext = function(value) {
+ if (typeof value !== "undefined") {
+ return new Notification2("N", value);
+ }
+ return Notification2.undefinedValueNotification;
+ };
+ Notification2.createError = function(err) {
+ return new Notification2("E", void 0, err);
+ };
+ Notification2.createComplete = function() {
+ return Notification2.completeNotification;
+ };
+ Notification2.completeNotification = new Notification2("C");
+ Notification2.undefinedValueNotification = new Notification2("N", void 0);
+ return Notification2;
+}();
+
+// node_modules/rxjs/_esm5/internal/operators/observeOn.js
+var ObserveOnOperator = function() {
+ function ObserveOnOperator2(scheduler, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ this.scheduler = scheduler;
+ this.delay = delay;
+ }
+ ObserveOnOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
+ };
+ return ObserveOnOperator2;
+}();
+var ObserveOnSubscriber = function(_super) {
+ __extends(ObserveOnSubscriber2, _super);
+ function ObserveOnSubscriber2(destination, scheduler, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ var _this = _super.call(this, destination) || this;
+ _this.scheduler = scheduler;
+ _this.delay = delay;
+ return _this;
+ }
+ ObserveOnSubscriber2.dispatch = function(arg) {
+ var notification = arg.notification, destination = arg.destination;
+ notification.observe(destination);
+ this.unsubscribe();
+ };
+ ObserveOnSubscriber2.prototype.scheduleMessage = function(notification) {
+ var destination = this.destination;
+ destination.add(this.scheduler.schedule(ObserveOnSubscriber2.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
+ };
+ ObserveOnSubscriber2.prototype._next = function(value) {
+ this.scheduleMessage(Notification.createNext(value));
+ };
+ ObserveOnSubscriber2.prototype._error = function(err) {
+ this.scheduleMessage(Notification.createError(err));
+ this.unsubscribe();
+ };
+ ObserveOnSubscriber2.prototype._complete = function() {
+ this.scheduleMessage(Notification.createComplete());
+ this.unsubscribe();
+ };
+ return ObserveOnSubscriber2;
+}(Subscriber);
+var ObserveOnMessage = /* @__PURE__ */ function() {
+ function ObserveOnMessage2(notification, destination) {
+ this.notification = notification;
+ this.destination = destination;
+ }
+ return ObserveOnMessage2;
+}();
+
+// node_modules/rxjs/_esm5/internal/ReplaySubject.js
+var ReplaySubject = function(_super) {
+ __extends(ReplaySubject2, _super);
+ function ReplaySubject2(bufferSize, windowTime, scheduler) {
+ if (bufferSize === void 0) {
+ bufferSize = Number.POSITIVE_INFINITY;
+ }
+ if (windowTime === void 0) {
+ windowTime = Number.POSITIVE_INFINITY;
+ }
+ var _this = _super.call(this) || this;
+ _this.scheduler = scheduler;
+ _this._events = [];
+ _this._infiniteTimeWindow = false;
+ _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
+ _this._windowTime = windowTime < 1 ? 1 : windowTime;
+ if (windowTime === Number.POSITIVE_INFINITY) {
+ _this._infiniteTimeWindow = true;
+ _this.next = _this.nextInfiniteTimeWindow;
+ } else {
+ _this.next = _this.nextTimeWindow;
+ }
+ return _this;
+ }
+ ReplaySubject2.prototype.nextInfiniteTimeWindow = function(value) {
+ if (!this.isStopped) {
+ var _events = this._events;
+ _events.push(value);
+ if (_events.length > this._bufferSize) {
+ _events.shift();
+ }
+ }
+ _super.prototype.next.call(this, value);
+ };
+ ReplaySubject2.prototype.nextTimeWindow = function(value) {
+ if (!this.isStopped) {
+ this._events.push(new ReplayEvent(this._getNow(), value));
+ this._trimBufferThenGetEvents();
+ }
+ _super.prototype.next.call(this, value);
+ };
+ ReplaySubject2.prototype._subscribe = function(subscriber) {
+ var _infiniteTimeWindow = this._infiniteTimeWindow;
+ var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
+ var scheduler = this.scheduler;
+ var len = _events.length;
+ var subscription;
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ } else if (this.isStopped || this.hasError) {
+ subscription = Subscription.EMPTY;
+ } else {
+ this.observers.push(subscriber);
+ subscription = new SubjectSubscription(this, subscriber);
+ }
+ if (scheduler) {
+ subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));
+ }
+ if (_infiniteTimeWindow) {
+ for (var i = 0; i < len && !subscriber.closed; i++) {
+ subscriber.next(_events[i]);
+ }
+ } else {
+ for (var i = 0; i < len && !subscriber.closed; i++) {
+ subscriber.next(_events[i].value);
+ }
+ }
+ if (this.hasError) {
+ subscriber.error(this.thrownError);
+ } else if (this.isStopped) {
+ subscriber.complete();
+ }
+ return subscription;
+ };
+ ReplaySubject2.prototype._getNow = function() {
+ return (this.scheduler || queue).now();
+ };
+ ReplaySubject2.prototype._trimBufferThenGetEvents = function() {
+ var now = this._getNow();
+ var _bufferSize = this._bufferSize;
+ var _windowTime = this._windowTime;
+ var _events = this._events;
+ var eventsCount = _events.length;
+ var spliceCount = 0;
+ while (spliceCount < eventsCount) {
+ if (now - _events[spliceCount].time < _windowTime) {
+ break;
+ }
+ spliceCount++;
+ }
+ if (eventsCount > _bufferSize) {
+ spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
+ }
+ if (spliceCount > 0) {
+ _events.splice(0, spliceCount);
+ }
+ return _events;
+ };
+ return ReplaySubject2;
+}(Subject);
+var ReplayEvent = /* @__PURE__ */ function() {
+ function ReplayEvent2(time, value) {
+ this.time = time;
+ this.value = value;
+ }
+ return ReplayEvent2;
+}();
+
+// node_modules/rxjs/_esm5/internal/AsyncSubject.js
+var AsyncSubject = function(_super) {
+ __extends(AsyncSubject2, _super);
+ function AsyncSubject2() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ _this.value = null;
+ _this.hasNext = false;
+ _this.hasCompleted = false;
+ return _this;
+ }
+ AsyncSubject2.prototype._subscribe = function(subscriber) {
+ if (this.hasError) {
+ subscriber.error(this.thrownError);
+ return Subscription.EMPTY;
+ } else if (this.hasCompleted && this.hasNext) {
+ subscriber.next(this.value);
+ subscriber.complete();
+ return Subscription.EMPTY;
+ }
+ return _super.prototype._subscribe.call(this, subscriber);
+ };
+ AsyncSubject2.prototype.next = function(value) {
+ if (!this.hasCompleted) {
+ this.value = value;
+ this.hasNext = true;
+ }
+ };
+ AsyncSubject2.prototype.error = function(error) {
+ if (!this.hasCompleted) {
+ _super.prototype.error.call(this, error);
+ }
+ };
+ AsyncSubject2.prototype.complete = function() {
+ this.hasCompleted = true;
+ if (this.hasNext) {
+ _super.prototype.next.call(this, this.value);
+ }
+ _super.prototype.complete.call(this);
+ };
+ return AsyncSubject2;
+}(Subject);
+
+// node_modules/rxjs/_esm5/internal/util/Immediate.js
+var nextHandle = 1;
+var RESOLVED = function() {
+ return Promise.resolve();
+}();
+var activeHandles = {};
+function findAndClearHandle(handle) {
+ if (handle in activeHandles) {
+ delete activeHandles[handle];
+ return true;
+ }
+ return false;
+}
+var Immediate = {
+ setImmediate: function(cb) {
+ var handle = nextHandle++;
+ activeHandles[handle] = true;
+ RESOLVED.then(function() {
+ return findAndClearHandle(handle) && cb();
+ });
+ return handle;
+ },
+ clearImmediate: function(handle) {
+ findAndClearHandle(handle);
+ }
+};
+
+// node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js
+var AsapAction = function(_super) {
+ __extends(AsapAction2, _super);
+ function AsapAction2(scheduler, work) {
+ var _this = _super.call(this, scheduler, work) || this;
+ _this.scheduler = scheduler;
+ _this.work = work;
+ return _this;
+ }
+ AsapAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && delay > 0) {
+ return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
+ }
+ scheduler.actions.push(this);
+ return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));
+ };
+ AsapAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && delay > 0 || delay === null && this.delay > 0) {
+ return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
+ }
+ if (scheduler.actions.length === 0) {
+ Immediate.clearImmediate(id);
+ scheduler.scheduled = void 0;
+ }
+ return void 0;
+ };
+ return AsapAction2;
+}(AsyncAction);
+
+// node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js
+var AsapScheduler = function(_super) {
+ __extends(AsapScheduler2, _super);
+ function AsapScheduler2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ AsapScheduler2.prototype.flush = function(action) {
+ this.active = true;
+ this.scheduled = void 0;
+ var actions = this.actions;
+ var error;
+ var index = -1;
+ var count = actions.length;
+ action = action || actions.shift();
+ do {
+ if (error = action.execute(action.state, action.delay)) {
+ break;
+ }
+ } while (++index < count && (action = actions.shift()));
+ this.active = false;
+ if (error) {
+ while (++index < count && (action = actions.shift())) {
+ action.unsubscribe();
+ }
+ throw error;
+ }
+ };
+ return AsapScheduler2;
+}(AsyncScheduler);
+
+// node_modules/rxjs/_esm5/internal/scheduler/asap.js
+var asapScheduler = new AsapScheduler(AsapAction);
+var asap = asapScheduler;
+
+// node_modules/rxjs/_esm5/internal/scheduler/async.js
+var asyncScheduler = new AsyncScheduler(AsyncAction);
+var async = asyncScheduler;
+
+// node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js
+var AnimationFrameAction = function(_super) {
+ __extends(AnimationFrameAction2, _super);
+ function AnimationFrameAction2(scheduler, work) {
+ var _this = _super.call(this, scheduler, work) || this;
+ _this.scheduler = scheduler;
+ _this.work = work;
+ return _this;
+ }
+ AnimationFrameAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && delay > 0) {
+ return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
+ }
+ scheduler.actions.push(this);
+ return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function() {
+ return scheduler.flush(null);
+ }));
+ };
+ AnimationFrameAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (delay !== null && delay > 0 || delay === null && this.delay > 0) {
+ return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
+ }
+ if (scheduler.actions.length === 0) {
+ cancelAnimationFrame(id);
+ scheduler.scheduled = void 0;
+ }
+ return void 0;
+ };
+ return AnimationFrameAction2;
+}(AsyncAction);
+
+// node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js
+var AnimationFrameScheduler = function(_super) {
+ __extends(AnimationFrameScheduler2, _super);
+ function AnimationFrameScheduler2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ AnimationFrameScheduler2.prototype.flush = function(action) {
+ this.active = true;
+ this.scheduled = void 0;
+ var actions = this.actions;
+ var error;
+ var index = -1;
+ var count = actions.length;
+ action = action || actions.shift();
+ do {
+ if (error = action.execute(action.state, action.delay)) {
+ break;
+ }
+ } while (++index < count && (action = actions.shift()));
+ this.active = false;
+ if (error) {
+ while (++index < count && (action = actions.shift())) {
+ action.unsubscribe();
+ }
+ throw error;
+ }
+ };
+ return AnimationFrameScheduler2;
+}(AsyncScheduler);
+
+// node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js
+var animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);
+var animationFrame = animationFrameScheduler;
+
+// node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js
+var VirtualTimeScheduler = function(_super) {
+ __extends(VirtualTimeScheduler2, _super);
+ function VirtualTimeScheduler2(SchedulerAction, maxFrames) {
+ if (SchedulerAction === void 0) {
+ SchedulerAction = VirtualAction;
+ }
+ if (maxFrames === void 0) {
+ maxFrames = Number.POSITIVE_INFINITY;
+ }
+ var _this = _super.call(this, SchedulerAction, function() {
+ return _this.frame;
+ }) || this;
+ _this.maxFrames = maxFrames;
+ _this.frame = 0;
+ _this.index = -1;
+ return _this;
+ }
+ VirtualTimeScheduler2.prototype.flush = function() {
+ var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
+ var error, action;
+ while ((action = actions[0]) && action.delay <= maxFrames) {
+ actions.shift();
+ this.frame = action.delay;
+ if (error = action.execute(action.state, action.delay)) {
+ break;
+ }
+ }
+ if (error) {
+ while (action = actions.shift()) {
+ action.unsubscribe();
+ }
+ throw error;
+ }
+ };
+ VirtualTimeScheduler2.frameTimeFactor = 10;
+ return VirtualTimeScheduler2;
+}(AsyncScheduler);
+var VirtualAction = function(_super) {
+ __extends(VirtualAction2, _super);
+ function VirtualAction2(scheduler, work, index) {
+ if (index === void 0) {
+ index = scheduler.index += 1;
+ }
+ var _this = _super.call(this, scheduler, work) || this;
+ _this.scheduler = scheduler;
+ _this.work = work;
+ _this.index = index;
+ _this.active = true;
+ _this.index = scheduler.index = index;
+ return _this;
+ }
+ VirtualAction2.prototype.schedule = function(state, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ if (!this.id) {
+ return _super.prototype.schedule.call(this, state, delay);
+ }
+ this.active = false;
+ var action = new VirtualAction2(this.scheduler, this.work);
+ this.add(action);
+ return action.schedule(state, delay);
+ };
+ VirtualAction2.prototype.requestAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ this.delay = scheduler.frame + delay;
+ var actions = scheduler.actions;
+ actions.push(this);
+ actions.sort(VirtualAction2.sortActions);
+ return true;
+ };
+ VirtualAction2.prototype.recycleAsyncId = function(scheduler, id, delay) {
+ if (delay === void 0) {
+ delay = 0;
+ }
+ return void 0;
+ };
+ VirtualAction2.prototype._execute = function(state, delay) {
+ if (this.active === true) {
+ return _super.prototype._execute.call(this, state, delay);
+ }
+ };
+ VirtualAction2.sortActions = function(a, b) {
+ if (a.delay === b.delay) {
+ if (a.index === b.index) {
+ return 0;
+ } else if (a.index > b.index) {
+ return 1;
+ } else {
+ return -1;
+ }
+ } else if (a.delay > b.delay) {
+ return 1;
+ } else {
+ return -1;
+ }
+ };
+ return VirtualAction2;
+}(AsyncAction);
+
+// node_modules/rxjs/_esm5/internal/util/noop.js
+function noop() {
+}
+
+// node_modules/rxjs/_esm5/internal/util/isObservable.js
+function isObservable(obj) {
+ return !!obj && (obj instanceof Observable || typeof obj.lift === "function" && typeof obj.subscribe === "function");
+}
+
+// node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js
+var ArgumentOutOfRangeErrorImpl = function() {
+ function ArgumentOutOfRangeErrorImpl2() {
+ Error.call(this);
+ this.message = "argument out of range";
+ this.name = "ArgumentOutOfRangeError";
+ return this;
+ }
+ ArgumentOutOfRangeErrorImpl2.prototype = Object.create(Error.prototype);
+ return ArgumentOutOfRangeErrorImpl2;
+}();
+var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
+
+// node_modules/rxjs/_esm5/internal/util/EmptyError.js
+var EmptyErrorImpl = function() {
+ function EmptyErrorImpl2() {
+ Error.call(this);
+ this.message = "no elements in sequence";
+ this.name = "EmptyError";
+ return this;
+ }
+ EmptyErrorImpl2.prototype = Object.create(Error.prototype);
+ return EmptyErrorImpl2;
+}();
+var EmptyError = EmptyErrorImpl;
+
+// node_modules/rxjs/_esm5/internal/util/TimeoutError.js
+var TimeoutErrorImpl = function() {
+ function TimeoutErrorImpl2() {
+ Error.call(this);
+ this.message = "Timeout has occurred";
+ this.name = "TimeoutError";
+ return this;
+ }
+ TimeoutErrorImpl2.prototype = Object.create(Error.prototype);
+ return TimeoutErrorImpl2;
+}();
+var TimeoutError = TimeoutErrorImpl;
+
+// node_modules/rxjs/_esm5/internal/operators/map.js
+function map(project, thisArg) {
+ return function mapOperation(source) {
+ if (typeof project !== "function") {
+ throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");
+ }
+ return source.lift(new MapOperator(project, thisArg));
+ };
+}
+var MapOperator = function() {
+ function MapOperator2(project, thisArg) {
+ this.project = project;
+ this.thisArg = thisArg;
+ }
+ MapOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
+ };
+ return MapOperator2;
+}();
+var MapSubscriber = function(_super) {
+ __extends(MapSubscriber2, _super);
+ function MapSubscriber2(destination, project, thisArg) {
+ var _this = _super.call(this, destination) || this;
+ _this.project = project;
+ _this.count = 0;
+ _this.thisArg = thisArg || _this;
+ return _this;
+ }
+ MapSubscriber2.prototype._next = function(value) {
+ var result;
+ try {
+ result = this.project.call(this.thisArg, value, this.count++);
+ } catch (err) {
+ this.destination.error(err);
+ return;
+ }
+ this.destination.next(result);
+ };
+ return MapSubscriber2;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/observable/bindCallback.js
+function bindCallback(callbackFunc, resultSelector, scheduler) {
+ if (resultSelector) {
+ if (isScheduler(resultSelector)) {
+ scheduler = resultSelector;
+ } else {
+ return function() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map(function(args2) {
+ return isArray(args2) ? resultSelector.apply(void 0, args2) : resultSelector(args2);
+ }));
+ };
+ }
+ }
+ return function() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ var context = this;
+ var subject;
+ var params = {
+ context,
+ subject,
+ callbackFunc,
+ scheduler
+ };
+ return new Observable(function(subscriber) {
+ if (!scheduler) {
+ if (!subject) {
+ subject = new AsyncSubject();
+ var handler = function() {
+ var innerArgs = [];
+ for (var _i2 = 0; _i2 < arguments.length; _i2++) {
+ innerArgs[_i2] = arguments[_i2];
+ }
+ subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
+ subject.complete();
+ };
+ try {
+ callbackFunc.apply(context, args.concat([handler]));
+ } catch (err) {
+ if (canReportError(subject)) {
+ subject.error(err);
+ } else {
+ console.warn(err);
+ }
+ }
+ }
+ return subject.subscribe(subscriber);
+ } else {
+ var state = {
+ args,
+ subscriber,
+ params
+ };
+ return scheduler.schedule(dispatch2, 0, state);
+ }
+ });
+ };
+}
+function dispatch2(state) {
+ var _this = this;
+ var self = this;
+ var args = state.args, subscriber = state.subscriber, params = state.params;
+ var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
+ var subject = params.subject;
+ if (!subject) {
+ subject = params.subject = new AsyncSubject();
+ var handler = function() {
+ var innerArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ innerArgs[_i] = arguments[_i];
+ }
+ var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
+ _this.add(scheduler.schedule(dispatchNext, 0, { value, subject }));
+ };
+ try {
+ callbackFunc.apply(context, args.concat([handler]));
+ } catch (err) {
+ subject.error(err);
+ }
+ }
+ this.add(subject.subscribe(subscriber));
+}
+function dispatchNext(state) {
+ var value = state.value, subject = state.subject;
+ subject.next(value);
+ subject.complete();
+}
+
+// node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js
+function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
+ if (resultSelector) {
+ if (isScheduler(resultSelector)) {
+ scheduler = resultSelector;
+ } else {
+ return function() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map(function(args2) {
+ return isArray(args2) ? resultSelector.apply(void 0, args2) : resultSelector(args2);
+ }));
+ };
+ }
+ }
+ return function() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ var params = {
+ subject: void 0,
+ args,
+ callbackFunc,
+ scheduler,
+ context: this
+ };
+ return new Observable(function(subscriber) {
+ var context = params.context;
+ var subject = params.subject;
+ if (!scheduler) {
+ if (!subject) {
+ subject = params.subject = new AsyncSubject();
+ var handler = function() {
+ var innerArgs = [];
+ for (var _i2 = 0; _i2 < arguments.length; _i2++) {
+ innerArgs[_i2] = arguments[_i2];
+ }
+ var err = innerArgs.shift();
+ if (err) {
+ subject.error(err);
+ return;
+ }
+ subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
+ subject.complete();
+ };
+ try {
+ callbackFunc.apply(context, args.concat([handler]));
+ } catch (err) {
+ if (canReportError(subject)) {
+ subject.error(err);
+ } else {
+ console.warn(err);
+ }
+ }
+ }
+ return subject.subscribe(subscriber);
+ } else {
+ return scheduler.schedule(dispatch3, 0, { params, subscriber, context });
+ }
+ });
+ };
+}
+function dispatch3(state) {
+ var _this = this;
+ var params = state.params, subscriber = state.subscriber, context = state.context;
+ var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
+ var subject = params.subject;
+ if (!subject) {
+ subject = params.subject = new AsyncSubject();
+ var handler = function() {
+ var innerArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ innerArgs[_i] = arguments[_i];
+ }
+ var err = innerArgs.shift();
+ if (err) {
+ _this.add(scheduler.schedule(dispatchError, 0, { err, subject }));
+ } else {
+ var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
+ _this.add(scheduler.schedule(dispatchNext2, 0, { value, subject }));
+ }
+ };
+ try {
+ callbackFunc.apply(context, args.concat([handler]));
+ } catch (err) {
+ this.add(scheduler.schedule(dispatchError, 0, { err, subject }));
+ }
+ }
+ this.add(subject.subscribe(subscriber));
+}
+function dispatchNext2(arg) {
+ var value = arg.value, subject = arg.subject;
+ subject.next(value);
+ subject.complete();
+}
+function dispatchError(arg) {
+ var err = arg.err, subject = arg.subject;
+ subject.error(err);
+}
+
+// node_modules/rxjs/_esm5/internal/OuterSubscriber.js
+var OuterSubscriber = function(_super) {
+ __extends(OuterSubscriber2, _super);
+ function OuterSubscriber2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ OuterSubscriber2.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
+ this.destination.next(innerValue);
+ };
+ OuterSubscriber2.prototype.notifyError = function(error, innerSub) {
+ this.destination.error(error);
+ };
+ OuterSubscriber2.prototype.notifyComplete = function(innerSub) {
+ this.destination.complete();
+ };
+ return OuterSubscriber2;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/InnerSubscriber.js
+var InnerSubscriber = function(_super) {
+ __extends(InnerSubscriber2, _super);
+ function InnerSubscriber2(parent, outerValue, outerIndex) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ _this.outerValue = outerValue;
+ _this.outerIndex = outerIndex;
+ _this.index = 0;
+ return _this;
+ }
+ InnerSubscriber2.prototype._next = function(value) {
+ this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
+ };
+ InnerSubscriber2.prototype._error = function(error) {
+ this.parent.notifyError(error, this);
+ this.unsubscribe();
+ };
+ InnerSubscriber2.prototype._complete = function() {
+ this.parent.notifyComplete(this);
+ this.unsubscribe();
+ };
+ return InnerSubscriber2;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js
+var subscribeToPromise = function(promise) {
+ return function(subscriber) {
+ promise.then(function(value) {
+ if (!subscriber.closed) {
+ subscriber.next(value);
+ subscriber.complete();
+ }
+ }, function(err) {
+ return subscriber.error(err);
+ }).then(null, hostReportError);
+ return subscriber;
+ };
+};
+
+// node_modules/rxjs/_esm5/internal/symbol/iterator.js
+function getSymbolIterator() {
+ if (typeof Symbol !== "function" || !Symbol.iterator) {
+ return "@@iterator";
+ }
+ return Symbol.iterator;
+}
+var iterator = getSymbolIterator();
+
+// node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js
+var subscribeToIterable = function(iterable) {
+ return function(subscriber) {
+ var iterator2 = iterable[iterator]();
+ do {
+ var item = void 0;
+ try {
+ item = iterator2.next();
+ } catch (err) {
+ subscriber.error(err);
+ return subscriber;
+ }
+ if (item.done) {
+ subscriber.complete();
+ break;
+ }
+ subscriber.next(item.value);
+ if (subscriber.closed) {
+ break;
+ }
+ } while (true);
+ if (typeof iterator2.return === "function") {
+ subscriber.add(function() {
+ if (iterator2.return) {
+ iterator2.return();
+ }
+ });
+ }
+ return subscriber;
+ };
+};
+
+// node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js
+var subscribeToObservable = function(obj) {
+ return function(subscriber) {
+ var obs = obj[observable]();
+ if (typeof obs.subscribe !== "function") {
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
+ } else {
+ return obs.subscribe(subscriber);
+ }
+ };
+};
+
+// node_modules/rxjs/_esm5/internal/util/isArrayLike.js
+var isArrayLike = function(x) {
+ return x && typeof x.length === "number" && typeof x !== "function";
+};
+
+// node_modules/rxjs/_esm5/internal/util/isPromise.js
+function isPromise(value) {
+ return !!value && typeof value.subscribe !== "function" && typeof value.then === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/util/subscribeTo.js
+var subscribeTo = function(result) {
+ if (!!result && typeof result[observable] === "function") {
+ return subscribeToObservable(result);
+ } else if (isArrayLike(result)) {
+ return subscribeToArray(result);
+ } else if (isPromise(result)) {
+ return subscribeToPromise(result);
+ } else if (!!result && typeof result[iterator] === "function") {
+ return subscribeToIterable(result);
+ } else {
+ var value = isObject(result) ? "an invalid object" : "'" + result + "'";
+ var msg = "You provided " + value + " where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";
+ throw new TypeError(msg);
+ }
+};
+
+// node_modules/rxjs/_esm5/internal/util/subscribeToResult.js
+function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber) {
+ if (innerSubscriber === void 0) {
+ innerSubscriber = new InnerSubscriber(outerSubscriber, outerValue, outerIndex);
+ }
+ if (innerSubscriber.closed) {
+ return void 0;
+ }
+ if (result instanceof Observable) {
+ return result.subscribe(innerSubscriber);
+ }
+ return subscribeTo(result)(innerSubscriber);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/combineLatest.js
+var NONE = {};
+function combineLatest() {
+ var observables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ observables[_i] = arguments[_i];
+ }
+ var resultSelector = void 0;
+ var scheduler = void 0;
+ if (isScheduler(observables[observables.length - 1])) {
+ scheduler = observables.pop();
+ }
+ if (typeof observables[observables.length - 1] === "function") {
+ resultSelector = observables.pop();
+ }
+ if (observables.length === 1 && isArray(observables[0])) {
+ observables = observables[0];
+ }
+ return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
+}
+var CombineLatestOperator = function() {
+ function CombineLatestOperator2(resultSelector) {
+ this.resultSelector = resultSelector;
+ }
+ CombineLatestOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
+ };
+ return CombineLatestOperator2;
+}();
+var CombineLatestSubscriber = function(_super) {
+ __extends(CombineLatestSubscriber2, _super);
+ function CombineLatestSubscriber2(destination, resultSelector) {
+ var _this = _super.call(this, destination) || this;
+ _this.resultSelector = resultSelector;
+ _this.active = 0;
+ _this.values = [];
+ _this.observables = [];
+ return _this;
+ }
+ CombineLatestSubscriber2.prototype._next = function(observable2) {
+ this.values.push(NONE);
+ this.observables.push(observable2);
+ };
+ CombineLatestSubscriber2.prototype._complete = function() {
+ var observables = this.observables;
+ var len = observables.length;
+ if (len === 0) {
+ this.destination.complete();
+ } else {
+ this.active = len;
+ this.toRespond = len;
+ for (var i = 0; i < len; i++) {
+ var observable2 = observables[i];
+ this.add(subscribeToResult(this, observable2, void 0, i));
+ }
+ }
+ };
+ CombineLatestSubscriber2.prototype.notifyComplete = function(unused) {
+ if ((this.active -= 1) === 0) {
+ this.destination.complete();
+ }
+ };
+ CombineLatestSubscriber2.prototype.notifyNext = function(_outerValue, innerValue, outerIndex) {
+ var values = this.values;
+ var oldVal = values[outerIndex];
+ var toRespond = !this.toRespond ? 0 : oldVal === NONE ? --this.toRespond : this.toRespond;
+ values[outerIndex] = innerValue;
+ if (toRespond === 0) {
+ if (this.resultSelector) {
+ this._tryResultSelector(values);
+ } else {
+ this.destination.next(values.slice());
+ }
+ }
+ };
+ CombineLatestSubscriber2.prototype._tryResultSelector = function(values) {
+ var result;
+ try {
+ result = this.resultSelector.apply(this, values);
+ } catch (err) {
+ this.destination.error(err);
+ return;
+ }
+ this.destination.next(result);
+ };
+ return CombineLatestSubscriber2;
+}(OuterSubscriber);
+
+// node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js
+function scheduleObservable(input, scheduler) {
+ return new Observable(function(subscriber) {
+ var sub = new Subscription();
+ sub.add(scheduler.schedule(function() {
+ var observable2 = input[observable]();
+ sub.add(observable2.subscribe({
+ next: function(value) {
+ sub.add(scheduler.schedule(function() {
+ return subscriber.next(value);
+ }));
+ },
+ error: function(err) {
+ sub.add(scheduler.schedule(function() {
+ return subscriber.error(err);
+ }));
+ },
+ complete: function() {
+ sub.add(scheduler.schedule(function() {
+ return subscriber.complete();
+ }));
+ }
+ }));
+ }));
+ return sub;
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js
+function schedulePromise(input, scheduler) {
+ return new Observable(function(subscriber) {
+ var sub = new Subscription();
+ sub.add(scheduler.schedule(function() {
+ return input.then(function(value) {
+ sub.add(scheduler.schedule(function() {
+ subscriber.next(value);
+ sub.add(scheduler.schedule(function() {
+ return subscriber.complete();
+ }));
+ }));
+ }, function(err) {
+ sub.add(scheduler.schedule(function() {
+ return subscriber.error(err);
+ }));
+ });
+ }));
+ return sub;
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js
+function scheduleIterable(input, scheduler) {
+ if (!input) {
+ throw new Error("Iterable cannot be null");
+ }
+ return new Observable(function(subscriber) {
+ var sub = new Subscription();
+ var iterator2;
+ sub.add(function() {
+ if (iterator2 && typeof iterator2.return === "function") {
+ iterator2.return();
+ }
+ });
+ sub.add(scheduler.schedule(function() {
+ iterator2 = input[iterator]();
+ sub.add(scheduler.schedule(function() {
+ if (subscriber.closed) {
+ return;
+ }
+ var value;
+ var done;
+ try {
+ var result = iterator2.next();
+ value = result.value;
+ done = result.done;
+ } catch (err) {
+ subscriber.error(err);
+ return;
+ }
+ if (done) {
+ subscriber.complete();
+ } else {
+ subscriber.next(value);
+ this.schedule();
+ }
+ }));
+ }));
+ return sub;
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/util/isInteropObservable.js
+function isInteropObservable(input) {
+ return input && typeof input[observable] === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/util/isIterable.js
+function isIterable(input) {
+ return input && typeof input[iterator] === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/scheduled/scheduled.js
+function scheduled(input, scheduler) {
+ if (input != null) {
+ if (isInteropObservable(input)) {
+ return scheduleObservable(input, scheduler);
+ } else if (isPromise(input)) {
+ return schedulePromise(input, scheduler);
+ } else if (isArrayLike(input)) {
+ return scheduleArray(input, scheduler);
+ } else if (isIterable(input) || typeof input === "string") {
+ return scheduleIterable(input, scheduler);
+ }
+ }
+ throw new TypeError((input !== null && typeof input || input) + " is not observable");
+}
+
+// node_modules/rxjs/_esm5/internal/observable/from.js
+function from(input, scheduler) {
+ if (!scheduler) {
+ if (input instanceof Observable) {
+ return input;
+ }
+ return new Observable(subscribeTo(input));
+ } else {
+ return scheduled(input, scheduler);
+ }
+}
+
+// node_modules/rxjs/_esm5/internal/innerSubscribe.js
+var SimpleInnerSubscriber = function(_super) {
+ __extends(SimpleInnerSubscriber2, _super);
+ function SimpleInnerSubscriber2(parent) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ return _this;
+ }
+ SimpleInnerSubscriber2.prototype._next = function(value) {
+ this.parent.notifyNext(value);
+ };
+ SimpleInnerSubscriber2.prototype._error = function(error) {
+ this.parent.notifyError(error);
+ this.unsubscribe();
+ };
+ SimpleInnerSubscriber2.prototype._complete = function() {
+ this.parent.notifyComplete();
+ this.unsubscribe();
+ };
+ return SimpleInnerSubscriber2;
+}(Subscriber);
+var ComplexInnerSubscriber = function(_super) {
+ __extends(ComplexInnerSubscriber2, _super);
+ function ComplexInnerSubscriber2(parent, outerValue, outerIndex) {
+ var _this = _super.call(this) || this;
+ _this.parent = parent;
+ _this.outerValue = outerValue;
+ _this.outerIndex = outerIndex;
+ return _this;
+ }
+ ComplexInnerSubscriber2.prototype._next = function(value) {
+ this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);
+ };
+ ComplexInnerSubscriber2.prototype._error = function(error) {
+ this.parent.notifyError(error);
+ this.unsubscribe();
+ };
+ ComplexInnerSubscriber2.prototype._complete = function() {
+ this.parent.notifyComplete(this);
+ this.unsubscribe();
+ };
+ return ComplexInnerSubscriber2;
+}(Subscriber);
+var SimpleOuterSubscriber = function(_super) {
+ __extends(SimpleOuterSubscriber2, _super);
+ function SimpleOuterSubscriber2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ SimpleOuterSubscriber2.prototype.notifyNext = function(innerValue) {
+ this.destination.next(innerValue);
+ };
+ SimpleOuterSubscriber2.prototype.notifyError = function(err) {
+ this.destination.error(err);
+ };
+ SimpleOuterSubscriber2.prototype.notifyComplete = function() {
+ this.destination.complete();
+ };
+ return SimpleOuterSubscriber2;
+}(Subscriber);
+var ComplexOuterSubscriber = function(_super) {
+ __extends(ComplexOuterSubscriber2, _super);
+ function ComplexOuterSubscriber2() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ ComplexOuterSubscriber2.prototype.notifyNext = function(_outerValue, innerValue, _outerIndex, _innerSub) {
+ this.destination.next(innerValue);
+ };
+ ComplexOuterSubscriber2.prototype.notifyError = function(error) {
+ this.destination.error(error);
+ };
+ ComplexOuterSubscriber2.prototype.notifyComplete = function(_innerSub) {
+ this.destination.complete();
+ };
+ return ComplexOuterSubscriber2;
+}(Subscriber);
+function innerSubscribe(result, innerSubscriber) {
+ if (innerSubscriber.closed) {
+ return void 0;
+ }
+ if (result instanceof Observable) {
+ return result.subscribe(innerSubscriber);
+ }
+ var subscription;
+ try {
+ subscription = subscribeTo(result)(innerSubscriber);
+ } catch (error) {
+ innerSubscriber.error(error);
+ }
+ return subscription;
+}
+
+// node_modules/rxjs/_esm5/internal/operators/mergeMap.js
+function mergeMap(project, resultSelector, concurrent) {
+ if (concurrent === void 0) {
+ concurrent = Number.POSITIVE_INFINITY;
+ }
+ if (typeof resultSelector === "function") {
+ return function(source) {
+ return source.pipe(mergeMap(function(a, i) {
+ return from(project(a, i)).pipe(map(function(b, ii) {
+ return resultSelector(a, b, i, ii);
+ }));
+ }, concurrent));
+ };
+ } else if (typeof resultSelector === "number") {
+ concurrent = resultSelector;
+ }
+ return function(source) {
+ return source.lift(new MergeMapOperator(project, concurrent));
+ };
+}
+var MergeMapOperator = function() {
+ function MergeMapOperator2(project, concurrent) {
+ if (concurrent === void 0) {
+ concurrent = Number.POSITIVE_INFINITY;
+ }
+ this.project = project;
+ this.concurrent = concurrent;
+ }
+ MergeMapOperator2.prototype.call = function(observer, source) {
+ return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
+ };
+ return MergeMapOperator2;
+}();
+var MergeMapSubscriber = function(_super) {
+ __extends(MergeMapSubscriber2, _super);
+ function MergeMapSubscriber2(destination, project, concurrent) {
+ if (concurrent === void 0) {
+ concurrent = Number.POSITIVE_INFINITY;
+ }
+ var _this = _super.call(this, destination) || this;
+ _this.project = project;
+ _this.concurrent = concurrent;
+ _this.hasCompleted = false;
+ _this.buffer = [];
+ _this.active = 0;
+ _this.index = 0;
+ return _this;
+ }
+ MergeMapSubscriber2.prototype._next = function(value) {
+ if (this.active < this.concurrent) {
+ this._tryNext(value);
+ } else {
+ this.buffer.push(value);
+ }
+ };
+ MergeMapSubscriber2.prototype._tryNext = function(value) {
+ var result;
+ var index = this.index++;
+ try {
+ result = this.project(value, index);
+ } catch (err) {
+ this.destination.error(err);
+ return;
+ }
+ this.active++;
+ this._innerSub(result);
+ };
+ MergeMapSubscriber2.prototype._innerSub = function(ish) {
+ var innerSubscriber = new SimpleInnerSubscriber(this);
+ var destination = this.destination;
+ destination.add(innerSubscriber);
+ var innerSubscription = innerSubscribe(ish, innerSubscriber);
+ if (innerSubscription !== innerSubscriber) {
+ destination.add(innerSubscription);
+ }
+ };
+ MergeMapSubscriber2.prototype._complete = function() {
+ this.hasCompleted = true;
+ if (this.active === 0 && this.buffer.length === 0) {
+ this.destination.complete();
+ }
+ this.unsubscribe();
+ };
+ MergeMapSubscriber2.prototype.notifyNext = function(innerValue) {
+ this.destination.next(innerValue);
+ };
+ MergeMapSubscriber2.prototype.notifyComplete = function() {
+ var buffer = this.buffer;
+ this.active--;
+ if (buffer.length > 0) {
+ this._next(buffer.shift());
+ } else if (this.active === 0 && this.hasCompleted) {
+ this.destination.complete();
+ }
+ };
+ return MergeMapSubscriber2;
+}(SimpleOuterSubscriber);
+
+// node_modules/rxjs/_esm5/internal/operators/mergeAll.js
+function mergeAll(concurrent) {
+ if (concurrent === void 0) {
+ concurrent = Number.POSITIVE_INFINITY;
+ }
+ return mergeMap(identity, concurrent);
+}
+
+// node_modules/rxjs/_esm5/internal/operators/concatAll.js
+function concatAll() {
+ return mergeAll(1);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/concat.js
+function concat() {
+ var observables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ observables[_i] = arguments[_i];
+ }
+ return concatAll()(of.apply(void 0, observables));
+}
+
+// node_modules/rxjs/_esm5/internal/observable/defer.js
+function defer(observableFactory) {
+ return new Observable(function(subscriber) {
+ var input;
+ try {
+ input = observableFactory();
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ var source = input ? from(input) : empty2();
+ return source.subscribe(subscriber);
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/forkJoin.js
+function forkJoin() {
+ var sources = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ sources[_i] = arguments[_i];
+ }
+ if (sources.length === 1) {
+ var first_1 = sources[0];
+ if (isArray(first_1)) {
+ return forkJoinInternal(first_1, null);
+ }
+ if (isObject(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {
+ var keys = Object.keys(first_1);
+ return forkJoinInternal(keys.map(function(key) {
+ return first_1[key];
+ }), keys);
+ }
+ }
+ if (typeof sources[sources.length - 1] === "function") {
+ var resultSelector_1 = sources.pop();
+ sources = sources.length === 1 && isArray(sources[0]) ? sources[0] : sources;
+ return forkJoinInternal(sources, null).pipe(map(function(args) {
+ return resultSelector_1.apply(void 0, args);
+ }));
+ }
+ return forkJoinInternal(sources, null);
+}
+function forkJoinInternal(sources, keys) {
+ return new Observable(function(subscriber) {
+ var len = sources.length;
+ if (len === 0) {
+ subscriber.complete();
+ return;
+ }
+ var values = new Array(len);
+ var completed = 0;
+ var emitted = 0;
+ var _loop_1 = function(i2) {
+ var source = from(sources[i2]);
+ var hasValue = false;
+ subscriber.add(source.subscribe({
+ next: function(value) {
+ if (!hasValue) {
+ hasValue = true;
+ emitted++;
+ }
+ values[i2] = value;
+ },
+ error: function(err) {
+ return subscriber.error(err);
+ },
+ complete: function() {
+ completed++;
+ if (completed === len || !hasValue) {
+ if (emitted === len) {
+ subscriber.next(keys ? keys.reduce(function(result, key, i3) {
+ return result[key] = values[i3], result;
+ }, {}) : values);
+ }
+ subscriber.complete();
+ }
+ }
+ }));
+ };
+ for (var i = 0; i < len; i++) {
+ _loop_1(i);
+ }
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/fromEvent.js
+function fromEvent(target, eventName, options, resultSelector) {
+ if (isFunction(options)) {
+ resultSelector = options;
+ options = void 0;
+ }
+ if (resultSelector) {
+ return fromEvent(target, eventName, options).pipe(map(function(args) {
+ return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args);
+ }));
+ }
+ return new Observable(function(subscriber) {
+ function handler(e) {
+ if (arguments.length > 1) {
+ subscriber.next(Array.prototype.slice.call(arguments));
+ } else {
+ subscriber.next(e);
+ }
+ }
+ setupSubscription(target, eventName, handler, subscriber, options);
+ });
+}
+function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
+ var unsubscribe;
+ if (isEventTarget(sourceObj)) {
+ var source_1 = sourceObj;
+ sourceObj.addEventListener(eventName, handler, options);
+ unsubscribe = function() {
+ return source_1.removeEventListener(eventName, handler, options);
+ };
+ } else if (isJQueryStyleEventEmitter(sourceObj)) {
+ var source_2 = sourceObj;
+ sourceObj.on(eventName, handler);
+ unsubscribe = function() {
+ return source_2.off(eventName, handler);
+ };
+ } else if (isNodeStyleEventEmitter(sourceObj)) {
+ var source_3 = sourceObj;
+ sourceObj.addListener(eventName, handler);
+ unsubscribe = function() {
+ return source_3.removeListener(eventName, handler);
+ };
+ } else if (sourceObj && sourceObj.length) {
+ for (var i = 0, len = sourceObj.length; i < len; i++) {
+ setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
+ }
+ } else {
+ throw new TypeError("Invalid event target");
+ }
+ subscriber.add(unsubscribe);
+}
+function isNodeStyleEventEmitter(sourceObj) {
+ return sourceObj && typeof sourceObj.addListener === "function" && typeof sourceObj.removeListener === "function";
+}
+function isJQueryStyleEventEmitter(sourceObj) {
+ return sourceObj && typeof sourceObj.on === "function" && typeof sourceObj.off === "function";
+}
+function isEventTarget(sourceObj) {
+ return sourceObj && typeof sourceObj.addEventListener === "function" && typeof sourceObj.removeEventListener === "function";
+}
+
+// node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js
+function fromEventPattern(addHandler, removeHandler, resultSelector) {
+ if (resultSelector) {
+ return fromEventPattern(addHandler, removeHandler).pipe(map(function(args) {
+ return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args);
+ }));
+ }
+ return new Observable(function(subscriber) {
+ var handler = function() {
+ var e = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ e[_i] = arguments[_i];
+ }
+ return subscriber.next(e.length === 1 ? e[0] : e);
+ };
+ var retValue;
+ try {
+ retValue = addHandler(handler);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ if (!isFunction(removeHandler)) {
+ return void 0;
+ }
+ return function() {
+ return removeHandler(handler, retValue);
+ };
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/generate.js
+function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
+ var resultSelector;
+ var initialState;
+ if (arguments.length == 1) {
+ var options = initialStateOrOptions;
+ initialState = options.initialState;
+ condition = options.condition;
+ iterate = options.iterate;
+ resultSelector = options.resultSelector || identity;
+ scheduler = options.scheduler;
+ } else if (resultSelectorOrObservable === void 0 || isScheduler(resultSelectorOrObservable)) {
+ initialState = initialStateOrOptions;
+ resultSelector = identity;
+ scheduler = resultSelectorOrObservable;
+ } else {
+ initialState = initialStateOrOptions;
+ resultSelector = resultSelectorOrObservable;
+ }
+ return new Observable(function(subscriber) {
+ var state = initialState;
+ if (scheduler) {
+ return scheduler.schedule(dispatch4, 0, {
+ subscriber,
+ iterate,
+ condition,
+ resultSelector,
+ state
+ });
+ }
+ do {
+ if (condition) {
+ var conditionResult = void 0;
+ try {
+ conditionResult = condition(state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ if (!conditionResult) {
+ subscriber.complete();
+ break;
+ }
+ }
+ var value = void 0;
+ try {
+ value = resultSelector(state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ subscriber.next(value);
+ if (subscriber.closed) {
+ break;
+ }
+ try {
+ state = iterate(state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ } while (true);
+ return void 0;
+ });
+}
+function dispatch4(state) {
+ var subscriber = state.subscriber, condition = state.condition;
+ if (subscriber.closed) {
+ return void 0;
+ }
+ if (state.needIterate) {
+ try {
+ state.state = state.iterate(state.state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ } else {
+ state.needIterate = true;
+ }
+ if (condition) {
+ var conditionResult = void 0;
+ try {
+ conditionResult = condition(state.state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ if (!conditionResult) {
+ subscriber.complete();
+ return void 0;
+ }
+ if (subscriber.closed) {
+ return void 0;
+ }
+ }
+ var value;
+ try {
+ value = state.resultSelector(state.state);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ if (subscriber.closed) {
+ return void 0;
+ }
+ subscriber.next(value);
+ if (subscriber.closed) {
+ return void 0;
+ }
+ return this.schedule(state);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/iif.js
+function iif(condition, trueResult, falseResult) {
+ if (trueResult === void 0) {
+ trueResult = EMPTY;
+ }
+ if (falseResult === void 0) {
+ falseResult = EMPTY;
+ }
+ return defer(function() {
+ return condition() ? trueResult : falseResult;
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/util/isNumeric.js
+function isNumeric(val) {
+ return !isArray(val) && val - parseFloat(val) + 1 >= 0;
+}
+
+// node_modules/rxjs/_esm5/internal/observable/interval.js
+function interval(period, scheduler) {
+ if (period === void 0) {
+ period = 0;
+ }
+ if (scheduler === void 0) {
+ scheduler = async;
+ }
+ if (!isNumeric(period) || period < 0) {
+ period = 0;
+ }
+ if (!scheduler || typeof scheduler.schedule !== "function") {
+ scheduler = async;
+ }
+ return new Observable(function(subscriber) {
+ subscriber.add(scheduler.schedule(dispatch5, period, { subscriber, counter: 0, period }));
+ return subscriber;
+ });
+}
+function dispatch5(state) {
+ var subscriber = state.subscriber, counter = state.counter, period = state.period;
+ subscriber.next(counter);
+ this.schedule({ subscriber, counter: counter + 1, period }, period);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/merge.js
+function merge() {
+ var observables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ observables[_i] = arguments[_i];
+ }
+ var concurrent = Number.POSITIVE_INFINITY;
+ var scheduler = null;
+ var last = observables[observables.length - 1];
+ if (isScheduler(last)) {
+ scheduler = observables.pop();
+ if (observables.length > 1 && typeof observables[observables.length - 1] === "number") {
+ concurrent = observables.pop();
+ }
+ } else if (typeof last === "number") {
+ concurrent = observables.pop();
+ }
+ if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {
+ return observables[0];
+ }
+ return mergeAll(concurrent)(fromArray(observables, scheduler));
+}
+
+// node_modules/rxjs/_esm5/internal/observable/never.js
+var NEVER = new Observable(noop);
+function never() {
+ return NEVER;
+}
+
+// node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js
+function onErrorResumeNext() {
+ var sources = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ sources[_i] = arguments[_i];
+ }
+ if (sources.length === 0) {
+ return EMPTY;
+ }
+ var first = sources[0], remainder = sources.slice(1);
+ if (sources.length === 1 && isArray(first)) {
+ return onErrorResumeNext.apply(void 0, first);
+ }
+ return new Observable(function(subscriber) {
+ var subNext = function() {
+ return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber));
+ };
+ return from(first).subscribe({
+ next: function(value) {
+ subscriber.next(value);
+ },
+ error: subNext,
+ complete: subNext
+ });
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/pairs.js
+function pairs(obj, scheduler) {
+ if (!scheduler) {
+ return new Observable(function(subscriber) {
+ var keys = Object.keys(obj);
+ for (var i = 0; i < keys.length && !subscriber.closed; i++) {
+ var key = keys[i];
+ if (obj.hasOwnProperty(key)) {
+ subscriber.next([key, obj[key]]);
+ }
+ }
+ subscriber.complete();
+ });
+ } else {
+ return new Observable(function(subscriber) {
+ var keys = Object.keys(obj);
+ var subscription = new Subscription();
+ subscription.add(scheduler.schedule(dispatch6, 0, { keys, index: 0, subscriber, subscription, obj }));
+ return subscription;
+ });
+ }
+}
+function dispatch6(state) {
+ var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
+ if (!subscriber.closed) {
+ if (index < keys.length) {
+ var key = keys[index];
+ subscriber.next([key, obj[key]]);
+ subscription.add(this.schedule({ keys, index: index + 1, subscriber, subscription, obj }));
+ } else {
+ subscriber.complete();
+ }
+ }
+}
+
+// node_modules/rxjs/_esm5/internal/util/not.js
+function not(pred, thisArg) {
+ function notPred() {
+ return !notPred.pred.apply(notPred.thisArg, arguments);
+ }
+ notPred.pred = pred;
+ notPred.thisArg = thisArg;
+ return notPred;
+}
+
+// node_modules/rxjs/_esm5/internal/operators/filter.js
+function filter(predicate, thisArg) {
+ return function filterOperatorFunction(source) {
+ return source.lift(new FilterOperator(predicate, thisArg));
+ };
+}
+var FilterOperator = function() {
+ function FilterOperator2(predicate, thisArg) {
+ this.predicate = predicate;
+ this.thisArg = thisArg;
+ }
+ FilterOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
+ };
+ return FilterOperator2;
+}();
+var FilterSubscriber = function(_super) {
+ __extends(FilterSubscriber2, _super);
+ function FilterSubscriber2(destination, predicate, thisArg) {
+ var _this = _super.call(this, destination) || this;
+ _this.predicate = predicate;
+ _this.thisArg = thisArg;
+ _this.count = 0;
+ return _this;
+ }
+ FilterSubscriber2.prototype._next = function(value) {
+ var result;
+ try {
+ result = this.predicate.call(this.thisArg, value, this.count++);
+ } catch (err) {
+ this.destination.error(err);
+ return;
+ }
+ if (result) {
+ this.destination.next(value);
+ }
+ };
+ return FilterSubscriber2;
+}(Subscriber);
+
+// node_modules/rxjs/_esm5/internal/observable/partition.js
+function partition(source, predicate, thisArg) {
+ return [
+ filter(predicate, thisArg)(new Observable(subscribeTo(source))),
+ filter(not(predicate, thisArg))(new Observable(subscribeTo(source)))
+ ];
+}
+
+// node_modules/rxjs/_esm5/internal/observable/race.js
+function race() {
+ var observables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ observables[_i] = arguments[_i];
+ }
+ if (observables.length === 1) {
+ if (isArray(observables[0])) {
+ observables = observables[0];
+ } else {
+ return observables[0];
+ }
+ }
+ return fromArray(observables, void 0).lift(new RaceOperator());
+}
+var RaceOperator = function() {
+ function RaceOperator2() {
+ }
+ RaceOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new RaceSubscriber(subscriber));
+ };
+ return RaceOperator2;
+}();
+var RaceSubscriber = function(_super) {
+ __extends(RaceSubscriber2, _super);
+ function RaceSubscriber2(destination) {
+ var _this = _super.call(this, destination) || this;
+ _this.hasFirst = false;
+ _this.observables = [];
+ _this.subscriptions = [];
+ return _this;
+ }
+ RaceSubscriber2.prototype._next = function(observable2) {
+ this.observables.push(observable2);
+ };
+ RaceSubscriber2.prototype._complete = function() {
+ var observables = this.observables;
+ var len = observables.length;
+ if (len === 0) {
+ this.destination.complete();
+ } else {
+ for (var i = 0; i < len && !this.hasFirst; i++) {
+ var observable2 = observables[i];
+ var subscription = subscribeToResult(this, observable2, void 0, i);
+ if (this.subscriptions) {
+ this.subscriptions.push(subscription);
+ }
+ this.add(subscription);
+ }
+ this.observables = null;
+ }
+ };
+ RaceSubscriber2.prototype.notifyNext = function(_outerValue, innerValue, outerIndex) {
+ if (!this.hasFirst) {
+ this.hasFirst = true;
+ for (var i = 0; i < this.subscriptions.length; i++) {
+ if (i !== outerIndex) {
+ var subscription = this.subscriptions[i];
+ subscription.unsubscribe();
+ this.remove(subscription);
+ }
+ }
+ this.subscriptions = null;
+ }
+ this.destination.next(innerValue);
+ };
+ return RaceSubscriber2;
+}(OuterSubscriber);
+
+// node_modules/rxjs/_esm5/internal/observable/range.js
+function range(start, count, scheduler) {
+ if (start === void 0) {
+ start = 0;
+ }
+ return new Observable(function(subscriber) {
+ if (count === void 0) {
+ count = start;
+ start = 0;
+ }
+ var index = 0;
+ var current = start;
+ if (scheduler) {
+ return scheduler.schedule(dispatch7, 0, {
+ index,
+ count,
+ start,
+ subscriber
+ });
+ } else {
+ do {
+ if (index++ >= count) {
+ subscriber.complete();
+ break;
+ }
+ subscriber.next(current++);
+ if (subscriber.closed) {
+ break;
+ }
+ } while (true);
+ }
+ return void 0;
+ });
+}
+function dispatch7(state) {
+ var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
+ if (index >= count) {
+ subscriber.complete();
+ return;
+ }
+ subscriber.next(start);
+ if (subscriber.closed) {
+ return;
+ }
+ state.index = index + 1;
+ state.start = start + 1;
+ this.schedule(state);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/timer.js
+function timer(dueTime, periodOrScheduler, scheduler) {
+ if (dueTime === void 0) {
+ dueTime = 0;
+ }
+ var period = -1;
+ if (isNumeric(periodOrScheduler)) {
+ period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (!isScheduler(scheduler)) {
+ scheduler = async;
+ }
+ return new Observable(function(subscriber) {
+ var due = isNumeric(dueTime) ? dueTime : +dueTime - scheduler.now();
+ return scheduler.schedule(dispatch8, due, {
+ index: 0,
+ period,
+ subscriber
+ });
+ });
+}
+function dispatch8(state) {
+ var index = state.index, period = state.period, subscriber = state.subscriber;
+ subscriber.next(index);
+ if (subscriber.closed) {
+ return;
+ } else if (period === -1) {
+ return subscriber.complete();
+ }
+ state.index = index + 1;
+ this.schedule(state, period);
+}
+
+// node_modules/rxjs/_esm5/internal/observable/using.js
+function using(resourceFactory, observableFactory) {
+ return new Observable(function(subscriber) {
+ var resource;
+ try {
+ resource = resourceFactory();
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ var result;
+ try {
+ result = observableFactory(resource);
+ } catch (err) {
+ subscriber.error(err);
+ return void 0;
+ }
+ var source = result ? from(result) : EMPTY;
+ var subscription = source.subscribe(subscriber);
+ return function() {
+ subscription.unsubscribe();
+ if (resource) {
+ resource.unsubscribe();
+ }
+ };
+ });
+}
+
+// node_modules/rxjs/_esm5/internal/observable/zip.js
+function zip() {
+ var observables = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ observables[_i] = arguments[_i];
+ }
+ var resultSelector = observables[observables.length - 1];
+ if (typeof resultSelector === "function") {
+ observables.pop();
+ }
+ return fromArray(observables, void 0).lift(new ZipOperator(resultSelector));
+}
+var ZipOperator = function() {
+ function ZipOperator2(resultSelector) {
+ this.resultSelector = resultSelector;
+ }
+ ZipOperator2.prototype.call = function(subscriber, source) {
+ return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
+ };
+ return ZipOperator2;
+}();
+var ZipSubscriber = function(_super) {
+ __extends(ZipSubscriber2, _super);
+ function ZipSubscriber2(destination, resultSelector, values) {
+ if (values === void 0) {
+ values = /* @__PURE__ */ Object.create(null);
+ }
+ var _this = _super.call(this, destination) || this;
+ _this.resultSelector = resultSelector;
+ _this.iterators = [];
+ _this.active = 0;
+ _this.resultSelector = typeof resultSelector === "function" ? resultSelector : void 0;
+ return _this;
+ }
+ ZipSubscriber2.prototype._next = function(value) {
+ var iterators = this.iterators;
+ if (isArray(value)) {
+ iterators.push(new StaticArrayIterator(value));
+ } else if (typeof value[iterator] === "function") {
+ iterators.push(new StaticIterator(value[iterator]()));
+ } else {
+ iterators.push(new ZipBufferIterator(this.destination, this, value));
+ }
+ };
+ ZipSubscriber2.prototype._complete = function() {
+ var iterators = this.iterators;
+ var len = iterators.length;
+ this.unsubscribe();
+ if (len === 0) {
+ this.destination.complete();
+ return;
+ }
+ this.active = len;
+ for (var i = 0; i < len; i++) {
+ var iterator2 = iterators[i];
+ if (iterator2.stillUnsubscribed) {
+ var destination = this.destination;
+ destination.add(iterator2.subscribe());
+ } else {
+ this.active--;
+ }
+ }
+ };
+ ZipSubscriber2.prototype.notifyInactive = function() {
+ this.active--;
+ if (this.active === 0) {
+ this.destination.complete();
+ }
+ };
+ ZipSubscriber2.prototype.checkIterators = function() {
+ var iterators = this.iterators;
+ var len = iterators.length;
+ var destination = this.destination;
+ for (var i = 0; i < len; i++) {
+ var iterator2 = iterators[i];
+ if (typeof iterator2.hasValue === "function" && !iterator2.hasValue()) {
+ return;
+ }
+ }
+ var shouldComplete = false;
+ var args = [];
+ for (var i = 0; i < len; i++) {
+ var iterator2 = iterators[i];
+ var result = iterator2.next();
+ if (iterator2.hasCompleted()) {
+ shouldComplete = true;
+ }
+ if (result.done) {
+ destination.complete();
+ return;
+ }
+ args.push(result.value);
+ }
+ if (this.resultSelector) {
+ this._tryresultSelector(args);
+ } else {
+ destination.next(args);
+ }
+ if (shouldComplete) {
+ destination.complete();
+ }
+ };
+ ZipSubscriber2.prototype._tryresultSelector = function(args) {
+ var result;
+ try {
+ result = this.resultSelector.apply(this, args);
+ } catch (err) {
+ this.destination.error(err);
+ return;
+ }
+ this.destination.next(result);
+ };
+ return ZipSubscriber2;
+}(Subscriber);
+var StaticIterator = function() {
+ function StaticIterator2(iterator2) {
+ this.iterator = iterator2;
+ this.nextResult = iterator2.next();
+ }
+ StaticIterator2.prototype.hasValue = function() {
+ return true;
+ };
+ StaticIterator2.prototype.next = function() {
+ var result = this.nextResult;
+ this.nextResult = this.iterator.next();
+ return result;
+ };
+ StaticIterator2.prototype.hasCompleted = function() {
+ var nextResult = this.nextResult;
+ return Boolean(nextResult && nextResult.done);
+ };
+ return StaticIterator2;
+}();
+var StaticArrayIterator = function() {
+ function StaticArrayIterator2(array) {
+ this.array = array;
+ this.index = 0;
+ this.length = 0;
+ this.length = array.length;
+ }
+ StaticArrayIterator2.prototype[iterator] = function() {
+ return this;
+ };
+ StaticArrayIterator2.prototype.next = function(value) {
+ var i = this.index++;
+ var array = this.array;
+ return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
+ };
+ StaticArrayIterator2.prototype.hasValue = function() {
+ return this.array.length > this.index;
+ };
+ StaticArrayIterator2.prototype.hasCompleted = function() {
+ return this.array.length === this.index;
+ };
+ return StaticArrayIterator2;
+}();
+var ZipBufferIterator = function(_super) {
+ __extends(ZipBufferIterator2, _super);
+ function ZipBufferIterator2(destination, parent, observable2) {
+ var _this = _super.call(this, destination) || this;
+ _this.parent = parent;
+ _this.observable = observable2;
+ _this.stillUnsubscribed = true;
+ _this.buffer = [];
+ _this.isComplete = false;
+ return _this;
+ }
+ ZipBufferIterator2.prototype[iterator] = function() {
+ return this;
+ };
+ ZipBufferIterator2.prototype.next = function() {
+ var buffer = this.buffer;
+ if (buffer.length === 0 && this.isComplete) {
+ return { value: null, done: true };
+ } else {
+ return { value: buffer.shift(), done: false };
+ }
+ };
+ ZipBufferIterator2.prototype.hasValue = function() {
+ return this.buffer.length > 0;
+ };
+ ZipBufferIterator2.prototype.hasCompleted = function() {
+ return this.buffer.length === 0 && this.isComplete;
+ };
+ ZipBufferIterator2.prototype.notifyComplete = function() {
+ if (this.buffer.length > 0) {
+ this.isComplete = true;
+ this.parent.notifyInactive();
+ } else {
+ this.destination.complete();
+ }
+ };
+ ZipBufferIterator2.prototype.notifyNext = function(innerValue) {
+ this.buffer.push(innerValue);
+ this.parent.checkIterators();
+ };
+ ZipBufferIterator2.prototype.subscribe = function() {
+ return innerSubscribe(this.observable, new SimpleInnerSubscriber(this));
+ };
+ return ZipBufferIterator2;
+}(SimpleOuterSubscriber);
+
+export {
+ isFunction,
+ config,
+ UnsubscriptionError,
+ Subscription,
+ Subscriber,
+ observable,
+ identity,
+ pipe,
+ Observable,
+ ObjectUnsubscribedError,
+ Subject,
+ refCount,
+ ConnectableObservable,
+ GroupedObservable,
+ BehaviorSubject,
+ Scheduler,
+ queueScheduler,
+ queue,
+ EMPTY,
+ empty2 as empty,
+ isScheduler,
+ of,
+ throwError,
+ NotificationKind,
+ Notification,
+ ReplaySubject,
+ AsyncSubject,
+ asapScheduler,
+ asap,
+ asyncScheduler,
+ async,
+ animationFrameScheduler,
+ animationFrame,
+ VirtualTimeScheduler,
+ VirtualAction,
+ noop,
+ isObservable,
+ ArgumentOutOfRangeError,
+ EmptyError,
+ TimeoutError,
+ map,
+ bindCallback,
+ bindNodeCallback,
+ OuterSubscriber,
+ subscribeToResult,
+ combineLatest,
+ scheduled,
+ from,
+ SimpleInnerSubscriber,
+ SimpleOuterSubscriber,
+ innerSubscribe,
+ mergeMap,
+ mergeAll,
+ concat,
+ defer,
+ forkJoin,
+ fromEvent,
+ fromEventPattern,
+ generate,
+ iif,
+ isNumeric,
+ interval,
+ merge,
+ NEVER,
+ never,
+ onErrorResumeNext,
+ pairs,
+ filter,
+ partition,
+ race,
+ range,
+ timer,
+ using,
+ zip
+};
+//# sourceMappingURL=chunk-6OOPNYDU.js.map
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js.map b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js.map
new file mode 100644
index 0000000..455d8d1
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-6OOPNYDU.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../../../../../node_modules/rxjs/_esm5/internal/util/isFunction.js", "../../../../../../node_modules/rxjs/_esm5/internal/config.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/hostReportError.js", "../../../../../../node_modules/rxjs/_esm5/internal/Observer.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isArray.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isObject.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js", "../../../../../../node_modules/rxjs/_esm5/internal/Subscription.js", "../../../../../../node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js", "../../../../../../node_modules/rxjs/_esm5/internal/Subscriber.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/canReportError.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/toSubscriber.js", "../../../../../../node_modules/rxjs/_esm5/internal/symbol/observable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/identity.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/pipe.js", "../../../../../../node_modules/rxjs/_esm5/internal/Observable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js", "../../../../../../node_modules/rxjs/_esm5/internal/SubjectSubscription.js", "../../../../../../node_modules/rxjs/_esm5/internal/Subject.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/refCount.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/groupBy.js", "../../../../../../node_modules/rxjs/_esm5/internal/BehaviorSubject.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/Action.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js", "../../../../../../node_modules/rxjs/_esm5/internal/Scheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/queue.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/empty.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeToArray.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/fromArray.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/of.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/throwError.js", "../../../../../../node_modules/rxjs/_esm5/internal/Notification.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/observeOn.js", "../../../../../../node_modules/rxjs/_esm5/internal/ReplaySubject.js", "../../../../../../node_modules/rxjs/_esm5/internal/AsyncSubject.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/Immediate.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/asap.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/async.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/noop.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isObservable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/EmptyError.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/TimeoutError.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/map.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/bindCallback.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js", "../../../../../../node_modules/rxjs/_esm5/internal/OuterSubscriber.js", "../../../../../../node_modules/rxjs/_esm5/internal/InnerSubscriber.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js", "../../../../../../node_modules/rxjs/_esm5/internal/symbol/iterator.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isArrayLike.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isPromise.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeTo.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/subscribeToResult.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/combineLatest.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isInteropObservable.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isIterable.js", "../../../../../../node_modules/rxjs/_esm5/internal/scheduled/scheduled.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/from.js", "../../../../../../node_modules/rxjs/_esm5/internal/innerSubscribe.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/mergeMap.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/mergeAll.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/concatAll.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/concat.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/defer.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/forkJoin.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/fromEvent.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/generate.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/iif.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/isNumeric.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/interval.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/merge.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/never.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/pairs.js", "../../../../../../node_modules/rxjs/_esm5/internal/util/not.js", "../../../../../../node_modules/rxjs/_esm5/internal/operators/filter.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/partition.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/race.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/range.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/timer.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/using.js", "../../../../../../node_modules/rxjs/_esm5/internal/observable/zip.js"],
+ "sourcesContent": ["/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar _enable_super_gross_mode_that_will_cause_bad_things = false;\nexport var config = {\n Promise: undefined,\n set useDeprecatedSynchronousErrorHandling(value) {\n if (value) {\n var error = /*@__PURE__*/ new Error();\n /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n }\n else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function hostReportError(err) {\n setTimeout(function () { throw err; }, 0);\n}\n\n", "/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nexport var empty = {\n closed: true,\n next: function (value) { },\n error: function (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n },\n complete: function () { }\n};\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isObject(x) {\n return x !== null && typeof x === 'object';\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ?\n errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n})();\nexport var UnsubscriptionError = UnsubscriptionErrorImpl;\n\n", "/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */\nimport { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nvar Subscription = /*@__PURE__*/ (function () {\n function Subscription(unsubscribe) {\n this.closed = false;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._ctorUnsubscribe = true;\n this._unsubscribe = unsubscribe;\n }\n }\n Subscription.prototype.unsubscribe = function () {\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n }\n else if (_parentOrParents !== null) {\n for (var index = 0; index < _parentOrParents.length; ++index) {\n var parent_1 = _parentOrParents[index];\n parent_1.remove(this);\n }\n }\n if (isFunction(_unsubscribe)) {\n if (_ctorUnsubscribe) {\n this._unsubscribe = undefined;\n }\n try {\n _unsubscribe.call(this);\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n if (isArray(_subscriptions)) {\n var index = -1;\n var len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject(sub)) {\n try {\n sub.unsubscribe();\n }\n catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n }\n else {\n errors.push(e);\n }\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n };\n Subscription.prototype.add = function (teardown) {\n var subscription = teardown;\n if (!teardown) {\n return Subscription.EMPTY;\n }\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (!(subscription instanceof Subscription)) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n var _parentOrParents = subscription._parentOrParents;\n if (_parentOrParents === null) {\n subscription._parentOrParents = this;\n }\n else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n return subscription;\n }\n subscription._parentOrParents = [_parentOrParents, this];\n }\n else if (_parentOrParents.indexOf(this) === -1) {\n _parentOrParents.push(this);\n }\n else {\n return subscription;\n }\n var subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n }\n else {\n subscriptions.push(subscription);\n }\n return subscription;\n };\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexport { Subscription };\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var rxSubscriber = /*@__PURE__*/ (function () {\n return typeof Symbol === 'function'\n ? /*@__PURE__*/ Symbol('rxSubscriber')\n : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();\n})();\nexport var $$rxSubscriber = rxSubscriber;\n\n", "/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nvar Subscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = emptyObserver;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n }\n else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriberSymbol] = function () { return this; };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar SafeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n }\n else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n }\n else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\n\n", "/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nexport function canReportError(observer) {\n while (observer) {\n var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;\n if (closed_1 || isStopped) {\n return false;\n }\n else if (destination && destination instanceof Subscriber) {\n observer = destination;\n }\n else {\n observer = null;\n }\n }\n return true;\n}\n\n", "/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nexport function toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n return new Subscriber(nextOrObserver, error, complete);\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function identity(x) {\n return x;\n}\n\n", "/** PURE_IMPORTS_START _identity PURE_IMPORTS_END */\nimport { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n\n", "/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nvar Observable = /*@__PURE__*/ (function () {\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n }\n else {\n sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink));\n }\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n }\n else {\n console.warn(err);\n }\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscription;\n subscription = _this.subscribe(function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var source = this.source;\n return source && source.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {\n function ObjectUnsubscribedErrorImpl() {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ObjectUnsubscribedErrorImpl;\n})();\nexport var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;\n\n", "/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from './Subscription';\nvar SubjectSubscription = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n var _this = _super.call(this) || this;\n _this.subject = subject;\n _this.subscriber = subscriber;\n _this.closed = false;\n return _this;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription));\nexport { SubjectSubscription };\n\n", "/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nvar SubjectSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n return _this;\n }\n return SubjectSubscriber;\n}(Subscriber));\nexport { SubjectSubscriber };\nvar Subject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.observers = [];\n _this.closed = false;\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype[rxSubscriberSymbol] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function refCount() {\n return function refCountOperatorFunction(source) {\n return source.lift(new RefCountOperator(source));\n };\n}\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n\n", "/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { SubjectSubscriber } from '../Subject';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\nvar ConnectableObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableObservable, _super);\n function ConnectableObservable(source, subjectFactory) {\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.subjectFactory = subjectFactory;\n _this._refCount = 0;\n _this._isComplete = false;\n return _this;\n }\n ConnectableObservable.prototype._subscribe = function (subscriber) {\n return this.getSubject().subscribe(subscriber);\n };\n ConnectableObservable.prototype.getSubject = function () {\n var subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n };\n ConnectableObservable.prototype.connect = function () {\n var connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n };\n ConnectableObservable.prototype.refCount = function () {\n return higherOrderRefCount()(this);\n };\n return ConnectableObservable;\n}(Observable));\nexport { ConnectableObservable };\nexport var connectableObservableDescriptor = /*@__PURE__*/ (function () {\n var connectableProto = ConnectableObservable.prototype;\n return {\n operator: { value: null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null, writable: true },\n _connection: { value: null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\nvar ConnectableSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableSubscriber, _super);\n function ConnectableSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n ConnectableSubscriber.prototype._error = function (err) {\n this._unsubscribe();\n _super.prototype._error.call(this, err);\n };\n ConnectableSubscriber.prototype._complete = function () {\n this.connectable._isComplete = true;\n this._unsubscribe();\n _super.prototype._complete.call(this);\n };\n ConnectableSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (connectable) {\n this.connectable = null;\n var connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n };\n return ConnectableSubscriber;\n}(SubjectSubscriber));\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { Subject } from '../Subject';\nexport function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {\n return function (source) {\n return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));\n };\n}\nvar GroupByOperator = /*@__PURE__*/ (function () {\n function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {\n this.keySelector = keySelector;\n this.elementSelector = elementSelector;\n this.durationSelector = durationSelector;\n this.subjectSelector = subjectSelector;\n }\n GroupByOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));\n };\n return GroupByOperator;\n}());\nvar GroupBySubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(GroupBySubscriber, _super);\n function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.elementSelector = elementSelector;\n _this.durationSelector = durationSelector;\n _this.subjectSelector = subjectSelector;\n _this.groups = null;\n _this.attemptedToUnsubscribe = false;\n _this.count = 0;\n return _this;\n }\n GroupBySubscriber.prototype._next = function (value) {\n var key;\n try {\n key = this.keySelector(value);\n }\n catch (err) {\n this.error(err);\n return;\n }\n this._group(value, key);\n };\n GroupBySubscriber.prototype._group = function (value, key) {\n var groups = this.groups;\n if (!groups) {\n groups = this.groups = new Map();\n }\n var group = groups.get(key);\n var element;\n if (this.elementSelector) {\n try {\n element = this.elementSelector(value);\n }\n catch (err) {\n this.error(err);\n }\n }\n else {\n element = value;\n }\n if (!group) {\n group = (this.subjectSelector ? this.subjectSelector() : new Subject());\n groups.set(key, group);\n var groupedObservable = new GroupedObservable(key, group, this);\n this.destination.next(groupedObservable);\n if (this.durationSelector) {\n var duration = void 0;\n try {\n duration = this.durationSelector(new GroupedObservable(key, group));\n }\n catch (err) {\n this.error(err);\n return;\n }\n this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));\n }\n }\n if (!group.closed) {\n group.next(element);\n }\n };\n GroupBySubscriber.prototype._error = function (err) {\n var groups = this.groups;\n if (groups) {\n groups.forEach(function (group, key) {\n group.error(err);\n });\n groups.clear();\n }\n this.destination.error(err);\n };\n GroupBySubscriber.prototype._complete = function () {\n var groups = this.groups;\n if (groups) {\n groups.forEach(function (group, key) {\n group.complete();\n });\n groups.clear();\n }\n this.destination.complete();\n };\n GroupBySubscriber.prototype.removeGroup = function (key) {\n this.groups.delete(key);\n };\n GroupBySubscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.attemptedToUnsubscribe = true;\n if (this.count === 0) {\n _super.prototype.unsubscribe.call(this);\n }\n }\n };\n return GroupBySubscriber;\n}(Subscriber));\nvar GroupDurationSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(GroupDurationSubscriber, _super);\n function GroupDurationSubscriber(key, group, parent) {\n var _this = _super.call(this, group) || this;\n _this.key = key;\n _this.group = group;\n _this.parent = parent;\n return _this;\n }\n GroupDurationSubscriber.prototype._next = function (value) {\n this.complete();\n };\n GroupDurationSubscriber.prototype._unsubscribe = function () {\n var _a = this, parent = _a.parent, key = _a.key;\n this.key = this.parent = null;\n if (parent) {\n parent.removeGroup(key);\n }\n };\n return GroupDurationSubscriber;\n}(Subscriber));\nvar GroupedObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(GroupedObservable, _super);\n function GroupedObservable(key, groupSubject, refCountSubscription) {\n var _this = _super.call(this) || this;\n _this.key = key;\n _this.groupSubject = groupSubject;\n _this.refCountSubscription = refCountSubscription;\n return _this;\n }\n GroupedObservable.prototype._subscribe = function (subscriber) {\n var subscription = new Subscription();\n var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;\n if (refCountSubscription && !refCountSubscription.closed) {\n subscription.add(new InnerRefCountSubscription(refCountSubscription));\n }\n subscription.add(groupSubject.subscribe(subscriber));\n return subscription;\n };\n return GroupedObservable;\n}(Observable));\nexport { GroupedObservable };\nvar InnerRefCountSubscription = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(InnerRefCountSubscription, _super);\n function InnerRefCountSubscription(parent) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n parent.count++;\n return _this;\n }\n InnerRefCountSubscription.prototype.unsubscribe = function () {\n var parent = this.parent;\n if (!parent.closed && !this.closed) {\n _super.prototype.unsubscribe.call(this);\n parent.count -= 1;\n if (parent.count === 0 && parent.attemptedToUnsubscribe) {\n parent.unsubscribe();\n }\n }\n };\n return InnerRefCountSubscription;\n}(Subscription));\n\n", "/** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subject } from './Subject';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nvar BehaviorSubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(BehaviorSubject, _super);\n function BehaviorSubject(_value) {\n var _this = _super.call(this) || this;\n _this._value = _value;\n return _this;\n }\n Object.defineProperty(BehaviorSubject.prototype, \"value\", {\n get: function () {\n return this.getValue();\n },\n enumerable: true,\n configurable: true\n });\n BehaviorSubject.prototype._subscribe = function (subscriber) {\n var subscription = _super.prototype._subscribe.call(this, subscriber);\n if (subscription && !subscription.closed) {\n subscriber.next(this._value);\n }\n return subscription;\n };\n BehaviorSubject.prototype.getValue = function () {\n if (this.hasError) {\n throw this.thrownError;\n }\n else if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else {\n return this._value;\n }\n };\n BehaviorSubject.prototype.next = function (value) {\n _super.prototype.next.call(this, this._value = value);\n };\n return BehaviorSubject;\n}(Subject));\nexport { BehaviorSubject };\n\n", "/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n\n", "/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Action } from './Action';\nvar AsyncAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n clearInterval(id);\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n\n", "/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar QueueAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueAction, _super);\n function QueueAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n QueueAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay > 0) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n };\n QueueAction.prototype.execute = function (state, delay) {\n return (delay > 0 || this.closed) ?\n _super.prototype.execute.call(this, state, delay) :\n this._execute(state, delay);\n };\n QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n return scheduler.flush(this);\n };\n return QueueAction;\n}(AsyncAction));\nexport { QueueAction };\n\n", "var Scheduler = /*@__PURE__*/ (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = function () { return Date.now(); };\n return Scheduler;\n}());\nexport { Scheduler };\n\n", "/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n var _this = _super.call(this, SchedulerAction, function () {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {\n return AsyncScheduler.delegate.now();\n }\n else {\n return now();\n }\n }) || this;\n _this.actions = [];\n _this.active = false;\n _this.scheduled = undefined;\n return _this;\n }\n AsyncScheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n }\n else {\n return _super.prototype.schedule.call(this, work, delay, state);\n }\n };\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n\n", "/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar QueueScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueScheduler, _super);\n function QueueScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return QueueScheduler;\n}(AsyncScheduler));\nexport { QueueScheduler };\n\n", "/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */\nimport { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\nexport var queueScheduler = /*@__PURE__*/ new QueueScheduler(QueueAction);\nexport var queue = queueScheduler;\n\n", "/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport var EMPTY = /*@__PURE__*/ new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var subscribeToArray = function (array) {\n return function (subscriber) {\n for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n };\n};\n\n", "/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_subscribeToArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeToArray } from '../util/subscribeToArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable(subscribeToArray(input));\n }\n else {\n return scheduleArray(input, scheduler);\n }\n}\n\n", "/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args, scheduler);\n }\n else {\n return fromArray(args);\n }\n}\n\n", "/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport function throwError(error, scheduler) {\n if (!scheduler) {\n return new Observable(function (subscriber) { return subscriber.error(error); });\n }\n else {\n return new Observable(function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });\n }\n}\nfunction dispatch(_a) {\n var error = _a.error, subscriber = _a.subscriber;\n subscriber.error(error);\n}\n\n", "/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nexport var NotificationKind;\n/*@__PURE__*/ (function (NotificationKind) {\n NotificationKind[\"NEXT\"] = \"N\";\n NotificationKind[\"ERROR\"] = \"E\";\n NotificationKind[\"COMPLETE\"] = \"C\";\n})(NotificationKind || (NotificationKind = {}));\nvar Notification = /*@__PURE__*/ (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty();\n }\n throw new Error('unexpected notification kind value');\n };\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexport { Notification };\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nvar ObserveOnOperator = /*@__PURE__*/ (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexport { ObserveOnOperator };\nvar ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber));\nexport { ObserveOnSubscriber };\nvar ObserveOnMessage = /*@__PURE__*/ (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexport { ObserveOnMessage };\n\n", "/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subject } from './Subject';\nimport { queue } from './scheduler/queue';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nvar ReplaySubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ReplaySubject, _super);\n function ReplaySubject(bufferSize, windowTime, scheduler) {\n if (bufferSize === void 0) {\n bufferSize = Number.POSITIVE_INFINITY;\n }\n if (windowTime === void 0) {\n windowTime = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this) || this;\n _this.scheduler = scheduler;\n _this._events = [];\n _this._infiniteTimeWindow = false;\n _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n _this._windowTime = windowTime < 1 ? 1 : windowTime;\n if (windowTime === Number.POSITIVE_INFINITY) {\n _this._infiniteTimeWindow = true;\n _this.next = _this.nextInfiniteTimeWindow;\n }\n else {\n _this.next = _this.nextTimeWindow;\n }\n return _this;\n }\n ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {\n if (!this.isStopped) {\n var _events = this._events;\n _events.push(value);\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype.nextTimeWindow = function (value) {\n if (!this.isStopped) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n var _infiniteTimeWindow = this._infiniteTimeWindow;\n var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n var scheduler = this.scheduler;\n var len = _events.length;\n var subscription;\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));\n }\n if (_infiniteTimeWindow) {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n }\n else {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i].value);\n }\n }\n if (this.hasError) {\n subscriber.error(this.thrownError);\n }\n else if (this.isStopped) {\n subscriber.complete();\n }\n return subscription;\n };\n ReplaySubject.prototype._getNow = function () {\n return (this.scheduler || queue).now();\n };\n ReplaySubject.prototype._trimBufferThenGetEvents = function () {\n var now = this._getNow();\n var _bufferSize = this._bufferSize;\n var _windowTime = this._windowTime;\n var _events = this._events;\n var eventsCount = _events.length;\n var spliceCount = 0;\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n return _events;\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\nvar ReplayEvent = /*@__PURE__*/ (function () {\n function ReplayEvent(time, value) {\n this.time = time;\n this.value = value;\n }\n return ReplayEvent;\n}());\n\n", "/** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subject } from './Subject';\nimport { Subscription } from './Subscription';\nvar AsyncSubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncSubject, _super);\n function AsyncSubject() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.value = null;\n _this.hasNext = false;\n _this.hasCompleted = false;\n return _this;\n }\n AsyncSubject.prototype._subscribe = function (subscriber) {\n if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n }\n else if (this.hasCompleted && this.hasNext) {\n subscriber.next(this.value);\n subscriber.complete();\n return Subscription.EMPTY;\n }\n return _super.prototype._subscribe.call(this, subscriber);\n };\n AsyncSubject.prototype.next = function (value) {\n if (!this.hasCompleted) {\n this.value = value;\n this.hasNext = true;\n }\n };\n AsyncSubject.prototype.error = function (error) {\n if (!this.hasCompleted) {\n _super.prototype.error.call(this, error);\n }\n };\n AsyncSubject.prototype.complete = function () {\n this.hasCompleted = true;\n if (this.hasNext) {\n _super.prototype.next.call(this, this.value);\n }\n _super.prototype.complete.call(this);\n };\n return AsyncSubject;\n}(Subject));\nexport { AsyncSubject };\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar nextHandle = 1;\nvar RESOLVED = /*@__PURE__*/ (function () { return /*@__PURE__*/ Promise.resolve(); })();\nvar activeHandles = {};\nfunction findAndClearHandle(handle) {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\nexport var Immediate = {\n setImmediate: function (cb) {\n var handle = nextHandle++;\n activeHandles[handle] = true;\n RESOLVED.then(function () { return findAndClearHandle(handle) && cb(); });\n return handle;\n },\n clearImmediate: function (handle) {\n findAndClearHandle(handle);\n },\n};\nexport var TestTools = {\n pending: function () {\n return Object.keys(activeHandles).length;\n }\n};\n\n", "/** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Immediate } from '../util/Immediate';\nimport { AsyncAction } from './AsyncAction';\nvar AsapAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsapAction, _super);\n function AsapAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(scheduler.flush.bind(scheduler, null)));\n };\n AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n if (scheduler.actions.length === 0) {\n Immediate.clearImmediate(id);\n scheduler.scheduled = undefined;\n }\n return undefined;\n };\n return AsapAction;\n}(AsyncAction));\nexport { AsapAction };\n\n", "/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AsapScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsapScheduler, _super);\n function AsapScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AsapScheduler.prototype.flush = function (action) {\n this.active = true;\n this.scheduled = undefined;\n var actions = this.actions;\n var error;\n var index = -1;\n var count = actions.length;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n this.active = false;\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsapScheduler;\n}(AsyncScheduler));\nexport { AsapScheduler };\n\n", "/** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */\nimport { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\nexport var asapScheduler = /*@__PURE__*/ new AsapScheduler(AsapAction);\nexport var asap = asapScheduler;\n\n", "/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */\nimport { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = /*@__PURE__*/ new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n\n", "/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar AnimationFrameAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameAction, _super);\n function AnimationFrameAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));\n };\n AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n return undefined;\n };\n return AnimationFrameAction;\n}(AsyncAction));\nexport { AnimationFrameAction };\n\n", "/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameScheduler, _super);\n function AnimationFrameScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationFrameScheduler.prototype.flush = function (action) {\n this.active = true;\n this.scheduled = undefined;\n var actions = this.actions;\n var error;\n var index = -1;\n var count = actions.length;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n this.active = false;\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AnimationFrameScheduler;\n}(AsyncScheduler));\nexport { AnimationFrameScheduler };\n\n", "/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */\nimport { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport var animationFrameScheduler = /*@__PURE__*/ new AnimationFrameScheduler(AnimationFrameAction);\nexport var animationFrame = animationFrameScheduler;\n\n", "/** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nvar VirtualTimeScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(VirtualTimeScheduler, _super);\n function VirtualTimeScheduler(SchedulerAction, maxFrames) {\n if (SchedulerAction === void 0) {\n SchedulerAction = VirtualAction;\n }\n if (maxFrames === void 0) {\n maxFrames = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;\n _this.maxFrames = maxFrames;\n _this.frame = 0;\n _this.index = -1;\n return _this;\n }\n VirtualTimeScheduler.prototype.flush = function () {\n var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;\n var error, action;\n while ((action = actions[0]) && action.delay <= maxFrames) {\n actions.shift();\n this.frame = action.delay;\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n }\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n VirtualTimeScheduler.frameTimeFactor = 10;\n return VirtualTimeScheduler;\n}(AsyncScheduler));\nexport { VirtualTimeScheduler };\nvar VirtualAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(VirtualAction, _super);\n function VirtualAction(scheduler, work, index) {\n if (index === void 0) {\n index = scheduler.index += 1;\n }\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.index = index;\n _this.active = true;\n _this.index = scheduler.index = index;\n return _this;\n }\n VirtualAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (!this.id) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.active = false;\n var action = new VirtualAction(this.scheduler, this.work);\n this.add(action);\n return action.schedule(state, delay);\n };\n VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n this.delay = scheduler.frame + delay;\n var actions = scheduler.actions;\n actions.push(this);\n actions.sort(VirtualAction.sortActions);\n return true;\n };\n VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return undefined;\n };\n VirtualAction.prototype._execute = function (state, delay) {\n if (this.active === true) {\n return _super.prototype._execute.call(this, state, delay);\n }\n };\n VirtualAction.sortActions = function (a, b) {\n if (a.delay === b.delay) {\n if (a.index === b.index) {\n return 0;\n }\n else if (a.index > b.index) {\n return 1;\n }\n else {\n return -1;\n }\n }\n else if (a.delay > b.delay) {\n return 1;\n }\n else {\n return -1;\n }\n };\n return VirtualAction;\n}(AsyncAction));\nexport { VirtualAction };\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function noop() { }\n\n", "/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport function isObservable(obj) {\n return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ArgumentOutOfRangeErrorImpl = /*@__PURE__*/ (function () {\n function ArgumentOutOfRangeErrorImpl() {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ArgumentOutOfRangeErrorImpl;\n})();\nexport var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar EmptyErrorImpl = /*@__PURE__*/ (function () {\n function EmptyErrorImpl() {\n Error.call(this);\n this.message = 'no elements in sequence';\n this.name = 'EmptyError';\n return this;\n }\n EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return EmptyErrorImpl;\n})();\nexport var EmptyError = EmptyErrorImpl;\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar TimeoutErrorImpl = /*@__PURE__*/ (function () {\n function TimeoutErrorImpl() {\n Error.call(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n return this;\n }\n TimeoutErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return TimeoutErrorImpl;\n})();\nexport var TimeoutError = TimeoutErrorImpl;\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nvar MapOperator = /*@__PURE__*/ (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexport { MapOperator };\nvar MapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.count = 0;\n _this.thisArg = thisArg || _this;\n return _this;\n }\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber));\n\n", "/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isArray,_util_isScheduler PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isArray } from '../util/isArray';\nimport { isScheduler } from '../util/isScheduler';\nexport function bindCallback(callbackFunc, resultSelector, scheduler) {\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n }\n else {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n };\n }\n }\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var context = this;\n var subject;\n var params = {\n context: context,\n subject: subject,\n callbackFunc: callbackFunc,\n scheduler: scheduler,\n };\n return new Observable(function (subscriber) {\n if (!scheduler) {\n if (!subject) {\n subject = new AsyncSubject();\n var handler = function () {\n var innerArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n innerArgs[_i] = arguments[_i];\n }\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n try {\n callbackFunc.apply(context, args.concat([handler]));\n }\n catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n }\n else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n }\n else {\n var state = {\n args: args, subscriber: subscriber, params: params,\n };\n return scheduler.schedule(dispatch, 0, state);\n }\n });\n };\n}\nfunction dispatch(state) {\n var _this = this;\n var self = this;\n var args = state.args, subscriber = state.subscriber, params = state.params;\n var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;\n var subject = params.subject;\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n var handler = function () {\n var innerArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n innerArgs[_i] = arguments[_i];\n }\n var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));\n };\n try {\n callbackFunc.apply(context, args.concat([handler]));\n }\n catch (err) {\n subject.error(err);\n }\n }\n this.add(subject.subscribe(subscriber));\n}\nfunction dispatchNext(state) {\n var value = state.value, subject = state.subject;\n subject.next(value);\n subject.complete();\n}\nfunction dispatchError(state) {\n var err = state.err, subject = state.subject;\n subject.error(err);\n}\n\n", "/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isScheduler,_util_isArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { AsyncSubject } from '../AsyncSubject';\nimport { map } from '../operators/map';\nimport { canReportError } from '../util/canReportError';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nexport function bindNodeCallback(callbackFunc, resultSelector, scheduler) {\n if (resultSelector) {\n if (isScheduler(resultSelector)) {\n scheduler = resultSelector;\n }\n else {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n };\n }\n }\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var params = {\n subject: undefined,\n args: args,\n callbackFunc: callbackFunc,\n scheduler: scheduler,\n context: this,\n };\n return new Observable(function (subscriber) {\n var context = params.context;\n var subject = params.subject;\n if (!scheduler) {\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n var handler = function () {\n var innerArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n innerArgs[_i] = arguments[_i];\n }\n var err = innerArgs.shift();\n if (err) {\n subject.error(err);\n return;\n }\n subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);\n subject.complete();\n };\n try {\n callbackFunc.apply(context, args.concat([handler]));\n }\n catch (err) {\n if (canReportError(subject)) {\n subject.error(err);\n }\n else {\n console.warn(err);\n }\n }\n }\n return subject.subscribe(subscriber);\n }\n else {\n return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });\n }\n });\n };\n}\nfunction dispatch(state) {\n var _this = this;\n var params = state.params, subscriber = state.subscriber, context = state.context;\n var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;\n var subject = params.subject;\n if (!subject) {\n subject = params.subject = new AsyncSubject();\n var handler = function () {\n var innerArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n innerArgs[_i] = arguments[_i];\n }\n var err = innerArgs.shift();\n if (err) {\n _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));\n }\n else {\n var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;\n _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));\n }\n };\n try {\n callbackFunc.apply(context, args.concat([handler]));\n }\n catch (err) {\n this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));\n }\n }\n this.add(subject.subscribe(subscriber));\n}\nfunction dispatchNext(arg) {\n var value = arg.value, subject = arg.subject;\n subject.next(value);\n subject.complete();\n}\nfunction dispatchError(arg) {\n var err = arg.err, subject = arg.subject;\n subject.error(err);\n}\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar OuterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber));\nexport { OuterSubscriber };\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar InnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n _this.index = 0;\n return _this;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber));\nexport { InnerSubscriber };\n\n", "/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */\nimport { hostReportError } from './hostReportError';\nexport var subscribeToPromise = function (promise) {\n return function (subscriber) {\n promise.then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, hostReportError);\n return subscriber;\n };\n};\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = /*@__PURE__*/ getSymbolIterator();\nexport var $$iterator = iterator;\n\n", "/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport var subscribeToIterable = function (iterable) {\n return function (subscriber) {\n var iterator = iterable[Symbol_iterator]();\n do {\n var item = void 0;\n try {\n item = iterator.next();\n }\n catch (err) {\n subscriber.error(err);\n return subscriber;\n }\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n if (typeof iterator.return === 'function') {\n subscriber.add(function () {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n return subscriber;\n };\n};\n\n", "/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeToObservable = function (obj) {\n return function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n }\n else {\n return obs.subscribe(subscriber);\n }\n };\n};\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isPromise(value) {\n return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\n\n", "/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeTo = function (result) {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result);\n }\n else if (isArrayLike(result)) {\n return subscribeToArray(result);\n }\n else if (isPromise(result)) {\n return subscribeToPromise(result);\n }\n else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result);\n }\n else {\n var value = isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = \"You provided \" + value + \" where a stream was expected.\"\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n\n", "/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo,_Observable PURE_IMPORTS_END */\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeTo } from './subscribeTo';\nimport { Observable } from '../Observable';\nexport function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber) {\n if (innerSubscriber === void 0) {\n innerSubscriber = new InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n }\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n return subscribeTo(result)(innerSubscriber);\n}\n\n", "/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\nvar NONE = {};\nexport function combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = undefined;\n var scheduler = undefined;\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nvar CombineLatestOperator = /*@__PURE__*/ (function () {\n function CombineLatestOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n };\n return CombineLatestOperator;\n}());\nexport { CombineLatestOperator };\nvar CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, resultSelector) {\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.active = 0;\n _this.values = [];\n _this.observables = [];\n return _this;\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryResultSelector = function (values) {\n var result;\n try {\n result = this.resultSelector.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber));\nexport { CombineLatestSubscriber };\n\n", "/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function scheduleObservable(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n var observable = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },\n error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },\n complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },\n }));\n }));\n return sub;\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function schedulePromise(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n return input.then(function (value) {\n sub.add(scheduler.schedule(function () {\n subscriber.next(value);\n sub.add(scheduler.schedule(function () { return subscriber.complete(); }));\n }));\n }, function (err) {\n sub.add(scheduler.schedule(function () { return subscriber.error(err); }));\n });\n }));\n return sub;\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\n\n", "/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function isInteropObservable(input) {\n return input && typeof input[Symbol_observable] === 'function';\n}\n\n", "/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function isIterable(input) {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n\n", "/** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */\nimport { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_subscribeTo,_scheduled_scheduled PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { scheduled } from '../scheduled/scheduled';\nexport function from(input, scheduler) {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable(subscribeTo(input));\n }\n else {\n return scheduled(input, scheduler);\n }\n}\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_util_subscribeTo PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nimport { Observable } from './Observable';\nimport { subscribeTo } from './util/subscribeTo';\nvar SimpleInnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SimpleInnerSubscriber, _super);\n function SimpleInnerSubscriber(parent) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n return _this;\n }\n SimpleInnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(value);\n };\n SimpleInnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error);\n this.unsubscribe();\n };\n SimpleInnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete();\n this.unsubscribe();\n };\n return SimpleInnerSubscriber;\n}(Subscriber));\nexport { SimpleInnerSubscriber };\nvar ComplexInnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ComplexInnerSubscriber, _super);\n function ComplexInnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n return _this;\n }\n ComplexInnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);\n };\n ComplexInnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error);\n this.unsubscribe();\n };\n ComplexInnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return ComplexInnerSubscriber;\n}(Subscriber));\nexport { ComplexInnerSubscriber };\nvar SimpleOuterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SimpleOuterSubscriber, _super);\n function SimpleOuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SimpleOuterSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n SimpleOuterSubscriber.prototype.notifyError = function (err) {\n this.destination.error(err);\n };\n SimpleOuterSubscriber.prototype.notifyComplete = function () {\n this.destination.complete();\n };\n return SimpleOuterSubscriber;\n}(Subscriber));\nexport { SimpleOuterSubscriber };\nvar ComplexOuterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ComplexOuterSubscriber, _super);\n function ComplexOuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ComplexOuterSubscriber.prototype.notifyNext = function (_outerValue, innerValue, _outerIndex, _innerSub) {\n this.destination.next(innerValue);\n };\n ComplexOuterSubscriber.prototype.notifyError = function (error) {\n this.destination.error(error);\n };\n ComplexOuterSubscriber.prototype.notifyComplete = function (_innerSub) {\n this.destination.complete();\n };\n return ComplexOuterSubscriber;\n}(Subscriber));\nexport { ComplexOuterSubscriber };\nexport function innerSubscribe(result, innerSubscriber) {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n var subscription;\n try {\n subscription = subscribeTo(result)(innerSubscriber);\n }\n catch (error) {\n innerSubscriber.error(error);\n }\n return subscription;\n}\n\n", "/** PURE_IMPORTS_START tslib,_map,_observable_from,_innerSubscribe PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(mergeMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };\n}\nvar MergeMapOperator = /*@__PURE__*/ (function () {\n function MergeMapOperator(project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n this.project = project;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexport { MergeMapOperator };\nvar MergeMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.concurrent = concurrent;\n _this.hasCompleted = false;\n _this.buffer = [];\n _this.active = 0;\n _this.index = 0;\n return _this;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish) {\n var innerSubscriber = new SimpleInnerSubscriber(this);\n var destination = this.destination;\n destination.add(innerSubscriber);\n var innerSubscription = innerSubscribe(ish, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n MergeMapSubscriber.prototype.notifyNext = function (innerValue) {\n this.destination.next(innerValue);\n };\n MergeMapSubscriber.prototype.notifyComplete = function () {\n var buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(SimpleOuterSubscriber));\nexport { MergeMapSubscriber };\nexport var flatMap = mergeMap;\n\n", "/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n return mergeMap(identity, concurrent);\n}\n\n", "/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */\nimport { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n\n", "/** PURE_IMPORTS_START _of,_operators_concatAll PURE_IMPORTS_END */\nimport { of } from './of';\nimport { concatAll } from '../operators/concatAll';\nexport function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return concatAll()(of.apply(void 0, observables));\n}\n\n", "/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { from } from './from';\nimport { empty } from './empty';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n var input;\n try {\n input = observableFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var source = input ? from(input) : empty();\n return source.subscribe(subscriber);\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_isArray,_operators_map,_util_isObject,_from PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { from } from './from';\nexport function forkJoin() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n if (sources.length === 1) {\n var first_1 = sources[0];\n if (isArray(first_1)) {\n return forkJoinInternal(first_1, null);\n }\n if (isObject(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {\n var keys = Object.keys(first_1);\n return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);\n }\n }\n if (typeof sources[sources.length - 1] === 'function') {\n var resultSelector_1 = sources.pop();\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(map(function (args) { return resultSelector_1.apply(void 0, args); }));\n }\n return forkJoinInternal(sources, null);\n}\nfunction forkJoinInternal(sources, keys) {\n return new Observable(function (subscriber) {\n var len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n var values = new Array(len);\n var completed = 0;\n var emitted = 0;\n var _loop_1 = function (i) {\n var source = from(sources[i]);\n var hasValue = false;\n subscriber.add(source.subscribe({\n next: function (value) {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: function (err) { return subscriber.error(err); },\n complete: function () {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ?\n keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :\n values);\n }\n subscriber.complete();\n }\n }\n }));\n };\n for (var i = 0; i < len; i++) {\n _loop_1(i);\n }\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nvar toString = /*@__PURE__*/ (function () { return Object.prototype.toString; })();\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n function handler(e) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n }\n else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options);\n });\n}\nfunction setupSubscription(sourceObj, eventName, handler, subscriber, options) {\n var unsubscribe;\n if (isEventTarget(sourceObj)) {\n var source_1 = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };\n }\n else if (isJQueryStyleEventEmitter(sourceObj)) {\n var source_2 = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = function () { return source_2.off(eventName, handler); };\n }\n else if (isNodeStyleEventEmitter(sourceObj)) {\n var source_3 = sourceObj;\n sourceObj.addListener(eventName, handler);\n unsubscribe = function () { return source_3.removeListener(eventName, handler); };\n }\n else if (sourceObj && sourceObj.length) {\n for (var i = 0, len = sourceObj.length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n }\n else {\n throw new TypeError('Invalid event target');\n }\n subscriber.add(unsubscribe);\n}\nfunction isNodeStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\nfunction isJQueryStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\nfunction isEventTarget(sourceObj) {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nexport function fromEventPattern(addHandler, removeHandler, resultSelector) {\n if (resultSelector) {\n return fromEventPattern(addHandler, removeHandler).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n var handler = function () {\n var e = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n e[_i] = arguments[_i];\n }\n return subscriber.next(e.length === 1 ? e[0] : e);\n };\n var retValue;\n try {\n retValue = addHandler(handler);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n return function () { return removeHandler(handler, retValue); };\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { identity } from '../util/identity';\nimport { isScheduler } from '../util/isScheduler';\nexport function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {\n var resultSelector;\n var initialState;\n if (arguments.length == 1) {\n var options = initialStateOrOptions;\n initialState = options.initialState;\n condition = options.condition;\n iterate = options.iterate;\n resultSelector = options.resultSelector || identity;\n scheduler = options.scheduler;\n }\n else if (resultSelectorOrObservable === undefined || isScheduler(resultSelectorOrObservable)) {\n initialState = initialStateOrOptions;\n resultSelector = identity;\n scheduler = resultSelectorOrObservable;\n }\n else {\n initialState = initialStateOrOptions;\n resultSelector = resultSelectorOrObservable;\n }\n return new Observable(function (subscriber) {\n var state = initialState;\n if (scheduler) {\n return scheduler.schedule(dispatch, 0, {\n subscriber: subscriber,\n iterate: iterate,\n condition: condition,\n resultSelector: resultSelector,\n state: state\n });\n }\n do {\n if (condition) {\n var conditionResult = void 0;\n try {\n conditionResult = condition(state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n break;\n }\n }\n var value = void 0;\n try {\n value = resultSelector(state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n break;\n }\n try {\n state = iterate(state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n } while (true);\n return undefined;\n });\n}\nfunction dispatch(state) {\n var subscriber = state.subscriber, condition = state.condition;\n if (subscriber.closed) {\n return undefined;\n }\n if (state.needIterate) {\n try {\n state.state = state.iterate(state.state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n }\n else {\n state.needIterate = true;\n }\n if (condition) {\n var conditionResult = void 0;\n try {\n conditionResult = condition(state.state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!conditionResult) {\n subscriber.complete();\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n }\n var value;\n try {\n value = state.resultSelector(state.state);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (subscriber.closed) {\n return undefined;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return undefined;\n }\n return this.schedule(state);\n}\n\n", "/** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */\nimport { defer } from './defer';\nimport { EMPTY } from './empty';\nexport function iif(condition, trueResult, falseResult) {\n if (trueResult === void 0) {\n trueResult = EMPTY;\n }\n if (falseResult === void 0) {\n falseResult = EMPTY;\n }\n return defer(function () { return condition() ? trueResult : falseResult; });\n}\n\n", "/** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */\nimport { isArray } from './isArray';\nexport function isNumeric(val) {\n return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}\n\n", "/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { isNumeric } from '../util/isNumeric';\nexport function interval(period, scheduler) {\n if (period === void 0) {\n period = 0;\n }\n if (scheduler === void 0) {\n scheduler = async;\n }\n if (!isNumeric(period) || period < 0) {\n period = 0;\n }\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n scheduler = async;\n }\n return new Observable(function (subscriber) {\n subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));\n return subscriber;\n });\n}\nfunction dispatch(state) {\n var subscriber = state.subscriber, counter = state.counter, period = state.period;\n subscriber.next(counter);\n this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\nexport function merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return observables[0];\n }\n return mergeAll(concurrent)(fromArray(observables, scheduler));\n}\n\n", "/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { noop } from '../util/noop';\nexport var NEVER = /*@__PURE__*/ new Observable(noop);\nexport function never() {\n return NEVER;\n}\n\n", "/** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { from } from './from';\nimport { isArray } from '../util/isArray';\nimport { EMPTY } from './empty';\nexport function onErrorResumeNext() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n if (sources.length === 0) {\n return EMPTY;\n }\n var first = sources[0], remainder = sources.slice(1);\n if (sources.length === 1 && isArray(first)) {\n return onErrorResumeNext.apply(void 0, first);\n }\n return new Observable(function (subscriber) {\n var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };\n return from(first).subscribe({\n next: function (value) { subscriber.next(value); },\n error: subNext,\n complete: subNext,\n });\n });\n}\n\n", "/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function pairs(obj, scheduler) {\n if (!scheduler) {\n return new Observable(function (subscriber) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length && !subscriber.closed; i++) {\n var key = keys[i];\n if (obj.hasOwnProperty(key)) {\n subscriber.next([key, obj[key]]);\n }\n }\n subscriber.complete();\n });\n }\n else {\n return new Observable(function (subscriber) {\n var keys = Object.keys(obj);\n var subscription = new Subscription();\n subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));\n return subscription;\n });\n }\n}\nexport function dispatch(state) {\n var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;\n if (!subscriber.closed) {\n if (index < keys.length) {\n var key = keys[index];\n subscriber.next([key, obj[key]]);\n subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));\n }\n else {\n subscriber.complete();\n }\n }\n}\n\n", "/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function not(pred, thisArg) {\n function notPred() {\n return !(notPred.pred.apply(notPred.thisArg, arguments));\n }\n notPred.pred = pred;\n notPred.thisArg = thisArg;\n return notPred;\n}\n\n", "/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nvar FilterOperator = /*@__PURE__*/ (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\nvar FilterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.thisArg = thisArg;\n _this.count = 0;\n return _this;\n }\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber));\n\n", "/** PURE_IMPORTS_START _util_not,_util_subscribeTo,_operators_filter,_Observable PURE_IMPORTS_END */\nimport { not } from '../util/not';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { filter } from '../operators/filter';\nimport { Observable } from '../Observable';\nexport function partition(source, predicate, thisArg) {\n return [\n filter(predicate, thisArg)(new Observable(subscribeTo(source))),\n filter(not(predicate, thisArg))(new Observable(subscribeTo(source)))\n ];\n}\n\n", "/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isArray } from '../util/isArray';\nimport { fromArray } from './fromArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function race() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n if (observables.length === 1) {\n if (isArray(observables[0])) {\n observables = observables[0];\n }\n else {\n return observables[0];\n }\n }\n return fromArray(observables, undefined).lift(new RaceOperator());\n}\nvar RaceOperator = /*@__PURE__*/ (function () {\n function RaceOperator() {\n }\n RaceOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RaceSubscriber(subscriber));\n };\n return RaceOperator;\n}());\nexport { RaceOperator };\nvar RaceSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RaceSubscriber, _super);\n function RaceSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.hasFirst = false;\n _this.observables = [];\n _this.subscriptions = [];\n return _this;\n }\n RaceSubscriber.prototype._next = function (observable) {\n this.observables.push(observable);\n };\n RaceSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n for (var i = 0; i < len && !this.hasFirst; i++) {\n var observable = observables[i];\n var subscription = subscribeToResult(this, observable, undefined, i);\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null;\n }\n };\n RaceSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {\n if (!this.hasFirst) {\n this.hasFirst = true;\n for (var i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n var subscription = this.subscriptions[i];\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n this.subscriptions = null;\n }\n this.destination.next(innerValue);\n };\n return RaceSubscriber;\n}(OuterSubscriber));\nexport { RaceSubscriber };\n\n", "/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport function range(start, count, scheduler) {\n if (start === void 0) {\n start = 0;\n }\n return new Observable(function (subscriber) {\n if (count === undefined) {\n count = start;\n start = 0;\n }\n var index = 0;\n var current = start;\n if (scheduler) {\n return scheduler.schedule(dispatch, 0, {\n index: index, count: count, start: start, subscriber: subscriber\n });\n }\n else {\n do {\n if (index++ >= count) {\n subscriber.complete();\n break;\n }\n subscriber.next(current++);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n }\n return undefined;\n });\n}\nexport function dispatch(state) {\n var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;\n if (index >= count) {\n subscriber.complete();\n return;\n }\n subscriber.next(start);\n if (subscriber.closed) {\n return;\n }\n state.index = index + 1;\n state.start = start + 1;\n this.schedule(state);\n}\n\n", "/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nexport function timer(dueTime, periodOrScheduler, scheduler) {\n if (dueTime === void 0) {\n dueTime = 0;\n }\n var period = -1;\n if (isNumeric(periodOrScheduler)) {\n period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);\n }\n else if (isScheduler(periodOrScheduler)) {\n scheduler = periodOrScheduler;\n }\n if (!isScheduler(scheduler)) {\n scheduler = async;\n }\n return new Observable(function (subscriber) {\n var due = isNumeric(dueTime)\n ? dueTime\n : (+dueTime - scheduler.now());\n return scheduler.schedule(dispatch, due, {\n index: 0, period: period, subscriber: subscriber\n });\n });\n}\nfunction dispatch(state) {\n var index = state.index, period = state.period, subscriber = state.subscriber;\n subscriber.next(index);\n if (subscriber.closed) {\n return;\n }\n else if (period === -1) {\n return subscriber.complete();\n }\n state.index = index + 1;\n this.schedule(state, period);\n}\n\n", "/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { from } from './from';\nimport { EMPTY } from './empty';\nexport function using(resourceFactory, observableFactory) {\n return new Observable(function (subscriber) {\n var resource;\n try {\n resource = resourceFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var result;\n try {\n result = observableFactory(resource);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var source = result ? from(result) : EMPTY;\n var subscription = source.subscribe(subscriber);\n return function () {\n subscription.unsubscribe();\n if (resource) {\n resource.unsubscribe();\n }\n };\n });\n}\n\n", "/** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_.._internal_symbol_iterator,_innerSubscribe PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { fromArray } from './fromArray';\nimport { isArray } from '../util/isArray';\nimport { Subscriber } from '../Subscriber';\nimport { iterator as Symbol_iterator } from '../../internal/symbol/iterator';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\nexport function zip() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}\nvar ZipOperator = /*@__PURE__*/ (function () {\n function ZipOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n ZipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));\n };\n return ZipOperator;\n}());\nexport { ZipOperator };\nvar ZipSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ZipSubscriber, _super);\n function ZipSubscriber(destination, resultSelector, values) {\n if (values === void 0) {\n values = Object.create(null);\n }\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.iterators = [];\n _this.active = 0;\n _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : undefined;\n return _this;\n }\n ZipSubscriber.prototype._next = function (value) {\n var iterators = this.iterators;\n if (isArray(value)) {\n iterators.push(new StaticArrayIterator(value));\n }\n else if (typeof value[Symbol_iterator] === 'function') {\n iterators.push(new StaticIterator(value[Symbol_iterator]()));\n }\n else {\n iterators.push(new ZipBufferIterator(this.destination, this, value));\n }\n };\n ZipSubscriber.prototype._complete = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n this.unsubscribe();\n if (len === 0) {\n this.destination.complete();\n return;\n }\n this.active = len;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (iterator.stillUnsubscribed) {\n var destination = this.destination;\n destination.add(iterator.subscribe());\n }\n else {\n this.active--;\n }\n }\n };\n ZipSubscriber.prototype.notifyInactive = function () {\n this.active--;\n if (this.active === 0) {\n this.destination.complete();\n }\n };\n ZipSubscriber.prototype.checkIterators = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n var destination = this.destination;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {\n return;\n }\n }\n var shouldComplete = false;\n var args = [];\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n var result = iterator.next();\n if (iterator.hasCompleted()) {\n shouldComplete = true;\n }\n if (result.done) {\n destination.complete();\n return;\n }\n args.push(result.value);\n }\n if (this.resultSelector) {\n this._tryresultSelector(args);\n }\n else {\n destination.next(args);\n }\n if (shouldComplete) {\n destination.complete();\n }\n };\n ZipSubscriber.prototype._tryresultSelector = function (args) {\n var result;\n try {\n result = this.resultSelector.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return ZipSubscriber;\n}(Subscriber));\nexport { ZipSubscriber };\nvar StaticIterator = /*@__PURE__*/ (function () {\n function StaticIterator(iterator) {\n this.iterator = iterator;\n this.nextResult = iterator.next();\n }\n StaticIterator.prototype.hasValue = function () {\n return true;\n };\n StaticIterator.prototype.next = function () {\n var result = this.nextResult;\n this.nextResult = this.iterator.next();\n return result;\n };\n StaticIterator.prototype.hasCompleted = function () {\n var nextResult = this.nextResult;\n return Boolean(nextResult && nextResult.done);\n };\n return StaticIterator;\n}());\nvar StaticArrayIterator = /*@__PURE__*/ (function () {\n function StaticArrayIterator(array) {\n this.array = array;\n this.index = 0;\n this.length = 0;\n this.length = array.length;\n }\n StaticArrayIterator.prototype[Symbol_iterator] = function () {\n return this;\n };\n StaticArrayIterator.prototype.next = function (value) {\n var i = this.index++;\n var array = this.array;\n return i < this.length ? { value: array[i], done: false } : { value: null, done: true };\n };\n StaticArrayIterator.prototype.hasValue = function () {\n return this.array.length > this.index;\n };\n StaticArrayIterator.prototype.hasCompleted = function () {\n return this.array.length === this.index;\n };\n return StaticArrayIterator;\n}());\nvar ZipBufferIterator = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ZipBufferIterator, _super);\n function ZipBufferIterator(destination, parent, observable) {\n var _this = _super.call(this, destination) || this;\n _this.parent = parent;\n _this.observable = observable;\n _this.stillUnsubscribed = true;\n _this.buffer = [];\n _this.isComplete = false;\n return _this;\n }\n ZipBufferIterator.prototype[Symbol_iterator] = function () {\n return this;\n };\n ZipBufferIterator.prototype.next = function () {\n var buffer = this.buffer;\n if (buffer.length === 0 && this.isComplete) {\n return { value: null, done: true };\n }\n else {\n return { value: buffer.shift(), done: false };\n }\n };\n ZipBufferIterator.prototype.hasValue = function () {\n return this.buffer.length > 0;\n };\n ZipBufferIterator.prototype.hasCompleted = function () {\n return this.buffer.length === 0 && this.isComplete;\n };\n ZipBufferIterator.prototype.notifyComplete = function () {\n if (this.buffer.length > 0) {\n this.isComplete = true;\n this.parent.notifyInactive();\n }\n else {\n this.destination.complete();\n }\n };\n ZipBufferIterator.prototype.notifyNext = function (innerValue) {\n this.buffer.push(innerValue);\n this.parent.checkIterators();\n };\n ZipBufferIterator.prototype.subscribe = function () {\n return innerSubscribe(this.observable, new SimpleInnerSubscriber(this));\n };\n return ZipBufferIterator;\n}(SimpleOuterSubscriber));\n\n"],
+ "mappings": ";;;;;AACO,SAAS,WAAW,GAAG;AAC1B,SAAO,OAAO,MAAM;AACxB;;;ACFA,IAAI,sDAAsD;AACnD,IAAI,SAAS;AAAA,EAChB,SAAS;AAAA,EACT,IAAI,sCAAsC,OAAO;AAC7C,QAAI,OAAO;AACP,UAAI,QAAsB,IAAI,MAAM;AACtB,cAAQ,KAAK,kGAAkG,MAAM,KAAK;AAAA,IAC5I,WACS,qDAAqD;AAC5C,cAAQ,IAAI,sDAAsD;AAAA,IACpF;AACA,0DAAsD;AAAA,EAC1D;AAAA,EACA,IAAI,wCAAwC;AACxC,WAAO;AAAA,EACX;AACJ;;;AChBO,SAAS,gBAAgB,KAAK;AACjC,aAAW,WAAY;AAAE,UAAM;AAAA,EAAK,GAAG,CAAC;AAC5C;;;ACAO,IAAI,QAAQ;AAAA,EACf,QAAQ;AAAA,EACR,MAAM,SAAU,OAAO;AAAA,EAAE;AAAA,EACzB,OAAO,SAAU,KAAK;AAClB,QAAI,OAAO,uCAAuC;AAC9C,YAAM;AAAA,IACV,OACK;AACD,sBAAgB,GAAG;AAAA,IACvB;AAAA,EACJ;AAAA,EACA,UAAU,WAAY;AAAA,EAAE;AAC5B;;;ACdO,IAAI,UAAyB,WAAY;AAAE,SAAO,MAAM,WAAY,SAAU,GAAG;AAAE,WAAO,KAAK,OAAO,EAAE,WAAW;AAAA,EAAU;AAAI,EAAG;;;ACApI,SAAS,SAAS,GAAG;AACxB,SAAO,MAAM,QAAQ,OAAO,MAAM;AACtC;;;ACFA,IAAI,0BAAyC,WAAY;AACrD,WAASA,yBAAwB,QAAQ;AACrC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CAAC;AAChB,UAAM,aAAa;AACnB,WAAO;AAAA,EACX;AACA,EAAAD,mBAAkB,UAAU,QAAe,IAAI,WAAY;AACvD,WAAO;AAAA,EACX;AACA,EAAAA,mBAAkB,UAAU,OAAO,WAAY;AAC3C,QAAI,SAAS,KAAK;AAClB,QAAI,OAAO,WAAW,KAAK,KAAK,YAAY;AACxC,aAAO,EAAE,OAAO,MAAM,MAAM,KAAK;AAAA,IACrC,OACK;AACD,aAAO,EAAE,OAAO,OAAO,MAAM,GAAG,MAAM,MAAM;AAAA,IAChD;AAAA,EACJ;AACA,EAAAA,mBAAkB,UAAU,WAAW,WAAY;AAC/C,WAAO,KAAK,OAAO,SAAS;AAAA,EAChC;AACA,EAAAA,mBAAkB,UAAU,eAAe,WAAY;AACnD,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC5C;AACA,EAAAA,mBAAkB,UAAU,iBAAiB,WAAY;AACrD,QAAI,KAAK,OAAO,SAAS,GAAG;AACxB,WAAK,aAAa;AAClB,WAAK,OAAO,eAAe;AAAA,IAC/B,OACK;AACD,WAAK,YAAY,SAAS;AAAA,IAC9B;AAAA,EACJ;AACA,EAAAA,mBAAkB,UAAU,aAAa,SAAU,YAAY;AAC3D,SAAK,OAAO,KAAK,UAAU;AAC3B,SAAK,OAAO,eAAe;AAAA,EAC/B;AACA,EAAAA,mBAAkB,UAAU,YAAY,WAAY;AAChD,WAAO,eAAe,KAAK,YAAY,IAAI,sBAAsB,IAAI,CAAC;AAAA,EAC1E;AACA,SAAOA;AACX,EAAE,qBAAqB;",
+ "names": ["UnsubscriptionErrorImpl", "Subscription", "empty", "Subscriber", "SafeSubscriber", "Observable", "observable", "ObjectUnsubscribedErrorImpl", "SubjectSubscription", "SubjectSubscriber", "Subject", "observable", "AnonymousSubject", "RefCountOperator", "RefCountSubscriber", "refCount", "ConnectableObservable", "ConnectableSubscriber", "RefCountOperator", "RefCountSubscriber", "refCount", "GroupByOperator", "GroupBySubscriber", "GroupDurationSubscriber", "GroupedObservable", "InnerRefCountSubscription", "BehaviorSubject", "Action", "AsyncAction", "QueueAction", "Scheduler", "AsyncScheduler", "QueueScheduler", "empty", "NotificationKind", "Notification", "empty", "ObserveOnOperator", "ObserveOnSubscriber", "ObserveOnMessage", "ReplaySubject", "ReplayEvent", "AsyncSubject", "AsapAction", "AsapScheduler", "AnimationFrameAction", "AnimationFrameScheduler", "VirtualTimeScheduler", "VirtualAction", "ArgumentOutOfRangeErrorImpl", "EmptyErrorImpl", "TimeoutErrorImpl", "MapOperator", "MapSubscriber", "args", "_i", "dispatch", "args", "_i", "dispatch", "dispatchNext", "OuterSubscriber", "InnerSubscriber", "iterator", "CombineLatestOperator", "CombineLatestSubscriber", "observable", "observable", "iterator", "SimpleInnerSubscriber", "ComplexInnerSubscriber", "SimpleOuterSubscriber", "ComplexOuterSubscriber", "MergeMapOperator", "MergeMapSubscriber", "empty", "i", "dispatch", "dispatch", "dispatch", "FilterOperator", "FilterSubscriber", "RaceOperator", "RaceSubscriber", "observable", "dispatch", "dispatch", "ZipOperator", "ZipSubscriber", "iterator", "StaticIterator", "iterator", "StaticArrayIterator", "ZipBufferIterator", "observable"]
+}
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js
new file mode 100644
index 0000000..e52de1c
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js
@@ -0,0 +1,340 @@
+// node_modules/tslib/tslib.es6.js
+var extendStatics = function(d, b) {
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
+ d2.__proto__ = b2;
+ } || function(d2, b2) {
+ for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
+ };
+ return extendStatics(d, b);
+};
+function __extends(d, b) {
+ extendStatics(d, b);
+ function __() {
+ this.constructor = d;
+ }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+}
+var __assign = function() {
+ __assign = Object.assign || function __assign2(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
+function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+}
+function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+function __param(paramIndex, decorator) {
+ return function(target, key) {
+ decorator(target, key, paramIndex);
+ };
+}
+function __metadata(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+}
+function __awaiter(thisArg, _arguments, P, generator) {
+ function adopt(value) {
+ return value instanceof P ? value : new P(function(resolve) {
+ resolve(value);
+ });
+ }
+ return new (P || (P = Promise))(function(resolve, reject) {
+ function fulfilled(value) {
+ try {
+ step(generator.next(value));
+ } catch (e) {
+ reject(e);
+ }
+ }
+ function rejected(value) {
+ try {
+ step(generator["throw"](value));
+ } catch (e) {
+ reject(e);
+ }
+ }
+ function step(result) {
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
+ }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+function __generator(thisArg, body) {
+ var _ = { label: 0, sent: function() {
+ if (t[0] & 1) throw t[1];
+ return t[1];
+ }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
+ return this;
+ }), g;
+ function verb(n) {
+ return function(v) {
+ return step([n, v]);
+ };
+ }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0:
+ case 1:
+ t = op;
+ break;
+ case 4:
+ _.label++;
+ return { value: op[1], done: false };
+ case 5:
+ _.label++;
+ y = op[1];
+ op = [0];
+ continue;
+ case 7:
+ op = _.ops.pop();
+ _.trys.pop();
+ continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+ }
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
+ _.label = op[1];
+ break;
+ }
+ if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
+ t = op;
+ break;
+ }
+ if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+ }
+ if (t[2]) _.ops.pop();
+ _.trys.pop();
+ continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) {
+ op = [6, e];
+ y = 0;
+ } finally {
+ f = t = 0;
+ }
+ if (op[0] & 5) throw op[1];
+ return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
+function __createBinding(o, m, k, k2) {
+ if (k2 === void 0) k2 = k;
+ o[k2] = m[k];
+}
+function __exportStar(m, exports) {
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+function __values(o) {
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+ if (m) return m.call(o);
+ if (o && typeof o.length === "number") return {
+ next: function() {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+}
+function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ } catch (error) {
+ e = { error };
+ } finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ } finally {
+ if (e) throw e.error;
+ }
+ }
+ return ar;
+}
+function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+}
+function __spreadArrays() {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+}
+function __await(v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+}
+function __asyncGenerator(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
+ return this;
+ }, i;
+ function verb(n) {
+ if (g[n]) i[n] = function(v) {
+ return new Promise(function(a, b) {
+ q.push([n, v, a, b]) > 1 || resume(n, v);
+ });
+ };
+ }
+ function resume(n, v) {
+ try {
+ step(g[n](v));
+ } catch (e) {
+ settle(q[0][3], e);
+ }
+ }
+ function step(r) {
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
+ }
+ function fulfill(value) {
+ resume("next", value);
+ }
+ function reject(value) {
+ resume("throw", value);
+ }
+ function settle(f, v) {
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
+ }
+}
+function __asyncDelegator(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function(e) {
+ throw e;
+ }), verb("return"), i[Symbol.iterator] = function() {
+ return this;
+ }, i;
+ function verb(n, f) {
+ i[n] = o[n] ? function(v) {
+ return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
+ } : f;
+ }
+}
+function __asyncValues(o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
+ return this;
+ }, i);
+ function verb(n) {
+ i[n] = o[n] && function(v) {
+ return new Promise(function(resolve, reject) {
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
+ });
+ };
+ }
+ function settle(resolve, reject, d, v) {
+ Promise.resolve(v).then(function(v2) {
+ resolve({ value: v2, done: d });
+ }, reject);
+ }
+}
+function __makeTemplateObject(cooked, raw) {
+ if (Object.defineProperty) {
+ Object.defineProperty(cooked, "raw", { value: raw });
+ } else {
+ cooked.raw = raw;
+ }
+ return cooked;
+}
+function __importStar(mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) {
+ for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+ }
+ result.default = mod;
+ return result;
+}
+function __importDefault(mod) {
+ return mod && mod.__esModule ? mod : { default: mod };
+}
+function __classPrivateFieldGet(receiver, privateMap) {
+ if (!privateMap.has(receiver)) {
+ throw new TypeError("attempted to get private field on non-instance");
+ }
+ return privateMap.get(receiver);
+}
+function __classPrivateFieldSet(receiver, privateMap, value) {
+ if (!privateMap.has(receiver)) {
+ throw new TypeError("attempted to set private field on non-instance");
+ }
+ privateMap.set(receiver, value);
+ return value;
+}
+
+export {
+ __extends,
+ __assign,
+ __rest,
+ __decorate,
+ __param,
+ __metadata,
+ __awaiter,
+ __generator,
+ __createBinding,
+ __exportStar,
+ __values,
+ __read,
+ __spread,
+ __spreadArrays,
+ __await,
+ __asyncGenerator,
+ __asyncDelegator,
+ __asyncValues,
+ __makeTemplateObject,
+ __importStar,
+ __importDefault,
+ __classPrivateFieldGet,
+ __classPrivateFieldSet
+};
+/*! Bundled license information:
+
+tslib/tslib.es6.js:
+ (*! *****************************************************************************
+ Copyright (c) Microsoft Corporation.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+ ***************************************************************************** *)
+*/
+//# sourceMappingURL=chunk-7PMVITZM.js.map
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js.map b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js.map
new file mode 100644
index 0000000..d287053
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-7PMVITZM.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../../../../../node_modules/tslib/tslib.es6.js"],
+ "sourcesContent": ["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"],
+ "mappings": ";AAgBA,IAAI,gBAAgB,SAAS,GAAG,GAAG;AAC/B,kBAAgB,OAAO,kBAClB,EAAE,WAAW,CAAC,EAAE,aAAa,SAAS,SAAUA,IAAGC,I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S,IAAI;AAC1D;AAEO,SAAS,uBAAuB,UAAU,YAAY;AACzD,MAAI,CAAC,WAAW,IAAI,QAAQ,GAAG;AAC3B,UAAM,IAAI,UAAU,gDAAgD;AAAA,EACxE;AACA,SAAO,WAAW,IAAI,QAAQ;AAClC;AAEO,SAAS,uBAAuB,UAAU,YAAY,OAAO;AAChE,MAAI,CAAC,WAAW,IAAI,QAAQ,GAAG;AAC3B,UAAM,IAAI,UAAU,gDAAgD;AAAA,EACxE;AACA,aAAW,IAAI,UAAU,KAAK;AAC9B,SAAO;AACX;",
+ "names": ["d", "b", "__assign", "v"]
+}
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js
new file mode 100644
index 0000000..4d0b175
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js
@@ -0,0 +1,5212 @@
+import {
+ ApplicationRef,
+ Attribute,
+ ChangeDetectorRef,
+ DEFAULT_CURRENCY_CODE,
+ DOCUMENT,
+ DestroyRef,
+ Directive,
+ ElementRef,
+ Host,
+ IMAGE_CONFIG,
+ IMAGE_CONFIG_DEFAULTS,
+ INTERNAL_APPLICATION_ERROR_HANDLER,
+ Inject,
+ Injectable,
+ InjectionToken,
+ Injector,
+ Input,
+ IterableDiffers,
+ KeyValueDiffers,
+ LOCALE_ID,
+ LocaleDataIndex,
+ NgModule,
+ NgModuleRef$1,
+ NgZone,
+ Optional,
+ Pipe,
+ Renderer2,
+ RendererStyleFlags2,
+ RuntimeError,
+ TemplateRef,
+ Version,
+ ViewContainerRef,
+ booleanAttribute,
+ createNgModule,
+ findLocaleData,
+ formatRuntimeError,
+ getLocaleCurrencyCode,
+ getLocalePluralCase,
+ inject,
+ isPromise,
+ isSubscribable,
+ numberAttribute,
+ performanceMarkFeature,
+ registerLocaleData,
+ setClassMetadata,
+ stringify,
+ untracked,
+ unwrapSafeValue,
+ ɵɵNgOnChangesFeature,
+ ɵɵdefineDirective,
+ ɵɵdefineInjectable,
+ ɵɵdefineInjector,
+ ɵɵdefineNgModule,
+ ɵɵdefinePipe,
+ ɵɵdirectiveInject,
+ ɵɵinject,
+ ɵɵinjectAttribute,
+ ɵɵstyleProp
+} from "./chunk-T7UM462Y.js";
+import {
+ Subject
+} from "./chunk-6OOPNYDU.js";
+import {
+ __async,
+ __spreadProps,
+ __spreadValues
+} from "./chunk-3OV72XIM.js";
+
+// node_modules/@angular/common/fesm2022/location.mjs
+var _DOM = null;
+function getDOM() {
+ return _DOM;
+}
+function setRootDomAdapter(adapter) {
+ _DOM ??= adapter;
+}
+var DomAdapter = class {
+};
+var PlatformLocation = class _PlatformLocation {
+ historyGo(relativePosition) {
+ throw new Error(ngDevMode ? "Not implemented" : "");
+ }
+ static ɵfac = function PlatformLocation_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PlatformLocation)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _PlatformLocation,
+ factory: () => (() => inject(BrowserPlatformLocation))(),
+ providedIn: "platform"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformLocation, [{
+ type: Injectable,
+ args: [{
+ providedIn: "platform",
+ useFactory: () => inject(BrowserPlatformLocation)
+ }]
+ }], null, null);
+})();
+var LOCATION_INITIALIZED = new InjectionToken(ngDevMode ? "Location Initialized" : "");
+var BrowserPlatformLocation = class _BrowserPlatformLocation extends PlatformLocation {
+ _location;
+ _history;
+ _doc = inject(DOCUMENT);
+ constructor() {
+ super();
+ this._location = window.location;
+ this._history = window.history;
+ }
+ getBaseHrefFromDOM() {
+ return getDOM().getBaseHref(this._doc);
+ }
+ onPopState(fn) {
+ const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
+ window2.addEventListener("popstate", fn, false);
+ return () => window2.removeEventListener("popstate", fn);
+ }
+ onHashChange(fn) {
+ const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
+ window2.addEventListener("hashchange", fn, false);
+ return () => window2.removeEventListener("hashchange", fn);
+ }
+ get href() {
+ return this._location.href;
+ }
+ get protocol() {
+ return this._location.protocol;
+ }
+ get hostname() {
+ return this._location.hostname;
+ }
+ get port() {
+ return this._location.port;
+ }
+ get pathname() {
+ return this._location.pathname;
+ }
+ get search() {
+ return this._location.search;
+ }
+ get hash() {
+ return this._location.hash;
+ }
+ set pathname(newPath) {
+ this._location.pathname = newPath;
+ }
+ pushState(state, title, url) {
+ this._history.pushState(state, title, url);
+ }
+ replaceState(state, title, url) {
+ this._history.replaceState(state, title, url);
+ }
+ forward() {
+ this._history.forward();
+ }
+ back() {
+ this._history.back();
+ }
+ historyGo(relativePosition = 0) {
+ this._history.go(relativePosition);
+ }
+ getState() {
+ return this._history.state;
+ }
+ static ɵfac = function BrowserPlatformLocation_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _BrowserPlatformLocation)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _BrowserPlatformLocation,
+ factory: () => (() => new _BrowserPlatformLocation())(),
+ providedIn: "platform"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserPlatformLocation, [{
+ type: Injectable,
+ args: [{
+ providedIn: "platform",
+ useFactory: () => new BrowserPlatformLocation()
+ }]
+ }], () => [], null);
+})();
+function joinWithSlash(start, end) {
+ if (!start) return end;
+ if (!end) return start;
+ if (start.endsWith("/")) {
+ return end.startsWith("/") ? start + end.slice(1) : start + end;
+ }
+ return end.startsWith("/") ? start + end : `${start}/${end}`;
+}
+function stripTrailingSlash(url) {
+ const pathEndIdx = url.search(/#|\?|$/);
+ return url[pathEndIdx - 1] === "/" ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;
+}
+function normalizeQueryParams(params) {
+ return params && params[0] !== "?" ? `?${params}` : params;
+}
+var LocationStrategy = class _LocationStrategy {
+ historyGo(relativePosition) {
+ throw new Error(ngDevMode ? "Not implemented" : "");
+ }
+ static ɵfac = function LocationStrategy_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _LocationStrategy)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _LocationStrategy,
+ factory: () => (() => inject(PathLocationStrategy))(),
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationStrategy, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root",
+ useFactory: () => inject(PathLocationStrategy)
+ }]
+ }], null, null);
+})();
+var APP_BASE_HREF = new InjectionToken(ngDevMode ? "appBaseHref" : "");
+var PathLocationStrategy = class _PathLocationStrategy extends LocationStrategy {
+ _platformLocation;
+ _baseHref;
+ _removeListenerFns = [];
+ constructor(_platformLocation, href) {
+ super();
+ this._platformLocation = _platformLocation;
+ this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject(DOCUMENT).location?.origin ?? "";
+ }
+ /** @docs-private */
+ ngOnDestroy() {
+ while (this._removeListenerFns.length) {
+ this._removeListenerFns.pop()();
+ }
+ }
+ onPopState(fn) {
+ this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
+ }
+ getBaseHref() {
+ return this._baseHref;
+ }
+ prepareExternalUrl(internal) {
+ return joinWithSlash(this._baseHref, internal);
+ }
+ path(includeHash = false) {
+ const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
+ const hash = this._platformLocation.hash;
+ return hash && includeHash ? `${pathname}${hash}` : pathname;
+ }
+ pushState(state, title, url, queryParams) {
+ const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
+ this._platformLocation.pushState(state, title, externalUrl);
+ }
+ replaceState(state, title, url, queryParams) {
+ const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
+ this._platformLocation.replaceState(state, title, externalUrl);
+ }
+ forward() {
+ this._platformLocation.forward();
+ }
+ back() {
+ this._platformLocation.back();
+ }
+ getState() {
+ return this._platformLocation.getState();
+ }
+ historyGo(relativePosition = 0) {
+ this._platformLocation.historyGo?.(relativePosition);
+ }
+ static ɵfac = function PathLocationStrategy_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PathLocationStrategy)(ɵɵinject(PlatformLocation), ɵɵinject(APP_BASE_HREF, 8));
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _PathLocationStrategy,
+ factory: _PathLocationStrategy.ɵfac,
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PathLocationStrategy, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root"
+ }]
+ }], () => [{
+ type: PlatformLocation
+ }, {
+ type: void 0,
+ decorators: [{
+ type: Optional
+ }, {
+ type: Inject,
+ args: [APP_BASE_HREF]
+ }]
+ }], null);
+})();
+var Location = class _Location {
+ /** @internal */
+ _subject = new Subject();
+ /** @internal */
+ _basePath;
+ /** @internal */
+ _locationStrategy;
+ /** @internal */
+ _urlChangeListeners = [];
+ /** @internal */
+ _urlChangeSubscription = null;
+ constructor(locationStrategy) {
+ this._locationStrategy = locationStrategy;
+ const baseHref = this._locationStrategy.getBaseHref();
+ this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
+ this._locationStrategy.onPopState((ev) => {
+ this._subject.next({
+ "url": this.path(true),
+ "pop": true,
+ "state": ev.state,
+ "type": ev.type
+ });
+ });
+ }
+ /** @docs-private */
+ ngOnDestroy() {
+ this._urlChangeSubscription?.unsubscribe();
+ this._urlChangeListeners = [];
+ }
+ /**
+ * Normalizes the URL path for this location.
+ *
+ * @param includeHash True to include an anchor fragment in the path.
+ *
+ * @returns The normalized URL path.
+ */
+ // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
+ // removed.
+ path(includeHash = false) {
+ return this.normalize(this._locationStrategy.path(includeHash));
+ }
+ /**
+ * Reports the current state of the location history.
+ * @returns The current value of the `history.state` object.
+ */
+ getState() {
+ return this._locationStrategy.getState();
+ }
+ /**
+ * Normalizes the given path and compares to the current normalized path.
+ *
+ * @param path The given URL path.
+ * @param query Query parameters.
+ *
+ * @returns True if the given URL path is equal to the current normalized path, false
+ * otherwise.
+ */
+ isCurrentPathEqualTo(path, query = "") {
+ return this.path() == this.normalize(path + normalizeQueryParams(query));
+ }
+ /**
+ * Normalizes a URL path by stripping any trailing slashes.
+ *
+ * @param url String representing a URL.
+ *
+ * @returns The normalized URL string.
+ */
+ normalize(url) {
+ return _Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
+ }
+ /**
+ * Normalizes an external URL path.
+ * If the given URL doesn't begin with a leading slash (`'/'`), adds one
+ * before normalizing. Adds a hash if `HashLocationStrategy` is
+ * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
+ *
+ * @param url String representing a URL.
+ *
+ * @returns A normalized platform-specific URL.
+ */
+ prepareExternalUrl(url) {
+ if (url && url[0] !== "/") {
+ url = "/" + url;
+ }
+ return this._locationStrategy.prepareExternalUrl(url);
+ }
+ // TODO: rename this method to pushState
+ /**
+ * Changes the browser's URL to a normalized version of a given URL, and pushes a
+ * new item onto the platform's history.
+ *
+ * @param path URL path to normalize.
+ * @param query Query parameters.
+ * @param state Location history state.
+ *
+ */
+ go(path, query = "", state = null) {
+ this._locationStrategy.pushState(state, "", path, query);
+ this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
+ }
+ /**
+ * Changes the browser's URL to a normalized version of the given URL, and replaces
+ * the top item on the platform's history stack.
+ *
+ * @param path URL path to normalize.
+ * @param query Query parameters.
+ * @param state Location history state.
+ */
+ replaceState(path, query = "", state = null) {
+ this._locationStrategy.replaceState(state, "", path, query);
+ this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
+ }
+ /**
+ * Navigates forward in the platform's history.
+ */
+ forward() {
+ this._locationStrategy.forward();
+ }
+ /**
+ * Navigates back in the platform's history.
+ */
+ back() {
+ this._locationStrategy.back();
+ }
+ /**
+ * Navigate to a specific page from session history, identified by its relative position to the
+ * current page.
+ *
+ * @param relativePosition Position of the target page in the history relative to the current
+ * page.
+ * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
+ * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
+ * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
+ * when `relativePosition` equals 0.
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
+ */
+ historyGo(relativePosition = 0) {
+ this._locationStrategy.historyGo?.(relativePosition);
+ }
+ /**
+ * Registers a URL change listener. Use to catch updates performed by the Angular
+ * framework that are not detectible through "popstate" or "hashchange" events.
+ *
+ * @param fn The change handler function, which take a URL and a location history state.
+ * @returns A function that, when executed, unregisters a URL change listener.
+ */
+ onUrlChange(fn) {
+ this._urlChangeListeners.push(fn);
+ this._urlChangeSubscription ??= this.subscribe((v) => {
+ this._notifyUrlChangeListeners(v.url, v.state);
+ });
+ return () => {
+ const fnIndex = this._urlChangeListeners.indexOf(fn);
+ this._urlChangeListeners.splice(fnIndex, 1);
+ if (this._urlChangeListeners.length === 0) {
+ this._urlChangeSubscription?.unsubscribe();
+ this._urlChangeSubscription = null;
+ }
+ };
+ }
+ /** @internal */
+ _notifyUrlChangeListeners(url = "", state) {
+ this._urlChangeListeners.forEach((fn) => fn(url, state));
+ }
+ /**
+ * Subscribes to the platform's `popState` events.
+ *
+ * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
+ * `Location.onUrlChange()` to subscribe to URL changes instead.
+ *
+ * @param value Event that is triggered when the state history changes.
+ * @param exception The exception to throw.
+ *
+ * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
+ *
+ * @returns Subscribed events.
+ */
+ subscribe(onNext, onThrow, onReturn) {
+ return this._subject.subscribe({
+ next: onNext,
+ error: onThrow ?? void 0,
+ complete: onReturn ?? void 0
+ });
+ }
+ /**
+ * Normalizes URL parameters by prepending with `?` if needed.
+ *
+ * @param params String of URL parameters.
+ *
+ * @returns The normalized URL parameters string.
+ */
+ static normalizeQueryParams = normalizeQueryParams;
+ /**
+ * Joins two parts of a URL with a slash if needed.
+ *
+ * @param start URL string
+ * @param end URL string
+ *
+ *
+ * @returns The joined URL string.
+ */
+ static joinWithSlash = joinWithSlash;
+ /**
+ * Removes a trailing slash from a URL string if needed.
+ * Looks for the first occurrence of either `#`, `?`, or the end of the
+ * line as `/` characters and removes the trailing slash if one exists.
+ *
+ * @param url URL string.
+ *
+ * @returns The URL string, modified if needed.
+ */
+ static stripTrailingSlash = stripTrailingSlash;
+ static ɵfac = function Location_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _Location)(ɵɵinject(LocationStrategy));
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _Location,
+ factory: () => createLocation(),
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Location, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root",
+ // See #23917
+ useFactory: createLocation
+ }]
+ }], () => [{
+ type: LocationStrategy
+ }], null);
+})();
+function createLocation() {
+ return new Location(ɵɵinject(LocationStrategy));
+}
+function _stripBasePath(basePath, url) {
+ if (!basePath || !url.startsWith(basePath)) {
+ return url;
+ }
+ const strippedUrl = url.substring(basePath.length);
+ if (strippedUrl === "" || ["/", ";", "?", "#"].includes(strippedUrl[0])) {
+ return strippedUrl;
+ }
+ return url;
+}
+function _stripIndexHtml(url) {
+ return url.replace(/\/index.html$/, "");
+}
+function _stripOrigin(baseHref) {
+ const isAbsoluteUrl2 = new RegExp("^(https?:)?//").test(baseHref);
+ if (isAbsoluteUrl2) {
+ const [, pathname] = baseHref.split(/\/\/[^\/]+/);
+ return pathname;
+ }
+ return baseHref;
+}
+
+// node_modules/@angular/common/fesm2022/common_module.mjs
+var HashLocationStrategy = class _HashLocationStrategy extends LocationStrategy {
+ _platformLocation;
+ _baseHref = "";
+ _removeListenerFns = [];
+ constructor(_platformLocation, _baseHref) {
+ super();
+ this._platformLocation = _platformLocation;
+ if (_baseHref != null) {
+ this._baseHref = _baseHref;
+ }
+ }
+ /** @docs-private */
+ ngOnDestroy() {
+ while (this._removeListenerFns.length) {
+ this._removeListenerFns.pop()();
+ }
+ }
+ onPopState(fn) {
+ this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
+ }
+ getBaseHref() {
+ return this._baseHref;
+ }
+ path(includeHash = false) {
+ const path = this._platformLocation.hash ?? "#";
+ return path.length > 0 ? path.substring(1) : path;
+ }
+ prepareExternalUrl(internal) {
+ const url = joinWithSlash(this._baseHref, internal);
+ return url.length > 0 ? "#" + url : url;
+ }
+ pushState(state, title, path, queryParams) {
+ const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
+ this._platformLocation.pushState(state, title, url);
+ }
+ replaceState(state, title, path, queryParams) {
+ const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
+ this._platformLocation.replaceState(state, title, url);
+ }
+ forward() {
+ this._platformLocation.forward();
+ }
+ back() {
+ this._platformLocation.back();
+ }
+ getState() {
+ return this._platformLocation.getState();
+ }
+ historyGo(relativePosition = 0) {
+ this._platformLocation.historyGo?.(relativePosition);
+ }
+ static ɵfac = function HashLocationStrategy_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _HashLocationStrategy)(ɵɵinject(PlatformLocation), ɵɵinject(APP_BASE_HREF, 8));
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _HashLocationStrategy,
+ factory: _HashLocationStrategy.ɵfac
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HashLocationStrategy, [{
+ type: Injectable
+ }], () => [{
+ type: PlatformLocation
+ }, {
+ type: void 0,
+ decorators: [{
+ type: Optional
+ }, {
+ type: Inject,
+ args: [APP_BASE_HREF]
+ }]
+ }], null);
+})();
+var CURRENCIES_EN = {
+ "ADP": [void 0, void 0, 0],
+ "AFN": [void 0, "؋", 0],
+ "ALL": [void 0, void 0, 0],
+ "AMD": [void 0, "֏", 2],
+ "AOA": [void 0, "Kz"],
+ "ARS": [void 0, "$"],
+ "AUD": ["A$", "$"],
+ "AZN": [void 0, "₼"],
+ "BAM": [void 0, "KM"],
+ "BBD": [void 0, "$"],
+ "BDT": [void 0, "৳"],
+ "BHD": [void 0, void 0, 3],
+ "BIF": [void 0, void 0, 0],
+ "BMD": [void 0, "$"],
+ "BND": [void 0, "$"],
+ "BOB": [void 0, "Bs"],
+ "BRL": ["R$"],
+ "BSD": [void 0, "$"],
+ "BWP": [void 0, "P"],
+ "BYN": [void 0, void 0, 2],
+ "BYR": [void 0, void 0, 0],
+ "BZD": [void 0, "$"],
+ "CAD": ["CA$", "$", 2],
+ "CHF": [void 0, void 0, 2],
+ "CLF": [void 0, void 0, 4],
+ "CLP": [void 0, "$", 0],
+ "CNY": ["CN¥", "¥"],
+ "COP": [void 0, "$", 2],
+ "CRC": [void 0, "₡", 2],
+ "CUC": [void 0, "$"],
+ "CUP": [void 0, "$"],
+ "CZK": [void 0, "Kč", 2],
+ "DJF": [void 0, void 0, 0],
+ "DKK": [void 0, "kr", 2],
+ "DOP": [void 0, "$"],
+ "EGP": [void 0, "E£"],
+ "ESP": [void 0, "₧", 0],
+ "EUR": ["€"],
+ "FJD": [void 0, "$"],
+ "FKP": [void 0, "£"],
+ "GBP": ["£"],
+ "GEL": [void 0, "₾"],
+ "GHS": [void 0, "GH₵"],
+ "GIP": [void 0, "£"],
+ "GNF": [void 0, "FG", 0],
+ "GTQ": [void 0, "Q"],
+ "GYD": [void 0, "$", 2],
+ "HKD": ["HK$", "$"],
+ "HNL": [void 0, "L"],
+ "HRK": [void 0, "kn"],
+ "HUF": [void 0, "Ft", 2],
+ "IDR": [void 0, "Rp", 2],
+ "ILS": ["₪"],
+ "INR": ["₹"],
+ "IQD": [void 0, void 0, 0],
+ "IRR": [void 0, void 0, 0],
+ "ISK": [void 0, "kr", 0],
+ "ITL": [void 0, void 0, 0],
+ "JMD": [void 0, "$"],
+ "JOD": [void 0, void 0, 3],
+ "JPY": ["¥", void 0, 0],
+ "KHR": [void 0, "៛"],
+ "KMF": [void 0, "CF", 0],
+ "KPW": [void 0, "₩", 0],
+ "KRW": ["₩", void 0, 0],
+ "KWD": [void 0, void 0, 3],
+ "KYD": [void 0, "$"],
+ "KZT": [void 0, "₸"],
+ "LAK": [void 0, "₭", 0],
+ "LBP": [void 0, "L£", 0],
+ "LKR": [void 0, "Rs"],
+ "LRD": [void 0, "$"],
+ "LTL": [void 0, "Lt"],
+ "LUF": [void 0, void 0, 0],
+ "LVL": [void 0, "Ls"],
+ "LYD": [void 0, void 0, 3],
+ "MGA": [void 0, "Ar", 0],
+ "MGF": [void 0, void 0, 0],
+ "MMK": [void 0, "K", 0],
+ "MNT": [void 0, "₮", 2],
+ "MRO": [void 0, void 0, 0],
+ "MUR": [void 0, "Rs", 2],
+ "MXN": ["MX$", "$"],
+ "MYR": [void 0, "RM"],
+ "NAD": [void 0, "$"],
+ "NGN": [void 0, "₦"],
+ "NIO": [void 0, "C$"],
+ "NOK": [void 0, "kr", 2],
+ "NPR": [void 0, "Rs"],
+ "NZD": ["NZ$", "$"],
+ "OMR": [void 0, void 0, 3],
+ "PHP": ["₱"],
+ "PKR": [void 0, "Rs", 2],
+ "PLN": [void 0, "zł"],
+ "PYG": [void 0, "₲", 0],
+ "RON": [void 0, "lei"],
+ "RSD": [void 0, void 0, 0],
+ "RUB": [void 0, "₽"],
+ "RWF": [void 0, "RF", 0],
+ "SBD": [void 0, "$"],
+ "SEK": [void 0, "kr", 2],
+ "SGD": [void 0, "$"],
+ "SHP": [void 0, "£"],
+ "SLE": [void 0, void 0, 2],
+ "SLL": [void 0, void 0, 0],
+ "SOS": [void 0, void 0, 0],
+ "SRD": [void 0, "$"],
+ "SSP": [void 0, "£"],
+ "STD": [void 0, void 0, 0],
+ "STN": [void 0, "Db"],
+ "SYP": [void 0, "£", 0],
+ "THB": [void 0, "฿"],
+ "TMM": [void 0, void 0, 0],
+ "TND": [void 0, void 0, 3],
+ "TOP": [void 0, "T$"],
+ "TRL": [void 0, void 0, 0],
+ "TRY": [void 0, "₺"],
+ "TTD": [void 0, "$"],
+ "TWD": ["NT$", "$", 2],
+ "TZS": [void 0, void 0, 2],
+ "UAH": [void 0, "₴"],
+ "UGX": [void 0, void 0, 0],
+ "USD": ["$"],
+ "UYI": [void 0, void 0, 0],
+ "UYU": [void 0, "$"],
+ "UYW": [void 0, void 0, 4],
+ "UZS": [void 0, void 0, 2],
+ "VEF": [void 0, "Bs", 2],
+ "VND": ["₫", void 0, 0],
+ "VUV": [void 0, void 0, 0],
+ "XAF": ["FCFA", void 0, 0],
+ "XCD": ["EC$", "$"],
+ "XOF": ["F CFA", void 0, 0],
+ "XPF": ["CFPF", void 0, 0],
+ "XXX": ["¤"],
+ "YER": [void 0, void 0, 0],
+ "ZAR": [void 0, "R"],
+ "ZMK": [void 0, void 0, 0],
+ "ZMW": [void 0, "ZK"],
+ "ZWD": [void 0, void 0, 0]
+};
+var NumberFormatStyle;
+(function(NumberFormatStyle2) {
+ NumberFormatStyle2[NumberFormatStyle2["Decimal"] = 0] = "Decimal";
+ NumberFormatStyle2[NumberFormatStyle2["Percent"] = 1] = "Percent";
+ NumberFormatStyle2[NumberFormatStyle2["Currency"] = 2] = "Currency";
+ NumberFormatStyle2[NumberFormatStyle2["Scientific"] = 3] = "Scientific";
+})(NumberFormatStyle || (NumberFormatStyle = {}));
+var Plural;
+(function(Plural2) {
+ Plural2[Plural2["Zero"] = 0] = "Zero";
+ Plural2[Plural2["One"] = 1] = "One";
+ Plural2[Plural2["Two"] = 2] = "Two";
+ Plural2[Plural2["Few"] = 3] = "Few";
+ Plural2[Plural2["Many"] = 4] = "Many";
+ Plural2[Plural2["Other"] = 5] = "Other";
+})(Plural || (Plural = {}));
+var FormStyle;
+(function(FormStyle2) {
+ FormStyle2[FormStyle2["Format"] = 0] = "Format";
+ FormStyle2[FormStyle2["Standalone"] = 1] = "Standalone";
+})(FormStyle || (FormStyle = {}));
+var TranslationWidth;
+(function(TranslationWidth2) {
+ TranslationWidth2[TranslationWidth2["Narrow"] = 0] = "Narrow";
+ TranslationWidth2[TranslationWidth2["Abbreviated"] = 1] = "Abbreviated";
+ TranslationWidth2[TranslationWidth2["Wide"] = 2] = "Wide";
+ TranslationWidth2[TranslationWidth2["Short"] = 3] = "Short";
+})(TranslationWidth || (TranslationWidth = {}));
+var FormatWidth;
+(function(FormatWidth2) {
+ FormatWidth2[FormatWidth2["Short"] = 0] = "Short";
+ FormatWidth2[FormatWidth2["Medium"] = 1] = "Medium";
+ FormatWidth2[FormatWidth2["Long"] = 2] = "Long";
+ FormatWidth2[FormatWidth2["Full"] = 3] = "Full";
+})(FormatWidth || (FormatWidth = {}));
+var NumberSymbol = {
+ /**
+ * Decimal separator.
+ * For `en-US`, the dot character.
+ * Example: 2,345`.`67
+ */
+ Decimal: 0,
+ /**
+ * Grouping separator, typically for thousands.
+ * For `en-US`, the comma character.
+ * Example: 2`,`345.67
+ */
+ Group: 1,
+ /**
+ * List-item separator.
+ * Example: "one, two, and three"
+ */
+ List: 2,
+ /**
+ * Sign for percentage (out of 100).
+ * Example: 23.4%
+ */
+ PercentSign: 3,
+ /**
+ * Sign for positive numbers.
+ * Example: +23
+ */
+ PlusSign: 4,
+ /**
+ * Sign for negative numbers.
+ * Example: -23
+ */
+ MinusSign: 5,
+ /**
+ * Computer notation for exponential value (n times a power of 10).
+ * Example: 1.2E3
+ */
+ Exponential: 6,
+ /**
+ * Human-readable format of exponential.
+ * Example: 1.2x103
+ */
+ SuperscriptingExponent: 7,
+ /**
+ * Sign for permille (out of 1000).
+ * Example: 23.4‰
+ */
+ PerMille: 8,
+ /**
+ * Infinity, can be used with plus and minus.
+ * Example: ∞, +∞, -∞
+ */
+ Infinity: 9,
+ /**
+ * Not a number.
+ * Example: NaN
+ */
+ NaN: 10,
+ /**
+ * Symbol used between time units.
+ * Example: 10:52
+ */
+ TimeSeparator: 11,
+ /**
+ * Decimal separator for currency values (fallback to `Decimal`).
+ * Example: $2,345.67
+ */
+ CurrencyDecimal: 12,
+ /**
+ * Group separator for currency values (fallback to `Group`).
+ * Example: $2,345.67
+ */
+ CurrencyGroup: 13
+};
+var WeekDay;
+(function(WeekDay2) {
+ WeekDay2[WeekDay2["Sunday"] = 0] = "Sunday";
+ WeekDay2[WeekDay2["Monday"] = 1] = "Monday";
+ WeekDay2[WeekDay2["Tuesday"] = 2] = "Tuesday";
+ WeekDay2[WeekDay2["Wednesday"] = 3] = "Wednesday";
+ WeekDay2[WeekDay2["Thursday"] = 4] = "Thursday";
+ WeekDay2[WeekDay2["Friday"] = 5] = "Friday";
+ WeekDay2[WeekDay2["Saturday"] = 6] = "Saturday";
+})(WeekDay || (WeekDay = {}));
+function getLocaleId(locale) {
+ return findLocaleData(locale)[LocaleDataIndex.LocaleId];
+}
+function getLocaleDayPeriods(locale, formStyle, width) {
+ const data = findLocaleData(locale);
+ const amPmData = [data[LocaleDataIndex.DayPeriodsFormat], data[LocaleDataIndex.DayPeriodsStandalone]];
+ const amPm = getLastDefinedValue(amPmData, formStyle);
+ return getLastDefinedValue(amPm, width);
+}
+function getLocaleDayNames(locale, formStyle, width) {
+ const data = findLocaleData(locale);
+ const daysData = [data[LocaleDataIndex.DaysFormat], data[LocaleDataIndex.DaysStandalone]];
+ const days = getLastDefinedValue(daysData, formStyle);
+ return getLastDefinedValue(days, width);
+}
+function getLocaleMonthNames(locale, formStyle, width) {
+ const data = findLocaleData(locale);
+ const monthsData = [data[LocaleDataIndex.MonthsFormat], data[LocaleDataIndex.MonthsStandalone]];
+ const months = getLastDefinedValue(monthsData, formStyle);
+ return getLastDefinedValue(months, width);
+}
+function getLocaleEraNames(locale, width) {
+ const data = findLocaleData(locale);
+ const erasData = data[LocaleDataIndex.Eras];
+ return getLastDefinedValue(erasData, width);
+}
+function getLocaleFirstDayOfWeek(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.FirstDayOfWeek];
+}
+function getLocaleWeekEndRange(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.WeekendRange];
+}
+function getLocaleDateFormat(locale, width) {
+ const data = findLocaleData(locale);
+ return getLastDefinedValue(data[LocaleDataIndex.DateFormat], width);
+}
+function getLocaleTimeFormat(locale, width) {
+ const data = findLocaleData(locale);
+ return getLastDefinedValue(data[LocaleDataIndex.TimeFormat], width);
+}
+function getLocaleDateTimeFormat(locale, width) {
+ const data = findLocaleData(locale);
+ const dateTimeFormatData = data[LocaleDataIndex.DateTimeFormat];
+ return getLastDefinedValue(dateTimeFormatData, width);
+}
+function getLocaleNumberSymbol(locale, symbol) {
+ const data = findLocaleData(locale);
+ const res = data[LocaleDataIndex.NumberSymbols][symbol];
+ if (typeof res === "undefined") {
+ if (symbol === NumberSymbol.CurrencyDecimal) {
+ return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
+ } else if (symbol === NumberSymbol.CurrencyGroup) {
+ return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
+ }
+ }
+ return res;
+}
+function getLocaleNumberFormat(locale, type) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.NumberFormats][type];
+}
+function getLocaleCurrencySymbol(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.CurrencySymbol] || null;
+}
+function getLocaleCurrencyName(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.CurrencyName] || null;
+}
+function getLocaleCurrencyCode2(locale) {
+ return getLocaleCurrencyCode(locale);
+}
+function getLocaleCurrencies(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.Currencies];
+}
+var getLocalePluralCase2 = getLocalePluralCase;
+function checkFullData(data) {
+ if (!data[LocaleDataIndex.ExtraData]) {
+ throw new RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
+ }
+}
+function getLocaleExtraDayPeriodRules(locale) {
+ const data = findLocaleData(locale);
+ checkFullData(data);
+ const rules = data[LocaleDataIndex.ExtraData][
+ 2
+ /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */
+ ] || [];
+ return rules.map((rule) => {
+ if (typeof rule === "string") {
+ return extractTime(rule);
+ }
+ return [extractTime(rule[0]), extractTime(rule[1])];
+ });
+}
+function getLocaleExtraDayPeriods(locale, formStyle, width) {
+ const data = findLocaleData(locale);
+ checkFullData(data);
+ const dayPeriodsData = [data[LocaleDataIndex.ExtraData][
+ 0
+ /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */
+ ], data[LocaleDataIndex.ExtraData][
+ 1
+ /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */
+ ]];
+ const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
+ return getLastDefinedValue(dayPeriods, width) || [];
+}
+function getLocaleDirection(locale) {
+ const data = findLocaleData(locale);
+ return data[LocaleDataIndex.Directionality];
+}
+function getLastDefinedValue(data, index) {
+ for (let i = index; i > -1; i--) {
+ if (typeof data[i] !== "undefined") {
+ return data[i];
+ }
+ }
+ throw new RuntimeError(2304, ngDevMode && "Locale data API: locale data undefined");
+}
+function extractTime(time) {
+ const [h, m] = time.split(":");
+ return {
+ hours: +h,
+ minutes: +m
+ };
+}
+function getCurrencySymbol(code, format, locale = "en") {
+ const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
+ const symbolNarrow = currency[
+ 1
+ /* ɵCurrencyIndex.SymbolNarrow */
+ ];
+ if (format === "narrow" && typeof symbolNarrow === "string") {
+ return symbolNarrow;
+ }
+ return currency[
+ 0
+ /* ɵCurrencyIndex.Symbol */
+ ] || code;
+}
+var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
+function getNumberOfCurrencyDigits(code) {
+ let digits;
+ const currency = CURRENCIES_EN[code];
+ if (currency) {
+ digits = currency[
+ 2
+ /* ɵCurrencyIndex.NbOfDigits */
+ ];
+ }
+ return typeof digits === "number" ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
+}
+var ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
+var NAMED_FORMATS = {};
+var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
+function formatDate(value, format, locale, timezone) {
+ let date = toDate(value);
+ const namedFormat = getNamedFormat(locale, format);
+ format = namedFormat || format;
+ let parts = [];
+ let match;
+ while (format) {
+ match = DATE_FORMATS_SPLIT.exec(format);
+ if (match) {
+ parts = parts.concat(match.slice(1));
+ const part = parts.pop();
+ if (!part) {
+ break;
+ }
+ format = part;
+ } else {
+ parts.push(format);
+ break;
+ }
+ }
+ if (typeof ngDevMode === "undefined" || ngDevMode) {
+ assertValidDateFormat(parts);
+ }
+ let dateTimezoneOffset = date.getTimezoneOffset();
+ if (timezone) {
+ dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
+ date = convertTimezoneToLocal(date, timezone);
+ }
+ let text = "";
+ parts.forEach((value2) => {
+ const dateFormatter = getDateFormatter(value2);
+ text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
+ });
+ return text;
+}
+function assertValidDateFormat(parts) {
+ if (parts.some((part) => /^Y+$/.test(part)) && !parts.some((part) => /^w+$/.test(part))) {
+ const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join("")}". Did you mean to use calendar year "y" instead?`;
+ if (parts.length === 1) {
+ console.error(formatRuntimeError(2300, message));
+ } else {
+ throw new RuntimeError(2300, message);
+ }
+ }
+}
+function createDate(year, month, date) {
+ const newDate = /* @__PURE__ */ new Date(0);
+ newDate.setFullYear(year, month, date);
+ newDate.setHours(0, 0, 0);
+ return newDate;
+}
+function getNamedFormat(locale, format) {
+ const localeId = getLocaleId(locale);
+ NAMED_FORMATS[localeId] ??= {};
+ if (NAMED_FORMATS[localeId][format]) {
+ return NAMED_FORMATS[localeId][format];
+ }
+ let formatValue = "";
+ switch (format) {
+ case "shortDate":
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
+ break;
+ case "mediumDate":
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
+ break;
+ case "longDate":
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
+ break;
+ case "fullDate":
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
+ break;
+ case "shortTime":
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
+ break;
+ case "mediumTime":
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
+ break;
+ case "longTime":
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
+ break;
+ case "fullTime":
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
+ break;
+ case "short":
+ const shortTime = getNamedFormat(locale, "shortTime");
+ const shortDate = getNamedFormat(locale, "shortDate");
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
+ break;
+ case "medium":
+ const mediumTime = getNamedFormat(locale, "mediumTime");
+ const mediumDate = getNamedFormat(locale, "mediumDate");
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
+ break;
+ case "long":
+ const longTime = getNamedFormat(locale, "longTime");
+ const longDate = getNamedFormat(locale, "longDate");
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
+ break;
+ case "full":
+ const fullTime = getNamedFormat(locale, "fullTime");
+ const fullDate = getNamedFormat(locale, "fullDate");
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
+ break;
+ }
+ if (formatValue) {
+ NAMED_FORMATS[localeId][format] = formatValue;
+ }
+ return formatValue;
+}
+function formatDateTime(str, opt_values) {
+ if (opt_values) {
+ str = str.replace(/\{([^}]+)}/g, function(match, key) {
+ return opt_values != null && key in opt_values ? opt_values[key] : match;
+ });
+ }
+ return str;
+}
+function padNumber(num, digits, minusSign = "-", trim, negWrap) {
+ let neg = "";
+ if (num < 0 || negWrap && num <= 0) {
+ if (negWrap) {
+ num = -num + 1;
+ } else {
+ num = -num;
+ neg = minusSign;
+ }
+ }
+ let strNum = String(num);
+ while (strNum.length < digits) {
+ strNum = "0" + strNum;
+ }
+ if (trim) {
+ strNum = strNum.slice(strNum.length - digits);
+ }
+ return neg + strNum;
+}
+function formatFractionalSeconds(milliseconds, digits) {
+ const strMs = padNumber(milliseconds, 3);
+ return strMs.substring(0, digits);
+}
+function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
+ return function(date, locale) {
+ let part = getDatePart(name, date);
+ if (offset > 0 || part > -offset) {
+ part += offset;
+ }
+ if (name === 3) {
+ if (part === 0 && offset === -12) {
+ part = 12;
+ }
+ } else if (name === 6) {
+ return formatFractionalSeconds(part, size);
+ }
+ const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
+ return padNumber(part, size, localeMinus, trim, negWrap);
+ };
+}
+function getDatePart(part, date) {
+ switch (part) {
+ case 0:
+ return date.getFullYear();
+ case 1:
+ return date.getMonth();
+ case 2:
+ return date.getDate();
+ case 3:
+ return date.getHours();
+ case 4:
+ return date.getMinutes();
+ case 5:
+ return date.getSeconds();
+ case 6:
+ return date.getMilliseconds();
+ case 7:
+ return date.getDay();
+ default:
+ throw new RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`);
+ }
+}
+function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
+ return function(date, locale) {
+ return getDateTranslation(date, locale, name, width, form, extended);
+ };
+}
+function getDateTranslation(date, locale, name, width, form, extended) {
+ switch (name) {
+ case 2:
+ return getLocaleMonthNames(locale, form, width)[date.getMonth()];
+ case 1:
+ return getLocaleDayNames(locale, form, width)[date.getDay()];
+ case 0:
+ const currentHours = date.getHours();
+ const currentMinutes = date.getMinutes();
+ if (extended) {
+ const rules = getLocaleExtraDayPeriodRules(locale);
+ const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
+ const index = rules.findIndex((rule) => {
+ if (Array.isArray(rule)) {
+ const [from, to] = rule;
+ const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
+ const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
+ if (from.hours < to.hours) {
+ if (afterFrom && beforeTo) {
+ return true;
+ }
+ } else if (afterFrom || beforeTo) {
+ return true;
+ }
+ } else {
+ if (rule.hours === currentHours && rule.minutes === currentMinutes) {
+ return true;
+ }
+ }
+ return false;
+ });
+ if (index !== -1) {
+ return dayPeriods[index];
+ }
+ }
+ return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
+ case 3:
+ return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
+ default:
+ const unexpected = name;
+ throw new RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`);
+ }
+}
+function timeZoneGetter(width) {
+ return function(date, locale, offset) {
+ const zone = -1 * offset;
+ const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
+ const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
+ switch (width) {
+ case 0:
+ return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
+ case 1:
+ return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 1, minusSign);
+ case 2:
+ return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
+ case 3:
+ if (offset === 0) {
+ return "Z";
+ } else {
+ return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
+ }
+ default:
+ throw new RuntimeError(2302, ngDevMode && `Unknown zone width "${width}"`);
+ }
+ };
+}
+var JANUARY = 0;
+var THURSDAY = 4;
+function getFirstThursdayOfYear(year) {
+ const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
+ return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
+}
+function getThursdayThisIsoWeek(datetime) {
+ const currentDay = datetime.getDay();
+ const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
+ return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
+}
+function weekGetter(size, monthBased = false) {
+ return function(date, locale) {
+ let result;
+ if (monthBased) {
+ const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
+ const today = date.getDate();
+ result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
+ } else {
+ const thisThurs = getThursdayThisIsoWeek(date);
+ const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
+ const diff = thisThurs.getTime() - firstThurs.getTime();
+ result = 1 + Math.round(diff / 6048e5);
+ }
+ return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ };
+}
+function weekNumberingYearGetter(size, trim = false) {
+ return function(date, locale) {
+ const thisThurs = getThursdayThisIsoWeek(date);
+ const weekNumberingYear = thisThurs.getFullYear();
+ return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
+ };
+}
+var DATE_FORMATS = {};
+function getDateFormatter(format) {
+ if (DATE_FORMATS[format]) {
+ return DATE_FORMATS[format];
+ }
+ let formatter;
+ switch (format) {
+ // Era name (AD/BC)
+ case "G":
+ case "GG":
+ case "GGG":
+ formatter = dateStrGetter(3, TranslationWidth.Abbreviated);
+ break;
+ case "GGGG":
+ formatter = dateStrGetter(3, TranslationWidth.Wide);
+ break;
+ case "GGGGG":
+ formatter = dateStrGetter(3, TranslationWidth.Narrow);
+ break;
+ // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
+ case "y":
+ formatter = dateGetter(0, 1, 0, false, true);
+ break;
+ // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
+ case "yy":
+ formatter = dateGetter(0, 2, 0, true, true);
+ break;
+ // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
+ case "yyy":
+ formatter = dateGetter(0, 3, 0, false, true);
+ break;
+ // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
+ case "yyyy":
+ formatter = dateGetter(0, 4, 0, false, true);
+ break;
+ // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)
+ case "Y":
+ formatter = weekNumberingYearGetter(1);
+ break;
+ // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD
+ // 2010 => 10)
+ case "YY":
+ formatter = weekNumberingYearGetter(2, true);
+ break;
+ // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD
+ // 2010 => 2010)
+ case "YYY":
+ formatter = weekNumberingYearGetter(3);
+ break;
+ // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)
+ case "YYYY":
+ formatter = weekNumberingYearGetter(4);
+ break;
+ // Month of the year (1-12), numeric
+ case "M":
+ case "L":
+ formatter = dateGetter(1, 1, 1);
+ break;
+ case "MM":
+ case "LL":
+ formatter = dateGetter(1, 2, 1);
+ break;
+ // Month of the year (January, ...), string, format
+ case "MMM":
+ formatter = dateStrGetter(2, TranslationWidth.Abbreviated);
+ break;
+ case "MMMM":
+ formatter = dateStrGetter(2, TranslationWidth.Wide);
+ break;
+ case "MMMMM":
+ formatter = dateStrGetter(2, TranslationWidth.Narrow);
+ break;
+ // Month of the year (January, ...), string, standalone
+ case "LLL":
+ formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone);
+ break;
+ case "LLLL":
+ formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone);
+ break;
+ case "LLLLL":
+ formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone);
+ break;
+ // Week of the year (1, ... 52)
+ case "w":
+ formatter = weekGetter(1);
+ break;
+ case "ww":
+ formatter = weekGetter(2);
+ break;
+ // Week of the month (1, ...)
+ case "W":
+ formatter = weekGetter(1, true);
+ break;
+ // Day of the month (1-31)
+ case "d":
+ formatter = dateGetter(2, 1);
+ break;
+ case "dd":
+ formatter = dateGetter(2, 2);
+ break;
+ // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)
+ case "c":
+ case "cc":
+ formatter = dateGetter(7, 1);
+ break;
+ case "ccc":
+ formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone);
+ break;
+ case "cccc":
+ formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone);
+ break;
+ case "ccccc":
+ formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone);
+ break;
+ case "cccccc":
+ formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone);
+ break;
+ // Day of the Week
+ case "E":
+ case "EE":
+ case "EEE":
+ formatter = dateStrGetter(1, TranslationWidth.Abbreviated);
+ break;
+ case "EEEE":
+ formatter = dateStrGetter(1, TranslationWidth.Wide);
+ break;
+ case "EEEEE":
+ formatter = dateStrGetter(1, TranslationWidth.Narrow);
+ break;
+ case "EEEEEE":
+ formatter = dateStrGetter(1, TranslationWidth.Short);
+ break;
+ // Generic period of the day (am-pm)
+ case "a":
+ case "aa":
+ case "aaa":
+ formatter = dateStrGetter(0, TranslationWidth.Abbreviated);
+ break;
+ case "aaaa":
+ formatter = dateStrGetter(0, TranslationWidth.Wide);
+ break;
+ case "aaaaa":
+ formatter = dateStrGetter(0, TranslationWidth.Narrow);
+ break;
+ // Extended period of the day (midnight, at night, ...), standalone
+ case "b":
+ case "bb":
+ case "bbb":
+ formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
+ break;
+ case "bbbb":
+ formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true);
+ break;
+ case "bbbbb":
+ formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true);
+ break;
+ // Extended period of the day (midnight, night, ...), standalone
+ case "B":
+ case "BB":
+ case "BBB":
+ formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true);
+ break;
+ case "BBBB":
+ formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true);
+ break;
+ case "BBBBB":
+ formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true);
+ break;
+ // Hour in AM/PM, (1-12)
+ case "h":
+ formatter = dateGetter(3, 1, -12);
+ break;
+ case "hh":
+ formatter = dateGetter(3, 2, -12);
+ break;
+ // Hour of the day (0-23)
+ case "H":
+ formatter = dateGetter(3, 1);
+ break;
+ // Hour in day, padded (00-23)
+ case "HH":
+ formatter = dateGetter(3, 2);
+ break;
+ // Minute of the hour (0-59)
+ case "m":
+ formatter = dateGetter(4, 1);
+ break;
+ case "mm":
+ formatter = dateGetter(4, 2);
+ break;
+ // Second of the minute (0-59)
+ case "s":
+ formatter = dateGetter(5, 1);
+ break;
+ case "ss":
+ formatter = dateGetter(5, 2);
+ break;
+ // Fractional second
+ case "S":
+ formatter = dateGetter(6, 1);
+ break;
+ case "SS":
+ formatter = dateGetter(6, 2);
+ break;
+ case "SSS":
+ formatter = dateGetter(6, 3);
+ break;
+ // Timezone ISO8601 short format (-0430)
+ case "Z":
+ case "ZZ":
+ case "ZZZ":
+ formatter = timeZoneGetter(
+ 0
+ /* ZoneWidth.Short */
+ );
+ break;
+ // Timezone ISO8601 extended format (-04:30)
+ case "ZZZZZ":
+ formatter = timeZoneGetter(
+ 3
+ /* ZoneWidth.Extended */
+ );
+ break;
+ // Timezone GMT short format (GMT+4)
+ case "O":
+ case "OO":
+ case "OOO":
+ // Should be location, but fallback to format O instead because we don't have the data yet
+ case "z":
+ case "zz":
+ case "zzz":
+ formatter = timeZoneGetter(
+ 1
+ /* ZoneWidth.ShortGMT */
+ );
+ break;
+ // Timezone GMT long format (GMT+0430)
+ case "OOOO":
+ case "ZZZZ":
+ // Should be location, but fallback to format O instead because we don't have the data yet
+ case "zzzz":
+ formatter = timeZoneGetter(
+ 2
+ /* ZoneWidth.Long */
+ );
+ break;
+ default:
+ return null;
+ }
+ DATE_FORMATS[format] = formatter;
+ return formatter;
+}
+function timezoneToOffset(timezone, fallback) {
+ timezone = timezone.replace(/:/g, "");
+ const requestedTimezoneOffset = Date.parse("Jan 01, 1970 00:00:00 " + timezone) / 6e4;
+ return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
+}
+function addDateMinutes(date, minutes) {
+ date = new Date(date.getTime());
+ date.setMinutes(date.getMinutes() + minutes);
+ return date;
+}
+function convertTimezoneToLocal(date, timezone, reverse) {
+ const reverseValue = -1;
+ const dateTimezoneOffset = date.getTimezoneOffset();
+ const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
+ return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
+}
+function toDate(value) {
+ if (isDate(value)) {
+ return value;
+ }
+ if (typeof value === "number" && !isNaN(value)) {
+ return new Date(value);
+ }
+ if (typeof value === "string") {
+ value = value.trim();
+ if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
+ const [y, m = 1, d = 1] = value.split("-").map((val) => +val);
+ return createDate(y, m - 1, d);
+ }
+ const parsedNb = parseFloat(value);
+ if (!isNaN(value - parsedNb)) {
+ return new Date(parsedNb);
+ }
+ let match;
+ if (match = value.match(ISO8601_DATE_REGEX)) {
+ return isoStringToDate(match);
+ }
+ }
+ const date = new Date(value);
+ if (!isDate(date)) {
+ throw new RuntimeError(2302, ngDevMode && `Unable to convert "${value}" into a date`);
+ }
+ return date;
+}
+function isoStringToDate(match) {
+ const date = /* @__PURE__ */ new Date(0);
+ let tzHour = 0;
+ let tzMin = 0;
+ const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
+ const timeSetter = match[8] ? date.setUTCHours : date.setHours;
+ if (match[9]) {
+ tzHour = Number(match[9] + match[10]);
+ tzMin = Number(match[9] + match[11]);
+ }
+ dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
+ const h = Number(match[4] || 0) - tzHour;
+ const m = Number(match[5] || 0) - tzMin;
+ const s = Number(match[6] || 0);
+ const ms = Math.floor(parseFloat("0." + (match[7] || 0)) * 1e3);
+ timeSetter.call(date, h, m, s, ms);
+ return date;
+}
+function isDate(value) {
+ return value instanceof Date && !isNaN(value.valueOf());
+}
+var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
+var MAX_DIGITS = 22;
+var DECIMAL_SEP = ".";
+var ZERO_CHAR = "0";
+var PATTERN_SEP = ";";
+var GROUP_SEP = ",";
+var DIGIT_CHAR = "#";
+var CURRENCY_CHAR = "¤";
+var PERCENT_CHAR = "%";
+function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
+ let formattedText = "";
+ let isZero = false;
+ if (!isFinite(value)) {
+ formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
+ } else {
+ let parsedNumber = parseNumber(value);
+ if (isPercent) {
+ parsedNumber = toPercent(parsedNumber);
+ }
+ let minInt = pattern.minInt;
+ let minFraction = pattern.minFrac;
+ let maxFraction = pattern.maxFrac;
+ if (digitsInfo) {
+ const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
+ if (parts === null) {
+ throw new RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`);
+ }
+ const minIntPart = parts[1];
+ const minFractionPart = parts[3];
+ const maxFractionPart = parts[5];
+ if (minIntPart != null) {
+ minInt = parseIntAutoRadix(minIntPart);
+ }
+ if (minFractionPart != null) {
+ minFraction = parseIntAutoRadix(minFractionPart);
+ }
+ if (maxFractionPart != null) {
+ maxFraction = parseIntAutoRadix(maxFractionPart);
+ } else if (minFractionPart != null && minFraction > maxFraction) {
+ maxFraction = minFraction;
+ }
+ }
+ roundNumber(parsedNumber, minFraction, maxFraction);
+ let digits = parsedNumber.digits;
+ let integerLen = parsedNumber.integerLen;
+ const exponent = parsedNumber.exponent;
+ let decimals = [];
+ isZero = digits.every((d) => !d);
+ for (; integerLen < minInt; integerLen++) {
+ digits.unshift(0);
+ }
+ for (; integerLen < 0; integerLen++) {
+ digits.unshift(0);
+ }
+ if (integerLen > 0) {
+ decimals = digits.splice(integerLen, digits.length);
+ } else {
+ decimals = digits;
+ digits = [0];
+ }
+ const groups = [];
+ if (digits.length >= pattern.lgSize) {
+ groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(""));
+ }
+ while (digits.length > pattern.gSize) {
+ groups.unshift(digits.splice(-pattern.gSize, digits.length).join(""));
+ }
+ if (digits.length) {
+ groups.unshift(digits.join(""));
+ }
+ formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
+ if (decimals.length) {
+ formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join("");
+ }
+ if (exponent) {
+ formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + "+" + exponent;
+ }
+ }
+ if (value < 0 && !isZero) {
+ formattedText = pattern.negPre + formattedText + pattern.negSuf;
+ } else {
+ formattedText = pattern.posPre + formattedText + pattern.posSuf;
+ }
+ return formattedText;
+}
+function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
+ pattern.maxFrac = pattern.minFrac;
+ const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
+ return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, "").trim();
+}
+function formatPercent(value, locale, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
+ return res.replace(new RegExp(PERCENT_CHAR, "g"), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
+}
+function formatNumber(value, locale, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
+}
+function parseNumberFormat(format, minusSign = "-") {
+ const p = {
+ minInt: 1,
+ minFrac: 0,
+ maxFrac: 0,
+ posPre: "",
+ posSuf: "",
+ negPre: "",
+ negSuf: "",
+ gSize: 0,
+ lgSize: 0
+ };
+ const patternParts = format.split(PATTERN_SEP);
+ const positive = patternParts[0];
+ const negative = patternParts[1];
+ const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || "";
+ p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
+ for (let i = 0; i < fraction.length; i++) {
+ const ch = fraction.charAt(i);
+ if (ch === ZERO_CHAR) {
+ p.minFrac = p.maxFrac = i + 1;
+ } else if (ch === DIGIT_CHAR) {
+ p.maxFrac = i + 1;
+ } else {
+ p.posSuf += ch;
+ }
+ }
+ const groups = integer.split(GROUP_SEP);
+ p.gSize = groups[1] ? groups[1].length : 0;
+ p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
+ if (negative) {
+ const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
+ p.negPre = negative.substring(0, pos).replace(/'/g, "");
+ p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, "");
+ } else {
+ p.negPre = minusSign + p.posPre;
+ p.negSuf = p.posSuf;
+ }
+ return p;
+}
+function toPercent(parsedNumber) {
+ if (parsedNumber.digits[0] === 0) {
+ return parsedNumber;
+ }
+ const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
+ if (parsedNumber.exponent) {
+ parsedNumber.exponent += 2;
+ } else {
+ if (fractionLen === 0) {
+ parsedNumber.digits.push(0, 0);
+ } else if (fractionLen === 1) {
+ parsedNumber.digits.push(0);
+ }
+ parsedNumber.integerLen += 2;
+ }
+ return parsedNumber;
+}
+function parseNumber(num) {
+ let numStr = Math.abs(num) + "";
+ let exponent = 0, digits, integerLen;
+ let i, j, zeros;
+ if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
+ numStr = numStr.replace(DECIMAL_SEP, "");
+ }
+ if ((i = numStr.search(/e/i)) > 0) {
+ if (integerLen < 0) integerLen = i;
+ integerLen += +numStr.slice(i + 1);
+ numStr = numStr.substring(0, i);
+ } else if (integerLen < 0) {
+ integerLen = numStr.length;
+ }
+ for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {
+ }
+ if (i === (zeros = numStr.length)) {
+ digits = [0];
+ integerLen = 1;
+ } else {
+ zeros--;
+ while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
+ integerLen -= i;
+ digits = [];
+ for (j = 0; i <= zeros; i++, j++) {
+ digits[j] = Number(numStr.charAt(i));
+ }
+ }
+ if (integerLen > MAX_DIGITS) {
+ digits = digits.splice(0, MAX_DIGITS - 1);
+ exponent = integerLen - 1;
+ integerLen = 1;
+ }
+ return {
+ digits,
+ exponent,
+ integerLen
+ };
+}
+function roundNumber(parsedNumber, minFrac, maxFrac) {
+ if (minFrac > maxFrac) {
+ throw new RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
+ }
+ let digits = parsedNumber.digits;
+ let fractionLen = digits.length - parsedNumber.integerLen;
+ const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
+ let roundAt = fractionSize + parsedNumber.integerLen;
+ let digit = digits[roundAt];
+ if (roundAt > 0) {
+ digits.splice(Math.max(parsedNumber.integerLen, roundAt));
+ for (let j = roundAt; j < digits.length; j++) {
+ digits[j] = 0;
+ }
+ } else {
+ fractionLen = Math.max(0, fractionLen);
+ parsedNumber.integerLen = 1;
+ digits.length = Math.max(1, roundAt = fractionSize + 1);
+ digits[0] = 0;
+ for (let i = 1; i < roundAt; i++) digits[i] = 0;
+ }
+ if (digit >= 5) {
+ if (roundAt - 1 < 0) {
+ for (let k = 0; k > roundAt; k--) {
+ digits.unshift(0);
+ parsedNumber.integerLen++;
+ }
+ digits.unshift(1);
+ parsedNumber.integerLen++;
+ } else {
+ digits[roundAt - 1]++;
+ }
+ }
+ for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
+ let dropTrailingZeros = fractionSize !== 0;
+ const minLen = minFrac + parsedNumber.integerLen;
+ const carry = digits.reduceRight(function(carry2, d, i, digits2) {
+ d = d + carry2;
+ digits2[i] = d < 10 ? d : d - 10;
+ if (dropTrailingZeros) {
+ if (digits2[i] === 0 && i >= minLen) {
+ digits2.pop();
+ } else {
+ dropTrailingZeros = false;
+ }
+ }
+ return d >= 10 ? 1 : 0;
+ }, 0);
+ if (carry) {
+ digits.unshift(carry);
+ parsedNumber.integerLen++;
+ }
+}
+function parseIntAutoRadix(text) {
+ const result = parseInt(text);
+ if (isNaN(result)) {
+ throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text);
+ }
+ return result;
+}
+var NgLocalization = class _NgLocalization {
+ static ɵfac = function NgLocalization_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgLocalization)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _NgLocalization,
+ factory: function NgLocalization_Factory(__ngFactoryType__) {
+ let __ngConditionalFactory__ = null;
+ if (__ngFactoryType__) {
+ __ngConditionalFactory__ = new __ngFactoryType__();
+ } else {
+ __ngConditionalFactory__ = ((locale) => new NgLocaleLocalization(locale))(ɵɵinject(LOCALE_ID));
+ }
+ return __ngConditionalFactory__;
+ },
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocalization, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root",
+ useFactory: (locale) => new NgLocaleLocalization(locale),
+ deps: [LOCALE_ID]
+ }]
+ }], null, null);
+})();
+function getPluralCategory(value, cases, ngLocalization, locale) {
+ let key = `=${value}`;
+ if (cases.indexOf(key) > -1) {
+ return key;
+ }
+ key = ngLocalization.getPluralCategory(value, locale);
+ if (cases.indexOf(key) > -1) {
+ return key;
+ }
+ if (cases.indexOf("other") > -1) {
+ return "other";
+ }
+ throw new RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`);
+}
+var NgLocaleLocalization = class _NgLocaleLocalization extends NgLocalization {
+ locale;
+ constructor(locale) {
+ super();
+ this.locale = locale;
+ }
+ getPluralCategory(value, locale) {
+ const plural = getLocalePluralCase2(locale || this.locale)(value);
+ switch (plural) {
+ case Plural.Zero:
+ return "zero";
+ case Plural.One:
+ return "one";
+ case Plural.Two:
+ return "two";
+ case Plural.Few:
+ return "few";
+ case Plural.Many:
+ return "many";
+ default:
+ return "other";
+ }
+ }
+ static ɵfac = function NgLocaleLocalization_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgLocaleLocalization)(ɵɵinject(LOCALE_ID));
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _NgLocaleLocalization,
+ factory: _NgLocaleLocalization.ɵfac
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocaleLocalization, [{
+ type: Injectable
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [LOCALE_ID]
+ }]
+ }], null);
+})();
+var WS_REGEXP = /\s+/;
+var EMPTY_ARRAY = [];
+var NgClass = class _NgClass {
+ _ngEl;
+ _renderer;
+ initialClasses = EMPTY_ARRAY;
+ rawClass;
+ stateMap = /* @__PURE__ */ new Map();
+ constructor(_ngEl, _renderer) {
+ this._ngEl = _ngEl;
+ this._renderer = _renderer;
+ }
+ set klass(value) {
+ this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;
+ }
+ set ngClass(value) {
+ this.rawClass = typeof value === "string" ? value.trim().split(WS_REGEXP) : value;
+ }
+ /*
+ The NgClass directive uses the custom change detection algorithm for its inputs. The custom
+ algorithm is necessary since inputs are represented as complex object or arrays that need to be
+ deeply-compared.
+ This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance
+ might negatively impact runtime performance of the entire change detection cycle. The design of
+ this algorithm is making sure that:
+ - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when
+ needed), even if references to bound objects change;
+ - there is no memory allocation if nothing changes (even relatively modest memory allocation
+ during the change detection cycle can result in GC pauses for some of the CD cycles).
+ The algorithm works by iterating over the set of bound classes, staring with [class] binding and
+ then going over [ngClass] binding. For each CSS class name:
+ - check if it was seen before (this information is tracked in the state map) and if its value
+ changed;
+ - mark it as "touched" - names that are not marked are not present in the latest set of binding
+ and we can remove such class name from the internal data structures;
+ After iteration over all the CSS class names we've got data structure with all the information
+ necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush
+ changes to the DOM and reset internal data structures so those are ready for the next change
+ detection cycle.
+ */
+ ngDoCheck() {
+ for (const klass of this.initialClasses) {
+ this._updateState(klass, true);
+ }
+ const rawClass = this.rawClass;
+ if (Array.isArray(rawClass) || rawClass instanceof Set) {
+ for (const klass of rawClass) {
+ this._updateState(klass, true);
+ }
+ } else if (rawClass != null) {
+ for (const klass of Object.keys(rawClass)) {
+ this._updateState(klass, Boolean(rawClass[klass]));
+ }
+ }
+ this._applyStateDiff();
+ }
+ _updateState(klass, nextEnabled) {
+ const state = this.stateMap.get(klass);
+ if (state !== void 0) {
+ if (state.enabled !== nextEnabled) {
+ state.changed = true;
+ state.enabled = nextEnabled;
+ }
+ state.touched = true;
+ } else {
+ this.stateMap.set(klass, {
+ enabled: nextEnabled,
+ changed: true,
+ touched: true
+ });
+ }
+ }
+ _applyStateDiff() {
+ for (const stateEntry of this.stateMap) {
+ const klass = stateEntry[0];
+ const state = stateEntry[1];
+ if (state.changed) {
+ this._toggleClass(klass, state.enabled);
+ state.changed = false;
+ } else if (!state.touched) {
+ if (state.enabled) {
+ this._toggleClass(klass, false);
+ }
+ this.stateMap.delete(klass);
+ }
+ state.touched = false;
+ }
+ }
+ _toggleClass(klass, enabled) {
+ if (ngDevMode) {
+ if (typeof klass !== "string") {
+ throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
+ }
+ }
+ klass = klass.trim();
+ if (klass.length > 0) {
+ klass.split(WS_REGEXP).forEach((klass2) => {
+ if (enabled) {
+ this._renderer.addClass(this._ngEl.nativeElement, klass2);
+ } else {
+ this._renderer.removeClass(this._ngEl.nativeElement, klass2);
+ }
+ });
+ }
+ }
+ static ɵfac = function NgClass_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgClass)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgClass,
+ selectors: [["", "ngClass", ""]],
+ inputs: {
+ klass: [0, "class", "klass"],
+ ngClass: "ngClass"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgClass, [{
+ type: Directive,
+ args: [{
+ selector: "[ngClass]"
+ }]
+ }], () => [{
+ type: ElementRef
+ }, {
+ type: Renderer2
+ }], {
+ klass: [{
+ type: Input,
+ args: ["class"]
+ }],
+ ngClass: [{
+ type: Input,
+ args: ["ngClass"]
+ }]
+ });
+})();
+var NgComponentOutlet = class _NgComponentOutlet {
+ _viewContainerRef;
+ // TODO(crisbeto): this should be `Type
`, but doing so broke a few
+ // targets in a TGP so we need to do it in a major version.
+ /** Component that should be rendered in the outlet. */
+ ngComponentOutlet = null;
+ ngComponentOutletInputs;
+ ngComponentOutletInjector;
+ ngComponentOutletEnvironmentInjector;
+ ngComponentOutletContent;
+ ngComponentOutletNgModule;
+ /**
+ * @deprecated This input is deprecated, use `ngComponentOutletNgModule` instead.
+ */
+ ngComponentOutletNgModuleFactory;
+ _componentRef;
+ _moduleRef;
+ /**
+ * A helper data structure that allows us to track inputs that were part of the
+ * ngComponentOutletInputs expression. Tracking inputs is necessary for proper removal of ones
+ * that are no longer referenced.
+ */
+ _inputsUsed = /* @__PURE__ */ new Map();
+ /**
+ * Gets the instance of the currently-rendered component.
+ * Will be null if no component has been rendered.
+ */
+ get componentInstance() {
+ return this._componentRef?.instance ?? null;
+ }
+ constructor(_viewContainerRef) {
+ this._viewContainerRef = _viewContainerRef;
+ }
+ _needToReCreateNgModuleInstance(changes) {
+ return changes["ngComponentOutletNgModule"] !== void 0 || changes["ngComponentOutletNgModuleFactory"] !== void 0;
+ }
+ _needToReCreateComponentInstance(changes) {
+ return changes["ngComponentOutlet"] !== void 0 || changes["ngComponentOutletContent"] !== void 0 || changes["ngComponentOutletInjector"] !== void 0 || changes["ngComponentOutletEnvironmentInjector"] !== void 0 || this._needToReCreateNgModuleInstance(changes);
+ }
+ /** @docs-private */
+ ngOnChanges(changes) {
+ if (this._needToReCreateComponentInstance(changes)) {
+ this._viewContainerRef.clear();
+ this._inputsUsed.clear();
+ this._componentRef = void 0;
+ if (this.ngComponentOutlet) {
+ const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
+ if (this._needToReCreateNgModuleInstance(changes)) {
+ this._moduleRef?.destroy();
+ if (this.ngComponentOutletNgModule) {
+ this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
+ } else if (this.ngComponentOutletNgModuleFactory) {
+ this._moduleRef = this.ngComponentOutletNgModuleFactory.create(getParentInjector(injector));
+ } else {
+ this._moduleRef = void 0;
+ }
+ }
+ this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
+ injector,
+ ngModuleRef: this._moduleRef,
+ projectableNodes: this.ngComponentOutletContent,
+ environmentInjector: this.ngComponentOutletEnvironmentInjector
+ });
+ }
+ }
+ }
+ /** @docs-private */
+ ngDoCheck() {
+ if (this._componentRef) {
+ if (this.ngComponentOutletInputs) {
+ for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
+ this._inputsUsed.set(inputName, true);
+ }
+ }
+ this._applyInputStateDiff(this._componentRef);
+ }
+ }
+ /** @docs-private */
+ ngOnDestroy() {
+ this._moduleRef?.destroy();
+ }
+ _applyInputStateDiff(componentRef) {
+ for (const [inputName, touched] of this._inputsUsed) {
+ if (!touched) {
+ componentRef.setInput(inputName, void 0);
+ this._inputsUsed.delete(inputName);
+ } else {
+ componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
+ this._inputsUsed.set(inputName, false);
+ }
+ }
+ }
+ static ɵfac = function NgComponentOutlet_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgComponentOutlet)(ɵɵdirectiveInject(ViewContainerRef));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgComponentOutlet,
+ selectors: [["", "ngComponentOutlet", ""]],
+ inputs: {
+ ngComponentOutlet: "ngComponentOutlet",
+ ngComponentOutletInputs: "ngComponentOutletInputs",
+ ngComponentOutletInjector: "ngComponentOutletInjector",
+ ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector",
+ ngComponentOutletContent: "ngComponentOutletContent",
+ ngComponentOutletNgModule: "ngComponentOutletNgModule",
+ ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory"
+ },
+ exportAs: ["ngComponentOutlet"],
+ features: [ɵɵNgOnChangesFeature]
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgComponentOutlet, [{
+ type: Directive,
+ args: [{
+ selector: "[ngComponentOutlet]",
+ exportAs: "ngComponentOutlet"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }], {
+ ngComponentOutlet: [{
+ type: Input
+ }],
+ ngComponentOutletInputs: [{
+ type: Input
+ }],
+ ngComponentOutletInjector: [{
+ type: Input
+ }],
+ ngComponentOutletEnvironmentInjector: [{
+ type: Input
+ }],
+ ngComponentOutletContent: [{
+ type: Input
+ }],
+ ngComponentOutletNgModule: [{
+ type: Input
+ }],
+ ngComponentOutletNgModuleFactory: [{
+ type: Input
+ }]
+ });
+})();
+function getParentInjector(injector) {
+ const parentNgModule = injector.get(NgModuleRef$1);
+ return parentNgModule.injector;
+}
+var NgForOfContext = class {
+ $implicit;
+ ngForOf;
+ index;
+ count;
+ constructor($implicit, ngForOf, index, count) {
+ this.$implicit = $implicit;
+ this.ngForOf = ngForOf;
+ this.index = index;
+ this.count = count;
+ }
+ // Indicates whether this is the first item in the collection.
+ get first() {
+ return this.index === 0;
+ }
+ // Indicates whether this is the last item in the collection.
+ get last() {
+ return this.index === this.count - 1;
+ }
+ // Indicates whether an index of this item in the collection is even.
+ get even() {
+ return this.index % 2 === 0;
+ }
+ // Indicates whether an index of this item in the collection is odd.
+ get odd() {
+ return !this.even;
+ }
+};
+var NgForOf = class _NgForOf {
+ _viewContainer;
+ _template;
+ _differs;
+ /**
+ * The value of the iterable expression, which can be used as a
+ * [template input variable](guide/directives/structural-directives#shorthand).
+ * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
+ */
+ set ngForOf(ngForOf) {
+ this._ngForOf = ngForOf;
+ this._ngForOfDirty = true;
+ }
+ /**
+ * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
+ *
+ * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
+ * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
+ * as the key.
+ *
+ * `NgForOf` uses the computed key to associate items in an iterable with DOM elements
+ * it produces for these items.
+ *
+ * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
+ * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
+ * primary key), and this iterable could be updated with new object instances that still
+ * represent the same underlying entity (for example, when data is re-fetched from the server,
+ * and the iterable is recreated and re-rendered, but most of the data is still the same).
+ *
+ * @see {@link TrackByFunction}
+ * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
+ */
+ set ngForTrackBy(fn) {
+ if ((typeof ngDevMode === "undefined" || ngDevMode) && fn != null && typeof fn !== "function") {
+ console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);
+ }
+ this._trackByFn = fn;
+ }
+ get ngForTrackBy() {
+ return this._trackByFn;
+ }
+ _ngForOf = null;
+ _ngForOfDirty = true;
+ _differ = null;
+ // waiting for microsoft/typescript#43662 to allow the return type `TrackByFunction|undefined` for
+ // the getter
+ _trackByFn;
+ constructor(_viewContainer, _template, _differs) {
+ this._viewContainer = _viewContainer;
+ this._template = _template;
+ this._differs = _differs;
+ }
+ /**
+ * A reference to the template that is stamped out for each item in the iterable.
+ * @see [template reference variable](guide/templates/variables#template-reference-variables)
+ * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.
+ */
+ set ngForTemplate(value) {
+ if (value) {
+ this._template = value;
+ }
+ }
+ /**
+ * Applies the changes when needed.
+ * @docs-private
+ */
+ ngDoCheck() {
+ if (this._ngForOfDirty) {
+ this._ngForOfDirty = false;
+ const value = this._ngForOf;
+ if (!this._differ && value) {
+ if (typeof ngDevMode === "undefined" || ngDevMode) {
+ try {
+ this._differ = this._differs.find(value).create(this.ngForTrackBy);
+ } catch {
+ let errorMessage = `Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
+ if (typeof value === "object") {
+ errorMessage += " Did you mean to use the keyvalue pipe?";
+ }
+ throw new RuntimeError(-2200, errorMessage);
+ }
+ } else {
+ this._differ = this._differs.find(value).create(this.ngForTrackBy);
+ }
+ }
+ }
+ if (this._differ) {
+ const changes = this._differ.diff(this._ngForOf);
+ if (changes) this._applyChanges(changes);
+ }
+ }
+ _applyChanges(changes) {
+ const viewContainer = this._viewContainer;
+ changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
+ if (item.previousIndex == null) {
+ viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? void 0 : currentIndex);
+ } else if (currentIndex == null) {
+ viewContainer.remove(adjustedPreviousIndex === null ? void 0 : adjustedPreviousIndex);
+ } else if (adjustedPreviousIndex !== null) {
+ const view = viewContainer.get(adjustedPreviousIndex);
+ viewContainer.move(view, currentIndex);
+ applyViewChange(view, item);
+ }
+ });
+ for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {
+ const viewRef = viewContainer.get(i);
+ const context = viewRef.context;
+ context.index = i;
+ context.count = ilen;
+ context.ngForOf = this._ngForOf;
+ }
+ changes.forEachIdentityChange((record) => {
+ const viewRef = viewContainer.get(record.currentIndex);
+ applyViewChange(viewRef, record);
+ });
+ }
+ /**
+ * Asserts the correct type of the context for the template that `NgForOf` will render.
+ *
+ * The presence of this method is a signal to the Ivy template type-check compiler that the
+ * `NgForOf` structural directive renders its template with a specific context type.
+ */
+ static ngTemplateContextGuard(dir, ctx) {
+ return true;
+ }
+ static ɵfac = function NgForOf_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgForOf)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(TemplateRef), ɵɵdirectiveInject(IterableDiffers));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgForOf,
+ selectors: [["", "ngFor", "", "ngForOf", ""]],
+ inputs: {
+ ngForOf: "ngForOf",
+ ngForTrackBy: "ngForTrackBy",
+ ngForTemplate: "ngForTemplate"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForOf, [{
+ type: Directive,
+ args: [{
+ selector: "[ngFor][ngForOf]"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }, {
+ type: TemplateRef
+ }, {
+ type: IterableDiffers
+ }], {
+ ngForOf: [{
+ type: Input
+ }],
+ ngForTrackBy: [{
+ type: Input
+ }],
+ ngForTemplate: [{
+ type: Input
+ }]
+ });
+})();
+function applyViewChange(view, record) {
+ view.context.$implicit = record.item;
+}
+function getTypeName(type) {
+ return type["name"] || typeof type;
+}
+var NgIf = class _NgIf {
+ _viewContainer;
+ _context = new NgIfContext();
+ _thenTemplateRef = null;
+ _elseTemplateRef = null;
+ _thenViewRef = null;
+ _elseViewRef = null;
+ constructor(_viewContainer, templateRef) {
+ this._viewContainer = _viewContainer;
+ this._thenTemplateRef = templateRef;
+ }
+ /**
+ * The Boolean expression to evaluate as the condition for showing a template.
+ * @deprecated Use the `@if` block instead. Intent to remove in v22
+ */
+ set ngIf(condition) {
+ this._context.$implicit = this._context.ngIf = condition;
+ this._updateView();
+ }
+ /**
+ * A template to show if the condition expression evaluates to true.
+ * @deprecated Use the `@if` block instead. Intent to remove in v22
+ */
+ set ngIfThen(templateRef) {
+ assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfThen");
+ this._thenTemplateRef = templateRef;
+ this._thenViewRef = null;
+ this._updateView();
+ }
+ /**
+ * A template to show if the condition expression evaluates to false.
+ * @deprecated Use the `@if` block instead. Intent to remove in v22
+ */
+ set ngIfElse(templateRef) {
+ assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfElse");
+ this._elseTemplateRef = templateRef;
+ this._elseViewRef = null;
+ this._updateView();
+ }
+ _updateView() {
+ if (this._context.$implicit) {
+ if (!this._thenViewRef) {
+ this._viewContainer.clear();
+ this._elseViewRef = null;
+ if (this._thenTemplateRef) {
+ this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
+ }
+ }
+ } else {
+ if (!this._elseViewRef) {
+ this._viewContainer.clear();
+ this._thenViewRef = null;
+ if (this._elseTemplateRef) {
+ this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
+ }
+ }
+ }
+ }
+ /** @internal */
+ static ngIfUseIfTypeGuard;
+ /**
+ * Assert the correct type of the expression bound to the `ngIf` input within the template.
+ *
+ * The presence of this static field is a signal to the Ivy template type check compiler that
+ * when the `NgIf` structural directive renders its template, the type of the expression bound
+ * to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to
+ * narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.
+ */
+ static ngTemplateGuard_ngIf;
+ /**
+ * Asserts the correct type of the context for the template that `NgIf` will render.
+ *
+ * The presence of this method is a signal to the Ivy template type-check compiler that the
+ * `NgIf` structural directive renders its template with a specific context type.
+ */
+ static ngTemplateContextGuard(dir, ctx) {
+ return true;
+ }
+ static ɵfac = function NgIf_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgIf)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(TemplateRef));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgIf,
+ selectors: [["", "ngIf", ""]],
+ inputs: {
+ ngIf: "ngIf",
+ ngIfThen: "ngIfThen",
+ ngIfElse: "ngIfElse"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgIf, [{
+ type: Directive,
+ args: [{
+ selector: "[ngIf]"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }, {
+ type: TemplateRef
+ }], {
+ ngIf: [{
+ type: Input
+ }],
+ ngIfThen: [{
+ type: Input
+ }],
+ ngIfElse: [{
+ type: Input
+ }]
+ });
+})();
+var NgIfContext = class {
+ $implicit = null;
+ ngIf = null;
+};
+function assertTemplate(templateRef, property) {
+ if (templateRef && !templateRef.createEmbeddedView) {
+ throw new RuntimeError(2020, (typeof ngDevMode === "undefined" || ngDevMode) && `${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);
+ }
+}
+var SwitchView = class {
+ _viewContainerRef;
+ _templateRef;
+ _created = false;
+ constructor(_viewContainerRef, _templateRef) {
+ this._viewContainerRef = _viewContainerRef;
+ this._templateRef = _templateRef;
+ }
+ create() {
+ this._created = true;
+ this._viewContainerRef.createEmbeddedView(this._templateRef);
+ }
+ destroy() {
+ this._created = false;
+ this._viewContainerRef.clear();
+ }
+ enforceState(created) {
+ if (created && !this._created) {
+ this.create();
+ } else if (!created && this._created) {
+ this.destroy();
+ }
+ }
+};
+var NgSwitch = class _NgSwitch {
+ _defaultViews = [];
+ _defaultUsed = false;
+ _caseCount = 0;
+ _lastCaseCheckIndex = 0;
+ _lastCasesMatched = false;
+ _ngSwitch;
+ /** @deprecated Use the `@switch` block instead. Intent to remove in v22 */
+ set ngSwitch(newValue) {
+ this._ngSwitch = newValue;
+ if (this._caseCount === 0) {
+ this._updateDefaultCases(true);
+ }
+ }
+ /** @internal */
+ _addCase() {
+ return this._caseCount++;
+ }
+ /** @internal */
+ _addDefault(view) {
+ this._defaultViews.push(view);
+ }
+ /** @internal */
+ _matchCase(value) {
+ const matched = value === this._ngSwitch;
+ this._lastCasesMatched ||= matched;
+ this._lastCaseCheckIndex++;
+ if (this._lastCaseCheckIndex === this._caseCount) {
+ this._updateDefaultCases(!this._lastCasesMatched);
+ this._lastCaseCheckIndex = 0;
+ this._lastCasesMatched = false;
+ }
+ return matched;
+ }
+ _updateDefaultCases(useDefault) {
+ if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
+ this._defaultUsed = useDefault;
+ for (const defaultView of this._defaultViews) {
+ defaultView.enforceState(useDefault);
+ }
+ }
+ }
+ static ɵfac = function NgSwitch_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgSwitch)();
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgSwitch,
+ selectors: [["", "ngSwitch", ""]],
+ inputs: {
+ ngSwitch: "ngSwitch"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitch, [{
+ type: Directive,
+ args: [{
+ selector: "[ngSwitch]"
+ }]
+ }], null, {
+ ngSwitch: [{
+ type: Input
+ }]
+ });
+})();
+var NgSwitchCase = class _NgSwitchCase {
+ ngSwitch;
+ _view;
+ /**
+ * Stores the HTML template to be selected on match.
+ * @deprecated Use the `@case` block within a `@switch` block instead. Intent to remove in v22
+ */
+ ngSwitchCase;
+ constructor(viewContainer, templateRef, ngSwitch) {
+ this.ngSwitch = ngSwitch;
+ if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
+ throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
+ }
+ ngSwitch._addCase();
+ this._view = new SwitchView(viewContainer, templateRef);
+ }
+ /**
+ * Performs case matching. For internal use only.
+ * @docs-private
+ */
+ ngDoCheck() {
+ this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
+ }
+ static ɵfac = function NgSwitchCase_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgSwitchCase)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(TemplateRef), ɵɵdirectiveInject(NgSwitch, 9));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgSwitchCase,
+ selectors: [["", "ngSwitchCase", ""]],
+ inputs: {
+ ngSwitchCase: "ngSwitchCase"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchCase, [{
+ type: Directive,
+ args: [{
+ selector: "[ngSwitchCase]"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }, {
+ type: TemplateRef
+ }, {
+ type: NgSwitch,
+ decorators: [{
+ type: Optional
+ }, {
+ type: Host
+ }]
+ }], {
+ ngSwitchCase: [{
+ type: Input
+ }]
+ });
+})();
+var NgSwitchDefault = class _NgSwitchDefault {
+ constructor(viewContainer, templateRef, ngSwitch) {
+ if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
+ throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
+ }
+ ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
+ }
+ static ɵfac = function NgSwitchDefault_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgSwitchDefault)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(TemplateRef), ɵɵdirectiveInject(NgSwitch, 9));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgSwitchDefault,
+ selectors: [["", "ngSwitchDefault", ""]]
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchDefault, [{
+ type: Directive,
+ args: [{
+ selector: "[ngSwitchDefault]"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }, {
+ type: TemplateRef
+ }, {
+ type: NgSwitch,
+ decorators: [{
+ type: Optional
+ }, {
+ type: Host
+ }]
+ }], null);
+})();
+function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
+ throw new RuntimeError(2e3, `An element with the "${attrName}" attribute (matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute (matching "NgSwitch" directive)`);
+}
+var NgPlural = class _NgPlural {
+ _localization;
+ _activeView;
+ _caseViews = {};
+ constructor(_localization) {
+ this._localization = _localization;
+ }
+ set ngPlural(value) {
+ this._updateView(value);
+ }
+ addCase(value, switchView) {
+ this._caseViews[value] = switchView;
+ }
+ _updateView(switchValue) {
+ this._clearViews();
+ const cases = Object.keys(this._caseViews);
+ const key = getPluralCategory(switchValue, cases, this._localization);
+ this._activateView(this._caseViews[key]);
+ }
+ _clearViews() {
+ if (this._activeView) this._activeView.destroy();
+ }
+ _activateView(view) {
+ if (view) {
+ this._activeView = view;
+ this._activeView.create();
+ }
+ }
+ static ɵfac = function NgPlural_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgPlural)(ɵɵdirectiveInject(NgLocalization));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgPlural,
+ selectors: [["", "ngPlural", ""]],
+ inputs: {
+ ngPlural: "ngPlural"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPlural, [{
+ type: Directive,
+ args: [{
+ selector: "[ngPlural]"
+ }]
+ }], () => [{
+ type: NgLocalization
+ }], {
+ ngPlural: [{
+ type: Input
+ }]
+ });
+})();
+var NgPluralCase = class _NgPluralCase {
+ value;
+ constructor(value, template, viewContainer, ngPlural) {
+ this.value = value;
+ const isANumber = !isNaN(Number(value));
+ ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
+ }
+ static ɵfac = function NgPluralCase_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgPluralCase)(ɵɵinjectAttribute("ngPluralCase"), ɵɵdirectiveInject(TemplateRef), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(NgPlural, 1));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgPluralCase,
+ selectors: [["", "ngPluralCase", ""]]
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPluralCase, [{
+ type: Directive,
+ args: [{
+ selector: "[ngPluralCase]"
+ }]
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Attribute,
+ args: ["ngPluralCase"]
+ }]
+ }, {
+ type: TemplateRef
+ }, {
+ type: ViewContainerRef
+ }, {
+ type: NgPlural,
+ decorators: [{
+ type: Host
+ }]
+ }], null);
+})();
+var NgStyle = class _NgStyle {
+ _ngEl;
+ _differs;
+ _renderer;
+ _ngStyle = null;
+ _differ = null;
+ constructor(_ngEl, _differs, _renderer) {
+ this._ngEl = _ngEl;
+ this._differs = _differs;
+ this._renderer = _renderer;
+ }
+ set ngStyle(values) {
+ this._ngStyle = values;
+ if (!this._differ && values) {
+ this._differ = this._differs.find(values).create();
+ }
+ }
+ ngDoCheck() {
+ if (this._differ) {
+ const changes = this._differ.diff(this._ngStyle);
+ if (changes) {
+ this._applyChanges(changes);
+ }
+ }
+ }
+ _setStyle(nameAndUnit, value) {
+ const [name, unit] = nameAndUnit.split(".");
+ const flags = name.indexOf("-") === -1 ? void 0 : RendererStyleFlags2.DashCase;
+ if (value != null) {
+ this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
+ } else {
+ this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
+ }
+ }
+ _applyChanges(changes) {
+ changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
+ changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
+ changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
+ }
+ static ɵfac = function NgStyle_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgStyle)(ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(KeyValueDiffers), ɵɵdirectiveInject(Renderer2));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgStyle,
+ selectors: [["", "ngStyle", ""]],
+ inputs: {
+ ngStyle: "ngStyle"
+ }
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgStyle, [{
+ type: Directive,
+ args: [{
+ selector: "[ngStyle]"
+ }]
+ }], () => [{
+ type: ElementRef
+ }, {
+ type: KeyValueDiffers
+ }, {
+ type: Renderer2
+ }], {
+ ngStyle: [{
+ type: Input,
+ args: ["ngStyle"]
+ }]
+ });
+})();
+var NgTemplateOutlet = class _NgTemplateOutlet {
+ _viewContainerRef;
+ _viewRef = null;
+ /**
+ * A context object to attach to the {@link EmbeddedViewRef}. This should be an
+ * object, the object's keys will be available for binding by the local template `let`
+ * declarations.
+ * Using the key `$implicit` in the context object will set its value as default.
+ */
+ ngTemplateOutletContext = null;
+ /**
+ * A string defining the template reference and optionally the context object for the template.
+ */
+ ngTemplateOutlet = null;
+ /** Injector to be used within the embedded view. */
+ ngTemplateOutletInjector = null;
+ constructor(_viewContainerRef) {
+ this._viewContainerRef = _viewContainerRef;
+ }
+ ngOnChanges(changes) {
+ if (this._shouldRecreateView(changes)) {
+ const viewContainerRef = this._viewContainerRef;
+ if (this._viewRef) {
+ viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
+ }
+ if (!this.ngTemplateOutlet) {
+ this._viewRef = null;
+ return;
+ }
+ const viewContext = this._createContextForwardProxy();
+ this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
+ injector: this.ngTemplateOutletInjector ?? void 0
+ });
+ }
+ }
+ /**
+ * We need to re-create existing embedded view if either is true:
+ * - the outlet changed.
+ * - the injector changed.
+ */
+ _shouldRecreateView(changes) {
+ return !!changes["ngTemplateOutlet"] || !!changes["ngTemplateOutletInjector"];
+ }
+ /**
+ * For a given outlet instance, we create a proxy object that delegates
+ * to the user-specified context. This allows changing, or swapping out
+ * the context object completely without having to destroy/re-create the view.
+ */
+ _createContextForwardProxy() {
+ return new Proxy({}, {
+ set: (_target, prop, newValue) => {
+ if (!this.ngTemplateOutletContext) {
+ return false;
+ }
+ return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
+ },
+ get: (_target, prop, receiver) => {
+ if (!this.ngTemplateOutletContext) {
+ return void 0;
+ }
+ return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
+ }
+ });
+ }
+ static ɵfac = function NgTemplateOutlet_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgTemplateOutlet)(ɵɵdirectiveInject(ViewContainerRef));
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgTemplateOutlet,
+ selectors: [["", "ngTemplateOutlet", ""]],
+ inputs: {
+ ngTemplateOutletContext: "ngTemplateOutletContext",
+ ngTemplateOutlet: "ngTemplateOutlet",
+ ngTemplateOutletInjector: "ngTemplateOutletInjector"
+ },
+ features: [ɵɵNgOnChangesFeature]
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTemplateOutlet, [{
+ type: Directive,
+ args: [{
+ selector: "[ngTemplateOutlet]"
+ }]
+ }], () => [{
+ type: ViewContainerRef
+ }], {
+ ngTemplateOutletContext: [{
+ type: Input
+ }],
+ ngTemplateOutlet: [{
+ type: Input
+ }],
+ ngTemplateOutletInjector: [{
+ type: Input
+ }]
+ });
+})();
+var COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
+function invalidPipeArgumentError(type, value) {
+ return new RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);
+}
+var SubscribableStrategy = class {
+ createSubscription(async, updateLatestValue, onError) {
+ return untracked(() => async.subscribe({
+ next: updateLatestValue,
+ error: onError
+ }));
+ }
+ dispose(subscription) {
+ untracked(() => subscription.unsubscribe());
+ }
+};
+var PromiseStrategy = class {
+ createSubscription(async, updateLatestValue, onError) {
+ async.then(
+ // Using optional chaining because we may have set it to `null`; since the promise
+ // is async, the view might be destroyed by the time the promise resolves.
+ (v) => updateLatestValue?.(v),
+ (e) => onError?.(e)
+ );
+ return {
+ unsubscribe: () => {
+ updateLatestValue = null;
+ onError = null;
+ }
+ };
+ }
+ dispose(subscription) {
+ subscription.unsubscribe();
+ }
+};
+var _promiseStrategy = new PromiseStrategy();
+var _subscribableStrategy = new SubscribableStrategy();
+var AsyncPipe = class _AsyncPipe {
+ _ref;
+ _latestValue = null;
+ markForCheckOnValueUpdate = true;
+ _subscription = null;
+ _obj = null;
+ _strategy = null;
+ applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
+ constructor(ref) {
+ this._ref = ref;
+ }
+ ngOnDestroy() {
+ if (this._subscription) {
+ this._dispose();
+ }
+ this._ref = null;
+ }
+ transform(obj) {
+ if (!this._obj) {
+ if (obj) {
+ try {
+ this.markForCheckOnValueUpdate = false;
+ this._subscribe(obj);
+ } finally {
+ this.markForCheckOnValueUpdate = true;
+ }
+ }
+ return this._latestValue;
+ }
+ if (obj !== this._obj) {
+ this._dispose();
+ return this.transform(obj);
+ }
+ return this._latestValue;
+ }
+ _subscribe(obj) {
+ this._obj = obj;
+ this._strategy = this._selectStrategy(obj);
+ this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value), (e) => this.applicationErrorHandler(e));
+ }
+ _selectStrategy(obj) {
+ if (isPromise(obj)) {
+ return _promiseStrategy;
+ }
+ if (isSubscribable(obj)) {
+ return _subscribableStrategy;
+ }
+ throw invalidPipeArgumentError(_AsyncPipe, obj);
+ }
+ _dispose() {
+ this._strategy.dispose(this._subscription);
+ this._latestValue = null;
+ this._subscription = null;
+ this._obj = null;
+ }
+ _updateLatestValue(async, value) {
+ if (async === this._obj) {
+ this._latestValue = value;
+ if (this.markForCheckOnValueUpdate) {
+ this._ref?.markForCheck();
+ }
+ }
+ }
+ static ɵfac = function AsyncPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _AsyncPipe)(ɵɵdirectiveInject(ChangeDetectorRef, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "async",
+ type: _AsyncPipe,
+ pure: false
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AsyncPipe, [{
+ type: Pipe,
+ args: [{
+ name: "async",
+ pure: false
+ }]
+ }], () => [{
+ type: ChangeDetectorRef
+ }], null);
+})();
+var LowerCasePipe = class _LowerCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== "string") {
+ throw invalidPipeArgumentError(_LowerCasePipe, value);
+ }
+ return value.toLowerCase();
+ }
+ static ɵfac = function LowerCasePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _LowerCasePipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "lowercase",
+ type: _LowerCasePipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LowerCasePipe, [{
+ type: Pipe,
+ args: [{
+ name: "lowercase"
+ }]
+ }], null, null);
+})();
+var unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uD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uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFF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uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
+var TitleCasePipe = class _TitleCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== "string") {
+ throw invalidPipeArgumentError(_TitleCasePipe, value);
+ }
+ return value.replace(unicodeWordMatch, (txt) => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
+ }
+ static ɵfac = function TitleCasePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _TitleCasePipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "titlecase",
+ type: _TitleCasePipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TitleCasePipe, [{
+ type: Pipe,
+ args: [{
+ name: "titlecase"
+ }]
+ }], null, null);
+})();
+var UpperCasePipe = class _UpperCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== "string") {
+ throw invalidPipeArgumentError(_UpperCasePipe, value);
+ }
+ return value.toUpperCase();
+ }
+ static ɵfac = function UpperCasePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _UpperCasePipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "uppercase",
+ type: _UpperCasePipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UpperCasePipe, [{
+ type: Pipe,
+ args: [{
+ name: "uppercase"
+ }]
+ }], null, null);
+})();
+var DEFAULT_DATE_FORMAT = "mediumDate";
+var DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_TIMEZONE" : "");
+var DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_OPTIONS" : "");
+var DatePipe = class _DatePipe {
+ locale;
+ defaultTimezone;
+ defaultOptions;
+ constructor(locale, defaultTimezone, defaultOptions) {
+ this.locale = locale;
+ this.defaultTimezone = defaultTimezone;
+ this.defaultOptions = defaultOptions;
+ }
+ transform(value, format, timezone, locale) {
+ if (value == null || value === "" || value !== value) return null;
+ try {
+ const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
+ const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? void 0;
+ return formatDate(value, _format, locale || this.locale, _timezone);
+ } catch (error) {
+ throw invalidPipeArgumentError(_DatePipe, error.message);
+ }
+ }
+ static ɵfac = function DatePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _DatePipe)(ɵɵdirectiveInject(LOCALE_ID, 16), ɵɵdirectiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), ɵɵdirectiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "date",
+ type: _DatePipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DatePipe, [{
+ type: Pipe,
+ args: [{
+ name: "date"
+ }]
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [LOCALE_ID]
+ }]
+ }, {
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [DATE_PIPE_DEFAULT_TIMEZONE]
+ }, {
+ type: Optional
+ }]
+ }, {
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [DATE_PIPE_DEFAULT_OPTIONS]
+ }, {
+ type: Optional
+ }]
+ }], null);
+})();
+var _INTERPOLATION_REGEXP = /#/g;
+var I18nPluralPipe = class _I18nPluralPipe {
+ _localization;
+ constructor(_localization) {
+ this._localization = _localization;
+ }
+ /**
+ * @param value the number to be formatted
+ * @param pluralMap an object that mimics the ICU format, see
+ * https://unicode-org.github.io/icu/userguide/format_parse/messages/.
+ * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
+ * default).
+ */
+ transform(value, pluralMap, locale) {
+ if (value == null) return "";
+ if (typeof pluralMap !== "object" || pluralMap === null) {
+ throw invalidPipeArgumentError(_I18nPluralPipe, pluralMap);
+ }
+ const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
+ return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
+ }
+ static ɵfac = function I18nPluralPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _I18nPluralPipe)(ɵɵdirectiveInject(NgLocalization, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "i18nPlural",
+ type: _I18nPluralPipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nPluralPipe, [{
+ type: Pipe,
+ args: [{
+ name: "i18nPlural"
+ }]
+ }], () => [{
+ type: NgLocalization
+ }], null);
+})();
+var I18nSelectPipe = class _I18nSelectPipe {
+ /**
+ * @param value a string to be internationalized.
+ * @param mapping an object that indicates the text that should be displayed
+ * for different values of the provided `value`.
+ */
+ transform(value, mapping) {
+ if (value == null) return "";
+ if (typeof mapping !== "object" || typeof value !== "string") {
+ throw invalidPipeArgumentError(_I18nSelectPipe, mapping);
+ }
+ if (mapping.hasOwnProperty(value)) {
+ return mapping[value];
+ }
+ if (mapping.hasOwnProperty("other")) {
+ return mapping["other"];
+ }
+ return "";
+ }
+ static ɵfac = function I18nSelectPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _I18nSelectPipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "i18nSelect",
+ type: _I18nSelectPipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nSelectPipe, [{
+ type: Pipe,
+ args: [{
+ name: "i18nSelect"
+ }]
+ }], null, null);
+})();
+var JsonPipe = class _JsonPipe {
+ /**
+ * @param value A value of any type to convert into a JSON-format string.
+ */
+ transform(value) {
+ return JSON.stringify(value, null, 2);
+ }
+ static ɵfac = function JsonPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _JsonPipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "json",
+ type: _JsonPipe,
+ pure: false
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonPipe, [{
+ type: Pipe,
+ args: [{
+ name: "json",
+ pure: false
+ }]
+ }], null, null);
+})();
+function makeKeyValuePair(key, value) {
+ return {
+ key,
+ value
+ };
+}
+var KeyValuePipe = class _KeyValuePipe {
+ differs;
+ constructor(differs) {
+ this.differs = differs;
+ }
+ differ;
+ keyValues = [];
+ compareFn = defaultComparator;
+ transform(input, compareFn = defaultComparator) {
+ if (!input || !(input instanceof Map) && typeof input !== "object") {
+ return null;
+ }
+ this.differ ??= this.differs.find(input).create();
+ const differChanges = this.differ.diff(input);
+ const compareFnChanged = compareFn !== this.compareFn;
+ if (differChanges) {
+ this.keyValues = [];
+ differChanges.forEachItem((r) => {
+ this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
+ });
+ }
+ if (differChanges || compareFnChanged) {
+ if (compareFn) {
+ this.keyValues.sort(compareFn);
+ }
+ this.compareFn = compareFn;
+ }
+ return this.keyValues;
+ }
+ static ɵfac = function KeyValuePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _KeyValuePipe)(ɵɵdirectiveInject(KeyValueDiffers, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "keyvalue",
+ type: _KeyValuePipe,
+ pure: false
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyValuePipe, [{
+ type: Pipe,
+ args: [{
+ name: "keyvalue",
+ pure: false
+ }]
+ }], () => [{
+ type: KeyValueDiffers
+ }], null);
+})();
+function defaultComparator(keyValueA, keyValueB) {
+ const a = keyValueA.key;
+ const b = keyValueB.key;
+ if (a === b) return 0;
+ if (a == null) return 1;
+ if (b == null) return -1;
+ if (typeof a == "string" && typeof b == "string") {
+ return a < b ? -1 : 1;
+ }
+ if (typeof a == "number" && typeof b == "number") {
+ return a - b;
+ }
+ if (typeof a == "boolean" && typeof b == "boolean") {
+ return a < b ? -1 : 1;
+ }
+ const aString = String(a);
+ const bString = String(b);
+ return aString == bString ? 0 : aString < bString ? -1 : 1;
+}
+var DecimalPipe = class _DecimalPipe {
+ _locale;
+ constructor(_locale) {
+ this._locale = _locale;
+ }
+ transform(value, digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale ||= this._locale;
+ try {
+ const num = strToNumber(value);
+ return formatNumber(num, locale, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(_DecimalPipe, error.message);
+ }
+ }
+ static ɵfac = function DecimalPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _DecimalPipe)(ɵɵdirectiveInject(LOCALE_ID, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "number",
+ type: _DecimalPipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DecimalPipe, [{
+ type: Pipe,
+ args: [{
+ name: "number"
+ }]
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [LOCALE_ID]
+ }]
+ }], null);
+})();
+var PercentPipe = class _PercentPipe {
+ _locale;
+ constructor(_locale) {
+ this._locale = _locale;
+ }
+ /**
+ *
+ * @param value The number to be formatted as a percentage.
+ * @param digitsInfo Decimal representation options, specified by a string
+ * in the following format:
+ * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
+ * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
+ * Default is `1`.
+ * - `minFractionDigits`: The minimum number of digits after the decimal point.
+ * Default is `0`.
+ * - `maxFractionDigits`: The maximum number of digits after the decimal point.
+ * Default is `0`.
+ * @param locale A locale code for the locale format rules to use.
+ * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
+ * See [Setting your app locale](guide/i18n/locale-id).
+ */
+ transform(value, digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale ||= this._locale;
+ try {
+ const num = strToNumber(value);
+ return formatPercent(num, locale, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(_PercentPipe, error.message);
+ }
+ }
+ static ɵfac = function PercentPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PercentPipe)(ɵɵdirectiveInject(LOCALE_ID, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "percent",
+ type: _PercentPipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PercentPipe, [{
+ type: Pipe,
+ args: [{
+ name: "percent"
+ }]
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [LOCALE_ID]
+ }]
+ }], null);
+})();
+var CurrencyPipe = class _CurrencyPipe {
+ _locale;
+ _defaultCurrencyCode;
+ constructor(_locale, _defaultCurrencyCode = "USD") {
+ this._locale = _locale;
+ this._defaultCurrencyCode = _defaultCurrencyCode;
+ }
+ transform(value, currencyCode = this._defaultCurrencyCode, display = "symbol", digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale ||= this._locale;
+ if (typeof display === "boolean") {
+ if (typeof ngDevMode === "undefined" || ngDevMode) {
+ console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
+ }
+ display = display ? "symbol" : "code";
+ }
+ let currency = currencyCode || this._defaultCurrencyCode;
+ if (display !== "code") {
+ if (display === "symbol" || display === "symbol-narrow") {
+ currency = getCurrencySymbol(currency, display === "symbol" ? "wide" : "narrow", locale);
+ } else {
+ currency = display;
+ }
+ }
+ try {
+ const num = strToNumber(value);
+ return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(_CurrencyPipe, error.message);
+ }
+ }
+ static ɵfac = function CurrencyPipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _CurrencyPipe)(ɵɵdirectiveInject(LOCALE_ID, 16), ɵɵdirectiveInject(DEFAULT_CURRENCY_CODE, 16));
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "currency",
+ type: _CurrencyPipe,
+ pure: true
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrencyPipe, [{
+ type: Pipe,
+ args: [{
+ name: "currency"
+ }]
+ }], () => [{
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [LOCALE_ID]
+ }]
+ }, {
+ type: void 0,
+ decorators: [{
+ type: Inject,
+ args: [DEFAULT_CURRENCY_CODE]
+ }]
+ }], null);
+})();
+function isValue(value) {
+ return !(value == null || value === "" || value !== value);
+}
+function strToNumber(value) {
+ if (typeof value === "string" && !isNaN(Number(value) - parseFloat(value))) {
+ return Number(value);
+ }
+ if (typeof value !== "number") {
+ throw new RuntimeError(2309, ngDevMode && `${value} is not a number`);
+ }
+ return value;
+}
+var SlicePipe = class _SlicePipe {
+ transform(value, start, end) {
+ if (value == null) return null;
+ const supports = typeof value === "string" || Array.isArray(value);
+ if (!supports) {
+ throw invalidPipeArgumentError(_SlicePipe, value);
+ }
+ return value.slice(start, end);
+ }
+ static ɵfac = function SlicePipe_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _SlicePipe)();
+ };
+ static ɵpipe = ɵɵdefinePipe({
+ name: "slice",
+ type: _SlicePipe,
+ pure: false
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SlicePipe, [{
+ type: Pipe,
+ args: [{
+ name: "slice",
+ pure: false
+ }]
+ }], null, null);
+})();
+var COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
+var CommonModule = class _CommonModule {
+ static ɵfac = function CommonModule_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _CommonModule)();
+ };
+ static ɵmod = ɵɵdefineNgModule({
+ type: _CommonModule,
+ imports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe],
+ exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]
+ });
+ static ɵinj = ɵɵdefineInjector({});
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CommonModule, [{
+ type: NgModule,
+ args: [{
+ imports: [COMMON_DIRECTIVES, COMMON_PIPES],
+ exports: [COMMON_DIRECTIVES, COMMON_PIPES]
+ }]
+ }], null, null);
+})();
+
+// node_modules/@angular/common/fesm2022/xhr.mjs
+function parseCookieValue(cookieStr, name) {
+ name = encodeURIComponent(name);
+ for (const cookie of cookieStr.split(";")) {
+ const eqIndex = cookie.indexOf("=");
+ const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ""] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
+ if (cookieName.trim() === name) {
+ return decodeURIComponent(cookieValue);
+ }
+ }
+ return null;
+}
+var XhrFactory = class {
+};
+
+// node_modules/@angular/common/fesm2022/platform_navigation.mjs
+var PlatformNavigation = class _PlatformNavigation {
+ static ɵfac = function PlatformNavigation_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PlatformNavigation)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _PlatformNavigation,
+ factory: () => (() => window.navigation)(),
+ providedIn: "platform"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformNavigation, [{
+ type: Injectable,
+ args: [{
+ providedIn: "platform",
+ useFactory: () => window.navigation
+ }]
+ }], null, null);
+})();
+
+// node_modules/@angular/common/fesm2022/common.mjs
+function registerLocaleData2(data, localeId, extraData) {
+ return registerLocaleData(data, localeId, extraData);
+}
+var PLATFORM_BROWSER_ID = "browser";
+var PLATFORM_SERVER_ID = "server";
+function isPlatformBrowser(platformId) {
+ return platformId === PLATFORM_BROWSER_ID;
+}
+function isPlatformServer(platformId) {
+ return platformId === PLATFORM_SERVER_ID;
+}
+var VERSION = new Version("20.1.7");
+var ViewportScroller = class _ViewportScroller {
+ // De-sugared tree-shakable injection
+ // See #23917
+ /** @nocollapse */
+ static ɵprov = (
+ /** @pureOrBreakMyCode */
+ ɵɵdefineInjectable({
+ token: _ViewportScroller,
+ providedIn: "root",
+ factory: () => false ? new NullViewportScroller() : new BrowserViewportScroller(inject(DOCUMENT), window)
+ })
+ );
+};
+var BrowserViewportScroller = class {
+ document;
+ window;
+ offset = () => [0, 0];
+ constructor(document, window2) {
+ this.document = document;
+ this.window = window2;
+ }
+ /**
+ * Configures the top offset used when scrolling to an anchor.
+ * @param offset A position in screen coordinates (a tuple with x and y values)
+ * or a function that returns the top offset position.
+ *
+ */
+ setOffset(offset) {
+ if (Array.isArray(offset)) {
+ this.offset = () => offset;
+ } else {
+ this.offset = offset;
+ }
+ }
+ /**
+ * Retrieves the current scroll position.
+ * @returns The position in screen coordinates.
+ */
+ getScrollPosition() {
+ return [this.window.scrollX, this.window.scrollY];
+ }
+ /**
+ * Sets the scroll position.
+ * @param position The new position in screen coordinates.
+ */
+ scrollToPosition(position, options) {
+ this.window.scrollTo(__spreadProps(__spreadValues({}, options), {
+ left: position[0],
+ top: position[1]
+ }));
+ }
+ /**
+ * Scrolls to an element and attempts to focus the element.
+ *
+ * Note that the function name here is misleading in that the target string may be an ID for a
+ * non-anchor element.
+ *
+ * @param target The ID of an element or name of the anchor.
+ *
+ * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document
+ * @see https://html.spec.whatwg.org/#scroll-to-fragid
+ */
+ scrollToAnchor(target, options) {
+ const elSelected = findAnchorFromDocument(this.document, target);
+ if (elSelected) {
+ this.scrollToElement(elSelected, options);
+ elSelected.focus();
+ }
+ }
+ /**
+ * Disables automatic scroll restoration provided by the browser.
+ */
+ setHistoryScrollRestoration(scrollRestoration) {
+ try {
+ this.window.history.scrollRestoration = scrollRestoration;
+ } catch {
+ console.warn(formatRuntimeError(2400, ngDevMode && "Failed to set `window.history.scrollRestoration`. This may occur when:\n• The script is running inside a sandboxed iframe\n• The window is partially navigated or inactive\n• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)\nScroll position may not be preserved across navigation."));
+ }
+ }
+ /**
+ * Scrolls to an element using the native offset and the specified offset set on this scroller.
+ *
+ * The offset can be used when we know that there is a floating header and scrolling naively to an
+ * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.
+ */
+ scrollToElement(el, options) {
+ const rect = el.getBoundingClientRect();
+ const left = rect.left + this.window.pageXOffset;
+ const top = rect.top + this.window.pageYOffset;
+ const offset = this.offset();
+ this.window.scrollTo(__spreadProps(__spreadValues({}, options), {
+ left: left - offset[0],
+ top: top - offset[1]
+ }));
+ }
+};
+function findAnchorFromDocument(document, target) {
+ const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];
+ if (documentResult) {
+ return documentResult;
+ }
+ if (typeof document.createTreeWalker === "function" && document.body && typeof document.body.attachShadow === "function") {
+ const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
+ let currentNode = treeWalker.currentNode;
+ while (currentNode) {
+ const shadowRoot = currentNode.shadowRoot;
+ if (shadowRoot) {
+ const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
+ if (result) {
+ return result;
+ }
+ }
+ currentNode = treeWalker.nextNode();
+ }
+ }
+ return null;
+}
+var NullViewportScroller = class {
+ /**
+ * Empty implementation
+ */
+ setOffset(offset) {
+ }
+ /**
+ * Empty implementation
+ */
+ getScrollPosition() {
+ return [0, 0];
+ }
+ /**
+ * Empty implementation
+ */
+ scrollToPosition(position) {
+ }
+ /**
+ * Empty implementation
+ */
+ scrollToAnchor(anchor) {
+ }
+ /**
+ * Empty implementation
+ */
+ setHistoryScrollRestoration(scrollRestoration) {
+ }
+};
+var PLACEHOLDER_QUALITY = "20";
+function getUrl(src, win) {
+ return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
+}
+function isAbsoluteUrl(src) {
+ return /^https?:\/\//.test(src);
+}
+function extractHostname(url) {
+ return isAbsoluteUrl(url) ? new URL(url).hostname : url;
+}
+function isValidPath(path) {
+ const isString = typeof path === "string";
+ if (!isString || path.trim() === "") {
+ return false;
+ }
+ try {
+ const url = new URL(path);
+ return true;
+ } catch {
+ return false;
+ }
+}
+function normalizePath(path) {
+ return path.endsWith("/") ? path.slice(0, -1) : path;
+}
+function normalizeSrc(src) {
+ return src.startsWith("/") ? src.slice(1) : src;
+}
+var noopImageLoader = (config) => config.src;
+var IMAGE_LOADER = new InjectionToken(ngDevMode ? "ImageLoader" : "", {
+ providedIn: "root",
+ factory: () => noopImageLoader
+});
+function createImageLoader(buildUrlFn, exampleUrls) {
+ return function provideImageLoader(path) {
+ if (!isValidPath(path)) {
+ throwInvalidPathError(path, exampleUrls || []);
+ }
+ path = normalizePath(path);
+ const loaderFn = (config) => {
+ if (isAbsoluteUrl(config.src)) {
+ throwUnexpectedAbsoluteUrlError(path, config.src);
+ }
+ return buildUrlFn(path, __spreadProps(__spreadValues({}, config), {
+ src: normalizeSrc(config.src)
+ }));
+ };
+ const providers = [{
+ provide: IMAGE_LOADER,
+ useValue: loaderFn
+ }];
+ return providers;
+ };
+}
+function throwInvalidPathError(path, exampleUrls) {
+ throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). To fix this, supply a path using one of the following formats: ${exampleUrls.join(" or ")}`);
+}
+function throwUnexpectedAbsoluteUrlError(path, url) {
+ throw new RuntimeError(2959, ngDevMode && `Image loader has detected a \`
\` tag with an invalid \`ngSrc\` attribute: ${url}. This image loader expects \`ngSrc\` to be a relative URL - however the provided value is an absolute URL. To fix this, provide \`ngSrc\` as a path relative to the base URL configured for this loader (\`${path}\`).`);
+}
+var provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ["https:///cdn-cgi/image//"] : void 0);
+function createCloudflareUrl(path, config) {
+ let params = `format=auto`;
+ if (config.width) {
+ params += `,width=${config.width}`;
+ }
+ if (config.isPlaceholder) {
+ params += `,quality=${PLACEHOLDER_QUALITY}`;
+ }
+ return `${path}/cdn-cgi/image/${params}/${config.src}`;
+}
+var cloudinaryLoaderInfo = {
+ name: "Cloudinary",
+ testUrl: isCloudinaryUrl
+};
+var CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
+function isCloudinaryUrl(url) {
+ return CLOUDINARY_LOADER_REGEX.test(url);
+}
+var provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ["https://res.cloudinary.com/mysite", "https://mysite.cloudinary.com", "https://subdomain.mysite.com"] : void 0);
+function createCloudinaryUrl(path, config) {
+ const quality = config.isPlaceholder ? "q_auto:low" : "q_auto";
+ let params = `f_auto,${quality}`;
+ if (config.width) {
+ params += `,w_${config.width}`;
+ }
+ if (config.loaderParams?.["rounded"]) {
+ params += `,r_max`;
+ }
+ return `${path}/image/upload/${params}/${config.src}`;
+}
+var imageKitLoaderInfo = {
+ name: "ImageKit",
+ testUrl: isImageKitUrl
+};
+var IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
+function isImageKitUrl(url) {
+ return IMAGE_KIT_LOADER_REGEX.test(url);
+}
+var provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ["https://ik.imagekit.io/mysite", "https://subdomain.mysite.com"] : void 0);
+function createImagekitUrl(path, config) {
+ const {
+ src,
+ width
+ } = config;
+ const params = [];
+ if (width) {
+ params.push(`w-${width}`);
+ }
+ if (config.isPlaceholder) {
+ params.push(`q-${PLACEHOLDER_QUALITY}`);
+ }
+ const urlSegments = params.length ? [path, `tr:${params.join(",")}`, src] : [path, src];
+ const url = new URL(urlSegments.join("/"));
+ return url.href;
+}
+var imgixLoaderInfo = {
+ name: "Imgix",
+ testUrl: isImgixUrl
+};
+var IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
+function isImgixUrl(url) {
+ return IMGIX_LOADER_REGEX.test(url);
+}
+var provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ["https://somepath.imgix.net/"] : void 0);
+function createImgixUrl(path, config) {
+ const url = new URL(`${path}/${config.src}`);
+ url.searchParams.set("auto", "format");
+ if (config.width) {
+ url.searchParams.set("w", config.width.toString());
+ }
+ if (config.isPlaceholder) {
+ url.searchParams.set("q", PLACEHOLDER_QUALITY);
+ }
+ return url.href;
+}
+var netlifyLoaderInfo = {
+ name: "Netlify",
+ testUrl: isNetlifyUrl
+};
+var NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/;
+function isNetlifyUrl(url) {
+ return NETLIFY_LOADER_REGEX.test(url);
+}
+function provideNetlifyLoader(path) {
+ if (path && !isValidPath(path)) {
+ throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`);
+ }
+ if (path) {
+ const url = new URL(path);
+ path = url.origin;
+ }
+ const loaderFn = (config) => {
+ return createNetlifyUrl(config, path);
+ };
+ const providers = [{
+ provide: IMAGE_LOADER,
+ useValue: loaderFn
+ }];
+ return providers;
+}
+var validParams = /* @__PURE__ */ new Map([["height", "h"], ["fit", "fit"], ["quality", "q"], ["q", "q"], ["position", "position"]]);
+function createNetlifyUrl(config, path) {
+ const url = new URL(path ?? "https://a/");
+ url.pathname = "/.netlify/images";
+ if (!isAbsoluteUrl(config.src) && !config.src.startsWith("/")) {
+ config.src = "/" + config.src;
+ }
+ url.searchParams.set("url", config.src);
+ if (config.width) {
+ url.searchParams.set("w", config.width.toString());
+ }
+ const configQuality = config.loaderParams?.["quality"] ?? config.loaderParams?.["q"];
+ if (config.isPlaceholder && !configQuality) {
+ url.searchParams.set("q", PLACEHOLDER_QUALITY);
+ }
+ for (const [param, value] of Object.entries(config.loaderParams ?? {})) {
+ if (validParams.has(param)) {
+ url.searchParams.set(validParams.get(param), value.toString());
+ } else {
+ if (ngDevMode) {
+ console.warn(formatRuntimeError(2959, `The Netlify image loader has detected an \`
\` tag with the unsupported attribute "\`${param}\`".`));
+ }
+ }
+ }
+ return url.hostname === "a" ? url.href.replace(url.origin, "") : url.href;
+}
+function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
+ const ngSrcInfo = includeNgSrc ? `(activated on an
element with the \`ngSrc="${ngSrc}"\`) ` : "";
+ return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
+}
+function assertDevMode(checkName) {
+ if (!ngDevMode) {
+ throw new RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. Please make sure that the prod mode is enabled for production builds.`);
+ }
+}
+var LCPImageObserver = class _LCPImageObserver {
+ // Map of full image URLs -> original `ngSrc` values.
+ images = /* @__PURE__ */ new Map();
+ window = inject(DOCUMENT).defaultView;
+ observer = null;
+ constructor() {
+ assertDevMode("LCP checker");
+ if (typeof PerformanceObserver !== "undefined") {
+ this.observer = this.initPerformanceObserver();
+ }
+ }
+ /**
+ * Inits PerformanceObserver and subscribes to LCP events.
+ * Based on https://web.dev/lcp/#measure-lcp-in-javascript
+ */
+ initPerformanceObserver() {
+ const observer = new PerformanceObserver((entryList) => {
+ const entries = entryList.getEntries();
+ if (entries.length === 0) return;
+ const lcpElement = entries[entries.length - 1];
+ const imgSrc = lcpElement.element?.src ?? "";
+ if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:")) return;
+ const img = this.images.get(imgSrc);
+ if (!img) return;
+ if (!img.priority && !img.alreadyWarnedPriority) {
+ img.alreadyWarnedPriority = true;
+ logMissingPriorityError(imgSrc);
+ }
+ if (img.modified && !img.alreadyWarnedModified) {
+ img.alreadyWarnedModified = true;
+ logModifiedWarning(imgSrc);
+ }
+ });
+ observer.observe({
+ type: "largest-contentful-paint",
+ buffered: true
+ });
+ return observer;
+ }
+ registerImage(rewrittenSrc, originalNgSrc, isPriority) {
+ if (!this.observer) return;
+ const newObservedImageState = {
+ priority: isPriority,
+ modified: false,
+ alreadyWarnedModified: false,
+ alreadyWarnedPriority: false
+ };
+ this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);
+ }
+ unregisterImage(rewrittenSrc) {
+ if (!this.observer) return;
+ this.images.delete(getUrl(rewrittenSrc, this.window).href);
+ }
+ updateImage(originalSrc, newSrc) {
+ if (!this.observer) return;
+ const originalUrl = getUrl(originalSrc, this.window).href;
+ const img = this.images.get(originalUrl);
+ if (img) {
+ img.modified = true;
+ this.images.set(getUrl(newSrc, this.window).href, img);
+ this.images.delete(originalUrl);
+ }
+ }
+ ngOnDestroy() {
+ if (!this.observer) return;
+ this.observer.disconnect();
+ this.images.clear();
+ }
+ static ɵfac = function LCPImageObserver_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _LCPImageObserver)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _LCPImageObserver,
+ factory: _LCPImageObserver.ɵfac,
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LCPImageObserver, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root"
+ }]
+ }], () => [], null);
+})();
+function logMissingPriorityError(ngSrc) {
+ const directiveDetails = imgDirectiveDetails(ngSrc);
+ console.error(formatRuntimeError(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element but was not marked "priority". This image should be marked "priority" in order to prioritize its loading. To fix this, add the "priority" attribute.`));
+}
+function logModifiedWarning(ngSrc) {
+ const directiveDetails = imgDirectiveDetails(ngSrc);
+ console.warn(formatRuntimeError(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element and has had its "ngSrc" attribute modified. This can cause slower loading performance. It is recommended not to modify the "ngSrc" property on any image which could be the LCP element.`));
+}
+var INTERNAL_PRECONNECT_CHECK_BLOCKLIST = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "0.0.0.0"]);
+var PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(ngDevMode ? "PRECONNECT_CHECK_BLOCKLIST" : "");
+var PreconnectLinkChecker = class _PreconnectLinkChecker {
+ document = inject(DOCUMENT);
+ /**
+ * Set of tags found on this page.
+ * The `null` value indicates that there was no DOM query operation performed.
+ */
+ preconnectLinks = null;
+ /*
+ * Keep track of all already seen origin URLs to avoid repeating the same check.
+ */
+ alreadySeen = /* @__PURE__ */ new Set();
+ window = this.document.defaultView;
+ blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
+ constructor() {
+ assertDevMode("preconnect link checker");
+ const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {
+ optional: true
+ });
+ if (blocklist) {
+ this.populateBlocklist(blocklist);
+ }
+ }
+ populateBlocklist(origins) {
+ if (Array.isArray(origins)) {
+ deepForEach(origins, (origin) => {
+ this.blocklist.add(extractHostname(origin));
+ });
+ } else {
+ this.blocklist.add(extractHostname(origins));
+ }
+ }
+ /**
+ * Checks that a preconnect resource hint exists in the head for the
+ * given src.
+ *
+ * @param rewrittenSrc src formatted with loader
+ * @param originalNgSrc ngSrc value
+ */
+ assertPreconnect(rewrittenSrc, originalNgSrc) {
+ if (false) return;
+ const imgUrl = getUrl(rewrittenSrc, this.window);
+ if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;
+ this.alreadySeen.add(imgUrl.origin);
+ this.preconnectLinks ??= this.queryPreconnectLinks();
+ if (!this.preconnectLinks.has(imgUrl.origin)) {
+ console.warn(formatRuntimeError(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this image. Preconnecting to the origin(s) that serve priority images ensures that these images are delivered as soon as possible. To fix this, please add the following element into the of the document:
+ `));
+ }
+ }
+ queryPreconnectLinks() {
+ const preconnectUrls = /* @__PURE__ */ new Set();
+ const links = this.document.querySelectorAll("link[rel=preconnect]");
+ for (const link of links) {
+ const url = getUrl(link.href, this.window);
+ preconnectUrls.add(url.origin);
+ }
+ return preconnectUrls;
+ }
+ ngOnDestroy() {
+ this.preconnectLinks?.clear();
+ this.alreadySeen.clear();
+ }
+ static ɵfac = function PreconnectLinkChecker_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PreconnectLinkChecker)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _PreconnectLinkChecker,
+ factory: _PreconnectLinkChecker.ɵfac,
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreconnectLinkChecker, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root"
+ }]
+ }], () => [], null);
+})();
+function deepForEach(input, fn) {
+ for (let value of input) {
+ Array.isArray(value) ? deepForEach(value, fn) : fn(value);
+ }
+}
+var DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
+var PRELOADED_IMAGES = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "NG_OPTIMIZED_PRELOADED_IMAGES" : "", {
+ providedIn: "root",
+ factory: () => /* @__PURE__ */ new Set()
+});
+var PreloadLinkCreator = class _PreloadLinkCreator {
+ preloadedImages = inject(PRELOADED_IMAGES);
+ document = inject(DOCUMENT);
+ errorShown = false;
+ /**
+ * @description Add a preload `` to the `` of the `index.html` that is served from the
+ * server while using Angular Universal and SSR to kick off image loads for high priority images.
+ *
+ * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
+ * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
+ * respectively, on the preload `` tag so that the correctly sized image is preloaded from
+ * the CDN.
+ *
+ * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
+ *
+ * @param renderer The `Renderer2` passed in from the directive
+ * @param src The original src of the image that is set on the `ngSrc` input.
+ * @param srcset The parsed and formatted srcset created from the `ngSrcset` input
+ * @param sizes The value of the `sizes` attribute passed in to the `
` tag
+ */
+ createPreloadLinkTag(renderer, src, srcset, sizes) {
+ if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
+ this.errorShown = true;
+ console.warn(formatRuntimeError(2961, `The \`NgOptimizedImage\` directive has detected that more than ${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. This might negatively affect an overall performance of the page. To fix this, remove the "priority" attribute from images with less priority.`));
+ }
+ if (this.preloadedImages.has(src)) {
+ return;
+ }
+ this.preloadedImages.add(src);
+ const preload = renderer.createElement("link");
+ renderer.setAttribute(preload, "as", "image");
+ renderer.setAttribute(preload, "href", src);
+ renderer.setAttribute(preload, "rel", "preload");
+ renderer.setAttribute(preload, "fetchpriority", "high");
+ if (sizes) {
+ renderer.setAttribute(preload, "imageSizes", sizes);
+ }
+ if (srcset) {
+ renderer.setAttribute(preload, "imageSrcset", srcset);
+ }
+ renderer.appendChild(this.document.head, preload);
+ }
+ static ɵfac = function PreloadLinkCreator_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _PreloadLinkCreator)();
+ };
+ static ɵprov = ɵɵdefineInjectable({
+ token: _PreloadLinkCreator,
+ factory: _PreloadLinkCreator.ɵfac,
+ providedIn: "root"
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreloadLinkCreator, [{
+ type: Injectable,
+ args: [{
+ providedIn: "root"
+ }]
+ }], null, null);
+})();
+var BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
+var VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
+var VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
+var ABSOLUTE_SRCSET_DENSITY_CAP = 3;
+var RECOMMENDED_SRCSET_DENSITY_CAP = 2;
+var DENSITY_SRCSET_MULTIPLIERS = [1, 2];
+var VIEWPORT_BREAKPOINT_CUTOFF = 640;
+var ASPECT_RATIO_TOLERANCE = 0.1;
+var OVERSIZED_IMAGE_TOLERANCE = 1e3;
+var FIXED_SRCSET_WIDTH_LIMIT = 1920;
+var FIXED_SRCSET_HEIGHT_LIMIT = 1080;
+var PLACEHOLDER_DIMENSION_LIMIT = 1e3;
+var DATA_URL_WARN_LIMIT = 4e3;
+var DATA_URL_ERROR_LIMIT = 1e4;
+var BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];
+var PRIORITY_COUNT_THRESHOLD = 10;
+var IMGS_WITH_PRIORITY_ATTR_COUNT = 0;
+var NgOptimizedImage = class _NgOptimizedImage {
+ imageLoader = inject(IMAGE_LOADER);
+ config = processConfig(inject(IMAGE_CONFIG));
+ renderer = inject(Renderer2);
+ imgElement = inject(ElementRef).nativeElement;
+ injector = inject(Injector);
+ // An LCP image observer should be injected only in development mode.
+ // Do not assign it to `null` to avoid having a redundant property in the production bundle.
+ lcpObserver;
+ /**
+ * Calculate the rewritten `src` once and store it.
+ * This is needed to avoid repetitive calculations and make sure the directive cleanup in the
+ * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
+ * instance that might be already destroyed).
+ */
+ _renderedSrc = null;
+ /**
+ * Name of the source image.
+ * Image name will be processed by the image loader and the final URL will be applied as the `src`
+ * property of the image.
+ */
+ ngSrc;
+ /**
+ * A comma separated list of width or density descriptors.
+ * The image name will be taken from `ngSrc` and combined with the list of width or density
+ * descriptors to generate the final `srcset` property of the image.
+ *
+ * Example:
+ * ```html
+ *
=>
+ *
+ * ```
+ */
+ ngSrcset;
+ /**
+ * The base `sizes` attribute passed through to the `
` element.
+ * Providing sizes causes the image to create an automatic responsive srcset.
+ */
+ sizes;
+ /**
+ * For responsive images: the intrinsic width of the image in pixels.
+ * For fixed size images: the desired rendered width of the image in pixels.
+ */
+ width;
+ /**
+ * For responsive images: the intrinsic height of the image in pixels.
+ * For fixed size images: the desired rendered height of the image in pixels.
+ */
+ height;
+ /**
+ * The desired decoding behavior for the image. Defaults to `auto`
+ * if not explicitly set, matching native browser behavior.
+ *
+ * Use `async` to decode the image off the main thread (non-blocking),
+ * `sync` for immediate decoding (blocking), or `auto` to let the
+ * browser decide the optimal strategy.
+ *
+ * [Spec](https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint)
+ */
+ decoding;
+ /**
+ * The desired loading behavior (lazy, eager, or auto). Defaults to `lazy`,
+ * which is recommended for most images.
+ *
+ * Warning: Setting images as loading="eager" or loading="auto" marks them
+ * as non-priority images and can hurt loading performance. For images which
+ * may be the LCP element, use the `priority` attribute instead of `loading`.
+ */
+ loading;
+ /**
+ * Indicates whether this image should have a high priority.
+ */
+ priority = false;
+ /**
+ * Data to pass through to custom loaders.
+ */
+ loaderParams;
+ /**
+ * Disables automatic srcset generation for this image.
+ */
+ disableOptimizedSrcset = false;
+ /**
+ * Sets the image to "fill mode", which eliminates the height/width requirement and adds
+ * styles such that the image fills its containing element.
+ */
+ fill = false;
+ /**
+ * A URL or data URL for an image to be used as a placeholder while this image loads.
+ */
+ placeholder;
+ /**
+ * Configuration object for placeholder settings. Options:
+ * * blur: Setting this to false disables the automatic CSS blur.
+ */
+ placeholderConfig;
+ /**
+ * Value of the `src` attribute if set on the host `
` element.
+ * This input is exclusively read to assert that `src` is not set in conflict
+ * with `ngSrc` and that images don't start to load until a lazy loading strategy is set.
+ * @internal
+ */
+ src;
+ /**
+ * Value of the `srcset` attribute if set on the host `
` element.
+ * This input is exclusively read to assert that `srcset` is not set in conflict
+ * with `ngSrcset` and that images don't start to load until a lazy loading strategy is set.
+ * @internal
+ */
+ srcset;
+ constructor() {
+ if (ngDevMode) {
+ this.lcpObserver = this.injector.get(LCPImageObserver);
+ const destroyRef = inject(DestroyRef);
+ destroyRef.onDestroy(() => {
+ if (!this.priority && this._renderedSrc !== null) {
+ this.lcpObserver.unregisterImage(this._renderedSrc);
+ }
+ });
+ }
+ }
+ /** @docs-private */
+ ngOnInit() {
+ performanceMarkFeature("NgOptimizedImage");
+ if (ngDevMode) {
+ const ngZone = this.injector.get(NgZone);
+ assertNonEmptyInput(this, "ngSrc", this.ngSrc);
+ assertValidNgSrcset(this, this.ngSrcset);
+ assertNoConflictingSrc(this);
+ if (this.ngSrcset) {
+ assertNoConflictingSrcset(this);
+ }
+ assertNotBase64Image(this);
+ assertNotBlobUrl(this);
+ if (this.fill) {
+ assertEmptyWidthAndHeight(this);
+ ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
+ } else {
+ assertNonEmptyWidthAndHeight(this);
+ if (this.height !== void 0) {
+ assertGreaterThanZero(this, this.height, "height");
+ }
+ if (this.width !== void 0) {
+ assertGreaterThanZero(this, this.width, "width");
+ }
+ ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
+ }
+ assertValidLoadingInput(this);
+ assertValidDecodingInput(this);
+ if (!this.ngSrcset) {
+ assertNoComplexSizes(this);
+ }
+ assertValidPlaceholder(this, this.imageLoader);
+ assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
+ assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
+ assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
+ ngZone.runOutsideAngular(() => {
+ this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
+ });
+ if (this.priority) {
+ const checker = this.injector.get(PreconnectLinkChecker);
+ checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
+ if (true) {
+ const applicationRef = this.injector.get(ApplicationRef);
+ assetPriorityCountBelowThreshold(applicationRef);
+ }
+ }
+ }
+ if (this.placeholder) {
+ this.removePlaceholderOnLoad(this.imgElement);
+ }
+ this.setHostAttributes();
+ }
+ setHostAttributes() {
+ if (this.fill) {
+ this.sizes ||= "100vw";
+ } else {
+ this.setHostAttribute("width", this.width.toString());
+ this.setHostAttribute("height", this.height.toString());
+ }
+ this.setHostAttribute("loading", this.getLoadingBehavior());
+ this.setHostAttribute("fetchpriority", this.getFetchPriority());
+ this.setHostAttribute("decoding", this.getDecoding());
+ this.setHostAttribute("ng-img", "true");
+ const rewrittenSrcset = this.updateSrcAndSrcset();
+ if (this.sizes) {
+ if (this.getLoadingBehavior() === "lazy") {
+ this.setHostAttribute("sizes", "auto, " + this.sizes);
+ } else {
+ this.setHostAttribute("sizes", this.sizes);
+ }
+ } else {
+ if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === "lazy") {
+ this.setHostAttribute("sizes", "auto, 100vw");
+ }
+ }
+ if (false) {
+ const preloadLinkCreator = this.injector.get(PreloadLinkCreator);
+ preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
+ }
+ }
+ /** @docs-private */
+ ngOnChanges(changes) {
+ if (ngDevMode) {
+ assertNoPostInitInputChange(this, changes, ["ngSrcset", "width", "height", "priority", "fill", "loading", "sizes", "loaderParams", "disableOptimizedSrcset"]);
+ }
+ if (changes["ngSrc"] && !changes["ngSrc"].isFirstChange()) {
+ const oldSrc = this._renderedSrc;
+ this.updateSrcAndSrcset(true);
+ if (ngDevMode) {
+ const newSrc = this._renderedSrc;
+ if (oldSrc && newSrc && oldSrc !== newSrc) {
+ const ngZone = this.injector.get(NgZone);
+ ngZone.runOutsideAngular(() => {
+ this.lcpObserver.updateImage(oldSrc, newSrc);
+ });
+ }
+ }
+ }
+ if (ngDevMode && changes["placeholder"]?.currentValue && true && true) {
+ assertPlaceholderDimensions(this, this.imgElement);
+ }
+ }
+ callImageLoader(configWithoutCustomParams) {
+ let augmentedConfig = configWithoutCustomParams;
+ if (this.loaderParams) {
+ augmentedConfig.loaderParams = this.loaderParams;
+ }
+ return this.imageLoader(augmentedConfig);
+ }
+ getLoadingBehavior() {
+ if (!this.priority && this.loading !== void 0) {
+ return this.loading;
+ }
+ return this.priority ? "eager" : "lazy";
+ }
+ getFetchPriority() {
+ return this.priority ? "high" : "auto";
+ }
+ getDecoding() {
+ if (this.priority) {
+ return "sync";
+ }
+ return this.decoding ?? "auto";
+ }
+ getRewrittenSrc() {
+ if (!this._renderedSrc) {
+ const imgConfig = {
+ src: this.ngSrc
+ };
+ this._renderedSrc = this.callImageLoader(imgConfig);
+ }
+ return this._renderedSrc;
+ }
+ getRewrittenSrcset() {
+ const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
+ const finalSrcs = this.ngSrcset.split(",").filter((src) => src !== "").map((srcStr) => {
+ srcStr = srcStr.trim();
+ const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
+ return `${this.callImageLoader({
+ src: this.ngSrc,
+ width
+ })} ${srcStr}`;
+ });
+ return finalSrcs.join(", ");
+ }
+ getAutomaticSrcset() {
+ if (this.sizes) {
+ return this.getResponsiveSrcset();
+ } else {
+ return this.getFixedSrcset();
+ }
+ }
+ getResponsiveSrcset() {
+ const {
+ breakpoints
+ } = this.config;
+ let filteredBreakpoints = breakpoints;
+ if (this.sizes?.trim() === "100vw") {
+ filteredBreakpoints = breakpoints.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
+ }
+ const finalSrcs = filteredBreakpoints.map((bp) => `${this.callImageLoader({
+ src: this.ngSrc,
+ width: bp
+ })} ${bp}w`);
+ return finalSrcs.join(", ");
+ }
+ updateSrcAndSrcset(forceSrcRecalc = false) {
+ if (forceSrcRecalc) {
+ this._renderedSrc = null;
+ }
+ const rewrittenSrc = this.getRewrittenSrc();
+ this.setHostAttribute("src", rewrittenSrc);
+ let rewrittenSrcset = void 0;
+ if (this.ngSrcset) {
+ rewrittenSrcset = this.getRewrittenSrcset();
+ } else if (this.shouldGenerateAutomaticSrcset()) {
+ rewrittenSrcset = this.getAutomaticSrcset();
+ }
+ if (rewrittenSrcset) {
+ this.setHostAttribute("srcset", rewrittenSrcset);
+ }
+ return rewrittenSrcset;
+ }
+ getFixedSrcset() {
+ const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map((multiplier) => `${this.callImageLoader({
+ src: this.ngSrc,
+ width: this.width * multiplier
+ })} ${multiplier}x`);
+ return finalSrcs.join(", ");
+ }
+ shouldGenerateAutomaticSrcset() {
+ let oversizedImage = false;
+ if (!this.sizes) {
+ oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
+ }
+ return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
+ }
+ /**
+ * Returns an image url formatted for use with the CSS background-image property. Expects one of:
+ * * A base64 encoded image, which is wrapped and passed through.
+ * * A boolean. If true, calls the image loader to generate a small placeholder url.
+ */
+ generatePlaceholder(placeholderInput) {
+ const {
+ placeholderResolution
+ } = this.config;
+ if (placeholderInput === true) {
+ return `url(${this.callImageLoader({
+ src: this.ngSrc,
+ width: placeholderResolution,
+ isPlaceholder: true
+ })})`;
+ } else if (typeof placeholderInput === "string") {
+ return `url(${placeholderInput})`;
+ }
+ return null;
+ }
+ /**
+ * Determines if blur should be applied, based on an optional boolean
+ * property `blur` within the optional configuration object `placeholderConfig`.
+ */
+ shouldBlurPlaceholder(placeholderConfig) {
+ if (!placeholderConfig || !placeholderConfig.hasOwnProperty("blur")) {
+ return true;
+ }
+ return Boolean(placeholderConfig.blur);
+ }
+ removePlaceholderOnLoad(img) {
+ const callback = () => {
+ const changeDetectorRef = this.injector.get(ChangeDetectorRef);
+ removeLoadListenerFn();
+ removeErrorListenerFn();
+ this.placeholder = false;
+ changeDetectorRef.markForCheck();
+ };
+ const removeLoadListenerFn = this.renderer.listen(img, "load", callback);
+ const removeErrorListenerFn = this.renderer.listen(img, "error", callback);
+ callOnLoadIfImageIsLoaded(img, callback);
+ }
+ setHostAttribute(name, value) {
+ this.renderer.setAttribute(this.imgElement, name, value);
+ }
+ static ɵfac = function NgOptimizedImage_Factory(__ngFactoryType__) {
+ return new (__ngFactoryType__ || _NgOptimizedImage)();
+ };
+ static ɵdir = ɵɵdefineDirective({
+ type: _NgOptimizedImage,
+ selectors: [["img", "ngSrc", ""]],
+ hostVars: 18,
+ hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {
+ if (rf & 2) {
+ ɵɵstyleProp("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null);
+ }
+ },
+ inputs: {
+ ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl],
+ ngSrcset: "ngSrcset",
+ sizes: "sizes",
+ width: [2, "width", "width", numberAttribute],
+ height: [2, "height", "height", numberAttribute],
+ decoding: "decoding",
+ loading: "loading",
+ priority: [2, "priority", "priority", booleanAttribute],
+ loaderParams: "loaderParams",
+ disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute],
+ fill: [2, "fill", "fill", booleanAttribute],
+ placeholder: [2, "placeholder", "placeholder", booleanOrUrlAttribute],
+ placeholderConfig: "placeholderConfig",
+ src: "src",
+ srcset: "srcset"
+ },
+ features: [ɵɵNgOnChangesFeature]
+ });
+};
+(() => {
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptimizedImage, [{
+ type: Directive,
+ args: [{
+ selector: "img[ngSrc]",
+ host: {
+ "[style.position]": 'fill ? "absolute" : null',
+ "[style.width]": 'fill ? "100%" : null',
+ "[style.height]": 'fill ? "100%" : null',
+ "[style.inset]": 'fill ? "0" : null',
+ "[style.background-size]": 'placeholder ? "cover" : null',
+ "[style.background-position]": 'placeholder ? "50% 50%" : null',
+ "[style.background-repeat]": 'placeholder ? "no-repeat" : null',
+ "[style.background-image]": "placeholder ? generatePlaceholder(placeholder) : null",
+ "[style.filter]": 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null'
+ }
+ }]
+ }], () => [], {
+ ngSrc: [{
+ type: Input,
+ args: [{
+ required: true,
+ transform: unwrapSafeUrl
+ }]
+ }],
+ ngSrcset: [{
+ type: Input
+ }],
+ sizes: [{
+ type: Input
+ }],
+ width: [{
+ type: Input,
+ args: [{
+ transform: numberAttribute
+ }]
+ }],
+ height: [{
+ type: Input,
+ args: [{
+ transform: numberAttribute
+ }]
+ }],
+ decoding: [{
+ type: Input
+ }],
+ loading: [{
+ type: Input
+ }],
+ priority: [{
+ type: Input,
+ args: [{
+ transform: booleanAttribute
+ }]
+ }],
+ loaderParams: [{
+ type: Input
+ }],
+ disableOptimizedSrcset: [{
+ type: Input,
+ args: [{
+ transform: booleanAttribute
+ }]
+ }],
+ fill: [{
+ type: Input,
+ args: [{
+ transform: booleanAttribute
+ }]
+ }],
+ placeholder: [{
+ type: Input,
+ args: [{
+ transform: booleanOrUrlAttribute
+ }]
+ }],
+ placeholderConfig: [{
+ type: Input
+ }],
+ src: [{
+ type: Input
+ }],
+ srcset: [{
+ type: Input
+ }]
+ });
+})();
+function processConfig(config) {
+ let sortedBreakpoints = {};
+ if (config.breakpoints) {
+ sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
+ }
+ return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);
+}
+function assertNoConflictingSrc(dir) {
+ if (dir.src) {
+ throw new RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. To fix this, please remove the \`src\` attribute.`);
+ }
+}
+function assertNoConflictingSrcset(dir) {
+ if (dir.srcset) {
+ throw new RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`srcset\` itself based on the value of \`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
+ }
+}
+function assertNotBase64Image(dir) {
+ let ngSrc = dir.ngSrc.trim();
+ if (ngSrc.startsWith("data:")) {
+ if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
+ ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + "...";
+ }
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string (${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
+ }
+}
+function assertNoComplexSizes(dir) {
+ let sizes = dir.sizes;
+ if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
+ }
+}
+function assertValidPlaceholder(dir, imageLoader) {
+ assertNoPlaceholderConfigWithoutPlaceholder(dir);
+ assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);
+ assertNoOversizedDataUrl(dir);
+}
+function assertNoPlaceholderConfigWithoutPlaceholder(dir) {
+ if (dir.placeholderConfig && !dir.placeholder) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an image that does not use the \`placeholder\` attribute, and will have no effect.`);
+ }
+}
+function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {
+ if (dir.placeholder === true && imageLoader === noopImageLoader) {
+ throw new RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for the primary image and its placeholder. To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`);
+ }
+}
+function assertNoOversizedDataUrl(dir) {
+ if (dir.placeholder && typeof dir.placeholder === "string" && dir.placeholder.startsWith("data:")) {
+ if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {
+ throw new RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. To fix this, generate a smaller data URL placeholder.`);
+ }
+ if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {
+ console.warn(formatRuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. For better loading performance, generate a smaller data URL placeholder.`));
+ }
+ }
+}
+function assertNotBlobUrl(dir) {
+ const ngSrc = dir.ngSrc.trim();
+ if (ngSrc.startsWith("blob:")) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). Blob URLs are not supported by the NgOptimizedImage directive. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
+ }
+}
+function assertNonEmptyInput(dir, name, value) {
+ const isString = typeof value === "string";
+ const isEmptyString = isString && value.trim() === "";
+ if (!isString || isEmptyString) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value (\`${value}\`). To fix this, change the value to a non-empty string.`);
+ }
+}
+function assertValidNgSrcset(dir, value) {
+ if (value == null) return;
+ assertNonEmptyInput(dir, "ngSrcset", value);
+ const stringVal = value;
+ const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
+ const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
+ if (isValidDensityDescriptor) {
+ assertUnderDensityCap(dir, stringVal);
+ }
+ const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
+ if (!isValidSrcset) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
+ }
+}
+function assertUnderDensityCap(dir, value) {
+ const underDensityCap = value.split(",").every((num) => num === "" || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
+ if (!underDensityCap) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:\`${value}\`. NgOptimizedImage generally recommends a max image density of ${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for most use cases. Images that will be pinch-zoomed are typically the primary use case for ${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
+ }
+}
+function postInitInputChangeError(dir, inputName) {
+ let reason;
+ if (inputName === "width" || inputName === "height") {
+ reason = `Changing \`${inputName}\` may result in different attribute value applied to the underlying image element and cause layout shifts on a page.`;
+ } else {
+ reason = `Changing the \`${inputName}\` would have no effect on the underlying image element, because the resource loading has already occurred.`;
+ }
+ return new RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. The NgOptimizedImage directive will not react to this input change. ${reason} To fix this, either switch \`${inputName}\` to a static value or wrap the image element in an @if that is gated on the necessary value.`);
+}
+function assertNoPostInitInputChange(dir, changes, inputs) {
+ inputs.forEach((input) => {
+ const isUpdated = changes.hasOwnProperty(input);
+ if (isUpdated && !changes[input].isFirstChange()) {
+ if (input === "ngSrc") {
+ dir = {
+ ngSrc: changes[input].previousValue
+ };
+ }
+ throw postInitInputChangeError(dir, input);
+ }
+ });
+}
+function assertGreaterThanZero(dir, inputValue, inputName) {
+ const validNumber = typeof inputValue === "number" && inputValue > 0;
+ const validString = typeof inputValue === "string" && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
+ if (!validNumber && !validString) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. To fix this, provide \`${inputName}\` as a number greater than 0.`);
+ }
+}
+function assertNoImageDistortion(dir, img, renderer) {
+ const callback = () => {
+ removeLoadListenerFn();
+ removeErrorListenerFn();
+ const computedStyle = window.getComputedStyle(img);
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
+ const boxSizing = computedStyle.getPropertyValue("box-sizing");
+ if (boxSizing === "border-box") {
+ const paddingTop = computedStyle.getPropertyValue("padding-top");
+ const paddingRight = computedStyle.getPropertyValue("padding-right");
+ const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
+ const paddingLeft = computedStyle.getPropertyValue("padding-left");
+ renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
+ renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
+ }
+ const renderedAspectRatio = renderedWidth / renderedHeight;
+ const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
+ const intrinsicWidth = img.naturalWidth;
+ const intrinsicHeight = img.naturalHeight;
+ const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
+ const suppliedWidth = dir.width;
+ const suppliedHeight = dir.height;
+ const suppliedAspectRatio = suppliedWidth / suppliedHeight;
+ const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
+ const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
+ if (inaccurateDimensions) {
+ console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes.
+Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}).
+Supplied width and height attributes: ${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}).
+To fix this, update the width and height attributes.`));
+ } else if (stylingDistortion) {
+ console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio.
+Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}).
+Rendered image size: ${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ${round(renderedAspectRatio)}).
+This issue can occur if "width" and "height" attributes are added to an image without updating the corresponding image styling. To fix this, adjust image styling. In most cases, adding "height: auto" or "width: auto" to the image styling will fix this issue.`));
+ } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
+ const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
+ const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
+ const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
+ const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
+ if (oversizedWidth || oversizedHeight) {
+ console.warn(formatRuntimeError(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly larger than necessary.
+Rendered image size: ${renderedWidth}w x ${renderedHeight}h.
+Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h.
+Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h.
+Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image or consider using the "ngSrcset" and "sizes" attributes.`));
+ }
+ }
+ };
+ const removeLoadListenerFn = renderer.listen(img, "load", callback);
+ const removeErrorListenerFn = renderer.listen(img, "error", () => {
+ removeLoadListenerFn();
+ removeErrorListenerFn();
+ });
+ callOnLoadIfImageIsLoaded(img, callback);
+}
+function assertNonEmptyWidthAndHeight(dir) {
+ let missingAttributes = [];
+ if (dir.width === void 0) missingAttributes.push("width");
+ if (dir.height === void 0) missingAttributes.push("height");
+ if (missingAttributes.length > 0) {
+ throw new RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes are missing: ${missingAttributes.map((attr) => `"${attr}"`).join(", ")}. Including "width" and "height" attributes will prevent image-related layout shifts. To fix this, include "width" and "height" attributes on the image tag or turn on "fill" mode with the \`fill\` attribute.`);
+ }
+}
+function assertEmptyWidthAndHeight(dir) {
+ if (dir.width || dir.height) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing element, the size attributes have no effect and should be removed.`);
+ }
+}
+function assertNonZeroRenderedHeight(dir, img, renderer) {
+ const callback = () => {
+ removeLoadListenerFn();
+ removeErrorListenerFn();
+ const renderedHeight = img.clientHeight;
+ if (dir.fill && renderedHeight === 0) {
+ console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. This is likely because the containing element does not have the CSS 'position' property set to one of the following: "relative", "fixed", or "absolute". To fix this problem, make sure the container element has the CSS 'position' property defined and the height of the element is not zero.`));
+ }
+ };
+ const removeLoadListenerFn = renderer.listen(img, "load", callback);
+ const removeErrorListenerFn = renderer.listen(img, "error", () => {
+ removeLoadListenerFn();
+ removeErrorListenerFn();
+ });
+ callOnLoadIfImageIsLoaded(img, callback);
+}
+function assertValidLoadingInput(dir) {
+ if (dir.loading && dir.priority) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute was used on an image that was marked "priority". Setting \`loading\` on priority images is not allowed because these images will always be eagerly loaded. To fix this, remove the “loading” attribute from the priority image.`);
+ }
+ const validInputs = ["auto", "eager", "lazy"];
+ if (typeof dir.loading === "string" && !validInputs.includes(dir.loading)) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute has an invalid value (\`${dir.loading}\`). To fix this, provide a valid value ("lazy", "eager", or "auto").`);
+ }
+}
+function assertValidDecodingInput(dir) {
+ const validInputs = ["sync", "async", "auto"];
+ if (typeof dir.decoding === "string" && !validInputs.includes(dir.decoding)) {
+ throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute has an invalid value (\`${dir.decoding}\`). To fix this, provide a valid value ("sync", "async", or "auto").`);
+ }
+}
+function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
+ if (imageLoader === noopImageLoader) {
+ let builtInLoaderName = "";
+ for (const loader of BUILT_IN_LOADERS) {
+ if (loader.testUrl(ngSrc)) {
+ builtInLoaderName = loader.name;
+ break;
+ }
+ }
+ if (builtInLoaderName) {
+ console.warn(formatRuntimeError(2962, `NgOptimizedImage: It looks like your images may be hosted on the ${builtInLoaderName} CDN, but your app is not using Angular's built-in loader for that CDN. We recommend switching to use the built-in by calling \`provide${builtInLoaderName}Loader()\` in your \`providers\` and passing it your instance's base URL. If you don't want to use the built-in loader, define a custom loader function using IMAGE_LOADER to silence this warning.`));
+ }
+ }
+}
+function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
+ if (dir.ngSrcset && imageLoader === noopImageLoader) {
+ console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for all configured sizes. To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
+ }
+}
+function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
+ if (dir.loaderParams && imageLoader === noopImageLoader) {
+ console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but no image loader is configured (i.e. the default one is being used), which means that the loaderParams data will not be consumed and will not affect the URL. To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
+ }
+}
+function assetPriorityCountBelowThreshold(appRef) {
+ return __async(this, null, function* () {
+ if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {
+ IMGS_WITH_PRIORITY_ATTR_COUNT++;
+ yield appRef.whenStable();
+ if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {
+ console.warn(formatRuntimeError(2966, `NgOptimizedImage: The "priority" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). Marking too many images as "high" priority can hurt your application's LCP (https://web.dev/lcp). "Priority" should only be set on the image expected to be the page's LCP element.`));
+ }
+ } else {
+ IMGS_WITH_PRIORITY_ATTR_COUNT++;
+ }
+ });
+}
+function assertPlaceholderDimensions(dir, imgElement) {
+ const computedStyle = window.getComputedStyle(imgElement);
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
+ if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {
+ console.warn(formatRuntimeError(2967, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. To fix this, use a smaller image as a placeholder.`));
+ }
+}
+function callOnLoadIfImageIsLoaded(img, callback) {
+ if (img.complete && img.naturalWidth) {
+ callback();
+ }
+}
+function round(input) {
+ return Number.isInteger(input) ? input : input.toFixed(2);
+}
+function unwrapSafeUrl(value) {
+ if (typeof value === "string") {
+ return value;
+ }
+ return unwrapSafeValue(value);
+}
+function booleanOrUrlAttribute(value) {
+ if (typeof value === "string" && value !== "true" && value !== "false" && value !== "") {
+ return value;
+ }
+ return booleanAttribute(value);
+}
+
+export {
+ getDOM,
+ setRootDomAdapter,
+ DomAdapter,
+ PlatformLocation,
+ LOCATION_INITIALIZED,
+ BrowserPlatformLocation,
+ normalizeQueryParams,
+ LocationStrategy,
+ APP_BASE_HREF,
+ PathLocationStrategy,
+ Location,
+ HashLocationStrategy,
+ NumberFormatStyle,
+ Plural,
+ FormStyle,
+ TranslationWidth,
+ FormatWidth,
+ NumberSymbol,
+ WeekDay,
+ getLocaleId,
+ getLocaleDayPeriods,
+ getLocaleDayNames,
+ getLocaleMonthNames,
+ getLocaleEraNames,
+ getLocaleFirstDayOfWeek,
+ getLocaleWeekEndRange,
+ getLocaleDateFormat,
+ getLocaleTimeFormat,
+ getLocaleDateTimeFormat,
+ getLocaleNumberSymbol,
+ getLocaleNumberFormat,
+ getLocaleCurrencySymbol,
+ getLocaleCurrencyName,
+ getLocaleCurrencyCode2 as getLocaleCurrencyCode,
+ getLocalePluralCase2 as getLocalePluralCase,
+ getLocaleExtraDayPeriodRules,
+ getLocaleExtraDayPeriods,
+ getLocaleDirection,
+ getCurrencySymbol,
+ getNumberOfCurrencyDigits,
+ formatDate,
+ formatCurrency,
+ formatPercent,
+ formatNumber,
+ NgLocalization,
+ NgLocaleLocalization,
+ NgClass,
+ NgComponentOutlet,
+ NgForOfContext,
+ NgForOf,
+ NgIf,
+ NgIfContext,
+ NgSwitch,
+ NgSwitchCase,
+ NgSwitchDefault,
+ NgPlural,
+ NgPluralCase,
+ NgStyle,
+ NgTemplateOutlet,
+ AsyncPipe,
+ LowerCasePipe,
+ TitleCasePipe,
+ UpperCasePipe,
+ DATE_PIPE_DEFAULT_TIMEZONE,
+ DATE_PIPE_DEFAULT_OPTIONS,
+ DatePipe,
+ I18nPluralPipe,
+ I18nSelectPipe,
+ JsonPipe,
+ KeyValuePipe,
+ DecimalPipe,
+ PercentPipe,
+ CurrencyPipe,
+ SlicePipe,
+ CommonModule,
+ parseCookieValue,
+ XhrFactory,
+ PlatformNavigation,
+ registerLocaleData2 as registerLocaleData,
+ PLATFORM_BROWSER_ID,
+ PLATFORM_SERVER_ID,
+ isPlatformBrowser,
+ isPlatformServer,
+ VERSION,
+ ViewportScroller,
+ NullViewportScroller,
+ IMAGE_LOADER,
+ provideCloudflareLoader,
+ provideCloudinaryLoader,
+ provideImageKitLoader,
+ provideImgixLoader,
+ provideNetlifyLoader,
+ PRECONNECT_CHECK_BLOCKLIST,
+ NgOptimizedImage
+};
+/*! Bundled license information:
+
+@angular/common/fesm2022/location.mjs:
+@angular/common/fesm2022/common_module.mjs:
+@angular/common/fesm2022/xhr.mjs:
+@angular/common/fesm2022/platform_navigation.mjs:
+@angular/common/fesm2022/common.mjs:
+ (**
+ * @license Angular v20.1.7
+ * (c) 2010-2025 Google LLC. https://angular.io/
+ * License: MIT
+ *)
+*/
+//# sourceMappingURL=chunk-J7WYVKQ5.js.map
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js.map b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js.map
new file mode 100644
index 0000000..e4f4a98
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-J7WYVKQ5.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../../../../../node_modules/@angular/common/fesm2022/location.mjs", "../../../../../../node_modules/@angular/common/fesm2022/common_module.mjs", "../../../../../../node_modules/@angular/common/fesm2022/xhr.mjs", "../../../../../../node_modules/@angular/common/fesm2022/platform_navigation.mjs", "../../../../../../node_modules/@angular/common/fesm2022/common.mjs"],
+ "sourcesContent": ["/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { inject, Injectable, InjectionToken, DOCUMENT, Optional, Inject, ɵɵinject as __inject } from '@angular/core';\nimport { Subject } from 'rxjs';\nlet _DOM = null;\nfunction getDOM() {\n return _DOM;\n}\nfunction setRootDomAdapter(adapter) {\n _DOM ??= adapter;\n}\n/**\n * Provides DOM operations in an environment-agnostic way.\n *\n * @security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nclass DomAdapter {}\n\n/**\n * This class should not be used directly by an application developer. Instead, use\n * {@link Location}.\n *\n * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be\n * platform-agnostic.\n * This means that we can have different implementation of `PlatformLocation` for the different\n * platforms that Angular supports. For example, `@angular/platform-browser` provides an\n * implementation specific to the browser environment, while `@angular/platform-server` provides\n * one suitable for use with server-side rendering.\n *\n * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}\n * when they need to interact with the DOM APIs like pushState, popState, etc.\n *\n * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly\n * by the {@link /api/router/Router Router} in order to navigate between routes. Since all interactions between\n * {@link /api/router/Router Router} /\n * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`\n * class, they are all platform-agnostic.\n *\n * @publicApi\n */\nclass PlatformLocation {\n historyGo(relativePosition) {\n throw new Error(ngDevMode ? 'Not implemented' : '');\n }\n static ɵfac = function PlatformLocation_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PlatformLocation)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PlatformLocation,\n factory: () => (() => inject(BrowserPlatformLocation))(),\n providedIn: 'platform'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PlatformLocation, [{\n type: Injectable,\n args: [{\n providedIn: 'platform',\n useFactory: () => inject(BrowserPlatformLocation)\n }]\n }], null, null);\n})();\n/**\n * @description\n * Indicates when a location is initialized.\n *\n * @publicApi\n */\nconst LOCATION_INITIALIZED = new InjectionToken(ngDevMode ? 'Location Initialized' : '');\n/**\n * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n * This class should not be used directly by an application developer. Instead, use\n * {@link Location}.\n *\n * @publicApi\n */\nclass BrowserPlatformLocation extends PlatformLocation {\n _location;\n _history;\n _doc = inject(DOCUMENT);\n constructor() {\n super();\n this._location = window.location;\n this._history = window.history;\n }\n getBaseHrefFromDOM() {\n return getDOM().getBaseHref(this._doc);\n }\n onPopState(fn) {\n const window = getDOM().getGlobalEventTarget(this._doc, 'window');\n window.addEventListener('popstate', fn, false);\n return () => window.removeEventListener('popstate', fn);\n }\n onHashChange(fn) {\n const window = getDOM().getGlobalEventTarget(this._doc, 'window');\n window.addEventListener('hashchange', fn, false);\n return () => window.removeEventListener('hashchange', fn);\n }\n get href() {\n return this._location.href;\n }\n get protocol() {\n return this._location.protocol;\n }\n get hostname() {\n return this._location.hostname;\n }\n get port() {\n return this._location.port;\n }\n get pathname() {\n return this._location.pathname;\n }\n get search() {\n return this._location.search;\n }\n get hash() {\n return this._location.hash;\n }\n set pathname(newPath) {\n this._location.pathname = newPath;\n }\n pushState(state, title, url) {\n this._history.pushState(state, title, url);\n }\n replaceState(state, title, url) {\n this._history.replaceState(state, title, url);\n }\n forward() {\n this._history.forward();\n }\n back() {\n this._history.back();\n }\n historyGo(relativePosition = 0) {\n this._history.go(relativePosition);\n }\n getState() {\n return this._history.state;\n }\n static ɵfac = function BrowserPlatformLocation_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || BrowserPlatformLocation)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: BrowserPlatformLocation,\n factory: () => (() => new BrowserPlatformLocation())(),\n providedIn: 'platform'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(BrowserPlatformLocation, [{\n type: Injectable,\n args: [{\n providedIn: 'platform',\n useFactory: () => new BrowserPlatformLocation()\n }]\n }], () => [], null);\n})();\n\n/**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\nfunction joinWithSlash(start, end) {\n // If `start` is an empty string, return `end` as the result.\n if (!start) return end;\n // If `end` is an empty string, return `start` as the result.\n if (!end) return start;\n // If `start` ends with a slash, remove the leading slash from `end`.\n if (start.endsWith('/')) {\n return end.startsWith('/') ? start + end.slice(1) : start + end;\n }\n // If `start` doesn't end with a slash, add one if `end` doesn't start with a slash.\n return end.startsWith('/') ? start + end : `${start}/${end}`;\n}\n/**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\nfunction stripTrailingSlash(url) {\n // Find the index of the first occurrence of `#`, `?`, or the end of the string.\n // This marks the start of the query string, fragment, or the end of the URL path.\n const pathEndIdx = url.search(/#|\\?|$/);\n // Check if the character before `pathEndIdx` is a trailing slash.\n // If it is, remove the trailing slash and return the modified URL.\n // Otherwise, return the URL as is.\n return url[pathEndIdx - 1] === '/' ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;\n}\n/**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\nfunction normalizeQueryParams(params) {\n return params && params[0] !== '?' ? `?${params}` : params;\n}\n\n/**\n * Enables the `Location` service to read route state from the browser's URL.\n * Angular provides two strategies:\n * `HashLocationStrategy` and `PathLocationStrategy`.\n *\n * Applications should use the `Router` or `Location` services to\n * interact with application route state.\n *\n * For instance, `HashLocationStrategy` produces URLs like\n * http://example.com/#/foo,\n * and `PathLocationStrategy` produces\n * http://example.com/foo as an equivalent URL.\n *\n * See these two classes for more.\n *\n * @publicApi\n */\nclass LocationStrategy {\n historyGo(relativePosition) {\n throw new Error(ngDevMode ? 'Not implemented' : '');\n }\n static ɵfac = function LocationStrategy_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || LocationStrategy)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: LocationStrategy,\n factory: () => (() => inject(PathLocationStrategy))(),\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(LocationStrategy, [{\n type: Injectable,\n args: [{\n providedIn: 'root',\n useFactory: () => inject(PathLocationStrategy)\n }]\n }], null, null);\n})();\n/**\n * A predefined DI token for the base href\n * to be used with the `PathLocationStrategy`.\n * The base href is the URL prefix that should be preserved when generating\n * and recognizing URLs.\n *\n * @usageNotes\n *\n * The following example shows how to use this token to configure the root app injector\n * with a base href value, so that the DI framework can supply the dependency anywhere in the app.\n *\n * ```ts\n * import {NgModule} from '@angular/core';\n * import {APP_BASE_HREF} from '@angular/common';\n *\n * @NgModule({\n * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * @publicApi\n */\nconst APP_BASE_HREF = new InjectionToken(ngDevMode ? 'appBaseHref' : '');\n/**\n * @description\n * A {@link LocationStrategy} used to configure the {@link Location} service to\n * represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}\n * or add a `` element to the document to override the default.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,\n * the `` and/or `APP_BASE_HREF` should end with a `/`.\n *\n * Similarly, if you add `` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Note that when using `PathLocationStrategy`, neither the query nor\n * the fragment in the `` will be preserved, as outlined\n * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\nclass PathLocationStrategy extends LocationStrategy {\n _platformLocation;\n _baseHref;\n _removeListenerFns = [];\n constructor(_platformLocation, href) {\n super();\n this._platformLocation = _platformLocation;\n this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject(DOCUMENT).location?.origin ?? '';\n }\n /** @docs-private */\n ngOnDestroy() {\n while (this._removeListenerFns.length) {\n this._removeListenerFns.pop()();\n }\n }\n onPopState(fn) {\n this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n }\n getBaseHref() {\n return this._baseHref;\n }\n prepareExternalUrl(internal) {\n return joinWithSlash(this._baseHref, internal);\n }\n path(includeHash = false) {\n const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);\n const hash = this._platformLocation.hash;\n return hash && includeHash ? `${pathname}${hash}` : pathname;\n }\n pushState(state, title, url, queryParams) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.pushState(state, title, externalUrl);\n }\n replaceState(state, title, url, queryParams) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.replaceState(state, title, externalUrl);\n }\n forward() {\n this._platformLocation.forward();\n }\n back() {\n this._platformLocation.back();\n }\n getState() {\n return this._platformLocation.getState();\n }\n historyGo(relativePosition = 0) {\n this._platformLocation.historyGo?.(relativePosition);\n }\n static ɵfac = function PathLocationStrategy_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PathLocationStrategy)(i0.ɵɵinject(PlatformLocation), i0.ɵɵinject(APP_BASE_HREF, 8));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PathLocationStrategy,\n factory: PathLocationStrategy.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PathLocationStrategy, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [{\n type: PlatformLocation\n }, {\n type: undefined,\n decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [APP_BASE_HREF]\n }]\n }], null);\n})();\n\n/**\n * @description\n *\n * A service that applications can use to interact with a browser's URL.\n *\n * Depending on the `LocationStrategy` used, `Location` persists\n * to the URL's path or the URL's hash segment.\n *\n * @usageNotes\n *\n * It's better to use the `Router.navigate()` service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n *\n * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\nclass Location {\n /** @internal */\n _subject = new Subject();\n /** @internal */\n _basePath;\n /** @internal */\n _locationStrategy;\n /** @internal */\n _urlChangeListeners = [];\n /** @internal */\n _urlChangeSubscription = null;\n constructor(locationStrategy) {\n this._locationStrategy = locationStrategy;\n const baseHref = this._locationStrategy.getBaseHref();\n // Note: This class's interaction with base HREF does not fully follow the rules\n // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm.\n // Instead of trying to fix individual bugs with more and more code, we should\n // investigate using the URL constructor and providing the base as a second\n // argument.\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters\n this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));\n this._locationStrategy.onPopState(ev => {\n this._subject.next({\n 'url': this.path(true),\n 'pop': true,\n 'state': ev.state,\n 'type': ev.type\n });\n });\n }\n /** @docs-private */\n ngOnDestroy() {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeListeners = [];\n }\n /**\n * Normalizes the URL path for this location.\n *\n * @param includeHash True to include an anchor fragment in the path.\n *\n * @returns The normalized URL path.\n */\n // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n // removed.\n path(includeHash = false) {\n return this.normalize(this._locationStrategy.path(includeHash));\n }\n /**\n * Reports the current state of the location history.\n * @returns The current value of the `history.state` object.\n */\n getState() {\n return this._locationStrategy.getState();\n }\n /**\n * Normalizes the given path and compares to the current normalized path.\n *\n * @param path The given URL path.\n * @param query Query parameters.\n *\n * @returns True if the given URL path is equal to the current normalized path, false\n * otherwise.\n */\n isCurrentPathEqualTo(path, query = '') {\n return this.path() == this.normalize(path + normalizeQueryParams(query));\n }\n /**\n * Normalizes a URL path by stripping any trailing slashes.\n *\n * @param url String representing a URL.\n *\n * @returns The normalized URL string.\n */\n normalize(url) {\n return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));\n }\n /**\n * Normalizes an external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), adds one\n * before normalizing. Adds a hash if `HashLocationStrategy` is\n * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n *\n * @param url String representing a URL.\n *\n * @returns A normalized platform-specific URL.\n */\n prepareExternalUrl(url) {\n if (url && url[0] !== '/') {\n url = '/' + url;\n }\n return this._locationStrategy.prepareExternalUrl(url);\n }\n // TODO: rename this method to pushState\n /**\n * Changes the browser's URL to a normalized version of a given URL, and pushes a\n * new item onto the platform's history.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n *\n */\n go(path, query = '', state = null) {\n this._locationStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }\n /**\n * Changes the browser's URL to a normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n */\n replaceState(path, query = '', state = null) {\n this._locationStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }\n /**\n * Navigates forward in the platform's history.\n */\n forward() {\n this._locationStrategy.forward();\n }\n /**\n * Navigates back in the platform's history.\n */\n back() {\n this._locationStrategy.back();\n }\n /**\n * Navigate to a specific page from session history, identified by its relative position to the\n * current page.\n *\n * @param relativePosition Position of the target page in the history relative to the current\n * page.\n * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`\n * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go\n * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs\n * when `relativePosition` equals 0.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history\n */\n historyGo(relativePosition = 0) {\n this._locationStrategy.historyGo?.(relativePosition);\n }\n /**\n * Registers a URL change listener. Use to catch updates performed by the Angular\n * framework that are not detectible through \"popstate\" or \"hashchange\" events.\n *\n * @param fn The change handler function, which take a URL and a location history state.\n * @returns A function that, when executed, unregisters a URL change listener.\n */\n onUrlChange(fn) {\n this._urlChangeListeners.push(fn);\n this._urlChangeSubscription ??= this.subscribe(v => {\n this._notifyUrlChangeListeners(v.url, v.state);\n });\n return () => {\n const fnIndex = this._urlChangeListeners.indexOf(fn);\n this._urlChangeListeners.splice(fnIndex, 1);\n if (this._urlChangeListeners.length === 0) {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeSubscription = null;\n }\n };\n }\n /** @internal */\n _notifyUrlChangeListeners(url = '', state) {\n this._urlChangeListeners.forEach(fn => fn(url, state));\n }\n /**\n * Subscribes to the platform's `popState` events.\n *\n * Note: `Location.go()` does not trigger the `popState` event in the browser. Use\n * `Location.onUrlChange()` to subscribe to URL changes instead.\n *\n * @param value Event that is triggered when the state history changes.\n * @param exception The exception to throw.\n *\n * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)\n *\n * @returns Subscribed events.\n */\n subscribe(onNext, onThrow, onReturn) {\n return this._subject.subscribe({\n next: onNext,\n error: onThrow ?? undefined,\n complete: onReturn ?? undefined\n });\n }\n /**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\n static normalizeQueryParams = normalizeQueryParams;\n /**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\n static joinWithSlash = joinWithSlash;\n /**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\n static stripTrailingSlash = stripTrailingSlash;\n static ɵfac = function Location_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Location)(i0.ɵɵinject(LocationStrategy));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: Location,\n factory: () => createLocation(),\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(Location, [{\n type: Injectable,\n args: [{\n providedIn: 'root',\n // See #23917\n useFactory: createLocation\n }]\n }], () => [{\n type: LocationStrategy\n }], null);\n})();\nfunction createLocation() {\n return new Location(__inject(LocationStrategy));\n}\nfunction _stripBasePath(basePath, url) {\n if (!basePath || !url.startsWith(basePath)) {\n return url;\n }\n const strippedUrl = url.substring(basePath.length);\n if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) {\n return strippedUrl;\n }\n return url;\n}\nfunction _stripIndexHtml(url) {\n return url.replace(/\\/index.html$/, '');\n}\nfunction _stripOrigin(baseHref) {\n // DO NOT REFACTOR! Previously, this check looked like this:\n // `/^(https?:)?\\/\\//.test(baseHref)`, but that resulted in\n // syntactically incorrect code after Closure Compiler minification.\n // This was likely caused by a bug in Closure Compiler, but\n // for now, the check is rewritten to use `new RegExp` instead.\n const isAbsoluteUrl = new RegExp('^(https?:)?//').test(baseHref);\n if (isAbsoluteUrl) {\n const [, pathname] = baseHref.split(/\\/\\/[^\\/]+/);\n return pathname;\n }\n return baseHref;\n}\nexport { APP_BASE_HREF, BrowserPlatformLocation, DomAdapter, LOCATION_INITIALIZED, Location, LocationStrategy, PathLocationStrategy, PlatformLocation, getDOM, joinWithSlash, normalizeQueryParams, setRootDomAdapter };\n", "/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { Injectable, Optional, Inject, ɵfindLocaleData as _findLocaleData, ɵLocaleDataIndex as _LocaleDataIndex, ɵgetLocaleCurrencyCode as _getLocaleCurrencyCode, ɵgetLocalePluralCase as _getLocalePluralCase, ɵRuntimeError as _RuntimeError, ɵformatRuntimeError as _formatRuntimeError, LOCALE_ID, ɵstringify as _stringify, Directive, Input, createNgModule, NgModuleRef, Host, Attribute, RendererStyleFlags2, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, ɵisPromise as _isPromise, ɵisSubscribable as _isSubscribable, Pipe, untracked, InjectionToken, DEFAULT_CURRENCY_CODE, NgModule } from '@angular/core';\nimport { LocationStrategy, joinWithSlash, normalizeQueryParams, PlatformLocation, APP_BASE_HREF } from './location.mjs';\n\n/**\n * @description\n * A {@link LocationStrategy} used to configure the {@link Location} service to\n * represent its state in the\n * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n * of the browser's URL.\n *\n * For instance, if you call `location.go('/foo')`, the browser's URL will become\n * `example.com#/foo`.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\nclass HashLocationStrategy extends LocationStrategy {\n _platformLocation;\n _baseHref = '';\n _removeListenerFns = [];\n constructor(_platformLocation, _baseHref) {\n super();\n this._platformLocation = _platformLocation;\n if (_baseHref != null) {\n this._baseHref = _baseHref;\n }\n }\n /** @docs-private */\n ngOnDestroy() {\n while (this._removeListenerFns.length) {\n this._removeListenerFns.pop()();\n }\n }\n onPopState(fn) {\n this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n }\n getBaseHref() {\n return this._baseHref;\n }\n path(includeHash = false) {\n // the hash value is always prefixed with a `#`\n // and if it is empty then it will stay empty\n const path = this._platformLocation.hash ?? '#';\n return path.length > 0 ? path.substring(1) : path;\n }\n prepareExternalUrl(internal) {\n const url = joinWithSlash(this._baseHref, internal);\n return url.length > 0 ? '#' + url : url;\n }\n pushState(state, title, path, queryParams) {\n const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;\n this._platformLocation.pushState(state, title, url);\n }\n replaceState(state, title, path, queryParams) {\n const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;\n this._platformLocation.replaceState(state, title, url);\n }\n forward() {\n this._platformLocation.forward();\n }\n back() {\n this._platformLocation.back();\n }\n getState() {\n return this._platformLocation.getState();\n }\n historyGo(relativePosition = 0) {\n this._platformLocation.historyGo?.(relativePosition);\n }\n static ɵfac = function HashLocationStrategy_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || HashLocationStrategy)(i0.ɵɵinject(PlatformLocation), i0.ɵɵinject(APP_BASE_HREF, 8));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: HashLocationStrategy,\n factory: HashLocationStrategy.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(HashLocationStrategy, [{\n type: Injectable\n }], () => [{\n type: PlatformLocation\n }, {\n type: undefined,\n decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [APP_BASE_HREF]\n }]\n }], null);\n})();\n\n/** @internal */\nconst CURRENCIES_EN = {\n \"ADP\": [undefined, undefined, 0],\n \"AFN\": [undefined, \"؋\", 0],\n \"ALL\": [undefined, undefined, 0],\n \"AMD\": [undefined, \"֏\", 2],\n \"AOA\": [undefined, \"Kz\"],\n \"ARS\": [undefined, \"$\"],\n \"AUD\": [\"A$\", \"$\"],\n \"AZN\": [undefined, \"₼\"],\n \"BAM\": [undefined, \"KM\"],\n \"BBD\": [undefined, \"$\"],\n \"BDT\": [undefined, \"৳\"],\n \"BHD\": [undefined, undefined, 3],\n \"BIF\": [undefined, undefined, 0],\n \"BMD\": [undefined, \"$\"],\n \"BND\": [undefined, \"$\"],\n \"BOB\": [undefined, \"Bs\"],\n \"BRL\": [\"R$\"],\n \"BSD\": [undefined, \"$\"],\n \"BWP\": [undefined, \"P\"],\n \"BYN\": [undefined, undefined, 2],\n \"BYR\": [undefined, undefined, 0],\n \"BZD\": [undefined, \"$\"],\n \"CAD\": [\"CA$\", \"$\", 2],\n \"CHF\": [undefined, undefined, 2],\n \"CLF\": [undefined, undefined, 4],\n \"CLP\": [undefined, \"$\", 0],\n \"CNY\": [\"CN¥\", \"¥\"],\n \"COP\": [undefined, \"$\", 2],\n \"CRC\": [undefined, \"₡\", 2],\n \"CUC\": [undefined, \"$\"],\n \"CUP\": [undefined, \"$\"],\n \"CZK\": [undefined, \"Kč\", 2],\n \"DJF\": [undefined, undefined, 0],\n \"DKK\": [undefined, \"kr\", 2],\n \"DOP\": [undefined, \"$\"],\n \"EGP\": [undefined, \"E£\"],\n \"ESP\": [undefined, \"₧\", 0],\n \"EUR\": [\"€\"],\n \"FJD\": [undefined, \"$\"],\n \"FKP\": [undefined, \"£\"],\n \"GBP\": [\"£\"],\n \"GEL\": [undefined, \"₾\"],\n \"GHS\": [undefined, \"GH₵\"],\n \"GIP\": [undefined, \"£\"],\n \"GNF\": [undefined, \"FG\", 0],\n \"GTQ\": [undefined, \"Q\"],\n \"GYD\": [undefined, \"$\", 2],\n \"HKD\": [\"HK$\", \"$\"],\n \"HNL\": [undefined, \"L\"],\n \"HRK\": [undefined, \"kn\"],\n \"HUF\": [undefined, \"Ft\", 2],\n \"IDR\": [undefined, \"Rp\", 2],\n \"ILS\": [\"₪\"],\n \"INR\": [\"₹\"],\n \"IQD\": [undefined, undefined, 0],\n \"IRR\": [undefined, undefined, 0],\n \"ISK\": [undefined, \"kr\", 0],\n \"ITL\": [undefined, undefined, 0],\n \"JMD\": [undefined, \"$\"],\n \"JOD\": [undefined, undefined, 3],\n \"JPY\": [\"¥\", undefined, 0],\n \"KHR\": [undefined, \"៛\"],\n \"KMF\": [undefined, \"CF\", 0],\n \"KPW\": [undefined, \"₩\", 0],\n \"KRW\": [\"₩\", undefined, 0],\n \"KWD\": [undefined, undefined, 3],\n \"KYD\": [undefined, \"$\"],\n \"KZT\": [undefined, \"₸\"],\n \"LAK\": [undefined, \"₭\", 0],\n \"LBP\": [undefined, \"L£\", 0],\n \"LKR\": [undefined, \"Rs\"],\n \"LRD\": [undefined, \"$\"],\n \"LTL\": [undefined, \"Lt\"],\n \"LUF\": [undefined, undefined, 0],\n \"LVL\": [undefined, \"Ls\"],\n \"LYD\": [undefined, undefined, 3],\n \"MGA\": [undefined, \"Ar\", 0],\n \"MGF\": [undefined, undefined, 0],\n \"MMK\": [undefined, \"K\", 0],\n \"MNT\": [undefined, \"₮\", 2],\n \"MRO\": [undefined, undefined, 0],\n \"MUR\": [undefined, \"Rs\", 2],\n \"MXN\": [\"MX$\", \"$\"],\n \"MYR\": [undefined, \"RM\"],\n \"NAD\": [undefined, \"$\"],\n \"NGN\": [undefined, \"₦\"],\n \"NIO\": [undefined, \"C$\"],\n \"NOK\": [undefined, \"kr\", 2],\n \"NPR\": [undefined, \"Rs\"],\n \"NZD\": [\"NZ$\", \"$\"],\n \"OMR\": [undefined, undefined, 3],\n \"PHP\": [\"₱\"],\n \"PKR\": [undefined, \"Rs\", 2],\n \"PLN\": [undefined, \"zł\"],\n \"PYG\": [undefined, \"₲\", 0],\n \"RON\": [undefined, \"lei\"],\n \"RSD\": [undefined, undefined, 0],\n \"RUB\": [undefined, \"₽\"],\n \"RWF\": [undefined, \"RF\", 0],\n \"SBD\": [undefined, \"$\"],\n \"SEK\": [undefined, \"kr\", 2],\n \"SGD\": [undefined, \"$\"],\n \"SHP\": [undefined, \"£\"],\n \"SLE\": [undefined, undefined, 2],\n \"SLL\": [undefined, undefined, 0],\n \"SOS\": [undefined, undefined, 0],\n \"SRD\": [undefined, \"$\"],\n \"SSP\": [undefined, \"£\"],\n \"STD\": [undefined, undefined, 0],\n \"STN\": [undefined, \"Db\"],\n \"SYP\": [undefined, \"£\", 0],\n \"THB\": [undefined, \"฿\"],\n \"TMM\": [undefined, undefined, 0],\n \"TND\": [undefined, undefined, 3],\n \"TOP\": [undefined, \"T$\"],\n \"TRL\": [undefined, undefined, 0],\n \"TRY\": [undefined, \"₺\"],\n \"TTD\": [undefined, \"$\"],\n \"TWD\": [\"NT$\", \"$\", 2],\n \"TZS\": [undefined, undefined, 2],\n \"UAH\": [undefined, \"₴\"],\n \"UGX\": [undefined, undefined, 0],\n \"USD\": [\"$\"],\n \"UYI\": [undefined, undefined, 0],\n \"UYU\": [undefined, \"$\"],\n \"UYW\": [undefined, undefined, 4],\n \"UZS\": [undefined, undefined, 2],\n \"VEF\": [undefined, \"Bs\", 2],\n \"VND\": [\"₫\", undefined, 0],\n \"VUV\": [undefined, undefined, 0],\n \"XAF\": [\"FCFA\", undefined, 0],\n \"XCD\": [\"EC$\", \"$\"],\n \"XOF\": [\"F CFA\", undefined, 0],\n \"XPF\": [\"CFPF\", undefined, 0],\n \"XXX\": [\"¤\"],\n \"YER\": [undefined, undefined, 0],\n \"ZAR\": [undefined, \"R\"],\n \"ZMK\": [undefined, undefined, 0],\n \"ZMW\": [undefined, \"ZK\"],\n \"ZWD\": [undefined, undefined, 0]\n};\n\n/**\n * Format styles that can be used to represent numbers.\n * @see {@link getLocaleNumberFormat}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated `getLocaleNumberFormat` is deprecated\n */\nvar NumberFormatStyle;\n(function (NumberFormatStyle) {\n NumberFormatStyle[NumberFormatStyle[\"Decimal\"] = 0] = \"Decimal\";\n NumberFormatStyle[NumberFormatStyle[\"Percent\"] = 1] = \"Percent\";\n NumberFormatStyle[NumberFormatStyle[\"Currency\"] = 2] = \"Currency\";\n NumberFormatStyle[NumberFormatStyle[\"Scientific\"] = 3] = \"Scientific\";\n})(NumberFormatStyle || (NumberFormatStyle = {}));\n/**\n * Plurality cases used for translating plurals to different languages.\n *\n * @see {@link NgPlural}\n * @see {@link NgPluralCase}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated `getLocalePluralCase` is deprecated\n */\nvar Plural;\n(function (Plural) {\n Plural[Plural[\"Zero\"] = 0] = \"Zero\";\n Plural[Plural[\"One\"] = 1] = \"One\";\n Plural[Plural[\"Two\"] = 2] = \"Two\";\n Plural[Plural[\"Few\"] = 3] = \"Few\";\n Plural[Plural[\"Many\"] = 4] = \"Many\";\n Plural[Plural[\"Other\"] = 5] = \"Other\";\n})(Plural || (Plural = {}));\n/**\n * Context-dependant translation forms for strings.\n * Typically the standalone version is for the nominative form of the word,\n * and the format version is used for the genitive case.\n * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles)\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated locale data getters are deprecated\n */\nvar FormStyle;\n(function (FormStyle) {\n FormStyle[FormStyle[\"Format\"] = 0] = \"Format\";\n FormStyle[FormStyle[\"Standalone\"] = 1] = \"Standalone\";\n})(FormStyle || (FormStyle = {}));\n/**\n * String widths available for translations.\n * The specific character widths are locale-specific.\n * Examples are given for the word \"Sunday\" in English.\n *\n * @publicApi\n *\n * @deprecated locale data getters are deprecated\n */\nvar TranslationWidth;\n(function (TranslationWidth) {\n /** 1 character for `en-US`. For example: 'S' */\n TranslationWidth[TranslationWidth[\"Narrow\"] = 0] = \"Narrow\";\n /** 3 characters for `en-US`. For example: 'Sun' */\n TranslationWidth[TranslationWidth[\"Abbreviated\"] = 1] = \"Abbreviated\";\n /** Full length for `en-US`. For example: \"Sunday\" */\n TranslationWidth[TranslationWidth[\"Wide\"] = 2] = \"Wide\";\n /** 2 characters for `en-US`, For example: \"Su\" */\n TranslationWidth[TranslationWidth[\"Short\"] = 3] = \"Short\";\n})(TranslationWidth || (TranslationWidth = {}));\n/**\n * String widths available for date-time formats.\n * The specific character widths are locale-specific.\n * Examples are given for `en-US`.\n *\n * @see {@link getLocaleDateFormat}\n * @see {@link getLocaleTimeFormat}\n * @see {@link getLocaleDateTimeFormat}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n * @publicApi\n *\n * @deprecated 18.0\n * Date locale data getters are deprecated\n */\nvar FormatWidth;\n(function (FormatWidth) {\n /**\n * For `en-US`, `'M/d/yy, h:mm a'`\n * (Example: `6/15/15, 9:03 AM`)\n */\n FormatWidth[FormatWidth[\"Short\"] = 0] = \"Short\";\n /**\n * For `en-US`, `'MMM d, y, h:mm:ss a'`\n * (Example: `Jun 15, 2015, 9:03:01 AM`)\n */\n FormatWidth[FormatWidth[\"Medium\"] = 1] = \"Medium\";\n /**\n * For `en-US`, `'MMMM d, y, h:mm:ss a z'`\n * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)\n */\n FormatWidth[FormatWidth[\"Long\"] = 2] = \"Long\";\n /**\n * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`\n * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)\n */\n FormatWidth[FormatWidth[\"Full\"] = 3] = \"Full\";\n})(FormatWidth || (FormatWidth = {}));\n// This needs to be an object literal, rather than an enum, because TypeScript 5.4+\n// doesn't allow numeric keys and we have `Infinity` and `NaN`.\n/**\n * Symbols that can be used to replace placeholders in number patterns.\n * Examples are based on `en-US` values.\n *\n * @see {@link getLocaleNumberSymbol}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated `getLocaleNumberSymbol` is deprecated\n *\n * @object-literal-as-enum\n */\nconst NumberSymbol = {\n /**\n * Decimal separator.\n * For `en-US`, the dot character.\n * Example: 2,345`.`67\n */\n Decimal: 0,\n /**\n * Grouping separator, typically for thousands.\n * For `en-US`, the comma character.\n * Example: 2`,`345.67\n */\n Group: 1,\n /**\n * List-item separator.\n * Example: \"one, two, and three\"\n */\n List: 2,\n /**\n * Sign for percentage (out of 100).\n * Example: 23.4%\n */\n PercentSign: 3,\n /**\n * Sign for positive numbers.\n * Example: +23\n */\n PlusSign: 4,\n /**\n * Sign for negative numbers.\n * Example: -23\n */\n MinusSign: 5,\n /**\n * Computer notation for exponential value (n times a power of 10).\n * Example: 1.2E3\n */\n Exponential: 6,\n /**\n * Human-readable format of exponential.\n * Example: 1.2x103\n */\n SuperscriptingExponent: 7,\n /**\n * Sign for permille (out of 1000).\n * Example: 23.4‰\n */\n PerMille: 8,\n /**\n * Infinity, can be used with plus and minus.\n * Example: ∞, +∞, -∞\n */\n Infinity: 9,\n /**\n * Not a number.\n * Example: NaN\n */\n NaN: 10,\n /**\n * Symbol used between time units.\n * Example: 10:52\n */\n TimeSeparator: 11,\n /**\n * Decimal separator for currency values (fallback to `Decimal`).\n * Example: $2,345.67\n */\n CurrencyDecimal: 12,\n /**\n * Group separator for currency values (fallback to `Group`).\n * Example: $2,345.67\n */\n CurrencyGroup: 13\n};\n/**\n * The value for each day of the week, based on the `en-US` locale\n *\n * @publicApi\n *\n * @deprecated Week locale getters are deprecated\n */\nvar WeekDay;\n(function (WeekDay) {\n WeekDay[WeekDay[\"Sunday\"] = 0] = \"Sunday\";\n WeekDay[WeekDay[\"Monday\"] = 1] = \"Monday\";\n WeekDay[WeekDay[\"Tuesday\"] = 2] = \"Tuesday\";\n WeekDay[WeekDay[\"Wednesday\"] = 3] = \"Wednesday\";\n WeekDay[WeekDay[\"Thursday\"] = 4] = \"Thursday\";\n WeekDay[WeekDay[\"Friday\"] = 5] = \"Friday\";\n WeekDay[WeekDay[\"Saturday\"] = 6] = \"Saturday\";\n})(WeekDay || (WeekDay = {}));\n/**\n * Retrieves the locale ID from the currently loaded locale.\n * The loaded locale could be, for example, a global one rather than a regional one.\n * @param locale A locale code, such as `fr-FR`.\n * @returns The locale code. For example, `fr`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * This function serves no purpose when relying on the `Intl` API.\n */\nfunction getLocaleId(locale) {\n return _findLocaleData(locale)[_LocaleDataIndex.LocaleId];\n}\n/**\n * Retrieves day period strings for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleDayPeriods(locale, formStyle, width) {\n const data = _findLocaleData(locale);\n const amPmData = [data[_LocaleDataIndex.DayPeriodsFormat], data[_LocaleDataIndex.DayPeriodsStandalone]];\n const amPm = getLastDefinedValue(amPmData, formStyle);\n return getLastDefinedValue(amPm, width);\n}\n/**\n * Retrieves days of the week for the given locale, using the Gregorian calendar.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized name strings.\n * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleDayNames(locale, formStyle, width) {\n const data = _findLocaleData(locale);\n const daysData = [data[_LocaleDataIndex.DaysFormat], data[_LocaleDataIndex.DaysStandalone]];\n const days = getLastDefinedValue(daysData, formStyle);\n return getLastDefinedValue(days, width);\n}\n/**\n * Retrieves months of the year for the given locale, using the Gregorian calendar.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized name strings.\n * For example, `[January, February, ...]` for `en-US`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleMonthNames(locale, formStyle, width) {\n const data = _findLocaleData(locale);\n const monthsData = [data[_LocaleDataIndex.MonthsFormat], data[_LocaleDataIndex.MonthsStandalone]];\n const months = getLastDefinedValue(monthsData, formStyle);\n return getLastDefinedValue(months, width);\n}\n/**\n * Retrieves Gregorian-calendar eras for the given locale.\n * @param locale A locale code for the locale format rules to use.\n * @param width The required character width.\n\n * @returns An array of localized era strings.\n * For example, `[AD, BC]` for `en-US`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleEraNames(locale, width) {\n const data = _findLocaleData(locale);\n const erasData = data[_LocaleDataIndex.Eras];\n return getLastDefinedValue(erasData, width);\n}\n/**\n * Retrieves the first day of the week for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns A day index number, using the 0-based week-day index for `en-US`\n * (Sunday = 0, Monday = 1, ...).\n * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Intl's [`getWeekInfo`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) has partial support (Chromium M99 & Safari 17).\n * You may want to rely on the following alternatives:\n * - Libraries like [`Luxon`](https://moment.github.io/luxon/#/) rely on `Intl` but fallback on the ISO 8601 definition (monday) if `getWeekInfo` is not supported.\n * - Other librairies like [`date-fns`](https://date-fns.org/), [`day.js`](https://day.js.org/en/) or [`weekstart`](https://www.npmjs.com/package/weekstart) library provide their own locale based data for the first day of the week.\n */\nfunction getLocaleFirstDayOfWeek(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.FirstDayOfWeek];\n}\n/**\n * Range of week days that are considered the week-end for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The range of day values, `[startDay, endDay]`.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Intl's [`getWeekInfo`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) has partial support (Chromium M99 & Safari 17).\n * Libraries like [`Luxon`](https://moment.github.io/luxon/#/) rely on `Intl` but fallback on the ISO 8601 definition (Saturday+Sunday) if `getWeekInfo` is not supported .\n */\nfunction getLocaleWeekEndRange(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.WeekendRange];\n}\n/**\n * Retrieves a localized date-value formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see {@link FormatWidth}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleDateFormat(locale, width) {\n const data = _findLocaleData(locale);\n return getLastDefinedValue(data[_LocaleDataIndex.DateFormat], width);\n}\n/**\n * Retrieves a localized time-value formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see {@link FormatWidth}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n\n * @publicApi\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleTimeFormat(locale, width) {\n const data = _findLocaleData(locale);\n return getLastDefinedValue(data[_LocaleDataIndex.TimeFormat], width);\n}\n/**\n * Retrieves a localized date-time formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see {@link FormatWidth}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.DateTimeFormat` for date formating instead.\n */\nfunction getLocaleDateTimeFormat(locale, width) {\n const data = _findLocaleData(locale);\n const dateTimeFormatData = data[_LocaleDataIndex.DateTimeFormat];\n return getLastDefinedValue(dateTimeFormatData, width);\n}\n/**\n * Retrieves a localized number symbol that can be used to replace placeholders in number formats.\n * @param locale The locale code.\n * @param symbol The symbol to localize. Must be one of `NumberSymbol`.\n * @returns The character for the localized symbol.\n * @see {@link NumberSymbol}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.NumberFormat` to format numbers instead.\n */\nfunction getLocaleNumberSymbol(locale, symbol) {\n const data = _findLocaleData(locale);\n const res = data[_LocaleDataIndex.NumberSymbols][symbol];\n if (typeof res === 'undefined') {\n if (symbol === NumberSymbol.CurrencyDecimal) {\n return data[_LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];\n } else if (symbol === NumberSymbol.CurrencyGroup) {\n return data[_LocaleDataIndex.NumberSymbols][NumberSymbol.Group];\n }\n }\n return res;\n}\n/**\n * Retrieves a number format for a given locale.\n *\n * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`\n * when used to format the number 12345.678 could result in \"12'345,678\". That would happen if the\n * grouping separator for your language is an apostrophe, and the decimal separator is a comma.\n *\n * Important: The characters `.` `,` `0` `#` (and others below) are special placeholders\n * that stand for the decimal separator, and so on, and are NOT real characters.\n * You must NOT \"translate\" the placeholders. For example, don't change `.` to `,` even though in\n * your language the decimal point is written with a comma. The symbols should be replaced by the\n * local equivalents, using the appropriate `NumberSymbol` for your language.\n *\n * Here are the special characters used in number patterns:\n *\n * | Symbol | Meaning |\n * |--------|---------|\n * | . | Replaced automatically by the character used for the decimal point. |\n * | , | Replaced by the \"grouping\" (thousands) separator. |\n * | 0 | Replaced by a digit (or zero if there aren't enough digits). |\n * | # | Replaced by a digit (or nothing if there aren't enough). |\n * | ¤ | Replaced by a currency symbol, such as $ or USD. |\n * | % | Marks a percent format. The % symbol may change position, but must be retained. |\n * | E | Marks a scientific format. The E symbol may change position, but must be retained. |\n * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |\n *\n * @param locale A locale code for the locale format rules to use.\n * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)\n * @returns The localized format string.\n * @see {@link NumberFormatStyle}\n * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Let `Intl.NumberFormat` determine the number format instead\n */\nfunction getLocaleNumberFormat(locale, type) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.NumberFormats][type];\n}\n/**\n * Retrieves the symbol used to represent the currency for the main country\n * corresponding to a given locale. For example, '$' for `en-US`.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The localized symbol character,\n * or `null` if the main country cannot be determined.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Use the `Intl` API to format a currency with from currency code\n */\nfunction getLocaleCurrencySymbol(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.CurrencySymbol] || null;\n}\n/**\n * Retrieves the name of the currency for the main country corresponding\n * to a given locale. For example, 'US Dollar' for `en-US`.\n * @param locale A locale code for the locale format rules to use.\n * @returns The currency name,\n * or `null` if the main country cannot be determined.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Use the `Intl` API to format a currency with from currency code\n */\nfunction getLocaleCurrencyName(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.CurrencyName] || null;\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 * @publicApi\n *\n * @deprecated We recommend you create a map of locale to ISO 4217 currency codes.\n * Time relative currency data is provided by the CLDR project. See https://www.unicode.org/cldr/charts/44/supplemental/detailed_territory_currency_information.html\n */\nfunction getLocaleCurrencyCode(locale) {\n return _getLocaleCurrencyCode(locale);\n}\n/**\n * Retrieves the currency values for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The currency values.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n */\nfunction getLocaleCurrencies(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.Currencies];\n}\n/**\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Use `Intl.PluralRules` instead\n */\nconst getLocalePluralCase = _getLocalePluralCase;\nfunction checkFullData(data) {\n if (!data[_LocaleDataIndex.ExtraData]) {\n throw new _RuntimeError(2303 /* RuntimeErrorCode.MISSING_EXTRA_LOCALE_DATA_FOR_LOCALE */, ngDevMode && `Missing extra locale data for the locale \"${data[_LocaleDataIndex.LocaleId]}\". Use \"registerLocaleData\" to load new data. See the \"I18n guide\" on angular.io to know more.`);\n }\n}\n/**\n * Retrieves locale-specific rules used to determine which day period to use\n * when more than one period is defined for a locale.\n *\n * There is a rule for each defined day period. The\n * first rule is applied to the first day period and so on.\n * Fall back to AM/PM when no rules are available.\n *\n * A rule can specify a period as time range, or as a single time value.\n *\n * This functionality is only available when you have loaded the full locale data.\n * See the [\"I18n guide\"](guide/i18n/format-data-locale).\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The rules for the locale, a single time value or array of *from-time, to-time*,\n * or null if no periods are available.\n *\n * @see {@link getLocaleExtraDayPeriods}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * Let `Intl.DateTimeFormat` determine the day period instead.\n */\nfunction getLocaleExtraDayPeriodRules(locale) {\n const data = _findLocaleData(locale);\n checkFullData(data);\n const rules = data[_LocaleDataIndex.ExtraData][2 /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */] || [];\n return rules.map(rule => {\n if (typeof rule === 'string') {\n return extractTime(rule);\n }\n return [extractTime(rule[0]), extractTime(rule[1])];\n });\n}\n/**\n * Retrieves locale-specific day periods, which indicate roughly how a day is broken up\n * in different languages.\n * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.\n *\n * This functionality is only available when you have loaded the full locale data.\n * See the [\"I18n guide\"](guide/i18n/format-data-locale).\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns The translated day-period strings.\n * @see {@link getLocaleExtraDayPeriodRules}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * To extract a day period use `Intl.DateTimeFormat` with the `dayPeriod` option instead.\n */\nfunction getLocaleExtraDayPeriods(locale, formStyle, width) {\n const data = _findLocaleData(locale);\n checkFullData(data);\n const dayPeriodsData = [data[_LocaleDataIndex.ExtraData][0 /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */], data[_LocaleDataIndex.ExtraData][1 /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */]];\n const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];\n return getLastDefinedValue(dayPeriods, width) || [];\n}\n/**\n * Retrieves the writing direction of a specified locale\n * @param locale A locale code for the locale format rules to use.\n * @publicApi\n * @returns 'rtl' or 'ltr'\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * For dates and numbers, let `Intl.DateTimeFormat()` and `Intl.NumberFormat()` determine the writing direction.\n * The `Intl` alternative [`getTextInfo`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo).\n * has only partial support (Chromium M99 & Safari 17).\n * 3rd party alternatives like [`rtl-detect`](https://www.npmjs.com/package/rtl-detect) can work around this issue.\n */\nfunction getLocaleDirection(locale) {\n const data = _findLocaleData(locale);\n return data[_LocaleDataIndex.Directionality];\n}\n/**\n * Retrieves the first value that is defined in an array, going backwards from an index position.\n *\n * To avoid repeating the same data (as when the \"format\" and \"standalone\" forms are the same)\n * add the first value to the locale data arrays, and add other values only if they are different.\n *\n * @param data The data array to retrieve from.\n * @param index A 0-based index into the array to start from.\n * @returns The value immediately before the given index position.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n */\nfunction getLastDefinedValue(data, index) {\n for (let i = index; i > -1; i--) {\n if (typeof data[i] !== 'undefined') {\n return data[i];\n }\n }\n throw new _RuntimeError(2304 /* RuntimeErrorCode.LOCALE_DATA_UNDEFINED */, ngDevMode && 'Locale data API: locale data undefined');\n}\n/**\n * Extracts the hours and minutes from a string like \"15:45\"\n */\nfunction extractTime(time) {\n const [h, m] = time.split(':');\n return {\n hours: +h,\n minutes: +m\n };\n}\n/**\n * Retrieves the currency symbol for a given currency code.\n *\n * For example, for the default `en-US` locale, the code `USD` can\n * be represented by the narrow symbol `$` or the wide symbol `US$`.\n *\n * @param code The currency code.\n * @param format The format, `wide` or `narrow`.\n * @param locale A locale code for the locale format rules to use.\n *\n * @returns The symbol, or the currency code if no symbol is available.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * You can use `Intl.NumberFormat().formatToParts()` to extract the currency symbol.\n * For example: `Intl.NumberFormat('en', {style:'currency', currency: 'USD'}).formatToParts().find(part => part.type === 'currency').value`\n * returns `$` for USD currency code in the `en` locale.\n * Note: `US$` is a currency symbol for the `en-ca` locale but not the `en-us` locale.\n */\nfunction getCurrencySymbol(code, format, locale = 'en') {\n const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];\n const symbolNarrow = currency[1 /* ɵCurrencyIndex.SymbolNarrow */];\n if (format === 'narrow' && typeof symbolNarrow === 'string') {\n return symbolNarrow;\n }\n return currency[0 /* ɵCurrencyIndex.Symbol */] || code;\n}\n// Most currencies have cents, that's why the default is 2\nconst DEFAULT_NB_OF_CURRENCY_DIGITS = 2;\n/**\n * Reports the number of decimal digits for a given currency.\n * The value depends upon the presence of cents in that particular currency.\n *\n * @param code The currency code.\n * @returns The number of decimal digits, typically 0 or 2.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n *\n * @deprecated Angular recommends relying on the `Intl` API for i18n.\n * This function should not be used anymore. Let `Intl.NumberFormat` determine the number of digits to display for the currency\n */\nfunction getNumberOfCurrencyDigits(code) {\n let digits;\n const currency = CURRENCIES_EN[code];\n if (currency) {\n digits = currency[2 /* ɵCurrencyIndex.NbOfDigits */];\n }\n return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;\n}\nconst ISO8601_DATE_REGEX = /^(\\d{4,})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n// 1 2 3 4 5 6 7 8 9 10 11\nconst NAMED_FORMATS = {};\nconst DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)/;\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a date according to locale rules.\n *\n * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)\n * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).\n * @param format The date-time components to include. See `DatePipe` for details.\n * @param locale A locale code for the locale format rules to use.\n * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`).\n * If not specified, uses host system settings.\n *\n * @returns The formatted date string.\n *\n * @see {@link DatePipe}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n */\nfunction formatDate(value, format, locale, timezone) {\n let date = toDate(value);\n const namedFormat = getNamedFormat(locale, format);\n format = namedFormat || format;\n let parts = [];\n let match;\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = parts.concat(match.slice(1));\n const part = parts.pop();\n if (!part) {\n break;\n }\n format = part;\n } else {\n parts.push(format);\n break;\n }\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertValidDateFormat(parts);\n }\n let dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone);\n }\n let text = '';\n parts.forEach(value => {\n const dateFormatter = getDateFormatter(value);\n text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value === \"''\" ? \"'\" : value.replace(/(^'|'$)/g, '').replace(/''/g, \"'\");\n });\n return text;\n}\n/**\n * Asserts that the given date format is free from common mistakes. Throws an\n * error if one is found (except for the case of all \"Y\", in which case we just\n * log a warning). This should only be called in development mode.\n */\nfunction assertValidDateFormat(parts) {\n if (parts.some(part => /^Y+$/.test(part)) && !parts.some(part => /^w+$/.test(part))) {\n // \"Y\" indicates \"week-based year\", which differs from the actual calendar\n // year for a few days around Jan 1 most years. Unless \"w\" is also\n // present (e.g. a date like \"2024-W52\") this is likely a mistake. Users\n // probably meant \"y\" instead.\n const message = `Suspicious use of week-based year \"Y\" in date pattern \"${parts.join('')}\". Did you mean to use calendar year \"y\" instead?`;\n if (parts.length === 1) {\n // NOTE: allow \"YYYY\" with just a warning, since it's used in tests.\n console.error(_formatRuntimeError(2300 /* RuntimeErrorCode.SUSPICIOUS_DATE_FORMAT */, message));\n } else {\n throw new _RuntimeError(2300 /* RuntimeErrorCode.SUSPICIOUS_DATE_FORMAT */, message);\n }\n }\n}\n/**\n * Create a new Date object with the given date value, and the time set to midnight.\n *\n * We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.\n * See: https://github.com/angular/angular/issues/40377\n *\n * Note that this function returns a Date object whose time is midnight in the current locale's\n * timezone. In the future we might want to change this to be midnight in UTC, but this would be a\n * considerable breaking change.\n */\nfunction createDate(year, month, date) {\n // The `newDate` is set to midnight (UTC) on January 1st 1970.\n // - In PST this will be December 31st 1969 at 4pm.\n // - In GMT this will be January 1st 1970 at 1am.\n // Note that they even have different years, dates and months!\n const newDate = new Date(0);\n // `setFullYear()` allows years like 0001 to be set correctly. This function does not\n // change the internal time of the date.\n // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).\n // - In PST this will now be September 20, 2019 at 4pm\n // - In GMT this will now be September 20, 2019 at 1am\n newDate.setFullYear(year, month, date);\n // We want the final date to be at local midnight, so we reset the time.\n // - In PST this will now be September 20, 2019 at 12am\n // - In GMT this will now be September 20, 2019 at 12am\n newDate.setHours(0, 0, 0);\n return newDate;\n}\nfunction getNamedFormat(locale, format) {\n const localeId = getLocaleId(locale);\n NAMED_FORMATS[localeId] ??= {};\n if (NAMED_FORMATS[localeId][format]) {\n return NAMED_FORMATS[localeId][format];\n }\n let formatValue = '';\n switch (format) {\n case 'shortDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Short);\n break;\n case 'mediumDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);\n break;\n case 'longDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Long);\n break;\n case 'fullDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Full);\n break;\n case 'shortTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);\n break;\n case 'mediumTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);\n break;\n case 'longTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);\n break;\n case 'fullTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);\n break;\n case 'short':\n const shortTime = getNamedFormat(locale, 'shortTime');\n const shortDate = getNamedFormat(locale, 'shortDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);\n break;\n case 'medium':\n const mediumTime = getNamedFormat(locale, 'mediumTime');\n const mediumDate = getNamedFormat(locale, 'mediumDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);\n break;\n case 'long':\n const longTime = getNamedFormat(locale, 'longTime');\n const longDate = getNamedFormat(locale, 'longDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);\n break;\n case 'full':\n const fullTime = getNamedFormat(locale, 'fullTime');\n const fullDate = getNamedFormat(locale, 'fullDate');\n formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);\n break;\n }\n if (formatValue) {\n NAMED_FORMATS[localeId][format] = formatValue;\n }\n return formatValue;\n}\nfunction formatDateTime(str, opt_values) {\n if (opt_values) {\n str = str.replace(/\\{([^}]+)}/g, function (match, key) {\n return opt_values != null && key in opt_values ? opt_values[key] : match;\n });\n }\n return str;\n}\nfunction padNumber(num, digits, minusSign = '-', trim, negWrap) {\n let neg = '';\n if (num < 0 || negWrap && num <= 0) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = minusSign;\n }\n }\n let strNum = String(num);\n while (strNum.length < digits) {\n strNum = '0' + strNum;\n }\n if (trim) {\n strNum = strNum.slice(strNum.length - digits);\n }\n return neg + strNum;\n}\nfunction formatFractionalSeconds(milliseconds, digits) {\n const strMs = padNumber(milliseconds, 3);\n return strMs.substring(0, digits);\n}\n/**\n * Returns a date formatter that transforms a date into its locale digit representation\n */\nfunction dateGetter(name, size, offset = 0, trim = false, negWrap = false) {\n return function (date, locale) {\n let part = getDatePart(name, date);\n if (offset > 0 || part > -offset) {\n part += offset;\n }\n if (name === 3 /* DateType.Hours */) {\n if (part === 0 && offset === -12) {\n part = 12;\n }\n } else if (name === 6 /* DateType.FractionalSeconds */) {\n return formatFractionalSeconds(part, size);\n }\n const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n return padNumber(part, size, localeMinus, trim, negWrap);\n };\n}\nfunction getDatePart(part, date) {\n switch (part) {\n case 0 /* DateType.FullYear */:\n return date.getFullYear();\n case 1 /* DateType.Month */:\n return date.getMonth();\n case 2 /* DateType.Date */:\n return date.getDate();\n case 3 /* DateType.Hours */:\n return date.getHours();\n case 4 /* DateType.Minutes */:\n return date.getMinutes();\n case 5 /* DateType.Seconds */:\n return date.getSeconds();\n case 6 /* DateType.FractionalSeconds */:\n return date.getMilliseconds();\n case 7 /* DateType.Day */:\n return date.getDay();\n default:\n throw new _RuntimeError(2301 /* RuntimeErrorCode.UNKNOWN_DATE_TYPE_VALUE */, ngDevMode && `Unknown DateType value \"${part}\".`);\n }\n}\n/**\n * Returns a date formatter that transforms a date into its locale string representation\n */\nfunction dateStrGetter(name, width, form = FormStyle.Format, extended = false) {\n return function (date, locale) {\n return getDateTranslation(date, locale, name, width, form, extended);\n };\n}\n/**\n * Returns the locale translation of a date for a given form, type and width\n */\nfunction getDateTranslation(date, locale, name, width, form, extended) {\n switch (name) {\n case 2 /* TranslationType.Months */:\n return getLocaleMonthNames(locale, form, width)[date.getMonth()];\n case 1 /* TranslationType.Days */:\n return getLocaleDayNames(locale, form, width)[date.getDay()];\n case 0 /* TranslationType.DayPeriods */:\n const currentHours = date.getHours();\n const currentMinutes = date.getMinutes();\n if (extended) {\n const rules = getLocaleExtraDayPeriodRules(locale);\n const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);\n const index = rules.findIndex(rule => {\n if (Array.isArray(rule)) {\n // morning, afternoon, evening, night\n const [from, to] = rule;\n const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;\n const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;\n // We must account for normal rules that span a period during the day (e.g. 6am-9am)\n // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g.\n // 10pm - 5am) where `from` is greater (later!) than `to`.\n //\n // In the first case the current time must be BOTH after `from` AND before `to`\n // (e.g. 8am is after 6am AND before 10am).\n //\n // In the second case the current time must be EITHER after `from` OR before `to`\n // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is\n // after 10pm).\n if (from.hours < to.hours) {\n if (afterFrom && beforeTo) {\n return true;\n }\n } else if (afterFrom || beforeTo) {\n return true;\n }\n } else {\n // noon or midnight\n if (rule.hours === currentHours && rule.minutes === currentMinutes) {\n return true;\n }\n }\n return false;\n });\n if (index !== -1) {\n return dayPeriods[index];\n }\n }\n // if no rules for the day periods, we use am/pm by default\n return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];\n case 3 /* TranslationType.Eras */:\n return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];\n default:\n // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n // However Closure Compiler does not understand that and reports an error in typed mode.\n // The `throw new Error` below works around the problem, and the unexpected: never variable\n // makes sure tsc still checks this code is unreachable.\n const unexpected = name;\n throw new _RuntimeError(2302 /* RuntimeErrorCode.UNEXPECTED_TRANSLATION_TYPE */, ngDevMode && `unexpected translation type ${unexpected}`);\n }\n}\n/**\n * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or\n * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,\n * extended = +04:30)\n */\nfunction timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case 0 /* ZoneWidth.Short */:\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);\n case 1 /* ZoneWidth.ShortGMT */:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign);\n case 2 /* ZoneWidth.Long */:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n case 3 /* ZoneWidth.Extended */:\n if (offset === 0) {\n return 'Z';\n } else {\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new _RuntimeError(2302 /* RuntimeErrorCode.UNKNOWN_ZONE_WIDTH */, ngDevMode && `Unknown zone width \"${width}\"`);\n }\n };\n}\nconst JANUARY = 0;\nconst THURSDAY = 4;\nfunction getFirstThursdayOfYear(year) {\n const firstDayOfYear = createDate(year, JANUARY, 1).getDay();\n return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);\n}\n/**\n * ISO Week starts on day 1 (Monday) and ends with day 0 (Sunday)\n */\nfunction getThursdayThisIsoWeek(datetime) {\n // getDay returns 0-6 range with sunday as 0.\n const currentDay = datetime.getDay();\n // On a Sunday, read the previous Thursday since ISO weeks start on Monday.\n const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;\n return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);\n}\nfunction weekGetter(size, monthBased = false) {\n return function (date, locale) {\n let result;\n if (monthBased) {\n const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;\n const today = date.getDate();\n result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);\n } else {\n const thisThurs = getThursdayThisIsoWeek(date);\n // Some days of a year are part of next year according to ISO 8601.\n // Compute the firstThurs from the year of this week's Thursday\n const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());\n const diff = thisThurs.getTime() - firstThurs.getTime();\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n }\n return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n };\n}\n/**\n * Returns a date formatter that provides the week-numbering year for the input date.\n */\nfunction weekNumberingYearGetter(size, trim = false) {\n return function (date, locale) {\n const thisThurs = getThursdayThisIsoWeek(date);\n const weekNumberingYear = thisThurs.getFullYear();\n return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);\n };\n}\nconst DATE_FORMATS = {};\n// Based on CLDR formats:\n// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n// See also explanations: http://cldr.unicode.org/translation/date-time\n// TODO(ocombe): support all missing cldr formats: U, Q, D, F, e, j, J, C, A, v, V, X, x\nfunction getDateFormatter(format) {\n if (DATE_FORMATS[format]) {\n return DATE_FORMATS[format];\n }\n let formatter;\n switch (format) {\n // Era name (AD/BC)\n case 'G':\n case 'GG':\n case 'GGG':\n formatter = dateStrGetter(3 /* TranslationType.Eras */, TranslationWidth.Abbreviated);\n break;\n case 'GGGG':\n formatter = dateStrGetter(3 /* TranslationType.Eras */, TranslationWidth.Wide);\n break;\n case 'GGGGG':\n formatter = dateStrGetter(3 /* TranslationType.Eras */, TranslationWidth.Narrow);\n break;\n // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'y':\n formatter = dateGetter(0 /* DateType.FullYear */, 1, 0, false, true);\n break;\n // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yy':\n formatter = dateGetter(0 /* DateType.FullYear */, 2, 0, true, true);\n break;\n // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yyy':\n formatter = dateGetter(0 /* DateType.FullYear */, 3, 0, false, true);\n break;\n // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'yyyy':\n formatter = dateGetter(0 /* DateType.FullYear */, 4, 0, false, true);\n break;\n // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'Y':\n formatter = weekNumberingYearGetter(1);\n break;\n // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD\n // 2010 => 10)\n case 'YY':\n formatter = weekNumberingYearGetter(2, true);\n break;\n // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD\n // 2010 => 2010)\n case 'YYY':\n formatter = weekNumberingYearGetter(3);\n break;\n // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'YYYY':\n formatter = weekNumberingYearGetter(4);\n break;\n // Month of the year (1-12), numeric\n case 'M':\n case 'L':\n formatter = dateGetter(1 /* DateType.Month */, 1, 1);\n break;\n case 'MM':\n case 'LL':\n formatter = dateGetter(1 /* DateType.Month */, 2, 1);\n break;\n // Month of the year (January, ...), string, format\n case 'MMM':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Abbreviated);\n break;\n case 'MMMM':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Wide);\n break;\n case 'MMMMM':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Narrow);\n break;\n // Month of the year (January, ...), string, standalone\n case 'LLL':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'LLLL':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'LLLLL':\n formatter = dateStrGetter(2 /* TranslationType.Months */, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n // Week of the year (1, ... 52)\n case 'w':\n formatter = weekGetter(1);\n break;\n case 'ww':\n formatter = weekGetter(2);\n break;\n // Week of the month (1, ...)\n case 'W':\n formatter = weekGetter(1, true);\n break;\n // Day of the month (1-31)\n case 'd':\n formatter = dateGetter(2 /* DateType.Date */, 1);\n break;\n case 'dd':\n formatter = dateGetter(2 /* DateType.Date */, 2);\n break;\n // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)\n case 'c':\n case 'cc':\n formatter = dateGetter(7 /* DateType.Day */, 1);\n break;\n case 'ccc':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'cccc':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'ccccc':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n case 'cccccc':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Short, FormStyle.Standalone);\n break;\n // Day of the Week\n case 'E':\n case 'EE':\n case 'EEE':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Abbreviated);\n break;\n case 'EEEE':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Wide);\n break;\n case 'EEEEE':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Narrow);\n break;\n case 'EEEEEE':\n formatter = dateStrGetter(1 /* TranslationType.Days */, TranslationWidth.Short);\n break;\n // Generic period of the day (am-pm)\n case 'a':\n case 'aa':\n case 'aaa':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Abbreviated);\n break;\n case 'aaaa':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Wide);\n break;\n case 'aaaaa':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Narrow);\n break;\n // Extended period of the day (midnight, at night, ...), standalone\n case 'b':\n case 'bb':\n case 'bbb':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Abbreviated, FormStyle.Standalone, true);\n break;\n case 'bbbb':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Wide, FormStyle.Standalone, true);\n break;\n case 'bbbbb':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Narrow, FormStyle.Standalone, true);\n break;\n // Extended period of the day (midnight, night, ...), standalone\n case 'B':\n case 'BB':\n case 'BBB':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Abbreviated, FormStyle.Format, true);\n break;\n case 'BBBB':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Wide, FormStyle.Format, true);\n break;\n case 'BBBBB':\n formatter = dateStrGetter(0 /* TranslationType.DayPeriods */, TranslationWidth.Narrow, FormStyle.Format, true);\n break;\n // Hour in AM/PM, (1-12)\n case 'h':\n formatter = dateGetter(3 /* DateType.Hours */, 1, -12);\n break;\n case 'hh':\n formatter = dateGetter(3 /* DateType.Hours */, 2, -12);\n break;\n // Hour of the day (0-23)\n case 'H':\n formatter = dateGetter(3 /* DateType.Hours */, 1);\n break;\n // Hour in day, padded (00-23)\n case 'HH':\n formatter = dateGetter(3 /* DateType.Hours */, 2);\n break;\n // Minute of the hour (0-59)\n case 'm':\n formatter = dateGetter(4 /* DateType.Minutes */, 1);\n break;\n case 'mm':\n formatter = dateGetter(4 /* DateType.Minutes */, 2);\n break;\n // Second of the minute (0-59)\n case 's':\n formatter = dateGetter(5 /* DateType.Seconds */, 1);\n break;\n case 'ss':\n formatter = dateGetter(5 /* DateType.Seconds */, 2);\n break;\n // Fractional second\n case 'S':\n formatter = dateGetter(6 /* DateType.FractionalSeconds */, 1);\n break;\n case 'SS':\n formatter = dateGetter(6 /* DateType.FractionalSeconds */, 2);\n break;\n case 'SSS':\n formatter = dateGetter(6 /* DateType.FractionalSeconds */, 3);\n break;\n // Timezone ISO8601 short format (-0430)\n case 'Z':\n case 'ZZ':\n case 'ZZZ':\n formatter = timeZoneGetter(0 /* ZoneWidth.Short */);\n break;\n // Timezone ISO8601 extended format (-04:30)\n case 'ZZZZZ':\n formatter = timeZoneGetter(3 /* ZoneWidth.Extended */);\n break;\n // Timezone GMT short format (GMT+4)\n case 'O':\n case 'OO':\n case 'OOO':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'z':\n case 'zz':\n case 'zzz':\n formatter = timeZoneGetter(1 /* ZoneWidth.ShortGMT */);\n break;\n // Timezone GMT long format (GMT+0430)\n case 'OOOO':\n case 'ZZZZ':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'zzzz':\n formatter = timeZoneGetter(2 /* ZoneWidth.Long */);\n break;\n default:\n return null;\n }\n DATE_FORMATS[format] = formatter;\n return formatter;\n}\nfunction timezoneToOffset(timezone, fallback) {\n // Support: IE 11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(/:/g, '');\n const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n const reverseValue = -1;\n const dateTimezoneOffset = date.getTimezoneOffset();\n const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));\n}\n/**\n * Converts a value to date.\n *\n * Supported input formats:\n * - `Date`\n * - number: timestamp\n * - string: numeric (e.g. \"1234\"), ISO and date strings in a format supported by\n * [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\n * Note: ISO strings without time return a date without timeoffset.\n *\n * Throws if unable to convert to a date.\n */\nfunction toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map(val => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new _RuntimeError(2302 /* RuntimeErrorCode.INVALID_TO_DATE_CONVERSION */, ngDevMode && `Unable to convert \"${value}\" into a date`);\n }\n return date;\n}\n/**\n * Converts a date in ISO8601 to a Date.\n * Used instead of `Date.parse` because of browser discrepancies.\n */\nfunction isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}\nfunction isDate(value) {\n return value instanceof Date && !isNaN(value.valueOf());\n}\nconst NUMBER_FORMAT_REGEXP = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\nconst MAX_DIGITS = 22;\nconst DECIMAL_SEP = '.';\nconst ZERO_CHAR = '0';\nconst PATTERN_SEP = ';';\nconst GROUP_SEP = ',';\nconst DIGIT_CHAR = '#';\nconst CURRENCY_CHAR = '¤';\nconst PERCENT_CHAR = '%';\n/**\n * Transforms a number to a locale string based on a style and a format.\n */\nfunction formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {\n let formattedText = '';\n let isZero = false;\n if (!isFinite(value)) {\n formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);\n } else {\n let parsedNumber = parseNumber(value);\n if (isPercent) {\n parsedNumber = toPercent(parsedNumber);\n }\n let minInt = pattern.minInt;\n let minFraction = pattern.minFrac;\n let maxFraction = pattern.maxFrac;\n if (digitsInfo) {\n const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);\n if (parts === null) {\n throw new _RuntimeError(2306 /* RuntimeErrorCode.INVALID_DIGIT_INFO */, ngDevMode && `${digitsInfo} is not a valid digit info`);\n }\n const minIntPart = parts[1];\n const minFractionPart = parts[3];\n const maxFractionPart = parts[5];\n if (minIntPart != null) {\n minInt = parseIntAutoRadix(minIntPart);\n }\n if (minFractionPart != null) {\n minFraction = parseIntAutoRadix(minFractionPart);\n }\n if (maxFractionPart != null) {\n maxFraction = parseIntAutoRadix(maxFractionPart);\n } else if (minFractionPart != null && minFraction > maxFraction) {\n maxFraction = minFraction;\n }\n }\n roundNumber(parsedNumber, minFraction, maxFraction);\n let digits = parsedNumber.digits;\n let integerLen = parsedNumber.integerLen;\n const exponent = parsedNumber.exponent;\n let decimals = [];\n isZero = digits.every(d => !d);\n // pad zeros for small numbers\n for (; integerLen < minInt; integerLen++) {\n digits.unshift(0);\n }\n // pad zeros for small numbers\n for (; integerLen < 0; integerLen++) {\n digits.unshift(0);\n }\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n } else {\n decimals = digits;\n digits = [0];\n }\n // format the integer digits with grouping separators\n const groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));\n // append the decimal digits\n if (decimals.length) {\n formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');\n }\n if (exponent) {\n formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;\n }\n }\n if (value < 0 && !isZero) {\n formattedText = pattern.negPre + formattedText + pattern.negSuf;\n } else {\n formattedText = pattern.posPre + formattedText + pattern.posSuf;\n }\n return formattedText;\n}\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a number as currency using locale rules.\n *\n * @param value The number to format.\n * @param locale A locale code for the locale format rules to use.\n * @param currency A string containing the currency symbol or its name,\n * such as \"$\" or \"Canadian Dollar\". Used in output string, but does not affect the operation\n * of the function.\n * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)\n * currency code, such as `USD` for the US dollar and `EUR` for the euro.\n * Used to determine the number of digits in the decimal part.\n * @param digitsInfo Decimal representation options, specified by a string in the following format:\n * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n *\n * @returns The formatted currency value.\n *\n * @see {@link formatNumber}\n * @see {@link DecimalPipe}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n */\nfunction formatCurrency(value, locale, currency, currencyCode, digitsInfo) {\n const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);\n const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);\n pattern.maxFrac = pattern.minFrac;\n const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);\n return res.replace(CURRENCY_CHAR, currency)\n // if we have 2 time the currency character, the second one is ignored\n .replace(CURRENCY_CHAR, '')\n // If there is a spacing between currency character and the value and\n // the currency character is suppressed by passing an empty string, the\n // spacing character would remain as part of the string. Then we\n // should remove it.\n .trim();\n}\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a number as a percentage according to locale rules.\n *\n * @param value The number to format.\n * @param locale A locale code for the locale format rules to use.\n * @param digitsInfo Decimal representation options, specified by a string in the following format:\n * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n *\n * @returns The formatted percentage value.\n *\n * @see {@link formatNumber}\n * @see {@link DecimalPipe}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n * @publicApi\n *\n */\nfunction formatPercent(value, locale, digitsInfo) {\n const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);\n const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);\n return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));\n}\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a number as text, with group sizing, separator, and other\n * parameters based on the locale.\n *\n * @param value The number to format.\n * @param locale A locale code for the locale format rules to use.\n * @param digitsInfo Decimal representation options, specified by a string in the following format:\n * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.\n *\n * @returns The formatted text string.\n * @see [Internationalization (i18n) Guide](guide/i18n)\n *\n * @publicApi\n */\nfunction formatNumber(value, locale, digitsInfo) {\n const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);\n const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);\n}\nfunction parseNumberFormat(format, minusSign = '-') {\n const p = {\n minInt: 1,\n minFrac: 0,\n maxFrac: 0,\n posPre: '',\n posSuf: '',\n negPre: '',\n negSuf: '',\n gSize: 0,\n lgSize: 0\n };\n const patternParts = format.split(PATTERN_SEP);\n const positive = patternParts[0];\n const negative = patternParts[1];\n const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)],\n integer = positiveParts[0],\n fraction = positiveParts[1] || '';\n p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));\n for (let i = 0; i < fraction.length; i++) {\n const ch = fraction.charAt(i);\n if (ch === ZERO_CHAR) {\n p.minFrac = p.maxFrac = i + 1;\n } else if (ch === DIGIT_CHAR) {\n p.maxFrac = i + 1;\n } else {\n p.posSuf += ch;\n }\n }\n const groups = integer.split(GROUP_SEP);\n p.gSize = groups[1] ? groups[1].length : 0;\n p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;\n if (negative) {\n const trunkLen = positive.length - p.posPre.length - p.posSuf.length,\n pos = negative.indexOf(DIGIT_CHAR);\n p.negPre = negative.substring(0, pos).replace(/'/g, '');\n p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, '');\n } else {\n p.negPre = minusSign + p.posPre;\n p.negSuf = p.posSuf;\n }\n return p;\n}\n// Transforms a parsed number into a percentage by multiplying it by 100\nfunction toPercent(parsedNumber) {\n // if the number is 0, don't do anything\n if (parsedNumber.digits[0] === 0) {\n return parsedNumber;\n }\n // Getting the current number of decimals\n const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;\n if (parsedNumber.exponent) {\n parsedNumber.exponent += 2;\n } else {\n if (fractionLen === 0) {\n parsedNumber.digits.push(0, 0);\n } else if (fractionLen === 1) {\n parsedNumber.digits.push(0);\n }\n parsedNumber.integerLen += 2;\n }\n return parsedNumber;\n}\n/**\n * Parses a number.\n * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/\n */\nfunction parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0,\n digits,\n integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0) integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return {\n digits,\n exponent,\n integerLen\n };\n}\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changes the parsedNumber in-place\n */\nfunction roundNumber(parsedNumber, minFrac, maxFrac) {\n if (minFrac > maxFrac) {\n throw new _RuntimeError(2307 /* RuntimeErrorCode.INVALID_NUMBER_OF_DIGITS_AFTER_FRACTION */, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);\n }\n let digits = parsedNumber.digits;\n let fractionLen = digits.length - parsedNumber.integerLen;\n const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);\n // The index of the digit to where rounding is to occur\n let roundAt = fractionSize + parsedNumber.integerLen;\n let digit = digits[roundAt];\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.integerLen, roundAt));\n // Set non-fractional digits beyond `roundAt` to 0\n for (let j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.integerLen = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (let i = 1; i < roundAt; i++) digits[i] = 0;\n }\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (let k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.integerLen++;\n }\n digits.unshift(1);\n parsedNumber.integerLen++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n let dropTrailingZeros = fractionSize !== 0;\n // Minimal length = nb of decimals required + current nb of integers\n // Any number besides that is optional and can be removed if it's a trailing 0\n const minLen = minFrac + parsedNumber.integerLen;\n // Do any carrying, e.g. a digit was rounded up to 10\n const carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d < 10 ? d : d - 10; // d % 10\n if (dropTrailingZeros) {\n // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)\n if (digits[i] === 0 && i >= minLen) {\n digits.pop();\n } else {\n dropTrailingZeros = false;\n }\n }\n return d >= 10 ? 1 : 0; // Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.integerLen++;\n }\n}\nfunction parseIntAutoRadix(text) {\n const result = parseInt(text);\n if (isNaN(result)) {\n throw new _RuntimeError(2305 /* RuntimeErrorCode.INVALID_INTEGER_LITERAL */, ngDevMode && 'Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n\n/**\n * @publicApi\n */\nclass NgLocalization {\n static ɵfac = function NgLocalization_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgLocalization)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NgLocalization,\n factory: function NgLocalization_Factory(__ngFactoryType__) {\n let __ngConditionalFactory__ = null;\n if (__ngFactoryType__) {\n __ngConditionalFactory__ = new __ngFactoryType__();\n } else {\n __ngConditionalFactory__ = (locale => new NgLocaleLocalization(locale))(i0.ɵɵinject(LOCALE_ID));\n }\n return __ngConditionalFactory__;\n },\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgLocalization, [{\n type: Injectable,\n args: [{\n providedIn: 'root',\n useFactory: locale => new NgLocaleLocalization(locale),\n deps: [LOCALE_ID]\n }]\n }], null, null);\n})();\n/**\n * Returns the plural category for a given value.\n * - \"=value\" when the case exists,\n * - the plural category otherwise\n */\nfunction getPluralCategory(value, cases, ngLocalization, locale) {\n let key = `=${value}`;\n if (cases.indexOf(key) > -1) {\n return key;\n }\n key = ngLocalization.getPluralCategory(value, locale);\n if (cases.indexOf(key) > -1) {\n return key;\n }\n if (cases.indexOf('other') > -1) {\n return 'other';\n }\n throw new _RuntimeError(2308 /* RuntimeErrorCode.NO_PLURAL_MESSAGE_FOUND */, ngDevMode && `No plural message found for value \"${value}\"`);\n}\n/**\n * Returns the plural case based on the locale\n *\n * @publicApi\n */\nclass NgLocaleLocalization extends NgLocalization {\n locale;\n constructor(locale) {\n super();\n this.locale = locale;\n }\n getPluralCategory(value, locale) {\n const plural = getLocalePluralCase(locale || this.locale)(value);\n switch (plural) {\n case Plural.Zero:\n return 'zero';\n case Plural.One:\n return 'one';\n case Plural.Two:\n return 'two';\n case Plural.Few:\n return 'few';\n case Plural.Many:\n return 'many';\n default:\n return 'other';\n }\n }\n static ɵfac = function NgLocaleLocalization_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgLocaleLocalization)(i0.ɵɵinject(LOCALE_ID));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NgLocaleLocalization,\n factory: NgLocaleLocalization.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgLocaleLocalization, [{\n type: Injectable\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }], null);\n})();\nconst WS_REGEXP = /\\s+/;\nconst EMPTY_ARRAY = [];\n/**\n * @ngModule CommonModule\n *\n * @usageNotes\n * ```html\n * ...\n *\n * ...\n * ```\n *\n * For more simple use cases you can use the [class bindings](/guide/templates/binding#css-class-and-style-property-bindings) directly.\n * It doesn't require importing a directive.\n *\n * ```html\n * ...\n *\n * ...\n *\n * ...\n *\n * ...\n * ```\n * @description\n *\n * Adds and removes CSS classes on an HTML element.\n *\n * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n * - `string` - the CSS classes listed in the string (space delimited) are added,\n * - `Array` - the CSS classes declared as Array elements are added,\n * - `Object` - keys are CSS classes that get added when the expression given in the value\n * evaluates to a truthy value, otherwise they are removed.\n *\n *\n * @see [Class bindings](/guide/templates/binding#css-class-and-style-property-bindings)\n *\n * @publicApi\n */\nclass NgClass {\n _ngEl;\n _renderer;\n initialClasses = EMPTY_ARRAY;\n rawClass;\n stateMap = new Map();\n constructor(_ngEl, _renderer) {\n this._ngEl = _ngEl;\n this._renderer = _renderer;\n }\n set klass(value) {\n this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;\n }\n set ngClass(value) {\n this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value;\n }\n /*\n The NgClass directive uses the custom change detection algorithm for its inputs. The custom\n algorithm is necessary since inputs are represented as complex object or arrays that need to be\n deeply-compared.\n This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance\n might negatively impact runtime performance of the entire change detection cycle. The design of\n this algorithm is making sure that:\n - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when\n needed), even if references to bound objects change;\n - there is no memory allocation if nothing changes (even relatively modest memory allocation\n during the change detection cycle can result in GC pauses for some of the CD cycles).\n The algorithm works by iterating over the set of bound classes, staring with [class] binding and\n then going over [ngClass] binding. For each CSS class name:\n - check if it was seen before (this information is tracked in the state map) and if its value\n changed;\n - mark it as \"touched\" - names that are not marked are not present in the latest set of binding\n and we can remove such class name from the internal data structures;\n After iteration over all the CSS class names we've got data structure with all the information\n necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush\n changes to the DOM and reset internal data structures so those are ready for the next change\n detection cycle.\n */\n ngDoCheck() {\n // classes from the [class] binding\n for (const klass of this.initialClasses) {\n this._updateState(klass, true);\n }\n // classes from the [ngClass] binding\n const rawClass = this.rawClass;\n if (Array.isArray(rawClass) || rawClass instanceof Set) {\n for (const klass of rawClass) {\n this._updateState(klass, true);\n }\n } else if (rawClass != null) {\n for (const klass of Object.keys(rawClass)) {\n this._updateState(klass, Boolean(rawClass[klass]));\n }\n }\n this._applyStateDiff();\n }\n _updateState(klass, nextEnabled) {\n const state = this.stateMap.get(klass);\n if (state !== undefined) {\n if (state.enabled !== nextEnabled) {\n state.changed = true;\n state.enabled = nextEnabled;\n }\n state.touched = true;\n } else {\n this.stateMap.set(klass, {\n enabled: nextEnabled,\n changed: true,\n touched: true\n });\n }\n }\n _applyStateDiff() {\n for (const stateEntry of this.stateMap) {\n const klass = stateEntry[0];\n const state = stateEntry[1];\n if (state.changed) {\n this._toggleClass(klass, state.enabled);\n state.changed = false;\n } else if (!state.touched) {\n // A class that was previously active got removed from the new collection of classes -\n // remove from the DOM as well.\n if (state.enabled) {\n this._toggleClass(klass, false);\n }\n this.stateMap.delete(klass);\n }\n state.touched = false;\n }\n }\n _toggleClass(klass, enabled) {\n if (ngDevMode) {\n if (typeof klass !== 'string') {\n throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${_stringify(klass)}`);\n }\n }\n klass = klass.trim();\n if (klass.length > 0) {\n klass.split(WS_REGEXP).forEach(klass => {\n if (enabled) {\n this._renderer.addClass(this._ngEl.nativeElement, klass);\n } else {\n this._renderer.removeClass(this._ngEl.nativeElement, klass);\n }\n });\n }\n }\n static ɵfac = function NgClass_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgClass)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgClass,\n selectors: [[\"\", \"ngClass\", \"\"]],\n inputs: {\n klass: [0, \"class\", \"klass\"],\n ngClass: \"ngClass\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgClass, [{\n type: Directive,\n args: [{\n selector: '[ngClass]'\n }]\n }], () => [{\n type: i0.ElementRef\n }, {\n type: i0.Renderer2\n }], {\n klass: [{\n type: Input,\n args: ['class']\n }],\n ngClass: [{\n type: Input,\n args: ['ngClass']\n }]\n });\n})();\n\n/**\n * Instantiates a {@link /api/core/Component Component} type and inserts its Host View into the current View.\n * `NgComponentOutlet` provides a declarative approach for dynamic component creation.\n *\n * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and\n * any existing component will be destroyed.\n *\n * @usageNotes\n *\n * ### Fine tune control\n *\n * You can control the component creation process by using the following optional attributes:\n *\n * * `ngComponentOutletInputs`: Optional component inputs object, which will be bind to the\n * component.\n *\n * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for\n * the Component. Defaults to the injector of the current view container.\n *\n * * `ngComponentOutletEnvironmentInjector`: Optional custom {@link EnvironmentInjector} which will\n * provide the component's environment.\n *\n * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content\n * section of the component, if it exists.\n *\n * * `ngComponentOutletNgModule`: Optional NgModule class reference to allow loading another\n * module dynamically, then loading a component from that module.\n *\n * * `ngComponentOutletNgModuleFactory`: Deprecated config option that allows providing optional\n * NgModule factory to allow loading another module dynamically, then loading a component from that\n * module. Use `ngComponentOutletNgModule` instead.\n *\n * ### Syntax\n *\n * Simple\n * ```html\n * \n * ```\n *\n * With inputs\n * ```html\n * \n * \n * ```\n *\n * Customized injector/content\n * ```html\n * \n * \n * ```\n *\n * Customized NgModule reference\n * ```html\n * \n * \n * ```\n *\n * ### A simple example\n *\n * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}\n *\n * A more complete example with additional options:\n *\n * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}\n *\n * @publicApi\n * @ngModule CommonModule\n */\nclass NgComponentOutlet {\n _viewContainerRef;\n // TODO(crisbeto): this should be `Type`, but doing so broke a few\n // targets in a TGP so we need to do it in a major version.\n /** Component that should be rendered in the outlet. */\n ngComponentOutlet = null;\n ngComponentOutletInputs;\n ngComponentOutletInjector;\n ngComponentOutletEnvironmentInjector;\n ngComponentOutletContent;\n ngComponentOutletNgModule;\n /**\n * @deprecated This input is deprecated, use `ngComponentOutletNgModule` instead.\n */\n ngComponentOutletNgModuleFactory;\n _componentRef;\n _moduleRef;\n /**\n * A helper data structure that allows us to track inputs that were part of the\n * ngComponentOutletInputs expression. Tracking inputs is necessary for proper removal of ones\n * that are no longer referenced.\n */\n _inputsUsed = new Map();\n /**\n * Gets the instance of the currently-rendered component.\n * Will be null if no component has been rendered.\n */\n get componentInstance() {\n return this._componentRef?.instance ?? null;\n }\n constructor(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n }\n _needToReCreateNgModuleInstance(changes) {\n // Note: square brackets property accessor is safe for Closure compiler optimizations (the\n // `changes` argument of the `ngOnChanges` lifecycle hook retains the names of the fields that\n // were changed).\n return changes['ngComponentOutletNgModule'] !== undefined || changes['ngComponentOutletNgModuleFactory'] !== undefined;\n }\n _needToReCreateComponentInstance(changes) {\n // Note: square brackets property accessor is safe for Closure compiler optimizations (the\n // `changes` argument of the `ngOnChanges` lifecycle hook retains the names of the fields that\n // were changed).\n return changes['ngComponentOutlet'] !== undefined || changes['ngComponentOutletContent'] !== undefined || changes['ngComponentOutletInjector'] !== undefined || changes['ngComponentOutletEnvironmentInjector'] !== undefined || this._needToReCreateNgModuleInstance(changes);\n }\n /** @docs-private */\n ngOnChanges(changes) {\n if (this._needToReCreateComponentInstance(changes)) {\n this._viewContainerRef.clear();\n this._inputsUsed.clear();\n this._componentRef = undefined;\n if (this.ngComponentOutlet) {\n const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;\n if (this._needToReCreateNgModuleInstance(changes)) {\n this._moduleRef?.destroy();\n if (this.ngComponentOutletNgModule) {\n this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));\n } else if (this.ngComponentOutletNgModuleFactory) {\n this._moduleRef = this.ngComponentOutletNgModuleFactory.create(getParentInjector(injector));\n } else {\n this._moduleRef = undefined;\n }\n }\n this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {\n injector,\n ngModuleRef: this._moduleRef,\n projectableNodes: this.ngComponentOutletContent,\n environmentInjector: this.ngComponentOutletEnvironmentInjector\n });\n }\n }\n }\n /** @docs-private */\n ngDoCheck() {\n if (this._componentRef) {\n if (this.ngComponentOutletInputs) {\n for (const inputName of Object.keys(this.ngComponentOutletInputs)) {\n this._inputsUsed.set(inputName, true);\n }\n }\n this._applyInputStateDiff(this._componentRef);\n }\n }\n /** @docs-private */\n ngOnDestroy() {\n this._moduleRef?.destroy();\n }\n _applyInputStateDiff(componentRef) {\n for (const [inputName, touched] of this._inputsUsed) {\n if (!touched) {\n // The input that was previously active no longer exists and needs to be set to undefined.\n componentRef.setInput(inputName, undefined);\n this._inputsUsed.delete(inputName);\n } else {\n // Since touched is true, it can be asserted that the inputs object is not empty.\n componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);\n this._inputsUsed.set(inputName, false);\n }\n }\n }\n static ɵfac = function NgComponentOutlet_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgComponentOutlet)(i0.ɵɵdirectiveInject(i0.ViewContainerRef));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgComponentOutlet,\n selectors: [[\"\", \"ngComponentOutlet\", \"\"]],\n inputs: {\n ngComponentOutlet: \"ngComponentOutlet\",\n ngComponentOutletInputs: \"ngComponentOutletInputs\",\n ngComponentOutletInjector: \"ngComponentOutletInjector\",\n ngComponentOutletEnvironmentInjector: \"ngComponentOutletEnvironmentInjector\",\n ngComponentOutletContent: \"ngComponentOutletContent\",\n ngComponentOutletNgModule: \"ngComponentOutletNgModule\",\n ngComponentOutletNgModuleFactory: \"ngComponentOutletNgModuleFactory\"\n },\n exportAs: [\"ngComponentOutlet\"],\n features: [i0.ɵɵNgOnChangesFeature]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgComponentOutlet, [{\n type: Directive,\n args: [{\n selector: '[ngComponentOutlet]',\n exportAs: 'ngComponentOutlet'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }], {\n ngComponentOutlet: [{\n type: Input\n }],\n ngComponentOutletInputs: [{\n type: Input\n }],\n ngComponentOutletInjector: [{\n type: Input\n }],\n ngComponentOutletEnvironmentInjector: [{\n type: Input\n }],\n ngComponentOutletContent: [{\n type: Input\n }],\n ngComponentOutletNgModule: [{\n type: Input\n }],\n ngComponentOutletNgModuleFactory: [{\n type: Input\n }]\n });\n})();\n// Helper function that returns an Injector instance of a parent NgModule.\nfunction getParentInjector(injector) {\n const parentNgModule = injector.get(NgModuleRef);\n return parentNgModule.injector;\n}\n\n/**\n * @publicApi\n *\n * @deprecated 20.0\n * The `ngFor` directive is deprecated. Use the `@for` block instead.\n */\nclass NgForOfContext {\n $implicit;\n ngForOf;\n index;\n count;\n constructor(/** Reference to the current item from the collection. */\n $implicit,\n /**\n * The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe\n * (`userStreams | async`).\n */\n ngForOf, /** Returns an index of the current item in the collection. */\n index, /** Returns total amount of items in the collection. */\n count) {\n this.$implicit = $implicit;\n this.ngForOf = ngForOf;\n this.index = index;\n this.count = count;\n }\n // Indicates whether this is the first item in the collection.\n get first() {\n return this.index === 0;\n }\n // Indicates whether this is the last item in the collection.\n get last() {\n return this.index === this.count - 1;\n }\n // Indicates whether an index of this item in the collection is even.\n get even() {\n return this.index % 2 === 0;\n }\n // Indicates whether an index of this item in the collection is odd.\n get odd() {\n return !this.even;\n }\n}\n/**\n * A [structural directive](guide/directives/structural-directives) that renders\n * a template for each item in a collection.\n * The directive is placed on an element, which becomes the parent\n * of the cloned templates.\n *\n * The `ngForOf` directive is generally used in the\n * [shorthand form](guide/directives/structural-directives#asterisk) `*ngFor`.\n * In this form, the template to be rendered for each iteration is the content\n * of an anchor element containing the directive.\n *\n * The following example shows the shorthand syntax with some options,\n * contained in an `` element.\n *\n * ```html\n * ...\n * ```\n *\n * The shorthand form expands into a long form that uses the `ngForOf` selector\n * on an `` element.\n * The content of the `` element is the `` element that held the\n * short-form directive.\n *\n * Here is the expanded version of the short-form example.\n *\n * ```html\n * \n * ...\n * \n * ```\n *\n * Angular automatically expands the shorthand syntax as it compiles the template.\n * The context for each embedded view is logically merged to the current component\n * context according to its lexical position.\n *\n * When using the shorthand syntax, Angular allows only [one structural directive\n * on an element](guide/directives/structural-directives#one-per-element).\n * If you want to iterate conditionally, for example,\n * put the `*ngIf` on a container element that wraps the `*ngFor` element.\n * For further discussion, see\n * [Structural Directives](guide/directives/structural-directives#one-per-element).\n *\n * @usageNotes\n *\n * ### Local variables\n *\n * `NgForOf` provides exported values that can be aliased to local variables.\n * For example:\n *\n * ```html\n * \n * {{i}}/{{users.length}}. {{user}} default\n * \n * ```\n *\n * The following exported values can be aliased to local variables:\n *\n * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n * - `ngForOf: NgIterable`: The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe (`userStreams |\n * async`).\n * - `index: number`: The index of the current item in the iterable.\n * - `count: number`: The length of the iterable.\n * - `first: boolean`: True when the item is the first item in the iterable.\n * - `last: boolean`: True when the item is the last item in the iterable.\n * - `even: boolean`: True when the item has an even index in the iterable.\n * - `odd: boolean`: True when the item has an odd index in the iterable.\n *\n * ### Change propagation\n *\n * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n *\n * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n * those changes in the DOM. This has important implications for animations and any stateful\n * controls that are present, such as `` elements that accept user input. Inserted rows can\n * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n * such as user input.\n * For more on animations, see [Transitions and Triggers](guide/animations/transition-and-triggers).\n *\n * The identities of elements in the iterator can change while the data does not.\n * This can happen, for example, if the iterator is produced from an RPC to the server, and that\n * RPC is re-run. Even if the data hasn't changed, the second response produces objects with\n * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old\n * elements were deleted and all new elements inserted).\n *\n * To avoid this expensive operation, you can customize the default tracking algorithm.\n * by supplying the `trackBy` option to `NgForOf`.\n * `trackBy` takes a function that has two arguments: `index` and `item`.\n * If `trackBy` is given, Angular tracks changes by the return value of the function.\n *\n * @see [Structural Directives](guide/directives/structural-directives)\n * @ngModule CommonModule\n * @publicApi\n *\n * @deprecated 20.0\n * Use the `@for` block instead. Intent to remove in v22\n */\nclass NgForOf {\n _viewContainer;\n _template;\n _differs;\n /**\n * The value of the iterable expression, which can be used as a\n * [template input variable](guide/directives/structural-directives#shorthand).\n * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.\n */\n set ngForOf(ngForOf) {\n this._ngForOf = ngForOf;\n this._ngForOfDirty = true;\n }\n /**\n * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.\n *\n * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object\n * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n * as the key.\n *\n * `NgForOf` uses the computed key to associate items in an iterable with DOM elements\n * it produces for these items.\n *\n * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an\n * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a\n * primary key), and this iterable could be updated with new object instances that still\n * represent the same underlying entity (for example, when data is re-fetched from the server,\n * and the iterable is recreated and re-rendered, but most of the data is still the same).\n *\n * @see {@link TrackByFunction}\n * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.\n */\n set ngForTrackBy(fn) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {\n console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);\n }\n this._trackByFn = fn;\n }\n get ngForTrackBy() {\n return this._trackByFn;\n }\n _ngForOf = null;\n _ngForOfDirty = true;\n _differ = null;\n // waiting for microsoft/typescript#43662 to allow the return type `TrackByFunction|undefined` for\n // the getter\n _trackByFn;\n constructor(_viewContainer, _template, _differs) {\n this._viewContainer = _viewContainer;\n this._template = _template;\n this._differs = _differs;\n }\n /**\n * A reference to the template that is stamped out for each item in the iterable.\n * @see [template reference variable](guide/templates/variables#template-reference-variables)\n * @deprecated The `ngFor` directive is deprecated. Use the `@for` block instead.\n */\n set ngForTemplate(value) {\n // TODO(TS2.1): make TemplateRef>> once we move to TS v2.1\n // The current type is too restrictive; a template that just uses index, for example,\n // should be acceptable.\n if (value) {\n this._template = value;\n }\n }\n /**\n * Applies the changes when needed.\n * @docs-private\n */\n ngDoCheck() {\n if (this._ngForOfDirty) {\n this._ngForOfDirty = false;\n // React on ngForOf changes only once all inputs have been initialized\n const value = this._ngForOf;\n if (!this._differ && value) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n try {\n // CAUTION: this logic is duplicated for production mode below, as the try-catch\n // is only present in development builds.\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n } catch {\n let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;\n if (typeof value === 'object') {\n errorMessage += ' Did you mean to use the keyvalue pipe?';\n }\n throw new _RuntimeError(-2200 /* RuntimeErrorCode.NG_FOR_MISSING_DIFFER */, errorMessage);\n }\n } else {\n // CAUTION: this logic is duplicated for development mode above, as the try-catch\n // is only present in development builds.\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n }\n }\n }\n if (this._differ) {\n const changes = this._differ.diff(this._ngForOf);\n if (changes) this._applyChanges(changes);\n }\n }\n _applyChanges(changes) {\n const viewContainer = this._viewContainer;\n changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {\n if (item.previousIndex == null) {\n // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n // that a new item needs to be inserted from the iterable. This implies that\n // there is an iterable value for \"_ngForOf\".\n viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);\n } else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);\n } else if (adjustedPreviousIndex !== null) {\n const view = viewContainer.get(adjustedPreviousIndex);\n viewContainer.move(view, currentIndex);\n applyViewChange(view, item);\n }\n });\n for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {\n const viewRef = viewContainer.get(i);\n const context = viewRef.context;\n context.index = i;\n context.count = ilen;\n context.ngForOf = this._ngForOf;\n }\n changes.forEachIdentityChange(record => {\n const viewRef = viewContainer.get(record.currentIndex);\n applyViewChange(viewRef, record);\n });\n }\n /**\n * Asserts the correct type of the context for the template that `NgForOf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgForOf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard(dir, ctx) {\n return true;\n }\n static ɵfac = function NgForOf_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgForOf)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.IterableDiffers));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgForOf,\n selectors: [[\"\", \"ngFor\", \"\", \"ngForOf\", \"\"]],\n inputs: {\n ngForOf: \"ngForOf\",\n ngForTrackBy: \"ngForTrackBy\",\n ngForTemplate: \"ngForTemplate\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgForOf, [{\n type: Directive,\n args: [{\n selector: '[ngFor][ngForOf]'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }, {\n type: i0.TemplateRef\n }, {\n type: i0.IterableDiffers\n }], {\n ngForOf: [{\n type: Input\n }],\n ngForTrackBy: [{\n type: Input\n }],\n ngForTemplate: [{\n type: Input\n }]\n });\n})();\nfunction applyViewChange(view, record) {\n view.context.$implicit = record.item;\n}\nfunction getTypeName(type) {\n return type['name'] || typeof type;\n}\n\n/**\n * A structural directive that conditionally includes a template based on the value of\n * an expression coerced to Boolean.\n * When the expression evaluates to true, Angular renders the template\n * provided in a `then` clause, and when false or null,\n * Angular renders the template provided in an optional `else` clause. The default\n * template for the `else` clause is blank.\n *\n * A [shorthand form](guide/directives/structural-directives#asterisk) of the directive,\n * `*ngIf=\"condition\"`, is generally used, provided\n * as an attribute of the anchor element for the inserted template.\n * Angular expands this into a more explicit version, in which the anchor element\n * is contained in an `` element.\n *\n * Simple form with shorthand syntax:\n *\n * ```html\n * Content to render when condition is true.
\n * ```\n *\n * Simple form with expanded syntax:\n *\n * ```html\n * Content to render when condition is\n * true.
\n * ```\n *\n * Form with an \"else\" block:\n *\n * ```html\n * Content to render when condition is true.
\n * Content to render when condition is false.\n * ```\n *\n * Shorthand form with \"then\" and \"else\" blocks:\n *\n * ```html\n * \n * Content to render when condition is true.\n * Content to render when condition is false.\n * ```\n *\n * Form with storing the value locally:\n *\n * ```html\n * {{value}}
\n * Content to render when value is null.\n * ```\n *\n * @usageNotes\n *\n * The `*ngIf` directive is most commonly used to conditionally show an inline template,\n * as seen in the following example.\n * The default `else` template is blank.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfSimple'}\n *\n * ### Showing an alternative template using `else`\n *\n * To display a template when `expression` evaluates to false, use an `else` template\n * binding as shown in the following example.\n * The `else` binding points to an `` element labeled `#elseBlock`.\n * The template can be defined anywhere in the component view, but is typically placed right after\n * `ngIf` for readability.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfElse'}\n *\n * ### Using an external `then` template\n *\n * In the previous example, the then-clause template is specified inline, as the content of the\n * tag that contains the `ngIf` directive. You can also specify a template that is defined\n * externally, by referencing a labeled `` element. When you do this, you can\n * change which template to use at runtime, as shown in the following example.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n *\n * ### Storing a conditional result in a variable\n *\n * You might want to show a set of properties from the same object. If you are waiting\n * for asynchronous data, the object can be undefined.\n * In this case, you can use `ngIf` and store the result of the condition in a local\n * variable as shown in the following example.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfAs'}\n *\n * This code uses only one `AsyncPipe`, so only one subscription is created.\n * The conditional statement stores the result of `userStream|async` in the local variable `user`.\n * You can then bind the local `user` repeatedly.\n *\n * The conditional displays the data only if `userStream` returns a value,\n * so you don't need to use the\n * safe-navigation-operator (`?.`)\n * to guard against null values when accessing properties.\n * You can display an alternative template while waiting for the data.\n *\n * ### Shorthand syntax\n *\n * The shorthand syntax `*ngIf` expands into two separate template specifications\n * for the \"then\" and \"else\" clauses. For example, consider the following shorthand statement,\n * that is meant to show a loading page while waiting for data to be loaded.\n *\n * ```html\n * \n * ...\n *
\n *\n * \n * Loading...
\n * \n * ```\n *\n * You can see that the \"else\" clause references the ``\n * with the `#loading` label, and the template for the \"then\" clause\n * is provided as the content of the anchor element.\n *\n * However, when Angular expands the shorthand syntax, it creates\n * another `` tag, with `ngIf` and `ngIfElse` directives.\n * The anchor element containing the template for the \"then\" clause becomes\n * the content of this unlabeled `` tag.\n *\n * ```html\n * \n * \n * ...\n *
\n * \n *\n * \n * Loading...
\n * \n * ```\n *\n * The presence of the implicit template object has implications for the nesting of\n * structural directives. For more on this subject, see\n * [Structural Directives](guide/directives/structural-directives#one-per-element).\n *\n * @ngModule CommonModule\n * @publicApi\n *\n * @deprecated 20.0\n * Use the `@if` block instead. Intent to remove in v22\n */\nclass NgIf {\n _viewContainer;\n _context = new NgIfContext();\n _thenTemplateRef = null;\n _elseTemplateRef = null;\n _thenViewRef = null;\n _elseViewRef = null;\n constructor(_viewContainer, templateRef) {\n this._viewContainer = _viewContainer;\n this._thenTemplateRef = templateRef;\n }\n /**\n * The Boolean expression to evaluate as the condition for showing a template.\n * @deprecated Use the `@if` block instead. Intent to remove in v22\n */\n set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }\n /**\n * A template to show if the condition expression evaluates to true.\n * @deprecated Use the `@if` block instead. Intent to remove in v22\n */\n set ngIfThen(templateRef) {\n assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfThen');\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }\n /**\n * A template to show if the condition expression evaluates to false.\n * @deprecated Use the `@if` block instead. Intent to remove in v22\n */\n set ngIfElse(templateRef) {\n assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfElse');\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }\n _updateView() {\n if (this._context.$implicit) {\n if (!this._thenViewRef) {\n this._viewContainer.clear();\n this._elseViewRef = null;\n if (this._thenTemplateRef) {\n this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n }\n }\n } else {\n if (!this._elseViewRef) {\n this._viewContainer.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n }\n }\n }\n }\n /** @internal */\n static ngIfUseIfTypeGuard;\n /**\n * Assert the correct type of the expression bound to the `ngIf` input within the template.\n *\n * The presence of this static field is a signal to the Ivy template type check compiler that\n * when the `NgIf` structural directive renders its template, the type of the expression bound\n * to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to\n * narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.\n */\n static ngTemplateGuard_ngIf;\n /**\n * Asserts the correct type of the context for the template that `NgIf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgIf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard(dir, ctx) {\n return true;\n }\n static ɵfac = function NgIf_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgIf)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgIf,\n selectors: [[\"\", \"ngIf\", \"\"]],\n inputs: {\n ngIf: \"ngIf\",\n ngIfThen: \"ngIfThen\",\n ngIfElse: \"ngIfElse\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgIf, [{\n type: Directive,\n args: [{\n selector: '[ngIf]'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }, {\n type: i0.TemplateRef\n }], {\n ngIf: [{\n type: Input\n }],\n ngIfThen: [{\n type: Input\n }],\n ngIfElse: [{\n type: Input\n }]\n });\n})();\n/**\n * @publicApi\n *\n * @deprecated 20.0\n * The ngIf directive is deprecated in favor of the @if block instead.\n */\nclass NgIfContext {\n $implicit = null;\n ngIf = null;\n}\nfunction assertTemplate(templateRef, property) {\n if (templateRef && !templateRef.createEmbeddedView) {\n throw new _RuntimeError(2020 /* RuntimeErrorCode.NG_IF_NOT_A_TEMPLATE_REF */, (typeof ngDevMode === 'undefined' || ngDevMode) && `${property} must be a TemplateRef, but received '${_stringify(templateRef)}'.`);\n }\n}\nclass SwitchView {\n _viewContainerRef;\n _templateRef;\n _created = false;\n constructor(_viewContainerRef, _templateRef) {\n this._viewContainerRef = _viewContainerRef;\n this._templateRef = _templateRef;\n }\n create() {\n this._created = true;\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n }\n destroy() {\n this._created = false;\n this._viewContainerRef.clear();\n }\n enforceState(created) {\n if (created && !this._created) {\n this.create();\n } else if (!created && this._created) {\n this.destroy();\n }\n }\n}\n/**\n * @ngModule CommonModule\n *\n * @description\n * The `[ngSwitch]` directive on a container specifies an expression to match against.\n * The expressions to match are provided by `ngSwitchCase` directives on views within the container.\n * - Every view that matches is rendered.\n * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.\n * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`\n * or `ngSwitchDefault` directive are preserved at the location.\n *\n * @usageNotes\n * Define a container element for the directive, and specify the switch expression\n * to match against as an attribute:\n *\n * ```html\n * \n * ```\n *\n * Within the container, `*ngSwitchCase` statements specify the match expressions\n * as attributes. Include `*ngSwitchDefault` as the final case.\n *\n * ```html\n * \n * ...\n * ...\n * ...\n * \n * ```\n *\n * ### Usage Examples\n *\n * The following example shows how to use more than one case to display the same view:\n *\n * ```html\n * \n * \n * ...\n * ...\n * ...\n * \n * ...\n * \n * ```\n *\n * The following example shows how cases can be nested:\n * ```html\n * \n * ...\n * ...\n * ...\n * \n * \n * \n * \n * \n * ...\n * \n * ```\n *\n * @publicApi\n * @see {@link NgSwitchCase}\n * @see {@link NgSwitchDefault}\n * @see [Structural Directives](guide/directives/structural-directives)\n *\n * @deprecated 20.0\n * Use the `@switch` block instead. Intent to remove in v22\n */\nclass NgSwitch {\n _defaultViews = [];\n _defaultUsed = false;\n _caseCount = 0;\n _lastCaseCheckIndex = 0;\n _lastCasesMatched = false;\n _ngSwitch;\n /** @deprecated Use the `@switch` block instead. Intent to remove in v22 */\n set ngSwitch(newValue) {\n this._ngSwitch = newValue;\n if (this._caseCount === 0) {\n this._updateDefaultCases(true);\n }\n }\n /** @internal */\n _addCase() {\n return this._caseCount++;\n }\n /** @internal */\n _addDefault(view) {\n this._defaultViews.push(view);\n }\n /** @internal */\n _matchCase(value) {\n const matched = value === this._ngSwitch;\n this._lastCasesMatched ||= matched;\n this._lastCaseCheckIndex++;\n if (this._lastCaseCheckIndex === this._caseCount) {\n this._updateDefaultCases(!this._lastCasesMatched);\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n return matched;\n }\n _updateDefaultCases(useDefault) {\n if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {\n this._defaultUsed = useDefault;\n for (const defaultView of this._defaultViews) {\n defaultView.enforceState(useDefault);\n }\n }\n }\n static ɵfac = function NgSwitch_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgSwitch)();\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgSwitch,\n selectors: [[\"\", \"ngSwitch\", \"\"]],\n inputs: {\n ngSwitch: \"ngSwitch\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitch, [{\n type: Directive,\n args: [{\n selector: '[ngSwitch]'\n }]\n }], null, {\n ngSwitch: [{\n type: Input\n }]\n });\n})();\n/**\n * @ngModule CommonModule\n *\n * @description\n * Provides a switch case expression to match against an enclosing `ngSwitch` expression.\n * When the expressions match, the given `NgSwitchCase` template is rendered.\n * If multiple match expressions match the switch expression value, all of them are displayed.\n *\n * @usageNotes\n *\n * Within a switch container, `*ngSwitchCase` statements specify the match expressions\n * as attributes. Include `*ngSwitchDefault` as the final case.\n *\n * ```html\n * \n * ...\n * ...\n * ...\n * \n * ```\n *\n * Each switch-case statement contains an in-line HTML template or template reference\n * that defines the subtree to be selected if the value of the match expression\n * matches the value of the switch expression.\n *\n * As of Angular v17 the NgSwitch directive uses strict equality comparison (`===`) instead of\n * loose equality (`==`) to match different cases.\n *\n * @publicApi\n * @see {@link NgSwitch}\n * @see {@link NgSwitchDefault}\n *\n * @deprecated 20.0\n * Use the `@case` block within a `@switch` block instead. Intent to remove in v22\n */\nclass NgSwitchCase {\n ngSwitch;\n _view;\n /**\n * Stores the HTML template to be selected on match.\n * @deprecated Use the `@case` block within a `@switch` block instead. Intent to remove in v22\n */\n ngSwitchCase;\n constructor(viewContainer, templateRef, ngSwitch) {\n this.ngSwitch = ngSwitch;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase');\n }\n ngSwitch._addCase();\n this._view = new SwitchView(viewContainer, templateRef);\n }\n /**\n * Performs case matching. For internal use only.\n * @docs-private\n */\n ngDoCheck() {\n this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));\n }\n static ɵfac = function NgSwitchCase_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgSwitchCase)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(NgSwitch, 9));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgSwitchCase,\n selectors: [[\"\", \"ngSwitchCase\", \"\"]],\n inputs: {\n ngSwitchCase: \"ngSwitchCase\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitchCase, [{\n type: Directive,\n args: [{\n selector: '[ngSwitchCase]'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }, {\n type: i0.TemplateRef\n }, {\n type: NgSwitch,\n decorators: [{\n type: Optional\n }, {\n type: Host\n }]\n }], {\n ngSwitchCase: [{\n type: Input\n }]\n });\n})();\n/**\n * @ngModule CommonModule\n *\n * @description\n *\n * Creates a view that is rendered when no `NgSwitchCase` expressions\n * match the `NgSwitch` expression.\n * This statement should be the final case in an `NgSwitch`.\n *\n * @publicApi\n * @see {@link NgSwitch}\n * @see {@link NgSwitchCase}\n *\n * @deprecated 20.0\n * Use the `@default` block within a `@switch` block instead. Intent to remove in v22\n */\nclass NgSwitchDefault {\n constructor(viewContainer, templateRef, ngSwitch) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault');\n }\n ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n }\n static ɵfac = function NgSwitchDefault_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgSwitchDefault)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(NgSwitch, 9));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgSwitchDefault,\n selectors: [[\"\", \"ngSwitchDefault\", \"\"]]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitchDefault, [{\n type: Directive,\n args: [{\n selector: '[ngSwitchDefault]'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }, {\n type: i0.TemplateRef\n }, {\n type: NgSwitch,\n decorators: [{\n type: Optional\n }, {\n type: Host\n }]\n }], null);\n})();\nfunction throwNgSwitchProviderNotFoundError(attrName, directiveName) {\n throw new _RuntimeError(2000 /* RuntimeErrorCode.PARENT_NG_SWITCH_NOT_FOUND */, `An element with the \"${attrName}\" attribute ` + `(matching the \"${directiveName}\" directive) must be located inside an element with the \"ngSwitch\" attribute ` + `(matching \"NgSwitch\" directive)`);\n}\n\n/**\n * @ngModule CommonModule\n *\n * @usageNotes\n * ```html\n * \n * there is nothing\n * there is one\n * there are a few\n * \n * ```\n *\n * @description\n *\n * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.\n *\n * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees\n * that match the switch expression's pluralization category.\n *\n * To use this directive you must provide a container element that sets the `[ngPlural]` attribute\n * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their\n * expression:\n * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value\n * matches the switch expression exactly,\n * - otherwise, the view will be treated as a \"category match\", and will only display if exact\n * value matches aren't found and the value maps to its category for the defined locale.\n *\n * See http://cldr.unicode.org/index/cldr-spec/plural-rules\n *\n * @publicApi\n */\nclass NgPlural {\n _localization;\n _activeView;\n _caseViews = {};\n constructor(_localization) {\n this._localization = _localization;\n }\n set ngPlural(value) {\n this._updateView(value);\n }\n addCase(value, switchView) {\n this._caseViews[value] = switchView;\n }\n _updateView(switchValue) {\n this._clearViews();\n const cases = Object.keys(this._caseViews);\n const key = getPluralCategory(switchValue, cases, this._localization);\n this._activateView(this._caseViews[key]);\n }\n _clearViews() {\n if (this._activeView) this._activeView.destroy();\n }\n _activateView(view) {\n if (view) {\n this._activeView = view;\n this._activeView.create();\n }\n }\n static ɵfac = function NgPlural_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgPlural)(i0.ɵɵdirectiveInject(NgLocalization));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgPlural,\n selectors: [[\"\", \"ngPlural\", \"\"]],\n inputs: {\n ngPlural: \"ngPlural\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgPlural, [{\n type: Directive,\n args: [{\n selector: '[ngPlural]'\n }]\n }], () => [{\n type: NgLocalization\n }], {\n ngPlural: [{\n type: Input\n }]\n });\n})();\n/**\n * @ngModule CommonModule\n *\n * @description\n *\n * Creates a view that will be added/removed from the parent {@link NgPlural} when the\n * given expression matches the plural expression according to CLDR rules.\n *\n * @usageNotes\n * ```html\n * \n * ...\n * ...\n * \n *```\n *\n * See {@link NgPlural} for more details and example.\n *\n * @publicApi\n */\nclass NgPluralCase {\n value;\n constructor(value, template, viewContainer, ngPlural) {\n this.value = value;\n const isANumber = !isNaN(Number(value));\n ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));\n }\n static ɵfac = function NgPluralCase_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgPluralCase)(i0.ɵɵinjectAttribute('ngPluralCase'), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(NgPlural, 1));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgPluralCase,\n selectors: [[\"\", \"ngPluralCase\", \"\"]]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgPluralCase, [{\n type: Directive,\n args: [{\n selector: '[ngPluralCase]'\n }]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Attribute,\n args: ['ngPluralCase']\n }]\n }, {\n type: i0.TemplateRef\n }, {\n type: i0.ViewContainerRef\n }, {\n type: NgPlural,\n decorators: [{\n type: Host\n }]\n }], null);\n})();\n\n/**\n * @ngModule CommonModule\n *\n * @usageNotes\n *\n * Set the width of the containing element to a pixel value returned by an expression.\n *\n * ```html\n * ...\n * ```\n *\n * Set a collection of style values using an expression that returns key-value pairs.\n *\n * ```html\n * ...\n * ```\n *\n * For more simple use cases you can use the [style bindings](/guide/templates/binding#css-class-and-style-property-bindings) directly.\n * It doesn't require importing a directive.\n *\n * Set the font of the containing element to the result of an expression.\n *\n * ```html\n * ...\n * ```\n *\n * @description\n *\n * An attribute directive that updates styles for the containing HTML element.\n * Sets one or more style properties, specified as colon-separated key-value pairs.\n * The key is a style name, with an optional `.` suffix\n * (such as 'top.px', 'font-style.em').\n * The value is an expression to be evaluated.\n * The resulting non-null value, expressed in the given unit,\n * is assigned to the given style property.\n * If the result of evaluation is null, the corresponding style is removed.\n *\n * @see [Style bindings](/guide/templates/binding#css-class-and-style-property-bindings)\n *\n * @publicApi\n */\nclass NgStyle {\n _ngEl;\n _differs;\n _renderer;\n _ngStyle = null;\n _differ = null;\n constructor(_ngEl, _differs, _renderer) {\n this._ngEl = _ngEl;\n this._differs = _differs;\n this._renderer = _renderer;\n }\n set ngStyle(values) {\n this._ngStyle = values;\n if (!this._differ && values) {\n this._differ = this._differs.find(values).create();\n }\n }\n ngDoCheck() {\n if (this._differ) {\n const changes = this._differ.diff(this._ngStyle);\n if (changes) {\n this._applyChanges(changes);\n }\n }\n }\n _setStyle(nameAndUnit, value) {\n const [name, unit] = nameAndUnit.split('.');\n const flags = name.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value != null) {\n this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);\n } else {\n this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);\n }\n }\n _applyChanges(changes) {\n changes.forEachRemovedItem(record => this._setStyle(record.key, null));\n changes.forEachAddedItem(record => this._setStyle(record.key, record.currentValue));\n changes.forEachChangedItem(record => this._setStyle(record.key, record.currentValue));\n }\n static ɵfac = function NgStyle_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgStyle)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.KeyValueDiffers), i0.ɵɵdirectiveInject(i0.Renderer2));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgStyle,\n selectors: [[\"\", \"ngStyle\", \"\"]],\n inputs: {\n ngStyle: \"ngStyle\"\n }\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgStyle, [{\n type: Directive,\n args: [{\n selector: '[ngStyle]'\n }]\n }], () => [{\n type: i0.ElementRef\n }, {\n type: i0.KeyValueDiffers\n }, {\n type: i0.Renderer2\n }], {\n ngStyle: [{\n type: Input,\n args: ['ngStyle']\n }]\n });\n})();\n\n/**\n * @ngModule CommonModule\n *\n * @description\n *\n * Inserts an embedded view from a prepared `TemplateRef`.\n *\n * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n * by the local template `let` declarations.\n *\n * @usageNotes\n * ```html\n * \n * ```\n *\n * Using the key `$implicit` in the context object will set its value as default.\n *\n * ### Example\n *\n * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n *\n * @publicApi\n */\nclass NgTemplateOutlet {\n _viewContainerRef;\n _viewRef = null;\n /**\n * A context object to attach to the {@link EmbeddedViewRef}. This should be an\n * object, the object's keys will be available for binding by the local template `let`\n * declarations.\n * Using the key `$implicit` in the context object will set its value as default.\n */\n ngTemplateOutletContext = null;\n /**\n * A string defining the template reference and optionally the context object for the template.\n */\n ngTemplateOutlet = null;\n /** Injector to be used within the embedded view. */\n ngTemplateOutletInjector = null;\n constructor(_viewContainerRef) {\n this._viewContainerRef = _viewContainerRef;\n }\n ngOnChanges(changes) {\n if (this._shouldRecreateView(changes)) {\n const viewContainerRef = this._viewContainerRef;\n if (this._viewRef) {\n viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));\n }\n // If there is no outlet, clear the destroyed view ref.\n if (!this.ngTemplateOutlet) {\n this._viewRef = null;\n return;\n }\n // Create a context forward `Proxy` that will always bind to the user-specified context,\n // without having to destroy and re-create views whenever the context changes.\n const viewContext = this._createContextForwardProxy();\n this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {\n injector: this.ngTemplateOutletInjector ?? undefined\n });\n }\n }\n /**\n * We need to re-create existing embedded view if either is true:\n * - the outlet changed.\n * - the injector changed.\n */\n _shouldRecreateView(changes) {\n return !!changes['ngTemplateOutlet'] || !!changes['ngTemplateOutletInjector'];\n }\n /**\n * For a given outlet instance, we create a proxy object that delegates\n * to the user-specified context. This allows changing, or swapping out\n * the context object completely without having to destroy/re-create the view.\n */\n _createContextForwardProxy() {\n return new Proxy({}, {\n set: (_target, prop, newValue) => {\n if (!this.ngTemplateOutletContext) {\n return false;\n }\n return Reflect.set(this.ngTemplateOutletContext, prop, newValue);\n },\n get: (_target, prop, receiver) => {\n if (!this.ngTemplateOutletContext) {\n return undefined;\n }\n return Reflect.get(this.ngTemplateOutletContext, prop, receiver);\n }\n });\n }\n static ɵfac = function NgTemplateOutlet_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgTemplateOutlet)(i0.ɵɵdirectiveInject(i0.ViewContainerRef));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgTemplateOutlet,\n selectors: [[\"\", \"ngTemplateOutlet\", \"\"]],\n inputs: {\n ngTemplateOutletContext: \"ngTemplateOutletContext\",\n ngTemplateOutlet: \"ngTemplateOutlet\",\n ngTemplateOutletInjector: \"ngTemplateOutletInjector\"\n },\n features: [i0.ɵɵNgOnChangesFeature]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgTemplateOutlet, [{\n type: Directive,\n args: [{\n selector: '[ngTemplateOutlet]'\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }], {\n ngTemplateOutletContext: [{\n type: Input\n }],\n ngTemplateOutlet: [{\n type: Input\n }],\n ngTemplateOutletInjector: [{\n type: Input\n }]\n });\n})();\n\n/**\n * A collection of Angular directives that are likely to be used in each and every Angular\n * application.\n */\nconst COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];\nfunction invalidPipeArgumentError(type, value) {\n return new _RuntimeError(2100 /* RuntimeErrorCode.INVALID_PIPE_ARGUMENT */, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${_stringify(type)}'`);\n}\nclass SubscribableStrategy {\n createSubscription(async, updateLatestValue, onError) {\n // Subscription can be side-effectful, and we don't want any signal reads which happen in the\n // side effect of the subscription to be tracked by a component's template when that\n // subscription is triggered via the async pipe. So we wrap the subscription in `untracked` to\n // decouple from the current reactive context.\n //\n // `untracked` also prevents signal _writes_ which happen in the subscription side effect from\n // being treated as signal writes during the template evaluation (which throws errors).\n return untracked(() => async.subscribe({\n next: updateLatestValue,\n error: onError\n }));\n }\n dispose(subscription) {\n // See the comment in `createSubscription` above on the use of `untracked`.\n untracked(() => subscription.unsubscribe());\n }\n}\nclass PromiseStrategy {\n createSubscription(async, updateLatestValue, onError) {\n // According to the promise specification, promises are not cancellable by default.\n // Once a promise is created, it will either resolve or reject, and it doesn't\n // provide a built-in mechanism to cancel it.\n // There may be situations where a promise is provided, and it either resolves after\n // the pipe has been destroyed or never resolves at all. If the promise never\n // resolves — potentially due to factors beyond our control, such as third-party\n // libraries — this can lead to a memory leak.\n // When we use `async.then(updateLatestValue)`, the engine captures a reference to the\n // `updateLatestValue` function. This allows the promise to invoke that function when it\n // resolves. In this case, the promise directly captures a reference to the\n // `updateLatestValue` function. If the promise resolves later, it retains a reference\n // to the original `updateLatestValue`, meaning that even if the context where\n // `updateLatestValue` was defined has been destroyed, the function reference remains in memory.\n // This can lead to memory leaks if `updateLatestValue` is no longer needed or if it holds\n // onto resources that should be released.\n // When we do `async.then(v => ...)` the promise captures a reference to the lambda\n // function (the arrow function).\n // When we assign `updateLatestValue = null` within the context of an `unsubscribe` function,\n // we're changing the reference of `updateLatestValue` in the current scope to `null`.\n // The lambda will no longer have access to it after the assignment, effectively\n // preventing any further calls to the original function and allowing it to be garbage collected.\n async.then(\n // Using optional chaining because we may have set it to `null`; since the promise\n // is async, the view might be destroyed by the time the promise resolves.\n v => updateLatestValue?.(v), e => onError?.(e));\n return {\n unsubscribe: () => {\n updateLatestValue = null;\n onError = null;\n }\n };\n }\n dispose(subscription) {\n subscription.unsubscribe();\n }\n}\nconst _promiseStrategy = new PromiseStrategy();\nconst _subscribableStrategy = new SubscribableStrategy();\n/**\n * @ngModule CommonModule\n * @description\n *\n * Unwraps a value from an asynchronous primitive.\n *\n * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n * potential memory leaks. When the reference of the expression changes, the `async` pipe\n * automatically unsubscribes from the old `Observable` or `Promise` and subscribes to the new one.\n *\n * @usageNotes\n *\n * ### Examples\n *\n * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n * promise.\n *\n * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n *\n * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n * to the view. The Observable continuously updates the view with the current time.\n *\n * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n *\n * @publicApi\n */\nclass AsyncPipe {\n _ref;\n _latestValue = null;\n markForCheckOnValueUpdate = true;\n _subscription = null;\n _obj = null;\n _strategy = null;\n applicationErrorHandler = inject(_INTERNAL_APPLICATION_ERROR_HANDLER);\n constructor(ref) {\n // Assign `ref` into `this._ref` manually instead of declaring `_ref` in the constructor\n // parameter list, as the type of `this._ref` includes `null` unlike the type of `ref`.\n this._ref = ref;\n }\n ngOnDestroy() {\n if (this._subscription) {\n this._dispose();\n }\n // Clear the `ChangeDetectorRef` and its association with the view data, to mitigate\n // potential memory leaks in Observables that could otherwise cause the view data to\n // be retained.\n // https://github.com/angular/angular/issues/17624\n this._ref = null;\n }\n transform(obj) {\n if (!this._obj) {\n if (obj) {\n try {\n // Only call `markForCheck` if the value is updated asynchronously.\n // Synchronous updates _during_ subscription should not wastefully mark for check -\n // this value is already going to be returned from the transform function.\n this.markForCheckOnValueUpdate = false;\n this._subscribe(obj);\n } finally {\n this.markForCheckOnValueUpdate = true;\n }\n }\n return this._latestValue;\n }\n if (obj !== this._obj) {\n this._dispose();\n return this.transform(obj);\n }\n return this._latestValue;\n }\n _subscribe(obj) {\n this._obj = obj;\n this._strategy = this._selectStrategy(obj);\n this._subscription = this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value), e => this.applicationErrorHandler(e));\n }\n _selectStrategy(obj) {\n if (_isPromise(obj)) {\n return _promiseStrategy;\n }\n if (_isSubscribable(obj)) {\n return _subscribableStrategy;\n }\n throw invalidPipeArgumentError(AsyncPipe, obj);\n }\n _dispose() {\n // Note: `dispose` is only called if a subscription has been initialized before, indicating\n // that `this._strategy` is also available.\n this._strategy.dispose(this._subscription);\n this._latestValue = null;\n this._subscription = null;\n this._obj = null;\n }\n _updateLatestValue(async, value) {\n if (async === this._obj) {\n this._latestValue = value;\n if (this.markForCheckOnValueUpdate) {\n this._ref?.markForCheck();\n }\n }\n }\n static ɵfac = function AsyncPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || AsyncPipe)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"async\",\n type: AsyncPipe,\n pure: false\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(AsyncPipe, [{\n type: Pipe,\n args: [{\n name: 'async',\n pure: false\n }]\n }], () => [{\n type: i0.ChangeDetectorRef\n }], null);\n})();\n\n/**\n * Transforms text to all lower case.\n *\n * @see {@link UpperCasePipe}\n * @see {@link TitleCasePipe}\n * @usageNotes\n *\n * The following example defines a view that allows the user to enter\n * text, and then uses the pipe to convert the input text to all lower case.\n *\n * {@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe'}\n *\n * @ngModule CommonModule\n * @publicApi\n */\nclass LowerCasePipe {\n transform(value) {\n if (value == null) return null;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(LowerCasePipe, value);\n }\n return value.toLowerCase();\n }\n static ɵfac = function LowerCasePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || LowerCasePipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"lowercase\",\n type: LowerCasePipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(LowerCasePipe, [{\n type: Pipe,\n args: [{\n name: 'lowercase'\n }]\n }], null, null);\n})();\n//\n// Regex below matches any Unicode word and number compatible with ES5. In ES2018 the same result\n// can be achieved by using /[0-9\\p{L}]\\S*/gu and also known as Unicode Property Escapes\n// (https://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no\n// transpilation of this functionality down to ES5 without external tool, the only solution is\n// to use already transpiled form. Example can be found here -\n// https://mothereff.in/regexpu#input=var+regex+%3D+%2F%5B0-9%5Cp%7BL%7D%5D%5CS*%2Fgu%3B%0A%0A&unicodePropertyEscape=1\n//\nconst unicodeWordMatch = /(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801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\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\u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uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF38\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A])\\S*/g;\n/**\n * Transforms text to title case.\n * Capitalizes the first letter of each word and transforms the\n * rest of the word to lower case.\n * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.\n *\n * @see {@link LowerCasePipe}\n * @see {@link UpperCasePipe}\n *\n * @usageNotes\n * The following example shows the result of transforming various strings into title case.\n *\n * {@example common/pipes/ts/titlecase_pipe.ts region='TitleCasePipe'}\n *\n * @ngModule CommonModule\n * @publicApi\n */\nclass TitleCasePipe {\n transform(value) {\n if (value == null) return null;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(TitleCasePipe, value);\n }\n return value.replace(unicodeWordMatch, txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase());\n }\n static ɵfac = function TitleCasePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || TitleCasePipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"titlecase\",\n type: TitleCasePipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TitleCasePipe, [{\n type: Pipe,\n args: [{\n name: 'titlecase'\n }]\n }], null, null);\n})();\n/**\n * Transforms text to all upper case.\n * @see {@link LowerCasePipe}\n * @see {@link TitleCasePipe}\n *\n * @ngModule CommonModule\n * @publicApi\n */\nclass UpperCasePipe {\n transform(value) {\n if (value == null) return null;\n if (typeof value !== 'string') {\n throw invalidPipeArgumentError(UpperCasePipe, value);\n }\n return value.toUpperCase();\n }\n static ɵfac = function UpperCasePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || UpperCasePipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"uppercase\",\n type: UpperCasePipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(UpperCasePipe, [{\n type: Pipe,\n args: [{\n name: 'uppercase'\n }]\n }], null, null);\n})();\n\n/**\n * The default date format of Angular date pipe, which corresponds to the following format:\n * `'MMM d,y'` (e.g. `Jun 15, 2015`)\n */\nconst DEFAULT_DATE_FORMAT = 'mediumDate';\n\n/**\n * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).\n * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.\n *\n * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe\n */\nconst DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(ngDevMode ? 'DATE_PIPE_DEFAULT_TIMEZONE' : '');\n/**\n * DI token that allows to provide default configuration for the `DatePipe` instances in an\n * application. The value is an object which can include the following fields:\n * - `dateFormat`: configures the default date format. If not provided, the `DatePipe`\n * will use the 'mediumDate' as a value.\n * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will\n * use the end-user's local system timezone.\n *\n * @see {@link DatePipeConfig}\n *\n * @usageNotes\n *\n * Various date pipe default values can be overwritten by providing this token with\n * the value that has this interface.\n *\n * For example:\n *\n * Override the default date format by providing a value using the token:\n * ```ts\n * providers: [\n * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}\n * ]\n * ```\n *\n * Override the default timezone by providing a value using the token:\n * ```ts\n * providers: [\n * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}\n * ]\n * ```\n */\nconst DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(ngDevMode ? 'DATE_PIPE_DEFAULT_OPTIONS' : '');\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a date value according to locale rules.\n *\n * `DatePipe` is executed only when it detects a pure change to the input value.\n * A pure change is either a change to a primitive input value\n * (such as `String`, `Number`, `Boolean`, or `Symbol`),\n * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).\n *\n * Note that mutating a `Date` object does not cause the pipe to be rendered again.\n * To ensure that the pipe is executed, you must create a new `Date` object.\n *\n * Only the `en-US` locale data comes with Angular. To localize dates\n * in another language, you must import the corresponding locale data.\n * See the [I18n guide](guide/i18n/format-data-locale) for more information.\n *\n * The time zone of the formatted value can be specified either by passing it in as the second\n * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS`\n * injection token. The value that is passed in as the second parameter takes precedence over\n * the one defined using the injection token.\n *\n * @see {@link formatDate}\n *\n *\n * @usageNotes\n *\n * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to\n * reformat the date on every change-detection cycle, treat the date as an immutable object\n * and change the reference when the pipe needs to run again.\n *\n * ### Pre-defined format options\n *\n * | Option | Equivalent to | Examples (given in `en-US` locale) |\n * |---------------|-------------------------------------|-------------------------------------------------|\n * | `'short'` | `'M/d/yy, h:mm a'` | `6/15/15, 9:03 AM` |\n * | `'medium'` | `'MMM d, y, h:mm:ss a'` | `Jun 15, 2015, 9:03:01 AM` |\n * | `'long'` | `'MMMM d, y, h:mm:ss a z'` | `June 15, 2015 at 9:03:01 AM GMT+1` |\n * | `'full'` | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |\n * | `'shortDate'` | `'M/d/yy'` | `6/15/15` |\n * | `'mediumDate'`| `'MMM d, y'` | `Jun 15, 2015` |\n * | `'longDate'` | `'MMMM d, y'` | `June 15, 2015` |\n * | `'fullDate'` | `'EEEE, MMMM d, y'` | `Monday, June 15, 2015` |\n * | `'shortTime'` | `'h:mm a'` | `9:03 AM` |\n * | `'mediumTime'`| `'h:mm:ss a'` | `9:03:01 AM` |\n * | `'longTime'` | `'h:mm:ss a z'` | `9:03:01 AM GMT+1` |\n * | `'fullTime'` | `'h:mm:ss a zzzz'` | `9:03:01 AM GMT+01:00` |\n *\n * ### Custom format options\n *\n * You can construct a format string using symbols to specify the components\n * of a date-time value, as described in the following table.\n * Format details depend on the locale.\n * Fields marked with (*) are only available in the extra data set for the given locale.\n *\n * | Field type | Format | Description | Example Value |\n * |-------------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|\n * | Era | G, GG & GGG | Abbreviated | AD |\n * | | GGGG | Wide | Anno Domini |\n * | | GGGGG | Narrow | A |\n * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | ISO Week-numbering year | Y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | YY | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | YYY | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | YYYY | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | Month | M | Numeric: 1 digit | 9, 12 |\n * | | MM | Numeric: 2 digits + zero padded | 09, 12 |\n * | | MMM | Abbreviated | Sep |\n * | | MMMM | Wide | September |\n * | | MMMMM | Narrow | S |\n * | Month standalone | L | Numeric: 1 digit | 9, 12 |\n * | | LL | Numeric: 2 digits + zero padded | 09, 12 |\n * | | LLL | Abbreviated | Sep |\n * | | LLLL | Wide | September |\n * | | LLLLL | Narrow | S |\n * | ISO Week of year | w | Numeric: minimum digits | 1... 53 |\n * | | ww | Numeric: 2 digits + zero padded | 01... 53 |\n * | Week of month | W | Numeric: 1 digit | 1... 5 |\n * | Day of month | d | Numeric: minimum digits | 1 |\n * | | dd | Numeric: 2 digits + zero padded | 01 |\n * | Week day | E, EE & EEE | Abbreviated | Tue |\n * | | EEEE | Wide | Tuesday |\n * | | EEEEE | Narrow | T |\n * | | EEEEEE | Short | Tu |\n * | Week day standalone | c, cc | Numeric: 1 digit | 2 |\n * | | ccc | Abbreviated | Tue |\n * | | cccc | Wide | Tuesday |\n * | | ccccc | Narrow | T |\n * | | cccccc | Short | Tu |\n * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |\n * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |\n * | | aaaaa | Narrow | a/p |\n * | Period* | B, BB & BBB | Abbreviated | mid. |\n * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | BBBBB | Narrow | md |\n * | Period standalone* | b, bb & bbb | Abbreviated | mid. |\n * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | bbbbb | Narrow | md |\n * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |\n * | | hh | Numeric: 2 digits + zero padded | 01, 12 |\n * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |\n * | | HH | Numeric: 2 digits + zero padded | 00, 23 |\n * | Minute | m | Numeric: minimum digits | 8, 59 |\n * | | mm | Numeric: 2 digits + zero padded | 08, 59 |\n * | Second | s | Numeric: minimum digits | 0... 59 |\n * | | ss | Numeric: 2 digits + zero padded | 00... 59 |\n * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |\n * | | SS | Numeric: 2 digits + zero padded | 00... 99 |\n * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |\n * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |\n * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |\n * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |\n * | | ZZZZ | Long localized GMT format | GMT-8:00 |\n * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |\n * | | O, OO & OOO | Short localized GMT format | GMT-8 |\n * | | OOOO | Long localized GMT format | GMT-08:00 |\n *\n *\n * ### Format examples\n *\n * These examples transform a date into various formats,\n * assuming that `dateObj` is a JavaScript `Date` object for\n * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,\n * given in the local time for the `en-US` locale.\n *\n * ```\n * {{ dateObj | date }} // output is 'Jun 15, 2015'\n * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'\n * {{ dateObj | date:'shortTime' }} // output is '9:43 PM'\n * {{ dateObj | date:'mm:ss' }} // output is '43:11'\n * {{ dateObj | date:\"MMM dd, yyyy 'at' hh:mm a\" }} // output is 'Jun 15, 2015 at 09:43 PM'\n * ```\n *\n * ### Usage example\n *\n * The following component uses a date pipe to display the current date in different formats.\n *\n * ```angular-ts\n * @Component({\n * selector: 'date-pipe',\n * template: `\n *
Today is {{today | date}}
\n *
Or if you prefer, {{today | date:'fullDate'}}
\n *
The time is {{today | date:'h:mm a z'}}
\n *
`\n * })\n * // Get the current date and time as a date-time value.\n * export class DatePipeComponent {\n * today: number = Date.now();\n * }\n * ```\n *\n * @publicApi\n */\nclass DatePipe {\n locale;\n defaultTimezone;\n defaultOptions;\n constructor(locale, defaultTimezone, defaultOptions) {\n this.locale = locale;\n this.defaultTimezone = defaultTimezone;\n this.defaultOptions = defaultOptions;\n }\n transform(value, format, timezone, locale) {\n if (value == null || value === '' || value !== value) return null;\n try {\n const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;\n const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;\n return formatDate(value, _format, locale || this.locale, _timezone);\n } catch (error) {\n throw invalidPipeArgumentError(DatePipe, error.message);\n }\n }\n static ɵfac = function DatePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16), i0.ɵɵdirectiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), i0.ɵɵdirectiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"date\",\n type: DatePipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{\n type: Pipe,\n args: [{\n name: 'date'\n }]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [DATE_PIPE_DEFAULT_TIMEZONE]\n }, {\n type: Optional\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [DATE_PIPE_DEFAULT_OPTIONS]\n }, {\n type: Optional\n }]\n }], null);\n})();\nconst _INTERPOLATION_REGEXP = /#/g;\n/**\n * @ngModule CommonModule\n * @description\n *\n * Maps a value to a string that pluralizes the value according to locale rules.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}\n *\n * @publicApi\n */\nclass I18nPluralPipe {\n _localization;\n constructor(_localization) {\n this._localization = _localization;\n }\n /**\n * @param value the number to be formatted\n * @param pluralMap an object that mimics the ICU format, see\n * https://unicode-org.github.io/icu/userguide/format_parse/messages/.\n * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by\n * default).\n */\n transform(value, pluralMap, locale) {\n if (value == null) return '';\n if (typeof pluralMap !== 'object' || pluralMap === null) {\n throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);\n }\n const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);\n return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());\n }\n static ɵfac = function I18nPluralPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || I18nPluralPipe)(i0.ɵɵdirectiveInject(NgLocalization, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"i18nPlural\",\n type: I18nPluralPipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(I18nPluralPipe, [{\n type: Pipe,\n args: [{\n name: 'i18nPlural'\n }]\n }], () => [{\n type: NgLocalization\n }], null);\n})();\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Generic selector that displays the string that matches the current value.\n *\n * If none of the keys of the `mapping` match the `value`, then the content\n * of the `other` key is returned when present, otherwise an empty string is returned.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}\n *\n * @publicApi\n */\nclass I18nSelectPipe {\n /**\n * @param value a string to be internationalized.\n * @param mapping an object that indicates the text that should be displayed\n * for different values of the provided `value`.\n */\n transform(value, mapping) {\n if (value == null) return '';\n if (typeof mapping !== 'object' || typeof value !== 'string') {\n throw invalidPipeArgumentError(I18nSelectPipe, mapping);\n }\n if (mapping.hasOwnProperty(value)) {\n return mapping[value];\n }\n if (mapping.hasOwnProperty('other')) {\n return mapping['other'];\n }\n return '';\n }\n static ɵfac = function I18nSelectPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || I18nSelectPipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"i18nSelect\",\n type: I18nSelectPipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(I18nSelectPipe, [{\n type: Pipe,\n args: [{\n name: 'i18nSelect'\n }]\n }], null, null);\n})();\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Converts a value into its JSON-format representation. Useful for debugging.\n *\n * @usageNotes\n *\n * The following component uses a JSON pipe to convert an object\n * to JSON format, and displays the string in both formats for comparison.\n *\n * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}\n *\n * @publicApi\n */\nclass JsonPipe {\n /**\n * @param value A value of any type to convert into a JSON-format string.\n */\n transform(value) {\n return JSON.stringify(value, null, 2);\n }\n static ɵfac = function JsonPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || JsonPipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"json\",\n type: JsonPipe,\n pure: false\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(JsonPipe, [{\n type: Pipe,\n args: [{\n name: 'json',\n pure: false\n }]\n }], null, null);\n})();\nfunction makeKeyValuePair(key, value) {\n return {\n key: key,\n value: value\n };\n}\n/**\n * @ngModule CommonModule\n * @description\n *\n * Transforms Object or Map into an array of key value pairs.\n *\n * The output array will be ordered by keys.\n * By default the comparator will be by Unicode point value.\n * You can optionally pass a compareFn if your keys are complex types.\n * Passing `null` as the compareFn will use natural ordering of the input.\n *\n * @usageNotes\n * ### Examples\n *\n * This examples show how an Object or a Map can be iterated by ngFor with the use of this\n * keyvalue pipe.\n *\n * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}\n *\n * @publicApi\n */\nclass KeyValuePipe {\n differs;\n constructor(differs) {\n this.differs = differs;\n }\n differ;\n keyValues = [];\n compareFn = defaultComparator;\n transform(input, compareFn = defaultComparator) {\n if (!input || !(input instanceof Map) && typeof input !== 'object') {\n return null;\n }\n // make a differ for whatever type we've been passed in\n this.differ ??= this.differs.find(input).create();\n const differChanges = this.differ.diff(input);\n const compareFnChanged = compareFn !== this.compareFn;\n if (differChanges) {\n this.keyValues = [];\n differChanges.forEachItem(r => {\n this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));\n });\n }\n if (differChanges || compareFnChanged) {\n if (compareFn) {\n this.keyValues.sort(compareFn);\n }\n this.compareFn = compareFn;\n }\n return this.keyValues;\n }\n static ɵfac = function KeyValuePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || KeyValuePipe)(i0.ɵɵdirectiveInject(i0.KeyValueDiffers, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"keyvalue\",\n type: KeyValuePipe,\n pure: false\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(KeyValuePipe, [{\n type: Pipe,\n args: [{\n name: 'keyvalue',\n pure: false\n }]\n }], () => [{\n type: i0.KeyValueDiffers\n }], null);\n})();\nfunction defaultComparator(keyValueA, keyValueB) {\n const a = keyValueA.key;\n const b = keyValueB.key;\n // If both keys are the same, return 0 (no sorting needed).\n if (a === b) return 0;\n // If one of the keys is `null` or `undefined`, place it at the end of the sort.\n if (a == null) return 1; // `a` comes after `b`.\n if (b == null) return -1; // `b` comes after `a`.\n // If both keys are strings, compare them lexicographically.\n if (typeof a == 'string' && typeof b == 'string') {\n return a < b ? -1 : 1;\n }\n // If both keys are numbers, sort them numerically.\n if (typeof a == 'number' && typeof b == 'number') {\n return a - b;\n }\n // If both keys are booleans, sort `false` before `true`.\n if (typeof a == 'boolean' && typeof b == 'boolean') {\n return a < b ? -1 : 1;\n }\n // Fallback case: if keys are of different types, compare their string representations.\n const aString = String(a);\n const bString = String(b);\n // Compare the string representations lexicographically.\n return aString == bString ? 0 : aString < bString ? -1 : 1;\n}\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a value according to digit options and locale rules.\n * Locale determines group sizing and separator,\n * decimal point character, and other locale-specific configurations.\n *\n * @see {@link formatNumber}\n *\n * @usageNotes\n *\n * ### digitsInfo\n *\n * The value's decimal representation is specified by the `digitsInfo`\n * parameter, written in the following format:
\n *\n * ```\n * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}\n * ```\n *\n * - `minIntegerDigits`:\n * The minimum number of integer digits before the decimal point.\n * Default is 1.\n *\n * - `minFractionDigits`:\n * The minimum number of digits after the decimal point.\n * Default is 0.\n *\n * - `maxFractionDigits`:\n * The maximum number of digits after the decimal point.\n * Default is 3.\n *\n * If the formatted value is truncated it will be rounded using the \"to-nearest\" method:\n *\n * ```\n * {{3.6 | number: '1.0-0'}}\n * \n *\n * {{-3.6 | number:'1.0-0'}}\n * \n * ```\n *\n * ### locale\n *\n * `locale` will format a value according to locale rules.\n * Locale determines group sizing and separator,\n * decimal point character, and other locale-specific configurations.\n *\n * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n *\n * See [Setting your app locale](guide/i18n/locale-id).\n *\n * ### Example\n *\n * The following code shows how the pipe transforms values\n * according to various format specifications,\n * where the caller's default locale is `en-US`.\n *\n * {@example common/pipes/ts/number_pipe.ts region='NumberPipe'}\n *\n * @publicApi\n */\nclass DecimalPipe {\n _locale;\n constructor(_locale) {\n this._locale = _locale;\n }\n transform(value, digitsInfo, locale) {\n if (!isValue(value)) return null;\n locale ||= this._locale;\n try {\n const num = strToNumber(value);\n return formatNumber(num, locale, digitsInfo);\n } catch (error) {\n throw invalidPipeArgumentError(DecimalPipe, error.message);\n }\n }\n static ɵfac = function DecimalPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || DecimalPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"number\",\n type: DecimalPipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(DecimalPipe, [{\n type: Pipe,\n args: [{\n name: 'number'\n }]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }], null);\n})();\n/**\n * @ngModule CommonModule\n * @description\n *\n * Transforms a number to a percentage\n * string, formatted according to locale rules that determine group sizing and\n * separator, decimal-point character, and other locale-specific\n * configurations.\n *\n * @see {@link formatPercent}\n *\n * @usageNotes\n * The following code shows how the pipe transforms numbers\n * into text strings, according to various format specifications,\n * where the caller's default locale is `en-US`.\n *\n * {@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}\n *\n * @publicApi\n */\nclass PercentPipe {\n _locale;\n constructor(_locale) {\n this._locale = _locale;\n }\n /**\n *\n * @param value The number to be formatted as a percentage.\n * @param digitsInfo Decimal representation options, specified by a string\n * in the following format:
\n * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.\n * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.\n * Default is `1`.\n * - `minFractionDigits`: The minimum number of digits after the decimal point.\n * Default is `0`.\n * - `maxFractionDigits`: The maximum number of digits after the decimal point.\n * Default is `0`.\n * @param locale A locale code for the locale format rules to use.\n * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n * See [Setting your app locale](guide/i18n/locale-id).\n */\n transform(value, digitsInfo, locale) {\n if (!isValue(value)) return null;\n locale ||= this._locale;\n try {\n const num = strToNumber(value);\n return formatPercent(num, locale, digitsInfo);\n } catch (error) {\n throw invalidPipeArgumentError(PercentPipe, error.message);\n }\n }\n static ɵfac = function PercentPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PercentPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"percent\",\n type: PercentPipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PercentPipe, [{\n type: Pipe,\n args: [{\n name: 'percent'\n }]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }], null);\n})();\n/**\n * @ngModule CommonModule\n * @description\n *\n * Transforms a number to a currency string, formatted according to locale rules\n * that determine group sizing and separator, decimal-point character,\n * and other locale-specific configurations.\n *\n *\n * @see {@link getCurrencySymbol}\n * @see {@link formatCurrency}\n *\n * @usageNotes\n * The following code shows how the pipe transforms numbers\n * into text strings, according to various format specifications,\n * where the caller's default locale is `en-US`.\n *\n * {@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}\n *\n * @publicApi\n */\nclass CurrencyPipe {\n _locale;\n _defaultCurrencyCode;\n constructor(_locale, _defaultCurrencyCode = 'USD') {\n this._locale = _locale;\n this._defaultCurrencyCode = _defaultCurrencyCode;\n }\n transform(value, currencyCode = this._defaultCurrencyCode, display = 'symbol', digitsInfo, locale) {\n if (!isValue(value)) return null;\n locale ||= this._locale;\n if (typeof display === 'boolean') {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \"code\", \"symbol\" or \"symbol-narrow\".`);\n }\n display = display ? 'symbol' : 'code';\n }\n let currency = currencyCode || this._defaultCurrencyCode;\n if (display !== 'code') {\n if (display === 'symbol' || display === 'symbol-narrow') {\n currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);\n } else {\n currency = display;\n }\n }\n try {\n const num = strToNumber(value);\n return formatCurrency(num, locale, currency, currencyCode, digitsInfo);\n } catch (error) {\n throw invalidPipeArgumentError(CurrencyPipe, error.message);\n }\n }\n static ɵfac = function CurrencyPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || CurrencyPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16), i0.ɵɵdirectiveInject(DEFAULT_CURRENCY_CODE, 16));\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"currency\",\n type: CurrencyPipe,\n pure: true\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(CurrencyPipe, [{\n type: Pipe,\n args: [{\n name: 'currency'\n }]\n }], () => [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [DEFAULT_CURRENCY_CODE]\n }]\n }], null);\n})();\nfunction isValue(value) {\n return !(value == null || value === '' || value !== value);\n}\n/**\n * Transforms a string into a number (if needed).\n */\nfunction strToNumber(value) {\n // Convert strings to numbers\n if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {\n return Number(value);\n }\n if (typeof value !== 'number') {\n throw new _RuntimeError(2309 /* RuntimeErrorCode.VALUE_NOT_A_NUMBER */, ngDevMode && `${value} is not a number`);\n }\n return value;\n}\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Creates a new `Array` or `String` containing a subset (slice) of the elements.\n *\n * @usageNotes\n *\n * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`\n * and `String.prototype.slice()`.\n *\n * When operating on an `Array`, the returned `Array` is always a copy even when all\n * the elements are being returned.\n *\n * When operating on a blank value, the pipe returns the blank value.\n *\n * ### List Example\n *\n * This `ngFor` example:\n *\n * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}\n *\n * produces the following:\n *\n * ```html\n * b\n * c\n * ```\n *\n * ### String Examples\n *\n * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}\n *\n * @publicApi\n */\nclass SlicePipe {\n transform(value, start, end) {\n if (value == null) return null;\n const supports = typeof value === 'string' || Array.isArray(value);\n if (!supports) {\n throw invalidPipeArgumentError(SlicePipe, value);\n }\n return value.slice(start, end);\n }\n static ɵfac = function SlicePipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || SlicePipe)();\n };\n static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"slice\",\n type: SlicePipe,\n pure: false\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(SlicePipe, [{\n type: Pipe,\n args: [{\n name: 'slice',\n pure: false\n }]\n }], null, null);\n})();\n\n/**\n * @module\n * @description\n * This module provides a set of common Pipes.\n */\n/**\n * A collection of Angular pipes that are likely to be used in each and every application.\n */\nconst COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];\n\n// Note: This does not contain the location providers,\n// as they need some platform specific implementations to work.\n/**\n * Exports all the basic Angular directives and pipes,\n * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.\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.\n *\n * @publicApi\n */\nclass CommonModule {\n static ɵfac = function CommonModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || CommonModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: CommonModule,\n imports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe],\n exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(CommonModule, [{\n type: NgModule,\n args: [{\n imports: [COMMON_DIRECTIVES, COMMON_PIPES],\n exports: [COMMON_DIRECTIVES, COMMON_PIPES]\n }]\n }], null, null);\n})();\nexport { AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PercentPipe, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits };\n", "/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nfunction parseCookieValue(cookieStr, name) {\n name = encodeURIComponent(name);\n for (const cookie of cookieStr.split(';')) {\n const eqIndex = cookie.indexOf('=');\n const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * @publicApi\n */\nclass XhrFactory {\n}\n\nexport { XhrFactory, parseCookieValue };\n\n", "/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\n\n/**\n * This class wraps the platform Navigation API which allows server-specific and test\n * implementations.\n */\nclass PlatformNavigation {\n static ɵfac = function PlatformNavigation_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PlatformNavigation)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PlatformNavigation,\n factory: () => (() => window.navigation)(),\n providedIn: 'platform'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PlatformNavigation, [{\n type: Injectable,\n args: [{\n providedIn: 'platform',\n useFactory: () => window.navigation\n }]\n }], null, null);\n})();\nexport { PlatformNavigation };\n", "/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nexport { AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PercentPipe, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits } from './common_module.mjs';\nimport * as i0 from '@angular/core';\nimport { ɵregisterLocaleData as _registerLocaleData, Version, ɵɵdefineInjectable as __defineInjectable, inject, DOCUMENT, ɵformatRuntimeError as _formatRuntimeError, InjectionToken, ɵRuntimeError as _RuntimeError, Injectable, ɵIMAGE_CONFIG as _IMAGE_CONFIG, Renderer2, ElementRef, Injector, DestroyRef, ɵperformanceMarkFeature as _performanceMarkFeature, NgZone, ApplicationRef, numberAttribute, booleanAttribute, Directive, Input, ɵIMAGE_CONFIG_DEFAULTS as _IMAGE_CONFIG_DEFAULTS, ɵunwrapSafeValue as _unwrapSafeValue, ChangeDetectorRef } from '@angular/core';\nexport { DOCUMENT, ɵIMAGE_CONFIG as IMAGE_CONFIG } from '@angular/core';\nexport { XhrFactory, parseCookieValue as ɵparseCookieValue } from './xhr.mjs';\nexport { APP_BASE_HREF, BrowserPlatformLocation, LOCATION_INITIALIZED, Location, LocationStrategy, PathLocationStrategy, PlatformLocation, DomAdapter as ɵDomAdapter, getDOM as ɵgetDOM, normalizeQueryParams as ɵnormalizeQueryParams, setRootDomAdapter as ɵsetRootDomAdapter } from './location.mjs';\nexport { PlatformNavigation as ɵPlatformNavigation } from './platform_navigation.mjs';\nimport 'rxjs';\n\n/**\n * Register global 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 *\n * @publicApi\n */\nfunction registerLocaleData(data, localeId, extraData) {\n return _registerLocaleData(data, localeId, extraData);\n}\nconst PLATFORM_BROWSER_ID = 'browser';\nconst PLATFORM_SERVER_ID = 'server';\n/**\n * Returns whether a platform id represents a browser platform.\n * @publicApi\n */\nfunction isPlatformBrowser(platformId) {\n return platformId === PLATFORM_BROWSER_ID;\n}\n/**\n * Returns whether a platform id represents a server platform.\n * @publicApi\n */\nfunction isPlatformServer(platformId) {\n return platformId === PLATFORM_SERVER_ID;\n}\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n/**\n * @publicApi\n */\nconst VERSION = new Version('20.1.7');\n\n/**\n * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.\n *\n * @publicApi\n */\nclass ViewportScroller {\n // De-sugared tree-shakable injection\n // See #23917\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: ViewportScroller,\n providedIn: 'root',\n factory: () => typeof ngServerMode !== 'undefined' && ngServerMode ? new NullViewportScroller() : new BrowserViewportScroller(inject(DOCUMENT), window)\n });\n}\n/**\n * Manages the scroll position for a browser window.\n */\nclass BrowserViewportScroller {\n document;\n window;\n offset = () => [0, 0];\n constructor(document, window) {\n this.document = document;\n this.window = window;\n }\n /**\n * Configures the top offset used when scrolling to an anchor.\n * @param offset A position in screen coordinates (a tuple with x and y values)\n * or a function that returns the top offset position.\n *\n */\n setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n } else {\n this.offset = offset;\n }\n }\n /**\n * Retrieves the current scroll position.\n * @returns The position in screen coordinates.\n */\n getScrollPosition() {\n return [this.window.scrollX, this.window.scrollY];\n }\n /**\n * Sets the scroll position.\n * @param position The new position in screen coordinates.\n */\n scrollToPosition(position, options) {\n this.window.scrollTo({\n ...options,\n left: position[0],\n top: position[1]\n });\n }\n /**\n * Scrolls to an element and attempts to focus the element.\n *\n * Note that the function name here is misleading in that the target string may be an ID for a\n * non-anchor element.\n *\n * @param target The ID of an element or name of the anchor.\n *\n * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document\n * @see https://html.spec.whatwg.org/#scroll-to-fragid\n */\n scrollToAnchor(target, options) {\n const elSelected = findAnchorFromDocument(this.document, target);\n if (elSelected) {\n this.scrollToElement(elSelected, options);\n // After scrolling to the element, the spec dictates that we follow the focus steps for the\n // target. Rather than following the robust steps, simply attempt focus.\n //\n // @see https://html.spec.whatwg.org/#get-the-focusable-area\n // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus\n // @see https://html.spec.whatwg.org/#focusable-area\n elSelected.focus();\n }\n }\n /**\n * Disables automatic scroll restoration provided by the browser.\n */\n setHistoryScrollRestoration(scrollRestoration) {\n try {\n this.window.history.scrollRestoration = scrollRestoration;\n } catch {\n console.warn(_formatRuntimeError(2400 /* RuntimeErrorCode.SCROLL_RESTORATION_UNSUPPORTED */, ngDevMode && 'Failed to set `window.history.scrollRestoration`. ' + 'This may occur when:\\n' + '• The script is running inside a sandboxed iframe\\n' + '• The window is partially navigated or inactive\\n' + '• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)\\n' + 'Scroll position may not be preserved across navigation.'));\n }\n }\n /**\n * Scrolls to an element using the native offset and the specified offset set on this scroller.\n *\n * The offset can be used when we know that there is a floating header and scrolling naively to an\n * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.\n */\n scrollToElement(el, options) {\n const rect = el.getBoundingClientRect();\n const left = rect.left + this.window.pageXOffset;\n const top = rect.top + this.window.pageYOffset;\n const offset = this.offset();\n this.window.scrollTo({\n ...options,\n left: left - offset[0],\n top: top - offset[1]\n });\n }\n}\nfunction findAnchorFromDocument(document, target) {\n const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];\n if (documentResult) {\n return documentResult;\n }\n // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we\n // have to traverse the DOM manually and do the lookup through the shadow roots.\n if (typeof document.createTreeWalker === 'function' && document.body && typeof document.body.attachShadow === 'function') {\n const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);\n let currentNode = treeWalker.currentNode;\n while (currentNode) {\n const shadowRoot = currentNode.shadowRoot;\n if (shadowRoot) {\n // Note that `ShadowRoot` doesn't support `getElementsByName`\n // so we have to fall back to `querySelector`.\n const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name=\"${target}\"]`);\n if (result) {\n return result;\n }\n }\n currentNode = treeWalker.nextNode();\n }\n }\n return null;\n}\n/**\n * Provides an empty implementation of the viewport scroller.\n */\nclass NullViewportScroller {\n /**\n * Empty implementation\n */\n setOffset(offset) {}\n /**\n * Empty implementation\n */\n getScrollPosition() {\n return [0, 0];\n }\n /**\n * Empty implementation\n */\n scrollToPosition(position) {}\n /**\n * Empty implementation\n */\n scrollToAnchor(anchor) {}\n /**\n * Empty implementation\n */\n setHistoryScrollRestoration(scrollRestoration) {}\n}\n\n/**\n * Value (out of 100) of the requested quality for placeholder images.\n */\nconst PLACEHOLDER_QUALITY = '20';\n\n// Converts a string that represents a URL into a URL class instance.\nfunction getUrl(src, win) {\n // Don't use a base URL is the URL is absolute.\n return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);\n}\n// Checks whether a URL is absolute (i.e. starts with `http://` or `https://`).\nfunction isAbsoluteUrl(src) {\n return /^https?:\\/\\//.test(src);\n}\n// Given a URL, extract the hostname part.\n// If a URL is a relative one - the URL is returned as is.\nfunction extractHostname(url) {\n return isAbsoluteUrl(url) ? new URL(url).hostname : url;\n}\nfunction isValidPath(path) {\n const isString = typeof path === 'string';\n if (!isString || path.trim() === '') {\n return false;\n }\n // Calling new URL() will throw if the path string is malformed\n try {\n const url = new URL(path);\n return true;\n } catch {\n return false;\n }\n}\nfunction normalizePath(path) {\n return path.endsWith('/') ? path.slice(0, -1) : path;\n}\nfunction normalizeSrc(src) {\n return src.startsWith('/') ? src.slice(1) : src;\n}\n\n/**\n * Noop image loader that does no transformation to the original src and just returns it as is.\n * This loader is used as a default one if more specific logic is not provided in an app config.\n *\n * @see {@link ImageLoader}\n * @see {@link NgOptimizedImage}\n */\nconst noopImageLoader = config => config.src;\n/**\n * Injection token that configures the image loader function.\n *\n * @see {@link ImageLoader}\n * @see {@link NgOptimizedImage}\n * @publicApi\n */\nconst IMAGE_LOADER = new InjectionToken(ngDevMode ? 'ImageLoader' : '', {\n providedIn: 'root',\n factory: () => noopImageLoader\n});\n/**\n * Internal helper function that makes it easier to introduce custom image loaders for the\n * `NgOptimizedImage` directive. It is enough to specify a URL builder function to obtain full DI\n * configuration for a given loader: a DI token corresponding to the actual loader function, plus DI\n * tokens managing preconnect check functionality.\n * @param buildUrlFn a function returning a full URL based on loader's configuration\n * @param exampleUrls example of full URLs for a given loader (used in error messages)\n * @returns a set of DI providers corresponding to the configured image loader\n */\nfunction createImageLoader(buildUrlFn, exampleUrls) {\n return function provideImageLoader(path) {\n if (!isValidPath(path)) {\n throwInvalidPathError(path, exampleUrls || []);\n }\n // The trailing / is stripped (if provided) to make URL construction (concatenation) easier in\n // the individual loader functions.\n path = normalizePath(path);\n const loaderFn = config => {\n if (isAbsoluteUrl(config.src)) {\n // Image loader functions expect an image file name (e.g. `my-image.png`)\n // or a relative path + a file name (e.g. `/a/b/c/my-image.png`) as an input,\n // so the final absolute URL can be constructed.\n // When an absolute URL is provided instead - the loader can not\n // build a final URL, thus the error is thrown to indicate that.\n throwUnexpectedAbsoluteUrlError(path, config.src);\n }\n return buildUrlFn(path, {\n ...config,\n src: normalizeSrc(config.src)\n });\n };\n const providers = [{\n provide: IMAGE_LOADER,\n useValue: loaderFn\n }];\n return providers;\n };\n}\nfunction throwInvalidPathError(path, exampleUrls) {\n throw new _RuntimeError(2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected an invalid path (\\`${path}\\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(' or ')}`);\n}\nfunction throwUnexpectedAbsoluteUrlError(path, url) {\n throw new _RuntimeError(2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected a \\`
\\` tag with an invalid \\`ngSrc\\` attribute: ${url}. ` + `This image loader expects \\`ngSrc\\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \\`ngSrc\\` as a path relative to the base URL ` + `configured for this loader (\\`${path}\\`).`);\n}\n\n/**\n * Function that generates an ImageLoader for [Cloudflare Image\n * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular\n * provider. Note: Cloudflare has multiple image products - this provider is specifically for\n * Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.\n *\n * @param path Your domain name, e.g. https://mysite.com\n * @returns Provider that provides an ImageLoader function\n *\n * @publicApi\n */\nconst provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https:///cdn-cgi/image//'] : undefined);\nfunction createCloudflareUrl(path, config) {\n let params = `format=auto`;\n if (config.width) {\n params += `,width=${config.width}`;\n }\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n params += `,quality=${PLACEHOLDER_QUALITY}`;\n }\n // Cloudflare image URLs format:\n // https://developers.cloudflare.com/images/image-resizing/url-format/\n return `${path}/cdn-cgi/image/${params}/${config.src}`;\n}\n\n/**\n * Name and URL tester for Cloudinary.\n */\nconst cloudinaryLoaderInfo = {\n name: 'Cloudinary',\n testUrl: isCloudinaryUrl\n};\nconst CLOUDINARY_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.cloudinary\\.com\\/.+/;\n/**\n * Tests whether a URL is from Cloudinary CDN.\n */\nfunction isCloudinaryUrl(url) {\n return CLOUDINARY_LOADER_REGEX.test(url);\n}\n/**\n * Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.\n *\n * @param path Base URL of your Cloudinary images\n * This URL should match one of the following formats:\n * https://res.cloudinary.com/mysite\n * https://mysite.cloudinary.com\n * https://subdomain.mysite.com\n * @returns Set of providers to configure the Cloudinary loader.\n *\n * @publicApi\n */\nconst provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ['https://res.cloudinary.com/mysite', 'https://mysite.cloudinary.com', 'https://subdomain.mysite.com'] : undefined);\nfunction createCloudinaryUrl(path, config) {\n // Cloudinary image URLformat:\n // https://cloudinary.com/documentation/image_transformations#transformation_url_structure\n // Example of a Cloudinary image URL:\n // https://res.cloudinary.com/mysite/image/upload/c_scale,f_auto,q_auto,w_600/marketing/tile-topics-m.png\n // For a placeholder image, we use the lowest image setting available to reduce the load time\n // else we use the auto size\n const quality = config.isPlaceholder ? 'q_auto:low' : 'q_auto';\n let params = `f_auto,${quality}`;\n if (config.width) {\n params += `,w_${config.width}`;\n }\n if (config.loaderParams?.['rounded']) {\n params += `,r_max`;\n }\n return `${path}/image/upload/${params}/${config.src}`;\n}\n\n/**\n * Name and URL tester for ImageKit.\n */\nconst imageKitLoaderInfo = {\n name: 'ImageKit',\n testUrl: isImageKitUrl\n};\nconst IMAGE_KIT_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.imagekit\\.io\\/.+/;\n/**\n * Tests whether a URL is from ImageKit CDN.\n */\nfunction isImageKitUrl(url) {\n return IMAGE_KIT_LOADER_REGEX.test(url);\n}\n/**\n * Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.\n *\n * @param path Base URL of your ImageKit images\n * This URL should match one of the following formats:\n * https://ik.imagekit.io/myaccount\n * https://subdomain.mysite.com\n * @returns Set of providers to configure the ImageKit loader.\n *\n * @publicApi\n */\nconst provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined);\nfunction createImagekitUrl(path, config) {\n // Example of an ImageKit image URL:\n // https://ik.imagekit.io/demo/tr:w-300,h-300/medium_cafe_B1iTdD0C.jpg\n const {\n src,\n width\n } = config;\n const params = [];\n if (width) {\n params.push(`w-${width}`);\n }\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n params.push(`q-${PLACEHOLDER_QUALITY}`);\n }\n const urlSegments = params.length ? [path, `tr:${params.join(',')}`, src] : [path, src];\n const url = new URL(urlSegments.join('/'));\n return url.href;\n}\n\n/**\n * Name and URL tester for Imgix.\n */\nconst imgixLoaderInfo = {\n name: 'Imgix',\n testUrl: isImgixUrl\n};\nconst IMGIX_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.imgix\\.net\\/.+/;\n/**\n * Tests whether a URL is from Imgix CDN.\n */\nfunction isImgixUrl(url) {\n return IMGIX_LOADER_REGEX.test(url);\n}\n/**\n * Function that generates an ImageLoader for Imgix and turns it into an Angular provider.\n *\n * @param path path to the desired Imgix origin,\n * e.g. https://somepath.imgix.net or https://images.mysite.com\n * @returns Set of providers to configure the Imgix loader.\n *\n * @publicApi\n */\nconst provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined);\nfunction createImgixUrl(path, config) {\n const url = new URL(`${path}/${config.src}`);\n // This setting ensures the smallest allowable format is set.\n url.searchParams.set('auto', 'format');\n if (config.width) {\n url.searchParams.set('w', config.width.toString());\n }\n // When requesting a placeholder image we ask a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n url.searchParams.set('q', PLACEHOLDER_QUALITY);\n }\n return url.href;\n}\n\n/**\n * Name and URL tester for Netlify.\n */\nconst netlifyLoaderInfo = {\n name: 'Netlify',\n testUrl: isNetlifyUrl\n};\nconst NETLIFY_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.netlify\\.app\\/.+/;\n/**\n * Tests whether a URL is from a Netlify site. This won't catch sites with a custom domain,\n * but it's a good start for sites in development. This is only used to warn users who haven't\n * configured an image loader.\n */\nfunction isNetlifyUrl(url) {\n return NETLIFY_LOADER_REGEX.test(url);\n}\n/**\n * Function that generates an ImageLoader for Netlify and turns it into an Angular provider.\n *\n * @param path optional URL of the desired Netlify site. Defaults to the current site.\n * @returns Set of providers to configure the Netlify loader.\n *\n * @publicApi\n */\nfunction provideNetlifyLoader(path) {\n if (path && !isValidPath(path)) {\n throw new _RuntimeError(2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected an invalid path (\\`${path}\\`). ` + `To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`);\n }\n if (path) {\n const url = new URL(path);\n path = url.origin;\n }\n const loaderFn = config => {\n return createNetlifyUrl(config, path);\n };\n const providers = [{\n provide: IMAGE_LOADER,\n useValue: loaderFn\n }];\n return providers;\n}\nconst validParams = new Map([['height', 'h'], ['fit', 'fit'], ['quality', 'q'], ['q', 'q'], ['position', 'position']]);\nfunction createNetlifyUrl(config, path) {\n // Note: `path` can be undefined, in which case we use a fake one to construct a `URL` instance.\n const url = new URL(path ?? 'https://a/');\n url.pathname = '/.netlify/images';\n if (!isAbsoluteUrl(config.src) && !config.src.startsWith('/')) {\n config.src = '/' + config.src;\n }\n url.searchParams.set('url', config.src);\n if (config.width) {\n url.searchParams.set('w', config.width.toString());\n }\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n // If the quality is specified in the loader config - always use provided value.\n const configQuality = config.loaderParams?.['quality'] ?? config.loaderParams?.['q'];\n if (config.isPlaceholder && !configQuality) {\n url.searchParams.set('q', PLACEHOLDER_QUALITY);\n }\n for (const [param, value] of Object.entries(config.loaderParams ?? {})) {\n if (validParams.has(param)) {\n url.searchParams.set(validParams.get(param), value.toString());\n } else {\n if (ngDevMode) {\n console.warn(_formatRuntimeError(2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, `The Netlify image loader has detected an \\`
\\` tag with the unsupported attribute \"\\`${param}\\`\".`));\n }\n }\n }\n // The \"a\" hostname is used for relative URLs, so we can remove it from the final URL.\n return url.hostname === 'a' ? url.href.replace(url.origin, '') : url.href;\n}\n\n// Assembles directive details string, useful for error messages.\nfunction imgDirectiveDetails(ngSrc, includeNgSrc = true) {\n const ngSrcInfo = includeNgSrc ? `(activated on an
element with the \\`ngSrc=\"${ngSrc}\"\\`) ` : '';\n return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;\n}\n\n/**\n * Asserts that the application is in development mode. Throws an error if the application is in\n * production mode. This assert can be used to make sure that there is no dev-mode code invoked in\n * the prod mode accidentally.\n */\nfunction assertDevMode(checkName) {\n if (!ngDevMode) {\n throw new _RuntimeError(2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`);\n }\n}\n\n/**\n * Observer that detects whether an image with `NgOptimizedImage`\n * is treated as a Largest Contentful Paint (LCP) element. If so,\n * asserts that the image has the `priority` attribute.\n *\n * Note: this is a dev-mode only class and it does not appear in prod bundles,\n * thus there is no `ngDevMode` use in the code.\n *\n * Based on https://web.dev/lcp/#measure-lcp-in-javascript.\n */\nclass LCPImageObserver {\n // Map of full image URLs -> original `ngSrc` values.\n images = new Map();\n window = inject(DOCUMENT).defaultView;\n observer = null;\n constructor() {\n assertDevMode('LCP checker');\n if ((typeof ngServerMode === 'undefined' || !ngServerMode) && typeof PerformanceObserver !== 'undefined') {\n this.observer = this.initPerformanceObserver();\n }\n }\n /**\n * Inits PerformanceObserver and subscribes to LCP events.\n * Based on https://web.dev/lcp/#measure-lcp-in-javascript\n */\n initPerformanceObserver() {\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 not supported by the directive.\n if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return;\n const img = this.images.get(imgSrc);\n if (!img) return;\n if (!img.priority && !img.alreadyWarnedPriority) {\n img.alreadyWarnedPriority = true;\n logMissingPriorityError(imgSrc);\n }\n if (img.modified && !img.alreadyWarnedModified) {\n img.alreadyWarnedModified = true;\n logModifiedWarning(imgSrc);\n }\n });\n observer.observe({\n type: 'largest-contentful-paint',\n buffered: true\n });\n return observer;\n }\n registerImage(rewrittenSrc, originalNgSrc, isPriority) {\n if (!this.observer) return;\n const newObservedImageState = {\n priority: isPriority,\n modified: false,\n alreadyWarnedModified: false,\n alreadyWarnedPriority: false\n };\n this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);\n }\n unregisterImage(rewrittenSrc) {\n if (!this.observer) return;\n this.images.delete(getUrl(rewrittenSrc, this.window).href);\n }\n updateImage(originalSrc, newSrc) {\n if (!this.observer) return;\n const originalUrl = getUrl(originalSrc, this.window).href;\n const img = this.images.get(originalUrl);\n if (img) {\n img.modified = true;\n this.images.set(getUrl(newSrc, this.window).href, img);\n this.images.delete(originalUrl);\n }\n }\n ngOnDestroy() {\n if (!this.observer) return;\n this.observer.disconnect();\n this.images.clear();\n }\n static ɵfac = function LCPImageObserver_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || LCPImageObserver)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: LCPImageObserver,\n factory: LCPImageObserver.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(LCPImageObserver, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\nfunction logMissingPriorityError(ngSrc) {\n const directiveDetails = imgDirectiveDetails(ngSrc);\n console.error(_formatRuntimeError(2955 /* RuntimeErrorCode.LCP_IMG_MISSING_PRIORITY */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked \"priority\". This image should be marked ` + `\"priority\" in order to prioritize its loading. ` + `To fix this, add the \"priority\" attribute.`));\n}\nfunction logModifiedWarning(ngSrc) {\n const directiveDetails = imgDirectiveDetails(ngSrc);\n console.warn(_formatRuntimeError(2964 /* RuntimeErrorCode.LCP_IMG_NGSRC_MODIFIED */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element and has had its \"ngSrc\" attribute modified. This can cause ` + `slower loading performance. It is recommended not to modify the \"ngSrc\" ` + `property on any image which could be the LCP element.`));\n}\n\n// Set of origins that are always excluded from the preconnect checks.\nconst INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);\n/**\n * Injection token to configure which origins should be excluded\n * from the preconnect checks. It can either be a single string or an array of strings\n * to represent a group of origins, for example:\n *\n * ```ts\n * {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}\n * ```\n *\n * or:\n *\n * ```ts\n * {provide: PRECONNECT_CHECK_BLOCKLIST,\n * useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}\n * ```\n *\n * @publicApi\n */\nconst PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(ngDevMode ? 'PRECONNECT_CHECK_BLOCKLIST' : '');\n/**\n * Contains the logic to detect whether an image, marked with the \"priority\" attribute\n * has a corresponding `` tag in the `document.head`.\n *\n * Note: this is a dev-mode only class, which should not appear in prod bundles,\n * thus there is no `ngDevMode` use in the code.\n */\nclass PreconnectLinkChecker {\n document = inject(DOCUMENT);\n /**\n * Set of tags found on this page.\n * The `null` value indicates that there was no DOM query operation performed.\n */\n preconnectLinks = null;\n /*\n * Keep track of all already seen origin URLs to avoid repeating the same check.\n */\n alreadySeen = new Set();\n window = this.document.defaultView;\n blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);\n constructor() {\n assertDevMode('preconnect link checker');\n const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {\n optional: true\n });\n if (blocklist) {\n this.populateBlocklist(blocklist);\n }\n }\n populateBlocklist(origins) {\n if (Array.isArray(origins)) {\n deepForEach(origins, origin => {\n this.blocklist.add(extractHostname(origin));\n });\n } else {\n this.blocklist.add(extractHostname(origins));\n }\n }\n /**\n * Checks that a preconnect resource hint exists in the head for the\n * given src.\n *\n * @param rewrittenSrc src formatted with loader\n * @param originalNgSrc ngSrc value\n */\n assertPreconnect(rewrittenSrc, originalNgSrc) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) return;\n const imgUrl = getUrl(rewrittenSrc, this.window);\n if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;\n // Register this origin as seen, so we don't check it again later.\n this.alreadySeen.add(imgUrl.origin);\n // Note: we query for preconnect links only *once* and cache the results\n // for the entire lifespan of an application, since it's unlikely that the\n // list would change frequently. This allows to make sure there are no\n // performance implications of making extra DOM lookups for each image.\n this.preconnectLinks ??= this.queryPreconnectLinks();\n if (!this.preconnectLinks.has(imgUrl.origin)) {\n console.warn(_formatRuntimeError(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the of the document:\\n` + ` `));\n }\n }\n queryPreconnectLinks() {\n const preconnectUrls = new Set();\n const links = this.document.querySelectorAll('link[rel=preconnect]');\n for (const link of links) {\n const url = getUrl(link.href, this.window);\n preconnectUrls.add(url.origin);\n }\n return preconnectUrls;\n }\n ngOnDestroy() {\n this.preconnectLinks?.clear();\n this.alreadySeen.clear();\n }\n static ɵfac = function PreconnectLinkChecker_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PreconnectLinkChecker)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PreconnectLinkChecker,\n factory: PreconnectLinkChecker.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PreconnectLinkChecker, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\n/**\n * Invokes a callback for each element in the array. Also invokes a callback\n * recursively for each nested array.\n */\nfunction deepForEach(input, fn) {\n for (let value of input) {\n Array.isArray(value) ? deepForEach(value, fn) : fn(value);\n }\n}\n\n/**\n * In SSR scenarios, a preload `` element is generated for priority images.\n * Having a large number of preload tags may negatively affect the performance,\n * so we warn developers (by throwing an error) if the number of preloaded images\n * is above a certain threshold. This const specifies this threshold.\n */\nconst DEFAULT_PRELOADED_IMAGES_LIMIT = 5;\n/**\n * Helps to keep track of priority images that already have a corresponding\n * preload tag (to avoid generating multiple preload tags with the same URL).\n *\n * This Set tracks the original src passed into the `ngSrc` input not the src after it has been\n * run through the specified `IMAGE_LOADER`.\n */\nconst PRELOADED_IMAGES = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_OPTIMIZED_PRELOADED_IMAGES' : '', {\n providedIn: 'root',\n factory: () => new Set()\n});\n\n/**\n * @description Contains the logic needed to track and add preload link tags to the `` tag. It\n * will also track what images have already had preload link tags added so as to not duplicate link\n * tags.\n *\n * In dev mode this service will validate that the number of preloaded images does not exceed the\n * configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.\n */\nclass PreloadLinkCreator {\n preloadedImages = inject(PRELOADED_IMAGES);\n document = inject(DOCUMENT);\n errorShown = false;\n /**\n * @description Add a preload `` to the `` of the `index.html` that is served from the\n * server while using Angular Universal and SSR to kick off image loads for high priority images.\n *\n * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)\n * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`\n * respectively, on the preload `` tag so that the correctly sized image is preloaded from\n * the CDN.\n *\n * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}\n *\n * @param renderer The `Renderer2` passed in from the directive\n * @param src The original src of the image that is set on the `ngSrc` input.\n * @param srcset The parsed and formatted srcset created from the `ngSrcset` input\n * @param sizes The value of the `sizes` attribute passed in to the `
` tag\n */\n createPreloadLinkTag(renderer, src, srcset, sizes) {\n if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {\n this.errorShown = true;\n console.warn(_formatRuntimeError(2961 /* RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES */, `The \\`NgOptimizedImage\\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the \"priority\" attribute from images with less priority.`));\n }\n if (this.preloadedImages.has(src)) {\n return;\n }\n this.preloadedImages.add(src);\n const preload = renderer.createElement('link');\n renderer.setAttribute(preload, 'as', 'image');\n renderer.setAttribute(preload, 'href', src);\n renderer.setAttribute(preload, 'rel', 'preload');\n renderer.setAttribute(preload, 'fetchpriority', 'high');\n if (sizes) {\n renderer.setAttribute(preload, 'imageSizes', sizes);\n }\n if (srcset) {\n renderer.setAttribute(preload, 'imageSrcset', srcset);\n }\n renderer.appendChild(this.document.head, preload);\n }\n static ɵfac = function PreloadLinkCreator_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PreloadLinkCreator)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: PreloadLinkCreator,\n factory: PreloadLinkCreator.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(PreloadLinkCreator, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n\n/**\n * When a Base64-encoded image is passed as an input to the `NgOptimizedImage` directive,\n * an error is thrown. The image content (as a string) might be very long, thus making\n * it hard to read an error message if the entire string is included. This const defines\n * the number of characters that should be included into the error message. The rest\n * of the content is truncated.\n */\nconst BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;\n/**\n * RegExpr to determine whether a src in a srcset is using width descriptors.\n * Should match something like: \"100w, 200w\".\n */\nconst VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\\s*\\d+w\\s*(,|$)){1,})$/;\n/**\n * RegExpr to determine whether a src in a srcset is using density descriptors.\n * Should match something like: \"1x, 2x, 50x\". Also supports decimals like \"1.5x, 1.50x\".\n */\nconst VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\\s*\\d+(\\.\\d+)?x\\s*(,|$)){1,})$/;\n/**\n * Srcset values with a density descriptor higher than this value will actively\n * throw an error. Such densities are not permitted as they cause image sizes\n * to be unreasonably large and slow down LCP.\n */\nconst ABSOLUTE_SRCSET_DENSITY_CAP = 3;\n/**\n * Used only in error message text to communicate best practices, as we will\n * only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.\n */\nconst RECOMMENDED_SRCSET_DENSITY_CAP = 2;\n/**\n * Used in generating automatic density-based srcsets\n */\nconst DENSITY_SRCSET_MULTIPLIERS = [1, 2];\n/**\n * Used to determine which breakpoints to use on full-width images\n */\nconst VIEWPORT_BREAKPOINT_CUTOFF = 640;\n/**\n * Used to determine whether two aspect ratios are similar in value.\n */\nconst ASPECT_RATIO_TOLERANCE = 0.1;\n/**\n * Used to determine whether the image has been requested at an overly\n * large size compared to the actual rendered image size (after taking\n * into account a typical device pixel ratio). In pixels.\n */\nconst OVERSIZED_IMAGE_TOLERANCE = 1000;\n/**\n * Used to limit automatic srcset generation of very large sources for\n * fixed-size images. In pixels.\n */\nconst FIXED_SRCSET_WIDTH_LIMIT = 1920;\nconst FIXED_SRCSET_HEIGHT_LIMIT = 1080;\n/**\n * Placeholder dimension (height or width) limit in pixels. Angular produces a warning\n * when this limit is crossed.\n */\nconst PLACEHOLDER_DIMENSION_LIMIT = 1000;\n/**\n * Used to warn or error when the user provides an overly large dataURL for the placeholder\n * attribute.\n * Character count of Base64 images is 1 character per byte, and base64 encoding is approximately\n * 33% larger than base images, so 4000 characters is around 3KB on disk and 10000 characters is\n * around 7.7KB. Experimentally, 4000 characters is about 20x20px in PNG or medium-quality JPEG\n * format, and 10,000 is around 50x50px, but there's quite a bit of variation depending on how the\n * image is saved.\n */\nconst DATA_URL_WARN_LIMIT = 4000;\nconst DATA_URL_ERROR_LIMIT = 10000;\n/** Info about built-in loaders we can test for. */\nconst BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];\n/**\n * Threshold for the PRIORITY_TRUE_COUNT\n */\nconst PRIORITY_COUNT_THRESHOLD = 10;\n/**\n * This count is used to log a devMode warning\n * when the count of directive instances with priority=true\n * exceeds the threshold PRIORITY_COUNT_THRESHOLD\n */\nlet IMGS_WITH_PRIORITY_ATTR_COUNT = 0;\n/**\n * Directive that improves image loading performance by enforcing best practices.\n *\n * `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is\n * prioritized by:\n * - Automatically setting the `fetchpriority` attribute on the `
` tag\n * - Lazy loading non-priority images by default\n * - Automatically generating a preconnect link tag in the document head\n *\n * In addition, the directive:\n * - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided\n * - Automatically generates a srcset\n * - Requires that `width` and `height` are set\n * - Warns if `width` or `height` have been set incorrectly\n * - Warns if the image will be visually distorted when rendered\n *\n * @usageNotes\n * The `NgOptimizedImage` directive is marked as [standalone](guide/components/importing) and can\n * be imported directly.\n *\n * Follow the steps below to enable and use the directive:\n * 1. Import it into the necessary NgModule or a standalone Component.\n * 2. Optionally provide an `ImageLoader` if you use an image hosting service.\n * 3. Update the necessary `
` tags in templates and replace `src` attributes with `ngSrc`.\n * Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image\n * download.\n *\n * Step 1: import the `NgOptimizedImage` directive.\n *\n * ```ts\n * import { NgOptimizedImage } from '@angular/common';\n *\n * // Include it into the necessary NgModule\n * @NgModule({\n * imports: [NgOptimizedImage],\n * })\n * class AppModule {}\n *\n * // ... or a standalone Component\n * @Component({\n * imports: [NgOptimizedImage],\n * })\n * class MyStandaloneComponent {}\n * ```\n *\n * Step 2: configure a loader.\n *\n * To use the **default loader**: no additional code changes are necessary. The URL returned by the\n * generic loader will always match the value of \"src\". In other words, this loader applies no\n * transformations to the resource URL and the value of the `ngSrc` attribute will be used as is.\n *\n * To use an existing loader for a **third-party image service**: add the provider factory for your\n * chosen service to the `providers` array. In the example below, the Imgix loader is used:\n *\n * ```ts\n * import {provideImgixLoader} from '@angular/common';\n *\n * // Call the function and add the result to the `providers` array:\n * providers: [\n * provideImgixLoader(\"https://my.base.url/\"),\n * ],\n * ```\n *\n * The `NgOptimizedImage` directive provides the following functions:\n * - `provideCloudflareLoader`\n * - `provideCloudinaryLoader`\n * - `provideImageKitLoader`\n * - `provideImgixLoader`\n *\n * If you use a different image provider, you can create a custom loader function as described\n * below.\n *\n * To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI\n * token.\n *\n * ```ts\n * import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';\n *\n * // Configure the loader using the `IMAGE_LOADER` token.\n * providers: [\n * {\n * provide: IMAGE_LOADER,\n * useValue: (config: ImageLoaderConfig) => {\n * return `https://example.com/${config.src}-${config.width}.jpg`;\n * }\n * },\n * ],\n * ```\n *\n * Step 3: update `
` tags in templates to use `ngSrc` instead of `src`.\n *\n * ```html\n *
\n * ```\n *\n * @publicApi\n */\nclass NgOptimizedImage {\n imageLoader = inject(IMAGE_LOADER);\n config = processConfig(inject(_IMAGE_CONFIG));\n renderer = inject(Renderer2);\n imgElement = inject(ElementRef).nativeElement;\n injector = inject(Injector);\n // An LCP image observer should be injected only in development mode.\n // Do not assign it to `null` to avoid having a redundant property in the production bundle.\n lcpObserver;\n /**\n * Calculate the rewritten `src` once and store it.\n * This is needed to avoid repetitive calculations and make sure the directive cleanup in the\n * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other\n * instance that might be already destroyed).\n */\n _renderedSrc = null;\n /**\n * Name of the source image.\n * Image name will be processed by the image loader and the final URL will be applied as the `src`\n * property of the image.\n */\n ngSrc;\n /**\n * A comma separated list of width or density descriptors.\n * The image name will be taken from `ngSrc` and combined with the list of width or density\n * descriptors to generate the final `srcset` property of the image.\n *\n * Example:\n * ```html\n *
=>\n *
\n * ```\n */\n ngSrcset;\n /**\n * The base `sizes` attribute passed through to the `
` element.\n * Providing sizes causes the image to create an automatic responsive srcset.\n */\n sizes;\n /**\n * For responsive images: the intrinsic width of the image in pixels.\n * For fixed size images: the desired rendered width of the image in pixels.\n */\n width;\n /**\n * For responsive images: the intrinsic height of the image in pixels.\n * For fixed size images: the desired rendered height of the image in pixels.\n */\n height;\n /**\n * The desired decoding behavior for the image. Defaults to `auto`\n * if not explicitly set, matching native browser behavior.\n *\n * Use `async` to decode the image off the main thread (non-blocking),\n * `sync` for immediate decoding (blocking), or `auto` to let the\n * browser decide the optimal strategy.\n *\n * [Spec](https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint)\n */\n decoding;\n /**\n * The desired loading behavior (lazy, eager, or auto). Defaults to `lazy`,\n * which is recommended for most images.\n *\n * Warning: Setting images as loading=\"eager\" or loading=\"auto\" marks them\n * as non-priority images and can hurt loading performance. For images which\n * may be the LCP element, use the `priority` attribute instead of `loading`.\n */\n loading;\n /**\n * Indicates whether this image should have a high priority.\n */\n priority = false;\n /**\n * Data to pass through to custom loaders.\n */\n loaderParams;\n /**\n * Disables automatic srcset generation for this image.\n */\n disableOptimizedSrcset = false;\n /**\n * Sets the image to \"fill mode\", which eliminates the height/width requirement and adds\n * styles such that the image fills its containing element.\n */\n fill = false;\n /**\n * A URL or data URL for an image to be used as a placeholder while this image loads.\n */\n placeholder;\n /**\n * Configuration object for placeholder settings. Options:\n * * blur: Setting this to false disables the automatic CSS blur.\n */\n placeholderConfig;\n /**\n * Value of the `src` attribute if set on the host `
` element.\n * This input is exclusively read to assert that `src` is not set in conflict\n * with `ngSrc` and that images don't start to load until a lazy loading strategy is set.\n * @internal\n */\n src;\n /**\n * Value of the `srcset` attribute if set on the host `
` element.\n * This input is exclusively read to assert that `srcset` is not set in conflict\n * with `ngSrcset` and that images don't start to load until a lazy loading strategy is set.\n * @internal\n */\n srcset;\n constructor() {\n if (ngDevMode) {\n this.lcpObserver = this.injector.get(LCPImageObserver);\n // Using `DestroyRef` to avoid having an empty `ngOnDestroy` method since this\n // is only run in development mode.\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => {\n if (!this.priority && this._renderedSrc !== null) {\n this.lcpObserver.unregisterImage(this._renderedSrc);\n }\n });\n }\n }\n /** @docs-private */\n ngOnInit() {\n _performanceMarkFeature('NgOptimizedImage');\n if (ngDevMode) {\n const ngZone = this.injector.get(NgZone);\n assertNonEmptyInput(this, 'ngSrc', this.ngSrc);\n assertValidNgSrcset(this, this.ngSrcset);\n assertNoConflictingSrc(this);\n if (this.ngSrcset) {\n assertNoConflictingSrcset(this);\n }\n assertNotBase64Image(this);\n assertNotBlobUrl(this);\n if (this.fill) {\n assertEmptyWidthAndHeight(this);\n // This leaves the Angular zone to avoid triggering unnecessary change detection cycles when\n // `load` tasks are invoked on images.\n ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));\n } else {\n assertNonEmptyWidthAndHeight(this);\n if (this.height !== undefined) {\n assertGreaterThanZero(this, this.height, 'height');\n }\n if (this.width !== undefined) {\n assertGreaterThanZero(this, this.width, 'width');\n }\n // Only check for distorted images when not in fill mode, where\n // images may be intentionally stretched, cropped or letterboxed.\n ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));\n }\n assertValidLoadingInput(this);\n assertValidDecodingInput(this);\n if (!this.ngSrcset) {\n assertNoComplexSizes(this);\n }\n assertValidPlaceholder(this, this.imageLoader);\n assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);\n assertNoNgSrcsetWithoutLoader(this, this.imageLoader);\n assertNoLoaderParamsWithoutLoader(this, this.imageLoader);\n ngZone.runOutsideAngular(() => {\n this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);\n });\n if (this.priority) {\n const checker = this.injector.get(PreconnectLinkChecker);\n checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);\n if (typeof ngServerMode !== 'undefined' && !ngServerMode) {\n const applicationRef = this.injector.get(ApplicationRef);\n assetPriorityCountBelowThreshold(applicationRef);\n }\n }\n }\n if (this.placeholder) {\n this.removePlaceholderOnLoad(this.imgElement);\n }\n this.setHostAttributes();\n }\n setHostAttributes() {\n // Must set width/height explicitly in case they are bound (in which case they will\n // only be reflected and not found by the browser)\n if (this.fill) {\n this.sizes ||= '100vw';\n } else {\n this.setHostAttribute('width', this.width.toString());\n this.setHostAttribute('height', this.height.toString());\n }\n this.setHostAttribute('loading', this.getLoadingBehavior());\n this.setHostAttribute('fetchpriority', this.getFetchPriority());\n this.setHostAttribute('decoding', this.getDecoding());\n // The `data-ng-img` attribute flags an image as using the directive, to allow\n // for analysis of the directive's performance.\n this.setHostAttribute('ng-img', 'true');\n // The `src` and `srcset` attributes should be set last since other attributes\n // could affect the image's loading behavior.\n const rewrittenSrcset = this.updateSrcAndSrcset();\n if (this.sizes) {\n if (this.getLoadingBehavior() === 'lazy') {\n this.setHostAttribute('sizes', 'auto, ' + this.sizes);\n } else {\n this.setHostAttribute('sizes', this.sizes);\n }\n } else {\n if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === 'lazy') {\n this.setHostAttribute('sizes', 'auto, 100vw');\n }\n }\n if (typeof ngServerMode !== 'undefined' && ngServerMode && this.priority) {\n const preloadLinkCreator = this.injector.get(PreloadLinkCreator);\n preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);\n }\n }\n /** @docs-private */\n ngOnChanges(changes) {\n if (ngDevMode) {\n assertNoPostInitInputChange(this, changes, ['ngSrcset', 'width', 'height', 'priority', 'fill', 'loading', 'sizes', 'loaderParams', 'disableOptimizedSrcset']);\n }\n if (changes['ngSrc'] && !changes['ngSrc'].isFirstChange()) {\n const oldSrc = this._renderedSrc;\n this.updateSrcAndSrcset(true);\n if (ngDevMode) {\n const newSrc = this._renderedSrc;\n if (oldSrc && newSrc && oldSrc !== newSrc) {\n const ngZone = this.injector.get(NgZone);\n ngZone.runOutsideAngular(() => {\n this.lcpObserver.updateImage(oldSrc, newSrc);\n });\n }\n }\n }\n if (ngDevMode && changes['placeholder']?.currentValue && typeof ngServerMode !== 'undefined' && !ngServerMode) {\n assertPlaceholderDimensions(this, this.imgElement);\n }\n }\n callImageLoader(configWithoutCustomParams) {\n let augmentedConfig = configWithoutCustomParams;\n if (this.loaderParams) {\n augmentedConfig.loaderParams = this.loaderParams;\n }\n return this.imageLoader(augmentedConfig);\n }\n getLoadingBehavior() {\n if (!this.priority && this.loading !== undefined) {\n return this.loading;\n }\n return this.priority ? 'eager' : 'lazy';\n }\n getFetchPriority() {\n return this.priority ? 'high' : 'auto';\n }\n getDecoding() {\n if (this.priority) {\n // `sync` means the image is decoded immediately when it's loaded,\n // reducing the risk of content shifting later (important for LCP).\n // If we're marking an image as priority, we want it decoded and\n // painted as early as possible.\n return 'sync';\n }\n // Returns the value of the `decoding` attribute, defaulting to `auto`\n // if not explicitly provided. This mimics native browser behavior and\n // avoids breaking changes when no decoding strategy is specified.\n return this.decoding ?? 'auto';\n }\n getRewrittenSrc() {\n // ImageLoaderConfig supports setting a width property. However, we're not setting width here\n // because if the developer uses rendered width instead of intrinsic width in the HTML width\n // attribute, the image requested may be too small for 2x+ screens.\n if (!this._renderedSrc) {\n const imgConfig = {\n src: this.ngSrc\n };\n // Cache calculated image src to reuse it later in the code.\n this._renderedSrc = this.callImageLoader(imgConfig);\n }\n return this._renderedSrc;\n }\n getRewrittenSrcset() {\n const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);\n const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => {\n srcStr = srcStr.trim();\n const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;\n return `${this.callImageLoader({\n src: this.ngSrc,\n width\n })} ${srcStr}`;\n });\n return finalSrcs.join(', ');\n }\n getAutomaticSrcset() {\n if (this.sizes) {\n return this.getResponsiveSrcset();\n } else {\n return this.getFixedSrcset();\n }\n }\n getResponsiveSrcset() {\n const {\n breakpoints\n } = this.config;\n let filteredBreakpoints = breakpoints;\n if (this.sizes?.trim() === '100vw') {\n // Since this is a full-screen-width image, our srcset only needs to include\n // breakpoints with full viewport widths.\n filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF);\n }\n const finalSrcs = filteredBreakpoints.map(bp => `${this.callImageLoader({\n src: this.ngSrc,\n width: bp\n })} ${bp}w`);\n return finalSrcs.join(', ');\n }\n updateSrcAndSrcset(forceSrcRecalc = false) {\n if (forceSrcRecalc) {\n // Reset cached value, so that the followup `getRewrittenSrc()` call\n // will recalculate it and update the cache.\n this._renderedSrc = null;\n }\n const rewrittenSrc = this.getRewrittenSrc();\n this.setHostAttribute('src', rewrittenSrc);\n let rewrittenSrcset = undefined;\n if (this.ngSrcset) {\n rewrittenSrcset = this.getRewrittenSrcset();\n } else if (this.shouldGenerateAutomaticSrcset()) {\n rewrittenSrcset = this.getAutomaticSrcset();\n }\n if (rewrittenSrcset) {\n this.setHostAttribute('srcset', rewrittenSrcset);\n }\n return rewrittenSrcset;\n }\n getFixedSrcset() {\n const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => `${this.callImageLoader({\n src: this.ngSrc,\n width: this.width * multiplier\n })} ${multiplier}x`);\n return finalSrcs.join(', ');\n }\n shouldGenerateAutomaticSrcset() {\n let oversizedImage = false;\n if (!this.sizes) {\n oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;\n }\n return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;\n }\n /**\n * Returns an image url formatted for use with the CSS background-image property. Expects one of:\n * * A base64 encoded image, which is wrapped and passed through.\n * * A boolean. If true, calls the image loader to generate a small placeholder url.\n */\n generatePlaceholder(placeholderInput) {\n const {\n placeholderResolution\n } = this.config;\n if (placeholderInput === true) {\n return `url(${this.callImageLoader({\n src: this.ngSrc,\n width: placeholderResolution,\n isPlaceholder: true\n })})`;\n } else if (typeof placeholderInput === 'string') {\n return `url(${placeholderInput})`;\n }\n return null;\n }\n /**\n * Determines if blur should be applied, based on an optional boolean\n * property `blur` within the optional configuration object `placeholderConfig`.\n */\n shouldBlurPlaceholder(placeholderConfig) {\n if (!placeholderConfig || !placeholderConfig.hasOwnProperty('blur')) {\n return true;\n }\n return Boolean(placeholderConfig.blur);\n }\n removePlaceholderOnLoad(img) {\n const callback = () => {\n const changeDetectorRef = this.injector.get(ChangeDetectorRef);\n removeLoadListenerFn();\n removeErrorListenerFn();\n this.placeholder = false;\n changeDetectorRef.markForCheck();\n };\n const removeLoadListenerFn = this.renderer.listen(img, 'load', callback);\n const removeErrorListenerFn = this.renderer.listen(img, 'error', callback);\n callOnLoadIfImageIsLoaded(img, callback);\n }\n setHostAttribute(name, value) {\n this.renderer.setAttribute(this.imgElement, name, value);\n }\n static ɵfac = function NgOptimizedImage_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgOptimizedImage)();\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: NgOptimizedImage,\n selectors: [[\"img\", \"ngSrc\", \"\"]],\n hostVars: 18,\n hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {\n if (rf & 2) {\n i0.ɵɵstyleProp(\"position\", ctx.fill ? \"absolute\" : null)(\"width\", ctx.fill ? \"100%\" : null)(\"height\", ctx.fill ? \"100%\" : null)(\"inset\", ctx.fill ? \"0\" : null)(\"background-size\", ctx.placeholder ? \"cover\" : null)(\"background-position\", ctx.placeholder ? \"50% 50%\" : null)(\"background-repeat\", ctx.placeholder ? \"no-repeat\" : null)(\"background-image\", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)(\"filter\", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? \"blur(15px)\" : null);\n }\n },\n inputs: {\n ngSrc: [2, \"ngSrc\", \"ngSrc\", unwrapSafeUrl],\n ngSrcset: \"ngSrcset\",\n sizes: \"sizes\",\n width: [2, \"width\", \"width\", numberAttribute],\n height: [2, \"height\", \"height\", numberAttribute],\n decoding: \"decoding\",\n loading: \"loading\",\n priority: [2, \"priority\", \"priority\", booleanAttribute],\n loaderParams: \"loaderParams\",\n disableOptimizedSrcset: [2, \"disableOptimizedSrcset\", \"disableOptimizedSrcset\", booleanAttribute],\n fill: [2, \"fill\", \"fill\", booleanAttribute],\n placeholder: [2, \"placeholder\", \"placeholder\", booleanOrUrlAttribute],\n placeholderConfig: \"placeholderConfig\",\n src: \"src\",\n srcset: \"srcset\"\n },\n features: [i0.ɵɵNgOnChangesFeature]\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NgOptimizedImage, [{\n type: Directive,\n args: [{\n selector: 'img[ngSrc]',\n host: {\n '[style.position]': 'fill ? \"absolute\" : null',\n '[style.width]': 'fill ? \"100%\" : null',\n '[style.height]': 'fill ? \"100%\" : null',\n '[style.inset]': 'fill ? \"0\" : null',\n '[style.background-size]': 'placeholder ? \"cover\" : null',\n '[style.background-position]': 'placeholder ? \"50% 50%\" : null',\n '[style.background-repeat]': 'placeholder ? \"no-repeat\" : null',\n '[style.background-image]': 'placeholder ? generatePlaceholder(placeholder) : null',\n '[style.filter]': 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? \"blur(15px)\" : null'\n }\n }]\n }], () => [], {\n ngSrc: [{\n type: Input,\n args: [{\n required: true,\n transform: unwrapSafeUrl\n }]\n }],\n ngSrcset: [{\n type: Input\n }],\n sizes: [{\n type: Input\n }],\n width: [{\n type: Input,\n args: [{\n transform: numberAttribute\n }]\n }],\n height: [{\n type: Input,\n args: [{\n transform: numberAttribute\n }]\n }],\n decoding: [{\n type: Input\n }],\n loading: [{\n type: Input\n }],\n priority: [{\n type: Input,\n args: [{\n transform: booleanAttribute\n }]\n }],\n loaderParams: [{\n type: Input\n }],\n disableOptimizedSrcset: [{\n type: Input,\n args: [{\n transform: booleanAttribute\n }]\n }],\n fill: [{\n type: Input,\n args: [{\n transform: booleanAttribute\n }]\n }],\n placeholder: [{\n type: Input,\n args: [{\n transform: booleanOrUrlAttribute\n }]\n }],\n placeholderConfig: [{\n type: Input\n }],\n src: [{\n type: Input\n }],\n srcset: [{\n type: Input\n }]\n });\n})();\n/***** Helpers *****/\n/**\n * Sorts provided config breakpoints and uses defaults.\n */\nfunction processConfig(config) {\n let sortedBreakpoints = {};\n if (config.breakpoints) {\n sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);\n }\n return Object.assign({}, _IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);\n}\n/***** Assert functions *****/\n/**\n * Verifies that there is no `src` set on a host element.\n */\nfunction assertNoConflictingSrc(dir) {\n if (dir.src) {\n throw new _RuntimeError(2950 /* RuntimeErrorCode.UNEXPECTED_SRC_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \\`src\\` and \\`ngSrc\\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \\`src\\` itself based on the value of \\`ngSrc\\`. ` + `To fix this, please remove the \\`src\\` attribute.`);\n }\n}\n/**\n * Verifies that there is no `srcset` set on a host element.\n */\nfunction assertNoConflictingSrcset(dir) {\n if (dir.srcset) {\n throw new _RuntimeError(2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \\`srcset\\` and \\`ngSrcset\\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \\`srcset\\` itself based on the value of ` + `\\`ngSrcset\\`. To fix this, please remove the \\`srcset\\` attribute.`);\n }\n}\n/**\n * Verifies that the `ngSrc` is not a Base64-encoded image.\n */\nfunction assertNotBase64Image(dir) {\n let ngSrc = dir.ngSrc.trim();\n if (ngSrc.startsWith('data:')) {\n if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {\n ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...';\n }\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \\`ngSrc\\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \\`ngSrc\\` and using a standard \\`src\\` attribute instead.`);\n }\n}\n/**\n * Verifies that the 'sizes' only includes responsive values.\n */\nfunction assertNoComplexSizes(dir) {\n let sizes = dir.sizes;\n if (sizes?.match(/((\\)|,)\\s|^)\\d+px/)) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \\`sizes\\` was set to a string including ` + `pixel values. For automatic \\`srcset\\` generation, \\`sizes\\` must only include responsive ` + `values, such as \\`sizes=\"50vw\"\\` or \\`sizes=\"(min-width: 768px) 50vw, 100vw\"\\`. ` + `To fix this, modify the \\`sizes\\` attribute, or provide your own \\`ngSrcset\\` value directly.`);\n }\n}\nfunction assertValidPlaceholder(dir, imageLoader) {\n assertNoPlaceholderConfigWithoutPlaceholder(dir);\n assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);\n assertNoOversizedDataUrl(dir);\n}\n/**\n * Verifies that placeholderConfig isn't being used without placeholder\n */\nfunction assertNoPlaceholderConfigWithoutPlaceholder(dir) {\n if (dir.placeholderConfig && !dir.placeholder) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \\`placeholderConfig\\` options were provided for an ` + `image that does not use the \\`placeholder\\` attribute, and will have no effect.`);\n }\n}\n/**\n * Warns if a relative URL placeholder is specified, but no loader is present to provide the small\n * image.\n */\nfunction assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {\n if (dir.placeholder === true && imageLoader === noopImageLoader) {\n throw new _RuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`placeholder\\` attribute is set to true but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for the primary image and its placeholder. ` + `To fix this, provide a loader or remove the \\`placeholder\\` attribute from the image.`);\n }\n}\n/**\n * Warns or throws an error if an oversized dataURL placeholder is provided.\n */\nfunction assertNoOversizedDataUrl(dir) {\n if (dir.placeholder && typeof dir.placeholder === 'string' && dir.placeholder.startsWith('data:')) {\n if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {\n throw new _RuntimeError(2965 /* RuntimeErrorCode.OVERSIZED_PLACEHOLDER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`placeholder\\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. To fix this, generate ` + `a smaller data URL placeholder.`);\n }\n if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {\n console.warn(_formatRuntimeError(2965 /* RuntimeErrorCode.OVERSIZED_PLACEHOLDER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`placeholder\\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. For better loading performance, ` + `generate a smaller data URL placeholder.`));\n }\n }\n}\n/**\n * Verifies that the `ngSrc` is not a Blob URL.\n */\nfunction assertNotBlobUrl(dir) {\n const ngSrc = dir.ngSrc.trim();\n if (ngSrc.startsWith('blob:')) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \\`ngSrc\\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \\`ngSrc\\` and using a regular \\`src\\` attribute instead.`);\n }\n}\n/**\n * Verifies that the input is set to a non-empty string.\n */\nfunction assertNonEmptyInput(dir, name, value) {\n const isString = typeof value === 'string';\n const isEmptyString = isString && value.trim() === '';\n if (!isString || isEmptyString) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \\`${name}\\` has an invalid value ` + `(\\`${value}\\`). To fix this, change the value to a non-empty string.`);\n }\n}\n/**\n * Verifies that the `ngSrcset` is in a valid format, e.g. \"100w, 200w\" or \"1x, 2x\".\n */\nfunction assertValidNgSrcset(dir, value) {\n if (value == null) return;\n assertNonEmptyInput(dir, 'ngSrcset', value);\n const stringVal = value;\n const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);\n const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);\n if (isValidDensityDescriptor) {\n assertUnderDensityCap(dir, stringVal);\n }\n const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;\n if (!isValidSrcset) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \\`ngSrcset\\` has an invalid value (\\`${value}\\`). ` + `To fix this, supply \\`ngSrcset\\` using a comma-separated list of one or more width ` + `descriptors (e.g. \"100w, 200w\") or density descriptors (e.g. \"1x, 2x\").`);\n }\n}\nfunction assertUnderDensityCap(dir, value) {\n const underDensityCap = value.split(',').every(num => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);\n if (!underDensityCap) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \\`ngSrcset\\` contains an unsupported image density:` + `\\`${value}\\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);\n }\n}\n/**\n * Creates a `RuntimeError` instance to represent a situation when an input is set after\n * the directive has initialized.\n */\nfunction postInitInputChangeError(dir, inputName) {\n let reason;\n if (inputName === 'width' || inputName === 'height') {\n reason = `Changing \\`${inputName}\\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`;\n } else {\n reason = `Changing the \\`${inputName}\\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`;\n }\n return new _RuntimeError(2953 /* RuntimeErrorCode.UNEXPECTED_INPUT_CHANGE */, `${imgDirectiveDetails(dir.ngSrc)} \\`${inputName}\\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \\`${inputName}\\` to a static value ` + `or wrap the image element in an @if that is gated on the necessary value.`);\n}\n/**\n * Verify that none of the listed inputs has changed.\n */\nfunction assertNoPostInitInputChange(dir, changes, inputs) {\n inputs.forEach(input => {\n const isUpdated = changes.hasOwnProperty(input);\n if (isUpdated && !changes[input].isFirstChange()) {\n if (input === 'ngSrc') {\n // When the `ngSrc` input changes, we detect that only in the\n // `ngOnChanges` hook, thus the `ngSrc` is already set. We use\n // `ngSrc` in the error message, so we use a previous value, but\n // not the updated one in it.\n dir = {\n ngSrc: changes[input].previousValue\n };\n }\n throw postInitInputChangeError(dir, input);\n }\n });\n}\n/**\n * Verifies that a specified input is a number greater than 0.\n */\nfunction assertGreaterThanZero(dir, inputValue, inputName) {\n const validNumber = typeof inputValue === 'number' && inputValue > 0;\n const validString = typeof inputValue === 'string' && /^\\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;\n if (!validNumber && !validString) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \\`${inputName}\\` has an invalid value. ` + `To fix this, provide \\`${inputName}\\` as a number greater than 0.`);\n }\n}\n/**\n * Verifies that the rendered image is not visually distorted. Effectively this is checking:\n * - Whether the \"width\" and \"height\" attributes reflect the actual dimensions of the image.\n * - Whether image styling is \"correct\" (see below for a longer explanation).\n */\nfunction assertNoImageDistortion(dir, img, renderer) {\n const callback = () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n const computedStyle = window.getComputedStyle(img);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n const boxSizing = computedStyle.getPropertyValue('box-sizing');\n if (boxSizing === 'border-box') {\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 renderedAspectRatio = renderedWidth / renderedHeight;\n const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;\n const intrinsicWidth = img.naturalWidth;\n const intrinsicHeight = img.naturalHeight;\n const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;\n const suppliedWidth = dir.width;\n const suppliedHeight = dir.height;\n const suppliedAspectRatio = suppliedWidth / suppliedHeight;\n // Tolerance is used to account for the impact of subpixel rendering.\n // Due to subpixel rendering, the rendered, intrinsic, and supplied\n // aspect ratios of a correctly configured image may not exactly match.\n // For example, a `width=4030 height=3020` image might have a rendered\n // size of \"1062w, 796.48h\". (An aspect ratio of 1.334... vs. 1.333...)\n const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;\n const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;\n if (inaccurateDimensions) {\n console.warn(_formatRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \\nSupplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). ` + `\\nTo fix this, update the width and height attributes.`));\n } else if (stylingDistortion) {\n console.warn(_formatRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \\nRendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${round(renderedAspectRatio)}). \\nThis issue can occur if \"width\" and \"height\" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding \"height: auto\" or \"width: auto\" to the image styling will fix ` + `this issue.`));\n } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {\n // If `ngSrcset` hasn't been set, sanity check the intrinsic size.\n const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;\n const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;\n const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;\n const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;\n if (oversizedWidth || oversizedHeight) {\n console.warn(_formatRuntimeError(2960 /* RuntimeErrorCode.OVERSIZED_IMAGE */, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `\\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `\\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `\\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the \"ngSrcset\" and \"sizes\" attributes.`));\n }\n }\n };\n const removeLoadListenerFn = renderer.listen(img, 'load', callback);\n // We only listen to the `error` event to remove the `load` event listener because it will not be\n // fired if the image fails to load. This is done to prevent memory leaks in development mode\n // because image elements aren't garbage-collected properly. It happens because zone.js stores the\n // event listener directly on the element and closures capture `dir`.\n const removeErrorListenerFn = renderer.listen(img, 'error', () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n callOnLoadIfImageIsLoaded(img, callback);\n}\n/**\n * Verifies that a specified input is set.\n */\nfunction assertNonEmptyWidthAndHeight(dir) {\n let missingAttributes = [];\n if (dir.width === undefined) missingAttributes.push('width');\n if (dir.height === undefined) missingAttributes.push('height');\n if (missingAttributes.length > 0) {\n throw new _RuntimeError(2954 /* RuntimeErrorCode.REQUIRED_INPUT_MISSING */, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map(attr => `\"${attr}\"`).join(', ')}. ` + `Including \"width\" and \"height\" attributes will prevent image-related layout shifts. ` + `To fix this, include \"width\" and \"height\" attributes on the image tag or turn on ` + `\"fill\" mode with the \\`fill\\` attribute.`);\n }\n}\n/**\n * Verifies that width and height are not set. Used in fill mode, where those attributes don't make\n * sense.\n */\nfunction assertEmptyWidthAndHeight(dir) {\n if (dir.width || dir.height) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \\`height\\` and/or \\`width\\` are present ` + `along with the \\`fill\\` attribute. Because \\`fill\\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`);\n }\n}\n/**\n * Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides\n * guidance that this can be caused by the containing element's CSS position property.\n */\nfunction assertNonZeroRenderedHeight(dir, img, renderer) {\n const callback = () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n const renderedHeight = img.clientHeight;\n if (dir.fill && renderedHeight === 0) {\n console.warn(_formatRuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: \"relative\", \"fixed\", or \"absolute\". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`));\n }\n };\n const removeLoadListenerFn = renderer.listen(img, 'load', callback);\n // See comments in the `assertNoImageDistortion`.\n const removeErrorListenerFn = renderer.listen(img, 'error', () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n callOnLoadIfImageIsLoaded(img, callback);\n}\n/**\n * Verifies that the `loading` attribute is set to a valid input &\n * is not used on priority images.\n */\nfunction assertValidLoadingInput(dir) {\n if (dir.loading && dir.priority) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \\`loading\\` attribute ` + `was used on an image that was marked \"priority\". ` + `Setting \\`loading\\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the “loading” attribute from the priority image.`);\n }\n const validInputs = ['auto', 'eager', 'lazy'];\n if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \\`loading\\` attribute ` + `has an invalid value (\\`${dir.loading}\\`). ` + `To fix this, provide a valid value (\"lazy\", \"eager\", or \"auto\").`);\n }\n}\n/**\n * Verifies that the `decoding` attribute is set to a valid input.\n */\nfunction assertValidDecodingInput(dir) {\n const validInputs = ['sync', 'async', 'auto'];\n if (typeof dir.decoding === 'string' && !validInputs.includes(dir.decoding)) {\n throw new _RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \\`decoding\\` attribute ` + `has an invalid value (\\`${dir.decoding}\\`). ` + `To fix this, provide a valid value (\"sync\", \"async\", or \"auto\").`);\n }\n}\n/**\n * Warns if NOT using a loader (falling back to the generic loader) and\n * the image appears to be hosted on one of the image CDNs for which\n * we do have a built-in image loader. Suggests switching to the\n * built-in loader.\n *\n * @param ngSrc Value of the ngSrc attribute\n * @param imageLoader ImageLoader provided\n */\nfunction assertNotMissingBuiltInLoader(ngSrc, imageLoader) {\n if (imageLoader === noopImageLoader) {\n let builtInLoaderName = '';\n for (const loader of BUILT_IN_LOADERS) {\n if (loader.testUrl(ngSrc)) {\n builtInLoaderName = loader.name;\n break;\n }\n }\n if (builtInLoaderName) {\n console.warn(_formatRuntimeError(2962 /* RuntimeErrorCode.MISSING_BUILTIN_LOADER */, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \\`provide${builtInLoaderName}Loader()\\` ` + `in your \\`providers\\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`));\n }\n }\n}\n/**\n * Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used).\n */\nfunction assertNoNgSrcsetWithoutLoader(dir, imageLoader) {\n if (dir.ngSrcset && imageLoader === noopImageLoader) {\n console.warn(_formatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`ngSrcset\\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \\`ngSrcset\\` attribute from the image.`));\n }\n}\n/**\n * Warns if loaderParams is present and no loader is configured (i.e. the default one is being\n * used).\n */\nfunction assertNoLoaderParamsWithoutLoader(dir, imageLoader) {\n if (dir.loaderParams && imageLoader === noopImageLoader) {\n console.warn(_formatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`loaderParams\\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which means that the loaderParams data will not be consumed and will not affect the URL. ` + `To fix this, provide a custom loader or remove the \\`loaderParams\\` attribute from the image.`));\n }\n}\n/**\n * Warns if the priority attribute is used too often on page load\n */\nasync function assetPriorityCountBelowThreshold(appRef) {\n if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {\n IMGS_WITH_PRIORITY_ATTR_COUNT++;\n await appRef.whenStable();\n if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {\n console.warn(_formatRuntimeError(2966 /* RuntimeErrorCode.TOO_MANY_PRIORITY_ATTRIBUTES */, `NgOptimizedImage: The \"priority\" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). ` + `Marking too many images as \"high\" priority can hurt your application's LCP (https://web.dev/lcp). ` + `\"Priority\" should only be set on the image expected to be the page's LCP element.`));\n }\n } else {\n IMGS_WITH_PRIORITY_ATTR_COUNT++;\n }\n}\n/**\n * Warns if placeholder's dimension are over a threshold.\n *\n * This assert function is meant to only run on the browser.\n */\nfunction assertPlaceholderDimensions(dir, imgElement) {\n const computedStyle = window.getComputedStyle(imgElement);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {\n console.warn(_formatRuntimeError(2967 /* RuntimeErrorCode.PLACEHOLDER_DIMENSION_LIMIT_EXCEEDED */, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one ` + `of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. ` + `To fix this, use a smaller image as a placeholder.`));\n }\n}\nfunction callOnLoadIfImageIsLoaded(img, callback) {\n // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-complete\n // The spec defines that `complete` is truthy once its request state is fully available.\n // The image may already be available if it’s loaded from the browser cache.\n // In that case, the `load` event will not fire at all, meaning that all setup\n // callbacks listening for the `load` event will not be invoked.\n // In Safari, there is a known behavior where the `complete` property of an\n // `HTMLImageElement` may sometimes return `true` even when the image is not fully loaded.\n // Checking both `img.complete` and `img.naturalWidth` is the most reliable way to\n // determine if an image has been fully loaded, especially in browsers where the\n // `complete` property may return `true` prematurely.\n if (img.complete && img.naturalWidth) {\n callback();\n }\n}\nfunction round(input) {\n return Number.isInteger(input) ? input : input.toFixed(2);\n}\n// Transform function to handle SafeValue input for ngSrc. This doesn't do any sanitization,\n// as that is not needed for img.src and img.srcset. This transform is purely for compatibility.\nfunction unwrapSafeUrl(value) {\n if (typeof value === 'string') {\n return value;\n }\n return _unwrapSafeValue(value);\n}\n// Transform function to handle inputs which may be booleans, strings, or string representations\n// of boolean values. Used for the placeholder attribute.\nfunction booleanOrUrlAttribute(value) {\n if (typeof value === 'string' && value !== 'true' && value !== 'false' && value !== '') {\n return value;\n }\n return booleanAttribute(value);\n}\nexport { IMAGE_LOADER, NgOptimizedImage, PRECONNECT_CHECK_BLOCKLIST, VERSION, ViewportScroller, isPlatformBrowser, isPlatformServer, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, provideNetlifyLoader, registerLocaleData, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID };\n"],
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAI,OAAO;AACX,SAAS,SAAS;AAChB,SAAO;AACT;AACA,SAAS,kBAAkB,SAAS;AAClC,WAAS;AACX;AAOA,IAAM,aAAN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AkC,GAAG;AACvC;AACA,YAAM,OAAO,WAAW;AACxB,UAAI,gCAAgC,0BAA0B;AAC5D,gBAAQ,KAAK,mBAAoB,MAA0D,uEAAuE,wBAAwB,WAAW,6BAA6B,8LAAwM,CAAC;AAAA,MAC7a;AAAA,IACF,OAAO;AACL;AAAA,IACF;AAAA,EACF;AAAA;AAMA,SAAS,4BAA4B,KAAK,YAAY;AACpD,QAAM,gBAAgB,OAAO,iBAAiB,UAAU;AACxD,MAAI,gBAAgB,WAAW,cAAc,iBAAiB,OAAO,CAAC;AACtE,MAAI,iBAAiB,WAAW,cAAc,iBAAiB,QAAQ,CAAC;AACxE,MAAI,gBAAgB,+BAA+B,iBAAiB,6BAA6B;AAC/F,YAAQ,KAAK,mBAAoB,MAAkE,GAAG,oBAAoB,IAAI,KAAK,CAAC,qHAA0H,2BAA2B,wDAA6D,CAAC;AAAA,EACzV;AACF;AACA,SAAS,0BAA0B,KAAK,UAAU;AAWhD,MAAI,IAAI,YAAY,IAAI,cAAc;AACpC,aAAS;AAAA,EACX;AACF;AACA,SAAS,MAAM,OAAO;AACpB,SAAO,OAAO,UAAU,KAAK,IAAI,QAAQ,MAAM,QAAQ,CAAC;AAC1D;AAGA,SAAS,cAAc,OAAO;AAC5B,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO,gBAAiB,KAAK;AAC/B;AAGA,SAAS,sBAAsB,OAAO;AACpC,MAAI,OAAO,UAAU,YAAY,UAAU,UAAU,UAAU,WAAW,UAAU,IAAI;AACtF,WAAO;AAAA,EACT;AACA,SAAO,iBAAiB,KAAK;AAC/B;",
+ "names": ["window", "isAbsoluteUrl", "NumberFormatStyle", "Plural", "FormStyle", "TranslationWidth", "FormatWidth", "WeekDay", "getLocaleCurrencyCode", "getLocalePluralCase", "value", "carry", "digits", "klass", "registerLocaleData", "window"]
+}
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js
new file mode 100644
index 0000000..e8fe60d
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js
@@ -0,0 +1,29502 @@
+import {
+ __spreadProps,
+ __spreadValues
+} from "./chunk-3OV72XIM.js";
+
+// node_modules/@angular/compiler/fesm2022/compiler.mjs
+var _SELECTOR_REGEXP = new RegExp(
+ `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
+ // 8: ","
+ "g"
+);
+var CssSelector = class _CssSelector {
+ element = null;
+ classNames = [];
+ /**
+ * The selectors are encoded in pairs where:
+ * - even locations are attribute names
+ * - odd locations are attribute values.
+ *
+ * Example:
+ * Selector: `[key1=value1][key2]` would parse to:
+ * ```
+ * ['key1', 'value1', 'key2', '']
+ * ```
+ */
+ attrs = [];
+ notSelectors = [];
+ static parse(selector) {
+ const results = [];
+ const _addResult = (res, cssSel) => {
+ if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 && cssSel.attrs.length == 0) {
+ cssSel.element = "*";
+ }
+ res.push(cssSel);
+ };
+ let cssSelector = new _CssSelector();
+ let match;
+ let current = cssSelector;
+ let inNot = false;
+ _SELECTOR_REGEXP.lastIndex = 0;
+ while (match = _SELECTOR_REGEXP.exec(selector)) {
+ if (match[
+ 1
+ /* SelectorRegexp.NOT */
+ ]) {
+ if (inNot) {
+ throw new Error("Nesting :not in a selector is not allowed");
+ }
+ inNot = true;
+ current = new _CssSelector();
+ cssSelector.notSelectors.push(current);
+ }
+ const tag = match[
+ 2
+ /* SelectorRegexp.TAG */
+ ];
+ if (tag) {
+ const prefix = match[
+ 3
+ /* SelectorRegexp.PREFIX */
+ ];
+ if (prefix === "#") {
+ current.addAttribute("id", tag.slice(1));
+ } else if (prefix === ".") {
+ current.addClassName(tag.slice(1));
+ } else {
+ current.setElement(tag);
+ }
+ }
+ const attribute2 = match[
+ 4
+ /* SelectorRegexp.ATTRIBUTE */
+ ];
+ if (attribute2) {
+ current.addAttribute(current.unescapeAttribute(attribute2), match[
+ 6
+ /* SelectorRegexp.ATTRIBUTE_VALUE */
+ ]);
+ }
+ if (match[
+ 7
+ /* SelectorRegexp.NOT_END */
+ ]) {
+ inNot = false;
+ current = cssSelector;
+ }
+ if (match[
+ 8
+ /* SelectorRegexp.SEPARATOR */
+ ]) {
+ if (inNot) {
+ throw new Error("Multiple selectors in :not are not supported");
+ }
+ _addResult(results, cssSelector);
+ cssSelector = current = new _CssSelector();
+ }
+ }
+ _addResult(results, cssSelector);
+ return results;
+ }
+ /**
+ * Unescape `\$` sequences from the CSS attribute selector.
+ *
+ * This is needed because `$` can have a special meaning in CSS selectors,
+ * but we might want to match an attribute that contains `$`.
+ * [MDN web link for more
+ * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
+ * @param attr the attribute to unescape.
+ * @returns the unescaped string.
+ */
+ unescapeAttribute(attr) {
+ let result = "";
+ let escaping = false;
+ for (let i = 0; i < attr.length; i++) {
+ const char = attr.charAt(i);
+ if (char === "\\") {
+ escaping = true;
+ continue;
+ }
+ if (char === "$" && !escaping) {
+ throw new Error(`Error in attribute selector "${attr}". Unescaped "$" is not supported. Please escape with "\\$".`);
+ }
+ escaping = false;
+ result += char;
+ }
+ return result;
+ }
+ /**
+ * Escape `$` sequences from the CSS attribute selector.
+ *
+ * This is needed because `$` can have a special meaning in CSS selectors,
+ * with this method we are escaping `$` with `\$'.
+ * [MDN web link for more
+ * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
+ * @param attr the attribute to escape.
+ * @returns the escaped string.
+ */
+ escapeAttribute(attr) {
+ return attr.replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
+ }
+ isElementSelector() {
+ return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 && this.notSelectors.length === 0;
+ }
+ hasElementSelector() {
+ return !!this.element;
+ }
+ setElement(element2 = null) {
+ this.element = element2;
+ }
+ getAttrs() {
+ const result = [];
+ if (this.classNames.length > 0) {
+ result.push("class", this.classNames.join(" "));
+ }
+ return result.concat(this.attrs);
+ }
+ addAttribute(name, value = "") {
+ this.attrs.push(name, value && value.toLowerCase() || "");
+ }
+ addClassName(name) {
+ this.classNames.push(name.toLowerCase());
+ }
+ toString() {
+ let res = this.element || "";
+ if (this.classNames) {
+ this.classNames.forEach((klass) => res += `.${klass}`);
+ }
+ if (this.attrs) {
+ for (let i = 0; i < this.attrs.length; i += 2) {
+ const name = this.escapeAttribute(this.attrs[i]);
+ const value = this.attrs[i + 1];
+ res += `[${name}${value ? "=" + value : ""}]`;
+ }
+ }
+ this.notSelectors.forEach((notSelector) => res += `:not(${notSelector})`);
+ return res;
+ }
+};
+var SelectorMatcher = class _SelectorMatcher {
+ static createNotMatcher(notSelectors) {
+ const notMatcher = new _SelectorMatcher();
+ notMatcher.addSelectables(notSelectors, null);
+ return notMatcher;
+ }
+ _elementMap = /* @__PURE__ */ new Map();
+ _elementPartialMap = /* @__PURE__ */ new Map();
+ _classMap = /* @__PURE__ */ new Map();
+ _classPartialMap = /* @__PURE__ */ new Map();
+ _attrValueMap = /* @__PURE__ */ new Map();
+ _attrValuePartialMap = /* @__PURE__ */ new Map();
+ _listContexts = [];
+ addSelectables(cssSelectors, callbackCtxt) {
+ let listContext = null;
+ if (cssSelectors.length > 1) {
+ listContext = new SelectorListContext(cssSelectors);
+ this._listContexts.push(listContext);
+ }
+ for (let i = 0; i < cssSelectors.length; i++) {
+ this._addSelectable(cssSelectors[i], callbackCtxt, listContext);
+ }
+ }
+ /**
+ * Add an object that can be found later on by calling `match`.
+ * @param cssSelector A css selector
+ * @param callbackCtxt An opaque object that will be given to the callback of the `match` function
+ */
+ _addSelectable(cssSelector, callbackCtxt, listContext) {
+ let matcher = this;
+ const element2 = cssSelector.element;
+ const classNames = cssSelector.classNames;
+ const attrs = cssSelector.attrs;
+ const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
+ if (element2) {
+ const isTerminal = attrs.length === 0 && classNames.length === 0;
+ if (isTerminal) {
+ this._addTerminal(matcher._elementMap, element2, selectable);
+ } else {
+ matcher = this._addPartial(matcher._elementPartialMap, element2);
+ }
+ }
+ if (classNames) {
+ for (let i = 0; i < classNames.length; i++) {
+ const isTerminal = attrs.length === 0 && i === classNames.length - 1;
+ const className = classNames[i];
+ if (isTerminal) {
+ this._addTerminal(matcher._classMap, className, selectable);
+ } else {
+ matcher = this._addPartial(matcher._classPartialMap, className);
+ }
+ }
+ }
+ if (attrs) {
+ for (let i = 0; i < attrs.length; i += 2) {
+ const isTerminal = i === attrs.length - 2;
+ const name = attrs[i];
+ const value = attrs[i + 1];
+ if (isTerminal) {
+ const terminalMap = matcher._attrValueMap;
+ let terminalValuesMap = terminalMap.get(name);
+ if (!terminalValuesMap) {
+ terminalValuesMap = /* @__PURE__ */ new Map();
+ terminalMap.set(name, terminalValuesMap);
+ }
+ this._addTerminal(terminalValuesMap, value, selectable);
+ } else {
+ const partialMap = matcher._attrValuePartialMap;
+ let partialValuesMap = partialMap.get(name);
+ if (!partialValuesMap) {
+ partialValuesMap = /* @__PURE__ */ new Map();
+ partialMap.set(name, partialValuesMap);
+ }
+ matcher = this._addPartial(partialValuesMap, value);
+ }
+ }
+ }
+ }
+ _addTerminal(map, name, selectable) {
+ let terminalList = map.get(name);
+ if (!terminalList) {
+ terminalList = [];
+ map.set(name, terminalList);
+ }
+ terminalList.push(selectable);
+ }
+ _addPartial(map, name) {
+ let matcher = map.get(name);
+ if (!matcher) {
+ matcher = new _SelectorMatcher();
+ map.set(name, matcher);
+ }
+ return matcher;
+ }
+ /**
+ * Find the objects that have been added via `addSelectable`
+ * whose css selector is contained in the given css selector.
+ * @param cssSelector A css selector
+ * @param matchedCallback This callback will be called with the object handed into `addSelectable`
+ * @return boolean true if a match was found
+ */
+ match(cssSelector, matchedCallback) {
+ let result = false;
+ const element2 = cssSelector.element;
+ const classNames = cssSelector.classNames;
+ const attrs = cssSelector.attrs;
+ for (let i = 0; i < this._listContexts.length; i++) {
+ this._listContexts[i].alreadyMatched = false;
+ }
+ result = this._matchTerminal(this._elementMap, element2, cssSelector, matchedCallback) || result;
+ result = this._matchPartial(this._elementPartialMap, element2, cssSelector, matchedCallback) || result;
+ if (classNames) {
+ for (let i = 0; i < classNames.length; i++) {
+ const className = classNames[i];
+ result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;
+ result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result;
+ }
+ }
+ if (attrs) {
+ for (let i = 0; i < attrs.length; i += 2) {
+ const name = attrs[i];
+ const value = attrs[i + 1];
+ const terminalValuesMap = this._attrValueMap.get(name);
+ if (value) {
+ result = this._matchTerminal(terminalValuesMap, "", cssSelector, matchedCallback) || result;
+ }
+ result = this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;
+ const partialValuesMap = this._attrValuePartialMap.get(name);
+ if (value) {
+ result = this._matchPartial(partialValuesMap, "", cssSelector, matchedCallback) || result;
+ }
+ result = this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;
+ }
+ }
+ return result;
+ }
+ /** @internal */
+ _matchTerminal(map, name, cssSelector, matchedCallback) {
+ if (!map || typeof name !== "string") {
+ return false;
+ }
+ let selectables = map.get(name) || [];
+ const starSelectables = map.get("*");
+ if (starSelectables) {
+ selectables = selectables.concat(starSelectables);
+ }
+ if (selectables.length === 0) {
+ return false;
+ }
+ let selectable;
+ let result = false;
+ for (let i = 0; i < selectables.length; i++) {
+ selectable = selectables[i];
+ result = selectable.finalize(cssSelector, matchedCallback) || result;
+ }
+ return result;
+ }
+ /** @internal */
+ _matchPartial(map, name, cssSelector, matchedCallback) {
+ if (!map || typeof name !== "string") {
+ return false;
+ }
+ const nestedSelector = map.get(name);
+ if (!nestedSelector) {
+ return false;
+ }
+ return nestedSelector.match(cssSelector, matchedCallback);
+ }
+};
+var SelectorListContext = class {
+ selectors;
+ alreadyMatched = false;
+ constructor(selectors) {
+ this.selectors = selectors;
+ }
+};
+var SelectorContext = class {
+ selector;
+ cbContext;
+ listContext;
+ notSelectors;
+ constructor(selector, cbContext, listContext) {
+ this.selector = selector;
+ this.cbContext = cbContext;
+ this.listContext = listContext;
+ this.notSelectors = selector.notSelectors;
+ }
+ finalize(cssSelector, callback) {
+ let result = true;
+ if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {
+ const notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);
+ result = !notMatcher.match(cssSelector, null);
+ }
+ if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {
+ if (this.listContext) {
+ this.listContext.alreadyMatched = true;
+ }
+ callback(this.selector, this.cbContext);
+ }
+ return result;
+ }
+};
+var SelectorlessMatcher = class {
+ registry;
+ constructor(registry) {
+ this.registry = registry;
+ }
+ match(name) {
+ return this.registry.has(name) ? this.registry.get(name) : [];
+ }
+};
+var emitDistinctChangesOnlyDefaultValue = true;
+var ViewEncapsulation$1;
+(function(ViewEncapsulation2) {
+ ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
+ ViewEncapsulation2[ViewEncapsulation2["None"] = 2] = "None";
+ ViewEncapsulation2[ViewEncapsulation2["ShadowDom"] = 3] = "ShadowDom";
+})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
+var ChangeDetectionStrategy;
+(function(ChangeDetectionStrategy2) {
+ ChangeDetectionStrategy2[ChangeDetectionStrategy2["OnPush"] = 0] = "OnPush";
+ ChangeDetectionStrategy2[ChangeDetectionStrategy2["Default"] = 1] = "Default";
+})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
+var InputFlags;
+(function(InputFlags2) {
+ InputFlags2[InputFlags2["None"] = 0] = "None";
+ InputFlags2[InputFlags2["SignalBased"] = 1] = "SignalBased";
+ InputFlags2[InputFlags2["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform";
+})(InputFlags || (InputFlags = {}));
+var CUSTOM_ELEMENTS_SCHEMA = {
+ name: "custom-elements"
+};
+var NO_ERRORS_SCHEMA = {
+ name: "no-errors-schema"
+};
+var Type$1 = Function;
+var SecurityContext;
+(function(SecurityContext2) {
+ SecurityContext2[SecurityContext2["NONE"] = 0] = "NONE";
+ SecurityContext2[SecurityContext2["HTML"] = 1] = "HTML";
+ SecurityContext2[SecurityContext2["STYLE"] = 2] = "STYLE";
+ SecurityContext2[SecurityContext2["SCRIPT"] = 3] = "SCRIPT";
+ SecurityContext2[SecurityContext2["URL"] = 4] = "URL";
+ SecurityContext2[SecurityContext2["RESOURCE_URL"] = 5] = "RESOURCE_URL";
+})(SecurityContext || (SecurityContext = {}));
+var MissingTranslationStrategy;
+(function(MissingTranslationStrategy2) {
+ MissingTranslationStrategy2[MissingTranslationStrategy2["Error"] = 0] = "Error";
+ MissingTranslationStrategy2[MissingTranslationStrategy2["Warning"] = 1] = "Warning";
+ MissingTranslationStrategy2[MissingTranslationStrategy2["Ignore"] = 2] = "Ignore";
+})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
+function parserSelectorToSimpleSelector(selector) {
+ const classes = selector.classNames && selector.classNames.length ? [8, ...selector.classNames] : [];
+ const elementName = selector.element && selector.element !== "*" ? selector.element : "";
+ return [elementName, ...selector.attrs, ...classes];
+}
+function parserSelectorToNegativeSelector(selector) {
+ const classes = selector.classNames && selector.classNames.length ? [8, ...selector.classNames] : [];
+ if (selector.element) {
+ return [
+ 1 | 4,
+ selector.element,
+ ...selector.attrs,
+ ...classes
+ ];
+ } else if (selector.attrs.length) {
+ return [1 | 2, ...selector.attrs, ...classes];
+ } else {
+ return selector.classNames && selector.classNames.length ? [1 | 8, ...selector.classNames] : [];
+ }
+}
+function parserSelectorToR3Selector(selector) {
+ const positive = parserSelectorToSimpleSelector(selector);
+ const negative = selector.notSelectors && selector.notSelectors.length ? selector.notSelectors.map((notSelector) => parserSelectorToNegativeSelector(notSelector)) : [];
+ return positive.concat(...negative);
+}
+function parseSelectorToR3Selector(selector) {
+ return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
+}
+var core = Object.freeze({
+ __proto__: null,
+ CUSTOM_ELEMENTS_SCHEMA,
+ get ChangeDetectionStrategy() {
+ return ChangeDetectionStrategy;
+ },
+ get InputFlags() {
+ return InputFlags;
+ },
+ get MissingTranslationStrategy() {
+ return MissingTranslationStrategy;
+ },
+ NO_ERRORS_SCHEMA,
+ get SecurityContext() {
+ return SecurityContext;
+ },
+ Type: Type$1,
+ get ViewEncapsulation() {
+ return ViewEncapsulation$1;
+ },
+ emitDistinctChangesOnlyDefaultValue,
+ parseSelectorToR3Selector
+});
+var FactoryTarget;
+(function(FactoryTarget2) {
+ FactoryTarget2[FactoryTarget2["Directive"] = 0] = "Directive";
+ FactoryTarget2[FactoryTarget2["Component"] = 1] = "Component";
+ FactoryTarget2[FactoryTarget2["Injectable"] = 2] = "Injectable";
+ FactoryTarget2[FactoryTarget2["Pipe"] = 3] = "Pipe";
+ FactoryTarget2[FactoryTarget2["NgModule"] = 4] = "NgModule";
+})(FactoryTarget || (FactoryTarget = {}));
+var R3TemplateDependencyKind$1;
+(function(R3TemplateDependencyKind2) {
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["Pipe"] = 1] = "Pipe";
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
+})(R3TemplateDependencyKind$1 || (R3TemplateDependencyKind$1 = {}));
+var ViewEncapsulation;
+(function(ViewEncapsulation2) {
+ ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
+ ViewEncapsulation2[ViewEncapsulation2["None"] = 2] = "None";
+ ViewEncapsulation2[ViewEncapsulation2["ShadowDom"] = 3] = "ShadowDom";
+})(ViewEncapsulation || (ViewEncapsulation = {}));
+var textEncoder;
+function digest$1(message) {
+ return message.id || computeDigest(message);
+}
+function computeDigest(message) {
+ return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
+}
+function decimalDigest(message) {
+ return message.id || computeDecimalDigest(message);
+}
+function computeDecimalDigest(message) {
+ const visitor = new _SerializerIgnoreIcuExpVisitor();
+ const parts = message.nodes.map((a) => a.visit(visitor, null));
+ return computeMsgId(parts.join(""), message.meaning);
+}
+var _SerializerVisitor = class {
+ visitText(text2, context) {
+ return text2.value;
+ }
+ visitContainer(container, context) {
+ return `[${container.children.map((child) => child.visit(this)).join(", ")}]`;
+ }
+ visitIcu(icu, context) {
+ const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
+ return `{${icu.expression}, ${icu.type}, ${strCases.join(", ")}}`;
+ }
+ visitTagPlaceholder(ph, context) {
+ return ph.isVoid ? `` : `${ph.children.map((child) => child.visit(this)).join(", ")}`;
+ }
+ visitPlaceholder(ph, context) {
+ return ph.value ? `${ph.value}` : ``;
+ }
+ visitIcuPlaceholder(ph, context) {
+ return `${ph.value.visit(this)}`;
+ }
+ visitBlockPlaceholder(ph, context) {
+ return `${ph.children.map((child) => child.visit(this)).join(", ")}`;
+ }
+};
+var serializerVisitor$1 = new _SerializerVisitor();
+function serializeNodes(nodes) {
+ return nodes.map((a) => a.visit(serializerVisitor$1, null));
+}
+var _SerializerIgnoreIcuExpVisitor = class extends _SerializerVisitor {
+ visitIcu(icu) {
+ let strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
+ return `{${icu.type}, ${strCases.join(", ")}}`;
+ }
+};
+function sha1(str) {
+ textEncoder ??= new TextEncoder();
+ const utf8 = [...textEncoder.encode(str)];
+ const words32 = bytesToWords32(utf8, Endian.Big);
+ const len = utf8.length * 8;
+ const w = new Uint32Array(80);
+ let a = 1732584193, b = 4023233417, c = 2562383102, d = 271733878, e = 3285377520;
+ words32[len >> 5] |= 128 << 24 - len % 32;
+ words32[(len + 64 >> 9 << 4) + 15] = len;
+ for (let i = 0; i < words32.length; i += 16) {
+ const h0 = a, h1 = b, h2 = c, h3 = d, h4 = e;
+ for (let j = 0; j < 80; j++) {
+ if (j < 16) {
+ w[j] = words32[i + j];
+ } else {
+ w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
+ }
+ const fkVal = fk(j, b, c, d);
+ const f = fkVal[0];
+ const k = fkVal[1];
+ const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);
+ e = d;
+ d = c;
+ c = rol32(b, 30);
+ b = a;
+ a = temp;
+ }
+ a = add32(a, h0);
+ b = add32(b, h1);
+ c = add32(c, h2);
+ d = add32(d, h3);
+ e = add32(e, h4);
+ }
+ return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);
+}
+function toHexU32(value) {
+ return (value >>> 0).toString(16).padStart(8, "0");
+}
+function fk(index, b, c, d) {
+ if (index < 20) {
+ return [b & c | ~b & d, 1518500249];
+ }
+ if (index < 40) {
+ return [b ^ c ^ d, 1859775393];
+ }
+ if (index < 60) {
+ return [b & c | b & d | c & d, 2400959708];
+ }
+ return [b ^ c ^ d, 3395469782];
+}
+function fingerprint(str) {
+ textEncoder ??= new TextEncoder();
+ const utf8 = textEncoder.encode(str);
+ const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);
+ let hi = hash32(view, utf8.length, 0);
+ let lo = hash32(view, utf8.length, 102072);
+ if (hi == 0 && (lo == 0 || lo == 1)) {
+ hi = hi ^ 319790063;
+ lo = lo ^ -1801410264;
+ }
+ return BigInt.asUintN(32, BigInt(hi)) << BigInt(32) | BigInt.asUintN(32, BigInt(lo));
+}
+function computeMsgId(msg, meaning = "") {
+ let msgFingerprint = fingerprint(msg);
+ if (meaning) {
+ msgFingerprint = BigInt.asUintN(64, msgFingerprint << BigInt(1)) | msgFingerprint >> BigInt(63) & BigInt(1);
+ msgFingerprint += fingerprint(meaning);
+ }
+ return BigInt.asUintN(63, msgFingerprint).toString();
+}
+function hash32(view, length, c) {
+ let a = 2654435769, b = 2654435769;
+ let index = 0;
+ const end = length - 12;
+ for (; index <= end; index += 12) {
+ a += view.getUint32(index, true);
+ b += view.getUint32(index + 4, true);
+ c += view.getUint32(index + 8, true);
+ const res = mix(a, b, c);
+ a = res[0], b = res[1], c = res[2];
+ }
+ const remainder = length - index;
+ c += length;
+ if (remainder >= 4) {
+ a += view.getUint32(index, true);
+ index += 4;
+ if (remainder >= 8) {
+ b += view.getUint32(index, true);
+ index += 4;
+ if (remainder >= 9) {
+ c += view.getUint8(index++) << 8;
+ }
+ if (remainder >= 10) {
+ c += view.getUint8(index++) << 16;
+ }
+ if (remainder === 11) {
+ c += view.getUint8(index++) << 24;
+ }
+ } else {
+ if (remainder >= 5) {
+ b += view.getUint8(index++);
+ }
+ if (remainder >= 6) {
+ b += view.getUint8(index++) << 8;
+ }
+ if (remainder === 7) {
+ b += view.getUint8(index++) << 16;
+ }
+ }
+ } else {
+ if (remainder >= 1) {
+ a += view.getUint8(index++);
+ }
+ if (remainder >= 2) {
+ a += view.getUint8(index++) << 8;
+ }
+ if (remainder === 3) {
+ a += view.getUint8(index++) << 16;
+ }
+ }
+ return mix(a, b, c)[2];
+}
+function mix(a, b, c) {
+ a -= b;
+ a -= c;
+ a ^= c >>> 13;
+ b -= c;
+ b -= a;
+ b ^= a << 8;
+ c -= a;
+ c -= b;
+ c ^= b >>> 13;
+ a -= b;
+ a -= c;
+ a ^= c >>> 12;
+ b -= c;
+ b -= a;
+ b ^= a << 16;
+ c -= a;
+ c -= b;
+ c ^= b >>> 5;
+ a -= b;
+ a -= c;
+ a ^= c >>> 3;
+ b -= c;
+ b -= a;
+ b ^= a << 10;
+ c -= a;
+ c -= b;
+ c ^= b >>> 15;
+ return [a, b, c];
+}
+var Endian;
+(function(Endian2) {
+ Endian2[Endian2["Little"] = 0] = "Little";
+ Endian2[Endian2["Big"] = 1] = "Big";
+})(Endian || (Endian = {}));
+function add32(a, b) {
+ return add32to64(a, b)[1];
+}
+function add32to64(a, b) {
+ const low = (a & 65535) + (b & 65535);
+ const high = (a >>> 16) + (b >>> 16) + (low >>> 16);
+ return [high >>> 16, high << 16 | low & 65535];
+}
+function rol32(a, count) {
+ return a << count | a >>> 32 - count;
+}
+function bytesToWords32(bytes, endian) {
+ const size = bytes.length + 3 >>> 2;
+ const words32 = [];
+ for (let i = 0; i < size; i++) {
+ words32[i] = wordAt(bytes, i * 4, endian);
+ }
+ return words32;
+}
+function byteAt(bytes, index) {
+ return index >= bytes.length ? 0 : bytes[index];
+}
+function wordAt(bytes, index, endian) {
+ let word = 0;
+ if (endian === Endian.Big) {
+ for (let i = 0; i < 4; i++) {
+ word += byteAt(bytes, index + i) << 24 - 8 * i;
+ }
+ } else {
+ for (let i = 0; i < 4; i++) {
+ word += byteAt(bytes, index + i) << 8 * i;
+ }
+ }
+ return word;
+}
+var TypeModifier;
+(function(TypeModifier2) {
+ TypeModifier2[TypeModifier2["None"] = 0] = "None";
+ TypeModifier2[TypeModifier2["Const"] = 1] = "Const";
+})(TypeModifier || (TypeModifier = {}));
+var Type = class {
+ modifiers;
+ constructor(modifiers = TypeModifier.None) {
+ this.modifiers = modifiers;
+ }
+ hasModifier(modifier) {
+ return (this.modifiers & modifier) !== 0;
+ }
+};
+var BuiltinTypeName;
+(function(BuiltinTypeName2) {
+ BuiltinTypeName2[BuiltinTypeName2["Dynamic"] = 0] = "Dynamic";
+ BuiltinTypeName2[BuiltinTypeName2["Bool"] = 1] = "Bool";
+ BuiltinTypeName2[BuiltinTypeName2["String"] = 2] = "String";
+ BuiltinTypeName2[BuiltinTypeName2["Int"] = 3] = "Int";
+ BuiltinTypeName2[BuiltinTypeName2["Number"] = 4] = "Number";
+ BuiltinTypeName2[BuiltinTypeName2["Function"] = 5] = "Function";
+ BuiltinTypeName2[BuiltinTypeName2["Inferred"] = 6] = "Inferred";
+ BuiltinTypeName2[BuiltinTypeName2["None"] = 7] = "None";
+})(BuiltinTypeName || (BuiltinTypeName = {}));
+var BuiltinType = class extends Type {
+ name;
+ constructor(name, modifiers) {
+ super(modifiers);
+ this.name = name;
+ }
+ visitType(visitor, context) {
+ return visitor.visitBuiltinType(this, context);
+ }
+};
+var ExpressionType = class extends Type {
+ value;
+ typeParams;
+ constructor(value, modifiers, typeParams = null) {
+ super(modifiers);
+ this.value = value;
+ this.typeParams = typeParams;
+ }
+ visitType(visitor, context) {
+ return visitor.visitExpressionType(this, context);
+ }
+};
+var ArrayType = class extends Type {
+ of;
+ constructor(of, modifiers) {
+ super(modifiers);
+ this.of = of;
+ }
+ visitType(visitor, context) {
+ return visitor.visitArrayType(this, context);
+ }
+};
+var MapType = class extends Type {
+ valueType;
+ constructor(valueType, modifiers) {
+ super(modifiers);
+ this.valueType = valueType || null;
+ }
+ visitType(visitor, context) {
+ return visitor.visitMapType(this, context);
+ }
+};
+var TransplantedType = class extends Type {
+ type;
+ constructor(type, modifiers) {
+ super(modifiers);
+ this.type = type;
+ }
+ visitType(visitor, context) {
+ return visitor.visitTransplantedType(this, context);
+ }
+};
+var DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
+var INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);
+var BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
+var INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
+var NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
+var STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
+var FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
+var NONE_TYPE = new BuiltinType(BuiltinTypeName.None);
+var UnaryOperator;
+(function(UnaryOperator2) {
+ UnaryOperator2[UnaryOperator2["Minus"] = 0] = "Minus";
+ UnaryOperator2[UnaryOperator2["Plus"] = 1] = "Plus";
+})(UnaryOperator || (UnaryOperator = {}));
+var BinaryOperator;
+(function(BinaryOperator2) {
+ BinaryOperator2[BinaryOperator2["Equals"] = 0] = "Equals";
+ BinaryOperator2[BinaryOperator2["NotEquals"] = 1] = "NotEquals";
+ BinaryOperator2[BinaryOperator2["Assign"] = 2] = "Assign";
+ BinaryOperator2[BinaryOperator2["Identical"] = 3] = "Identical";
+ BinaryOperator2[BinaryOperator2["NotIdentical"] = 4] = "NotIdentical";
+ BinaryOperator2[BinaryOperator2["Minus"] = 5] = "Minus";
+ BinaryOperator2[BinaryOperator2["Plus"] = 6] = "Plus";
+ BinaryOperator2[BinaryOperator2["Divide"] = 7] = "Divide";
+ BinaryOperator2[BinaryOperator2["Multiply"] = 8] = "Multiply";
+ BinaryOperator2[BinaryOperator2["Modulo"] = 9] = "Modulo";
+ BinaryOperator2[BinaryOperator2["And"] = 10] = "And";
+ BinaryOperator2[BinaryOperator2["Or"] = 11] = "Or";
+ BinaryOperator2[BinaryOperator2["BitwiseOr"] = 12] = "BitwiseOr";
+ BinaryOperator2[BinaryOperator2["BitwiseAnd"] = 13] = "BitwiseAnd";
+ BinaryOperator2[BinaryOperator2["Lower"] = 14] = "Lower";
+ BinaryOperator2[BinaryOperator2["LowerEquals"] = 15] = "LowerEquals";
+ BinaryOperator2[BinaryOperator2["Bigger"] = 16] = "Bigger";
+ BinaryOperator2[BinaryOperator2["BiggerEquals"] = 17] = "BiggerEquals";
+ BinaryOperator2[BinaryOperator2["NullishCoalesce"] = 18] = "NullishCoalesce";
+ BinaryOperator2[BinaryOperator2["Exponentiation"] = 19] = "Exponentiation";
+ BinaryOperator2[BinaryOperator2["In"] = 20] = "In";
+ BinaryOperator2[BinaryOperator2["AdditionAssignment"] = 21] = "AdditionAssignment";
+ BinaryOperator2[BinaryOperator2["SubtractionAssignment"] = 22] = "SubtractionAssignment";
+ BinaryOperator2[BinaryOperator2["MultiplicationAssignment"] = 23] = "MultiplicationAssignment";
+ BinaryOperator2[BinaryOperator2["DivisionAssignment"] = 24] = "DivisionAssignment";
+ BinaryOperator2[BinaryOperator2["RemainderAssignment"] = 25] = "RemainderAssignment";
+ BinaryOperator2[BinaryOperator2["ExponentiationAssignment"] = 26] = "ExponentiationAssignment";
+ BinaryOperator2[BinaryOperator2["AndAssignment"] = 27] = "AndAssignment";
+ BinaryOperator2[BinaryOperator2["OrAssignment"] = 28] = "OrAssignment";
+ BinaryOperator2[BinaryOperator2["NullishCoalesceAssignment"] = 29] = "NullishCoalesceAssignment";
+})(BinaryOperator || (BinaryOperator = {}));
+function nullSafeIsEquivalent(base, other) {
+ if (base == null || other == null) {
+ return base == other;
+ }
+ return base.isEquivalent(other);
+}
+function areAllEquivalentPredicate(base, other, equivalentPredicate) {
+ const len = base.length;
+ if (len !== other.length) {
+ return false;
+ }
+ for (let i = 0; i < len; i++) {
+ if (!equivalentPredicate(base[i], other[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+function areAllEquivalent(base, other) {
+ return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement));
+}
+var Expression = class {
+ type;
+ sourceSpan;
+ constructor(type, sourceSpan) {
+ this.type = type || null;
+ this.sourceSpan = sourceSpan || null;
+ }
+ prop(name, sourceSpan) {
+ return new ReadPropExpr(this, name, null, sourceSpan);
+ }
+ key(index, type, sourceSpan) {
+ return new ReadKeyExpr(this, index, type, sourceSpan);
+ }
+ callFn(params, sourceSpan, pure) {
+ return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);
+ }
+ instantiate(params, type, sourceSpan) {
+ return new InstantiateExpr(this, params, type, sourceSpan);
+ }
+ conditional(trueCase, falseCase = null, sourceSpan) {
+ return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
+ }
+ equals(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);
+ }
+ notEquals(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);
+ }
+ identical(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);
+ }
+ notIdentical(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);
+ }
+ minus(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);
+ }
+ plus(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);
+ }
+ divide(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);
+ }
+ multiply(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);
+ }
+ modulo(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
+ }
+ power(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Exponentiation, this, rhs, null, sourceSpan);
+ }
+ and(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
+ }
+ bitwiseOr(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan);
+ }
+ bitwiseAnd(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan);
+ }
+ or(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
+ }
+ lower(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);
+ }
+ lowerEquals(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);
+ }
+ bigger(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);
+ }
+ biggerEquals(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);
+ }
+ isBlank(sourceSpan) {
+ return this.equals(TYPED_NULL_EXPR, sourceSpan);
+ }
+ nullishCoalesce(rhs, sourceSpan) {
+ return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);
+ }
+ toStmt() {
+ return new ExpressionStatement(this, null);
+ }
+};
+var ReadVarExpr = class _ReadVarExpr extends Expression {
+ name;
+ constructor(name, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.name = name;
+ }
+ isEquivalent(e) {
+ return e instanceof _ReadVarExpr && this.name === e.name;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitReadVarExpr(this, context);
+ }
+ clone() {
+ return new _ReadVarExpr(this.name, this.type, this.sourceSpan);
+ }
+ set(value) {
+ return new BinaryOperatorExpr(BinaryOperator.Assign, this, value, null, this.sourceSpan);
+ }
+};
+var TypeofExpr = class _TypeofExpr extends Expression {
+ expr;
+ constructor(expr, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.expr = expr;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitTypeofExpr(this, context);
+ }
+ isEquivalent(e) {
+ return e instanceof _TypeofExpr && e.expr.isEquivalent(this.expr);
+ }
+ isConstant() {
+ return this.expr.isConstant();
+ }
+ clone() {
+ return new _TypeofExpr(this.expr.clone());
+ }
+};
+var VoidExpr = class _VoidExpr extends Expression {
+ expr;
+ constructor(expr, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.expr = expr;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitVoidExpr(this, context);
+ }
+ isEquivalent(e) {
+ return e instanceof _VoidExpr && e.expr.isEquivalent(this.expr);
+ }
+ isConstant() {
+ return this.expr.isConstant();
+ }
+ clone() {
+ return new _VoidExpr(this.expr.clone());
+ }
+};
+var WrappedNodeExpr = class _WrappedNodeExpr extends Expression {
+ node;
+ constructor(node, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.node = node;
+ }
+ isEquivalent(e) {
+ return e instanceof _WrappedNodeExpr && this.node === e.node;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitWrappedNodeExpr(this, context);
+ }
+ clone() {
+ return new _WrappedNodeExpr(this.node, this.type, this.sourceSpan);
+ }
+};
+var InvokeFunctionExpr = class _InvokeFunctionExpr extends Expression {
+ fn;
+ args;
+ pure;
+ constructor(fn2, args, type, sourceSpan, pure = false) {
+ super(type, sourceSpan);
+ this.fn = fn2;
+ this.args = args;
+ this.pure = pure;
+ }
+ // An alias for fn, which allows other logic to handle calls and property reads together.
+ get receiver() {
+ return this.fn;
+ }
+ isEquivalent(e) {
+ return e instanceof _InvokeFunctionExpr && this.fn.isEquivalent(e.fn) && areAllEquivalent(this.args, e.args) && this.pure === e.pure;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitInvokeFunctionExpr(this, context);
+ }
+ clone() {
+ return new _InvokeFunctionExpr(this.fn.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan, this.pure);
+ }
+};
+var TaggedTemplateLiteralExpr = class _TaggedTemplateLiteralExpr extends Expression {
+ tag;
+ template;
+ constructor(tag, template2, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.tag = tag;
+ this.template = template2;
+ }
+ isEquivalent(e) {
+ return e instanceof _TaggedTemplateLiteralExpr && this.tag.isEquivalent(e.tag) && this.template.isEquivalent(e.template);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitTaggedTemplateLiteralExpr(this, context);
+ }
+ clone() {
+ return new _TaggedTemplateLiteralExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan);
+ }
+};
+var InstantiateExpr = class _InstantiateExpr extends Expression {
+ classExpr;
+ args;
+ constructor(classExpr, args, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.classExpr = classExpr;
+ this.args = args;
+ }
+ isEquivalent(e) {
+ return e instanceof _InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) && areAllEquivalent(this.args, e.args);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitInstantiateExpr(this, context);
+ }
+ clone() {
+ return new _InstantiateExpr(this.classExpr.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan);
+ }
+};
+var LiteralExpr = class _LiteralExpr extends Expression {
+ value;
+ constructor(value, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.value = value;
+ }
+ isEquivalent(e) {
+ return e instanceof _LiteralExpr && this.value === e.value;
+ }
+ isConstant() {
+ return true;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitLiteralExpr(this, context);
+ }
+ clone() {
+ return new _LiteralExpr(this.value, this.type, this.sourceSpan);
+ }
+};
+var TemplateLiteralExpr = class _TemplateLiteralExpr extends Expression {
+ elements;
+ expressions;
+ constructor(elements, expressions, sourceSpan) {
+ super(null, sourceSpan);
+ this.elements = elements;
+ this.expressions = expressions;
+ }
+ isEquivalent(e) {
+ return e instanceof _TemplateLiteralExpr && areAllEquivalentPredicate(this.elements, e.elements, (a, b) => a.text === b.text) && areAllEquivalent(this.expressions, e.expressions);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitTemplateLiteralExpr(this, context);
+ }
+ clone() {
+ return new _TemplateLiteralExpr(this.elements.map((el) => el.clone()), this.expressions.map((expr) => expr.clone()));
+ }
+};
+var TemplateLiteralElementExpr = class _TemplateLiteralElementExpr extends Expression {
+ text;
+ rawText;
+ constructor(text2, sourceSpan, rawText) {
+ super(STRING_TYPE, sourceSpan);
+ this.text = text2;
+ this.rawText = rawText ?? escapeForTemplateLiteral(escapeSlashes(text2));
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitTemplateLiteralElementExpr(this, context);
+ }
+ isEquivalent(e) {
+ return e instanceof _TemplateLiteralElementExpr && e.text === this.text && e.rawText === this.rawText;
+ }
+ isConstant() {
+ return true;
+ }
+ clone() {
+ return new _TemplateLiteralElementExpr(this.text, this.sourceSpan, this.rawText);
+ }
+};
+var LiteralPiece = class {
+ text;
+ sourceSpan;
+ constructor(text2, sourceSpan) {
+ this.text = text2;
+ this.sourceSpan = sourceSpan;
+ }
+};
+var PlaceholderPiece = class {
+ text;
+ sourceSpan;
+ associatedMessage;
+ /**
+ * Create a new instance of a `PlaceholderPiece`.
+ *
+ * @param text the name of this placeholder (e.g. `PH_1`).
+ * @param sourceSpan the location of this placeholder in its localized message the source code.
+ * @param associatedMessage reference to another message that this placeholder is associated with.
+ * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has
+ * been extracted out from the message containing the placeholder.
+ */
+ constructor(text2, sourceSpan, associatedMessage) {
+ this.text = text2;
+ this.sourceSpan = sourceSpan;
+ this.associatedMessage = associatedMessage;
+ }
+};
+var MEANING_SEPARATOR$1 = "|";
+var ID_SEPARATOR$1 = "@@";
+var LEGACY_ID_INDICATOR = "␟";
+var LocalizedString = class _LocalizedString extends Expression {
+ metaBlock;
+ messageParts;
+ placeHolderNames;
+ expressions;
+ constructor(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan) {
+ super(STRING_TYPE, sourceSpan);
+ this.metaBlock = metaBlock;
+ this.messageParts = messageParts;
+ this.placeHolderNames = placeHolderNames;
+ this.expressions = expressions;
+ }
+ isEquivalent(e) {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitLocalizedString(this, context);
+ }
+ clone() {
+ return new _LocalizedString(this.metaBlock, this.messageParts, this.placeHolderNames, this.expressions.map((expr) => expr.clone()), this.sourceSpan);
+ }
+ /**
+ * Serialize the given `meta` and `messagePart` into "cooked" and "raw" strings that can be used
+ * in a `$localize` tagged string. The format of the metadata is the same as that parsed by
+ * `parseI18nMeta()`.
+ *
+ * @param meta The metadata to serialize
+ * @param messagePart The first part of the tagged string
+ */
+ serializeI18nHead() {
+ let metaBlock = this.metaBlock.description || "";
+ if (this.metaBlock.meaning) {
+ metaBlock = `${this.metaBlock.meaning}${MEANING_SEPARATOR$1}${metaBlock}`;
+ }
+ if (this.metaBlock.customId) {
+ metaBlock = `${metaBlock}${ID_SEPARATOR$1}${this.metaBlock.customId}`;
+ }
+ if (this.metaBlock.legacyIds) {
+ this.metaBlock.legacyIds.forEach((legacyId) => {
+ metaBlock = `${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`;
+ });
+ }
+ return createCookedRawString(metaBlock, this.messageParts[0].text, this.getMessagePartSourceSpan(0));
+ }
+ getMessagePartSourceSpan(i) {
+ return this.messageParts[i]?.sourceSpan ?? this.sourceSpan;
+ }
+ getPlaceholderSourceSpan(i) {
+ return this.placeHolderNames[i]?.sourceSpan ?? this.expressions[i]?.sourceSpan ?? this.sourceSpan;
+ }
+ /**
+ * Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that
+ * can be used in a `$localize` tagged string.
+ *
+ * The format is `:[@@]:`.
+ *
+ * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder
+ * refers.
+ *
+ * @param partIndex The index of the message part to serialize.
+ */
+ serializeI18nTemplatePart(partIndex) {
+ const placeholder = this.placeHolderNames[partIndex - 1];
+ const messagePart = this.messageParts[partIndex];
+ let metaBlock = placeholder.text;
+ if (placeholder.associatedMessage?.legacyIds.length === 0) {
+ metaBlock += `${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString, placeholder.associatedMessage.meaning)}`;
+ }
+ return createCookedRawString(metaBlock, messagePart.text, this.getMessagePartSourceSpan(partIndex));
+ }
+};
+var escapeSlashes = (str) => str.replace(/\\/g, "\\\\");
+var escapeStartingColon = (str) => str.replace(/^:/, "\\:");
+var escapeColons = (str) => str.replace(/:/g, "\\:");
+var escapeForTemplateLiteral = (str) => str.replace(/`/g, "\\`").replace(/\${/g, "$\\{");
+function createCookedRawString(metaBlock, messagePart, range) {
+ if (metaBlock === "") {
+ return {
+ cooked: messagePart,
+ raw: escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),
+ range
+ };
+ } else {
+ return {
+ cooked: `:${metaBlock}:${messagePart}`,
+ raw: escapeForTemplateLiteral(`:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`),
+ range
+ };
+ }
+}
+var ExternalExpr = class _ExternalExpr extends Expression {
+ value;
+ typeParams;
+ constructor(value, type, typeParams = null, sourceSpan) {
+ super(type, sourceSpan);
+ this.value = value;
+ this.typeParams = typeParams;
+ }
+ isEquivalent(e) {
+ return e instanceof _ExternalExpr && this.value.name === e.value.name && this.value.moduleName === e.value.moduleName;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitExternalExpr(this, context);
+ }
+ clone() {
+ return new _ExternalExpr(this.value, this.type, this.typeParams, this.sourceSpan);
+ }
+};
+var ExternalReference = class {
+ moduleName;
+ name;
+ constructor(moduleName, name) {
+ this.moduleName = moduleName;
+ this.name = name;
+ }
+};
+var ConditionalExpr = class _ConditionalExpr extends Expression {
+ condition;
+ falseCase;
+ trueCase;
+ constructor(condition, trueCase, falseCase = null, type, sourceSpan) {
+ super(type || trueCase.type, sourceSpan);
+ this.condition = condition;
+ this.falseCase = falseCase;
+ this.trueCase = trueCase;
+ }
+ isEquivalent(e) {
+ return e instanceof _ConditionalExpr && this.condition.isEquivalent(e.condition) && this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitConditionalExpr(this, context);
+ }
+ clone() {
+ return new _ConditionalExpr(this.condition.clone(), this.trueCase.clone(), this.falseCase?.clone(), this.type, this.sourceSpan);
+ }
+};
+var DynamicImportExpr = class _DynamicImportExpr extends Expression {
+ url;
+ urlComment;
+ constructor(url, sourceSpan, urlComment) {
+ super(null, sourceSpan);
+ this.url = url;
+ this.urlComment = urlComment;
+ }
+ isEquivalent(e) {
+ return e instanceof _DynamicImportExpr && this.url === e.url && this.urlComment === e.urlComment;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitDynamicImportExpr(this, context);
+ }
+ clone() {
+ return new _DynamicImportExpr(typeof this.url === "string" ? this.url : this.url.clone(), this.sourceSpan, this.urlComment);
+ }
+};
+var NotExpr = class _NotExpr extends Expression {
+ condition;
+ constructor(condition, sourceSpan) {
+ super(BOOL_TYPE, sourceSpan);
+ this.condition = condition;
+ }
+ isEquivalent(e) {
+ return e instanceof _NotExpr && this.condition.isEquivalent(e.condition);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitNotExpr(this, context);
+ }
+ clone() {
+ return new _NotExpr(this.condition.clone(), this.sourceSpan);
+ }
+};
+var FnParam = class _FnParam {
+ name;
+ type;
+ constructor(name, type = null) {
+ this.name = name;
+ this.type = type;
+ }
+ isEquivalent(param) {
+ return this.name === param.name;
+ }
+ clone() {
+ return new _FnParam(this.name, this.type);
+ }
+};
+var FunctionExpr = class _FunctionExpr extends Expression {
+ params;
+ statements;
+ name;
+ constructor(params, statements, type, sourceSpan, name) {
+ super(type, sourceSpan);
+ this.params = params;
+ this.statements = statements;
+ this.name = name;
+ }
+ isEquivalent(e) {
+ return (e instanceof _FunctionExpr || e instanceof DeclareFunctionStmt) && areAllEquivalent(this.params, e.params) && areAllEquivalent(this.statements, e.statements);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitFunctionExpr(this, context);
+ }
+ toDeclStmt(name, modifiers) {
+ return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);
+ }
+ clone() {
+ return new _FunctionExpr(this.params.map((p) => p.clone()), this.statements, this.type, this.sourceSpan, this.name);
+ }
+};
+var ArrowFunctionExpr = class _ArrowFunctionExpr extends Expression {
+ params;
+ body;
+ // Note that `body: Expression` represents `() => expr` whereas
+ // `body: Statement[]` represents `() => { expr }`.
+ constructor(params, body, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.params = params;
+ this.body = body;
+ }
+ isEquivalent(e) {
+ if (!(e instanceof _ArrowFunctionExpr) || !areAllEquivalent(this.params, e.params)) {
+ return false;
+ }
+ if (this.body instanceof Expression && e.body instanceof Expression) {
+ return this.body.isEquivalent(e.body);
+ }
+ if (Array.isArray(this.body) && Array.isArray(e.body)) {
+ return areAllEquivalent(this.body, e.body);
+ }
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitArrowFunctionExpr(this, context);
+ }
+ clone() {
+ return new _ArrowFunctionExpr(this.params.map((p) => p.clone()), Array.isArray(this.body) ? this.body : this.body.clone(), this.type, this.sourceSpan);
+ }
+ toDeclStmt(name, modifiers) {
+ return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan);
+ }
+};
+var UnaryOperatorExpr = class _UnaryOperatorExpr extends Expression {
+ operator;
+ expr;
+ parens;
+ constructor(operator, expr, type, sourceSpan, parens = true) {
+ super(type || NUMBER_TYPE, sourceSpan);
+ this.operator = operator;
+ this.expr = expr;
+ this.parens = parens;
+ }
+ isEquivalent(e) {
+ return e instanceof _UnaryOperatorExpr && this.operator === e.operator && this.expr.isEquivalent(e.expr);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitUnaryOperatorExpr(this, context);
+ }
+ clone() {
+ return new _UnaryOperatorExpr(this.operator, this.expr.clone(), this.type, this.sourceSpan, this.parens);
+ }
+};
+var ParenthesizedExpr = class _ParenthesizedExpr extends Expression {
+ expr;
+ constructor(expr, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.expr = expr;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitParenthesizedExpr(this, context);
+ }
+ isEquivalent(e) {
+ return e instanceof _ParenthesizedExpr && e.expr.isEquivalent(this.expr);
+ }
+ isConstant() {
+ return this.expr.isConstant();
+ }
+ clone() {
+ return new _ParenthesizedExpr(this.expr.clone());
+ }
+};
+var BinaryOperatorExpr = class _BinaryOperatorExpr extends Expression {
+ operator;
+ rhs;
+ lhs;
+ constructor(operator, lhs, rhs, type, sourceSpan) {
+ super(type || lhs.type, sourceSpan);
+ this.operator = operator;
+ this.rhs = rhs;
+ this.lhs = lhs;
+ }
+ isEquivalent(e) {
+ return e instanceof _BinaryOperatorExpr && this.operator === e.operator && this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitBinaryOperatorExpr(this, context);
+ }
+ clone() {
+ return new _BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan);
+ }
+ isAssignment() {
+ const op = this.operator;
+ return op === BinaryOperator.Assign || op === BinaryOperator.AdditionAssignment || op === BinaryOperator.SubtractionAssignment || op === BinaryOperator.MultiplicationAssignment || op === BinaryOperator.DivisionAssignment || op === BinaryOperator.RemainderAssignment || op === BinaryOperator.ExponentiationAssignment || op === BinaryOperator.AndAssignment || op === BinaryOperator.OrAssignment || op === BinaryOperator.NullishCoalesceAssignment;
+ }
+};
+var ReadPropExpr = class _ReadPropExpr extends Expression {
+ receiver;
+ name;
+ constructor(receiver, name, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.receiver = receiver;
+ this.name = name;
+ }
+ // An alias for name, which allows other logic to handle property reads and keyed reads together.
+ get index() {
+ return this.name;
+ }
+ isEquivalent(e) {
+ return e instanceof _ReadPropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name;
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitReadPropExpr(this, context);
+ }
+ set(value) {
+ return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.prop(this.name), value, null, this.sourceSpan);
+ }
+ clone() {
+ return new _ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan);
+ }
+};
+var ReadKeyExpr = class _ReadKeyExpr extends Expression {
+ receiver;
+ index;
+ constructor(receiver, index, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.receiver = receiver;
+ this.index = index;
+ }
+ isEquivalent(e) {
+ return e instanceof _ReadKeyExpr && this.receiver.isEquivalent(e.receiver) && this.index.isEquivalent(e.index);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitReadKeyExpr(this, context);
+ }
+ set(value) {
+ return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.key(this.index), value, null, this.sourceSpan);
+ }
+ clone() {
+ return new _ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan);
+ }
+};
+var LiteralArrayExpr = class _LiteralArrayExpr extends Expression {
+ entries;
+ constructor(entries, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.entries = entries;
+ }
+ isConstant() {
+ return this.entries.every((e) => e.isConstant());
+ }
+ isEquivalent(e) {
+ return e instanceof _LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitLiteralArrayExpr(this, context);
+ }
+ clone() {
+ return new _LiteralArrayExpr(this.entries.map((e) => e.clone()), this.type, this.sourceSpan);
+ }
+};
+var LiteralMapEntry = class _LiteralMapEntry {
+ key;
+ value;
+ quoted;
+ constructor(key, value, quoted) {
+ this.key = key;
+ this.value = value;
+ this.quoted = quoted;
+ }
+ isEquivalent(e) {
+ return this.key === e.key && this.value.isEquivalent(e.value);
+ }
+ clone() {
+ return new _LiteralMapEntry(this.key, this.value.clone(), this.quoted);
+ }
+};
+var LiteralMapExpr = class _LiteralMapExpr extends Expression {
+ entries;
+ valueType = null;
+ constructor(entries, type, sourceSpan) {
+ super(type, sourceSpan);
+ this.entries = entries;
+ if (type) {
+ this.valueType = type.valueType;
+ }
+ }
+ isEquivalent(e) {
+ return e instanceof _LiteralMapExpr && areAllEquivalent(this.entries, e.entries);
+ }
+ isConstant() {
+ return this.entries.every((e) => e.value.isConstant());
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitLiteralMapExpr(this, context);
+ }
+ clone() {
+ const entriesClone = this.entries.map((entry) => entry.clone());
+ return new _LiteralMapExpr(entriesClone, this.type, this.sourceSpan);
+ }
+};
+var CommaExpr = class _CommaExpr extends Expression {
+ parts;
+ constructor(parts, sourceSpan) {
+ super(parts[parts.length - 1].type, sourceSpan);
+ this.parts = parts;
+ }
+ isEquivalent(e) {
+ return e instanceof _CommaExpr && areAllEquivalent(this.parts, e.parts);
+ }
+ isConstant() {
+ return false;
+ }
+ visitExpression(visitor, context) {
+ return visitor.visitCommaExpr(this, context);
+ }
+ clone() {
+ return new _CommaExpr(this.parts.map((p) => p.clone()));
+ }
+};
+var NULL_EXPR = new LiteralExpr(null, null, null);
+var TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);
+var StmtModifier;
+(function(StmtModifier2) {
+ StmtModifier2[StmtModifier2["None"] = 0] = "None";
+ StmtModifier2[StmtModifier2["Final"] = 1] = "Final";
+ StmtModifier2[StmtModifier2["Private"] = 2] = "Private";
+ StmtModifier2[StmtModifier2["Exported"] = 4] = "Exported";
+ StmtModifier2[StmtModifier2["Static"] = 8] = "Static";
+})(StmtModifier || (StmtModifier = {}));
+var LeadingComment = class {
+ text;
+ multiline;
+ trailingNewline;
+ constructor(text2, multiline, trailingNewline) {
+ this.text = text2;
+ this.multiline = multiline;
+ this.trailingNewline = trailingNewline;
+ }
+ toString() {
+ return this.multiline ? ` ${this.text} ` : this.text;
+ }
+};
+var JSDocComment = class extends LeadingComment {
+ tags;
+ constructor(tags) {
+ super(
+ "",
+ /* multiline */
+ true,
+ /* trailingNewline */
+ true
+ );
+ this.tags = tags;
+ }
+ toString() {
+ return serializeTags(this.tags);
+ }
+};
+var Statement = class {
+ modifiers;
+ sourceSpan;
+ leadingComments;
+ constructor(modifiers = StmtModifier.None, sourceSpan = null, leadingComments) {
+ this.modifiers = modifiers;
+ this.sourceSpan = sourceSpan;
+ this.leadingComments = leadingComments;
+ }
+ hasModifier(modifier) {
+ return (this.modifiers & modifier) !== 0;
+ }
+ addLeadingComment(leadingComment2) {
+ this.leadingComments = this.leadingComments ?? [];
+ this.leadingComments.push(leadingComment2);
+ }
+};
+var DeclareVarStmt = class _DeclareVarStmt extends Statement {
+ name;
+ value;
+ type;
+ constructor(name, value, type, modifiers, sourceSpan, leadingComments) {
+ super(modifiers, sourceSpan, leadingComments);
+ this.name = name;
+ this.value = value;
+ this.type = type || value && value.type || null;
+ }
+ isEquivalent(stmt) {
+ return stmt instanceof _DeclareVarStmt && this.name === stmt.name && (this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value);
+ }
+ visitStatement(visitor, context) {
+ return visitor.visitDeclareVarStmt(this, context);
+ }
+};
+var DeclareFunctionStmt = class _DeclareFunctionStmt extends Statement {
+ name;
+ params;
+ statements;
+ type;
+ constructor(name, params, statements, type, modifiers, sourceSpan, leadingComments) {
+ super(modifiers, sourceSpan, leadingComments);
+ this.name = name;
+ this.params = params;
+ this.statements = statements;
+ this.type = type || null;
+ }
+ isEquivalent(stmt) {
+ return stmt instanceof _DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) && areAllEquivalent(this.statements, stmt.statements);
+ }
+ visitStatement(visitor, context) {
+ return visitor.visitDeclareFunctionStmt(this, context);
+ }
+};
+var ExpressionStatement = class _ExpressionStatement extends Statement {
+ expr;
+ constructor(expr, sourceSpan, leadingComments) {
+ super(StmtModifier.None, sourceSpan, leadingComments);
+ this.expr = expr;
+ }
+ isEquivalent(stmt) {
+ return stmt instanceof _ExpressionStatement && this.expr.isEquivalent(stmt.expr);
+ }
+ visitStatement(visitor, context) {
+ return visitor.visitExpressionStmt(this, context);
+ }
+};
+var ReturnStatement = class _ReturnStatement extends Statement {
+ value;
+ constructor(value, sourceSpan = null, leadingComments) {
+ super(StmtModifier.None, sourceSpan, leadingComments);
+ this.value = value;
+ }
+ isEquivalent(stmt) {
+ return stmt instanceof _ReturnStatement && this.value.isEquivalent(stmt.value);
+ }
+ visitStatement(visitor, context) {
+ return visitor.visitReturnStmt(this, context);
+ }
+};
+var IfStmt = class _IfStmt extends Statement {
+ condition;
+ trueCase;
+ falseCase;
+ constructor(condition, trueCase, falseCase = [], sourceSpan, leadingComments) {
+ super(StmtModifier.None, sourceSpan, leadingComments);
+ this.condition = condition;
+ this.trueCase = trueCase;
+ this.falseCase = falseCase;
+ }
+ isEquivalent(stmt) {
+ return stmt instanceof _IfStmt && this.condition.isEquivalent(stmt.condition) && areAllEquivalent(this.trueCase, stmt.trueCase) && areAllEquivalent(this.falseCase, stmt.falseCase);
+ }
+ visitStatement(visitor, context) {
+ return visitor.visitIfStmt(this, context);
+ }
+};
+var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
+ visitType(ast, context) {
+ return ast;
+ }
+ visitExpression(ast, context) {
+ if (ast.type) {
+ ast.type.visitType(this, context);
+ }
+ return ast;
+ }
+ visitBuiltinType(type, context) {
+ return this.visitType(type, context);
+ }
+ visitExpressionType(type, context) {
+ type.value.visitExpression(this, context);
+ if (type.typeParams !== null) {
+ type.typeParams.forEach((param) => this.visitType(param, context));
+ }
+ return this.visitType(type, context);
+ }
+ visitArrayType(type, context) {
+ return this.visitType(type, context);
+ }
+ visitMapType(type, context) {
+ return this.visitType(type, context);
+ }
+ visitTransplantedType(type, context) {
+ return type;
+ }
+ visitWrappedNodeExpr(ast, context) {
+ return ast;
+ }
+ visitReadVarExpr(ast, context) {
+ return this.visitExpression(ast, context);
+ }
+ visitDynamicImportExpr(ast, context) {
+ return this.visitExpression(ast, context);
+ }
+ visitInvokeFunctionExpr(ast, context) {
+ ast.fn.visitExpression(this, context);
+ this.visitAllExpressions(ast.args, context);
+ return this.visitExpression(ast, context);
+ }
+ visitTaggedTemplateLiteralExpr(ast, context) {
+ ast.tag.visitExpression(this, context);
+ ast.template.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitInstantiateExpr(ast, context) {
+ ast.classExpr.visitExpression(this, context);
+ this.visitAllExpressions(ast.args, context);
+ return this.visitExpression(ast, context);
+ }
+ visitLiteralExpr(ast, context) {
+ return this.visitExpression(ast, context);
+ }
+ visitLocalizedString(ast, context) {
+ return this.visitExpression(ast, context);
+ }
+ visitExternalExpr(ast, context) {
+ if (ast.typeParams) {
+ ast.typeParams.forEach((type) => type.visitType(this, context));
+ }
+ return this.visitExpression(ast, context);
+ }
+ visitConditionalExpr(ast, context) {
+ ast.condition.visitExpression(this, context);
+ ast.trueCase.visitExpression(this, context);
+ ast.falseCase.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitNotExpr(ast, context) {
+ ast.condition.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitFunctionExpr(ast, context) {
+ this.visitAllStatements(ast.statements, context);
+ return this.visitExpression(ast, context);
+ }
+ visitArrowFunctionExpr(ast, context) {
+ if (Array.isArray(ast.body)) {
+ this.visitAllStatements(ast.body, context);
+ } else {
+ ast.body.visitExpression(this, context);
+ }
+ return this.visitExpression(ast, context);
+ }
+ visitUnaryOperatorExpr(ast, context) {
+ ast.expr.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitTypeofExpr(ast, context) {
+ ast.expr.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitVoidExpr(ast, context) {
+ ast.expr.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitBinaryOperatorExpr(ast, context) {
+ ast.lhs.visitExpression(this, context);
+ ast.rhs.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitReadPropExpr(ast, context) {
+ ast.receiver.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitReadKeyExpr(ast, context) {
+ ast.receiver.visitExpression(this, context);
+ ast.index.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitLiteralArrayExpr(ast, context) {
+ this.visitAllExpressions(ast.entries, context);
+ return this.visitExpression(ast, context);
+ }
+ visitLiteralMapExpr(ast, context) {
+ ast.entries.forEach((entry) => entry.value.visitExpression(this, context));
+ return this.visitExpression(ast, context);
+ }
+ visitCommaExpr(ast, context) {
+ this.visitAllExpressions(ast.parts, context);
+ return this.visitExpression(ast, context);
+ }
+ visitTemplateLiteralExpr(ast, context) {
+ this.visitAllExpressions(ast.elements, context);
+ this.visitAllExpressions(ast.expressions, context);
+ return this.visitExpression(ast, context);
+ }
+ visitTemplateLiteralElementExpr(ast, context) {
+ return this.visitExpression(ast, context);
+ }
+ visitParenthesizedExpr(ast, context) {
+ ast.expr.visitExpression(this, context);
+ return this.visitExpression(ast, context);
+ }
+ visitAllExpressions(exprs, context) {
+ exprs.forEach((expr) => expr.visitExpression(this, context));
+ }
+ visitDeclareVarStmt(stmt, context) {
+ if (stmt.value) {
+ stmt.value.visitExpression(this, context);
+ }
+ if (stmt.type) {
+ stmt.type.visitType(this, context);
+ }
+ return stmt;
+ }
+ visitDeclareFunctionStmt(stmt, context) {
+ this.visitAllStatements(stmt.statements, context);
+ if (stmt.type) {
+ stmt.type.visitType(this, context);
+ }
+ return stmt;
+ }
+ visitExpressionStmt(stmt, context) {
+ stmt.expr.visitExpression(this, context);
+ return stmt;
+ }
+ visitReturnStmt(stmt, context) {
+ stmt.value.visitExpression(this, context);
+ return stmt;
+ }
+ visitIfStmt(stmt, context) {
+ stmt.condition.visitExpression(this, context);
+ this.visitAllStatements(stmt.trueCase, context);
+ this.visitAllStatements(stmt.falseCase, context);
+ return stmt;
+ }
+ visitAllStatements(stmts, context) {
+ stmts.forEach((stmt) => stmt.visitStatement(this, context));
+ }
+};
+function leadingComment(text2, multiline = false, trailingNewline = true) {
+ return new LeadingComment(text2, multiline, trailingNewline);
+}
+function jsDocComment(tags = []) {
+ return new JSDocComment(tags);
+}
+function variable(name, type, sourceSpan) {
+ return new ReadVarExpr(name, type, sourceSpan);
+}
+function importExpr(id, typeParams = null, sourceSpan) {
+ return new ExternalExpr(id, null, typeParams, sourceSpan);
+}
+function importType(id, typeParams, typeModifiers) {
+ return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;
+}
+function expressionType(expr, typeModifiers, typeParams) {
+ return new ExpressionType(expr, typeModifiers, typeParams);
+}
+function transplantedType(type, typeModifiers) {
+ return new TransplantedType(type, typeModifiers);
+}
+function typeofExpr(expr) {
+ return new TypeofExpr(expr);
+}
+function literalArr(values, type, sourceSpan) {
+ return new LiteralArrayExpr(values, type, sourceSpan);
+}
+function literalMap(values, type = null) {
+ return new LiteralMapExpr(values.map((e) => new LiteralMapEntry(e.key, e.value, e.quoted)), type, null);
+}
+function unary(operator, expr, type, sourceSpan) {
+ return new UnaryOperatorExpr(operator, expr, type, sourceSpan);
+}
+function not(expr, sourceSpan) {
+ return new NotExpr(expr, sourceSpan);
+}
+function fn(params, body, type, sourceSpan, name) {
+ return new FunctionExpr(params, body, type, sourceSpan, name);
+}
+function arrowFn(params, body, type, sourceSpan) {
+ return new ArrowFunctionExpr(params, body, type, sourceSpan);
+}
+function ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments) {
+ return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments);
+}
+function taggedTemplate(tag, template2, type, sourceSpan) {
+ return new TaggedTemplateLiteralExpr(tag, template2, type, sourceSpan);
+}
+function literal(value, type, sourceSpan) {
+ return new LiteralExpr(value, type, sourceSpan);
+}
+function localizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan) {
+ return new LocalizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan);
+}
+function isNull(exp) {
+ return exp instanceof LiteralExpr && exp.value === null;
+}
+function tagToString(tag) {
+ let out = "";
+ if (tag.tagName) {
+ out += ` @${tag.tagName}`;
+ }
+ if (tag.text) {
+ if (tag.text.match(/\/\*|\*\//)) {
+ throw new Error('JSDoc text cannot contain "/*" and "*/"');
+ }
+ out += " " + tag.text.replace(/@/g, "\\@");
+ }
+ return out;
+}
+function serializeTags(tags) {
+ if (tags.length === 0)
+ return "";
+ if (tags.length === 1 && tags[0].tagName && !tags[0].text) {
+ return `*${tagToString(tags[0])} `;
+ }
+ let out = "*\n";
+ for (const tag of tags) {
+ out += " *";
+ out += tagToString(tag).replace(/\n/g, "\n * ");
+ out += "\n";
+ }
+ out += " ";
+ return out;
+}
+var output_ast = Object.freeze({
+ __proto__: null,
+ ArrayType,
+ ArrowFunctionExpr,
+ BOOL_TYPE,
+ get BinaryOperator() {
+ return BinaryOperator;
+ },
+ BinaryOperatorExpr,
+ BuiltinType,
+ get BuiltinTypeName() {
+ return BuiltinTypeName;
+ },
+ CommaExpr,
+ ConditionalExpr,
+ DYNAMIC_TYPE,
+ DeclareFunctionStmt,
+ DeclareVarStmt,
+ DynamicImportExpr,
+ Expression,
+ ExpressionStatement,
+ ExpressionType,
+ ExternalExpr,
+ ExternalReference,
+ FUNCTION_TYPE,
+ FnParam,
+ FunctionExpr,
+ INFERRED_TYPE,
+ INT_TYPE,
+ IfStmt,
+ InstantiateExpr,
+ InvokeFunctionExpr,
+ JSDocComment,
+ LeadingComment,
+ LiteralArrayExpr,
+ LiteralExpr,
+ LiteralMapEntry,
+ LiteralMapExpr,
+ LiteralPiece,
+ LocalizedString,
+ MapType,
+ NONE_TYPE,
+ NULL_EXPR,
+ NUMBER_TYPE,
+ NotExpr,
+ ParenthesizedExpr,
+ PlaceholderPiece,
+ ReadKeyExpr,
+ ReadPropExpr,
+ ReadVarExpr,
+ RecursiveAstVisitor: RecursiveAstVisitor$1,
+ ReturnStatement,
+ STRING_TYPE,
+ Statement,
+ get StmtModifier() {
+ return StmtModifier;
+ },
+ TYPED_NULL_EXPR,
+ TaggedTemplateLiteralExpr,
+ TemplateLiteralElementExpr,
+ TemplateLiteralExpr,
+ TransplantedType,
+ Type,
+ get TypeModifier() {
+ return TypeModifier;
+ },
+ TypeofExpr,
+ get UnaryOperator() {
+ return UnaryOperator;
+ },
+ UnaryOperatorExpr,
+ VoidExpr,
+ WrappedNodeExpr,
+ areAllEquivalent,
+ arrowFn,
+ expressionType,
+ fn,
+ ifStmt,
+ importExpr,
+ importType,
+ isNull,
+ jsDocComment,
+ leadingComment,
+ literal,
+ literalArr,
+ literalMap,
+ localizedString,
+ not,
+ nullSafeIsEquivalent,
+ taggedTemplate,
+ transplantedType,
+ typeofExpr,
+ unary,
+ variable
+});
+var CONSTANT_PREFIX = "_c";
+var UNKNOWN_VALUE_KEY = variable("");
+var KEY_CONTEXT = {};
+var POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50;
+var FixupExpression = class _FixupExpression extends Expression {
+ resolved;
+ original;
+ shared = false;
+ constructor(resolved) {
+ super(resolved.type);
+ this.resolved = resolved;
+ this.original = resolved;
+ }
+ visitExpression(visitor, context) {
+ if (context === KEY_CONTEXT) {
+ return this.original.visitExpression(visitor, context);
+ } else {
+ return this.resolved.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent(e) {
+ return e instanceof _FixupExpression && this.resolved.isEquivalent(e.resolved);
+ }
+ isConstant() {
+ return true;
+ }
+ clone() {
+ throw new Error(`Not supported.`);
+ }
+ fixup(expression) {
+ this.resolved = expression;
+ this.shared = true;
+ }
+};
+var ConstantPool = class {
+ isClosureCompilerEnabled;
+ statements = [];
+ literals = /* @__PURE__ */ new Map();
+ literalFactories = /* @__PURE__ */ new Map();
+ sharedConstants = /* @__PURE__ */ new Map();
+ /**
+ * Constant pool also tracks claimed names from {@link uniqueName}.
+ * This is useful to avoid collisions if variables are intended to be
+ * named a certain way- but may conflict. We wouldn't want to always suffix
+ * them with unique numbers.
+ */
+ _claimedNames = /* @__PURE__ */ new Map();
+ nextNameIndex = 0;
+ constructor(isClosureCompilerEnabled = false) {
+ this.isClosureCompilerEnabled = isClosureCompilerEnabled;
+ }
+ getConstLiteral(literal2, forceShared) {
+ if (literal2 instanceof LiteralExpr && !isLongStringLiteral(literal2) || literal2 instanceof FixupExpression) {
+ return literal2;
+ }
+ const key = GenericKeyFn.INSTANCE.keyOf(literal2);
+ let fixup = this.literals.get(key);
+ let newValue = false;
+ if (!fixup) {
+ fixup = new FixupExpression(literal2);
+ this.literals.set(key, fixup);
+ newValue = true;
+ }
+ if (!newValue && !fixup.shared || newValue && forceShared) {
+ const name = this.freshName();
+ let value;
+ let usage;
+ if (this.isClosureCompilerEnabled && isLongStringLiteral(literal2)) {
+ value = new FunctionExpr(
+ [],
+ // Params.
+ [
+ // Statements.
+ new ReturnStatement(literal2)
+ ]
+ );
+ usage = variable(name).callFn([]);
+ } else {
+ value = literal2;
+ usage = variable(name);
+ }
+ this.statements.push(new DeclareVarStmt(name, value, INFERRED_TYPE, StmtModifier.Final));
+ fixup.fixup(usage);
+ }
+ return fixup;
+ }
+ getSharedConstant(def, expr) {
+ const key = def.keyOf(expr);
+ if (!this.sharedConstants.has(key)) {
+ const id = this.freshName();
+ this.sharedConstants.set(key, variable(id));
+ this.statements.push(def.toSharedConstantDeclaration(id, expr));
+ }
+ return this.sharedConstants.get(key);
+ }
+ getLiteralFactory(literal2) {
+ if (literal2 instanceof LiteralArrayExpr) {
+ const argumentsForKey = literal2.entries.map((e) => e.isConstant() ? e : UNKNOWN_VALUE_KEY);
+ const key = GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey));
+ return this._getLiteralFactory(key, literal2.entries, (entries) => literalArr(entries));
+ } else {
+ const expressionForKey = literalMap(literal2.entries.map((e) => ({
+ key: e.key,
+ value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY,
+ quoted: e.quoted
+ })));
+ const key = GenericKeyFn.INSTANCE.keyOf(expressionForKey);
+ return this._getLiteralFactory(key, literal2.entries.map((e) => e.value), (entries) => literalMap(entries.map((value, index) => ({
+ key: literal2.entries[index].key,
+ value,
+ quoted: literal2.entries[index].quoted
+ }))));
+ }
+ }
+ // TODO: useUniqueName(false) is necessary for naming compatibility with
+ // TemplateDefinitionBuilder, but should be removed once Template Pipeline is the default.
+ getSharedFunctionReference(fn2, prefix, useUniqueName = true) {
+ const isArrow = fn2 instanceof ArrowFunctionExpr;
+ for (const current of this.statements) {
+ if (isArrow && current instanceof DeclareVarStmt && current.value?.isEquivalent(fn2)) {
+ return variable(current.name);
+ }
+ if (!isArrow && current instanceof DeclareFunctionStmt && fn2 instanceof FunctionExpr && fn2.isEquivalent(current)) {
+ return variable(current.name);
+ }
+ }
+ const name = useUniqueName ? this.uniqueName(prefix) : prefix;
+ this.statements.push(fn2 instanceof FunctionExpr ? fn2.toDeclStmt(name, StmtModifier.Final) : new DeclareVarStmt(name, fn2, INFERRED_TYPE, StmtModifier.Final, fn2.sourceSpan));
+ return variable(name);
+ }
+ _getLiteralFactory(key, values, resultMap) {
+ let literalFactory = this.literalFactories.get(key);
+ const literalFactoryArguments = values.filter((e) => !e.isConstant());
+ if (!literalFactory) {
+ const resultExpressions = values.map((e, index) => e.isConstant() ? this.getConstLiteral(e, true) : variable(`a${index}`));
+ const parameters = resultExpressions.filter(isVariable).map((e) => new FnParam(e.name, DYNAMIC_TYPE));
+ const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE);
+ const name = this.freshName();
+ this.statements.push(new DeclareVarStmt(name, pureFunctionDeclaration, INFERRED_TYPE, StmtModifier.Final));
+ literalFactory = variable(name);
+ this.literalFactories.set(key, literalFactory);
+ }
+ return { literalFactory, literalFactoryArguments };
+ }
+ /**
+ * Produce a unique name in the context of this pool.
+ *
+ * The name might be unique among different prefixes if any of the prefixes end in
+ * a digit so the prefix should be a constant string (not based on user input) and
+ * must not end in a digit.
+ */
+ uniqueName(name, alwaysIncludeSuffix = true) {
+ const count = this._claimedNames.get(name) ?? 0;
+ const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;
+ this._claimedNames.set(name, count + 1);
+ return result;
+ }
+ freshName() {
+ return this.uniqueName(CONSTANT_PREFIX);
+ }
+};
+var GenericKeyFn = class _GenericKeyFn {
+ static INSTANCE = new _GenericKeyFn();
+ keyOf(expr) {
+ if (expr instanceof LiteralExpr && typeof expr.value === "string") {
+ return `"${expr.value}"`;
+ } else if (expr instanceof LiteralExpr) {
+ return String(expr.value);
+ } else if (expr instanceof LiteralArrayExpr) {
+ const entries = [];
+ for (const entry of expr.entries) {
+ entries.push(this.keyOf(entry));
+ }
+ return `[${entries.join(",")}]`;
+ } else if (expr instanceof LiteralMapExpr) {
+ const entries = [];
+ for (const entry of expr.entries) {
+ let key = entry.key;
+ if (entry.quoted) {
+ key = `"${key}"`;
+ }
+ entries.push(key + ":" + this.keyOf(entry.value));
+ }
+ return `{${entries.join(",")}}`;
+ } else if (expr instanceof ExternalExpr) {
+ return `import("${expr.value.moduleName}", ${expr.value.name})`;
+ } else if (expr instanceof ReadVarExpr) {
+ return `read(${expr.name})`;
+ } else if (expr instanceof TypeofExpr) {
+ return `typeof(${this.keyOf(expr.expr)})`;
+ } else {
+ throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`);
+ }
+ }
+};
+function isVariable(e) {
+ return e instanceof ReadVarExpr;
+}
+function isLongStringLiteral(expr) {
+ return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
+}
+var CORE = "@angular/core";
+var Identifiers = class {
+ /* Methods */
+ static NEW_METHOD = "factory";
+ static TRANSFORM_METHOD = "transform";
+ static PATCH_DEPS = "patchedDeps";
+ static core = { name: null, moduleName: CORE };
+ /* Instructions */
+ static namespaceHTML = { name: "ɵɵnamespaceHTML", moduleName: CORE };
+ static namespaceMathML = { name: "ɵɵnamespaceMathML", moduleName: CORE };
+ static namespaceSVG = { name: "ɵɵnamespaceSVG", moduleName: CORE };
+ static element = { name: "ɵɵelement", moduleName: CORE };
+ static elementStart = { name: "ɵɵelementStart", moduleName: CORE };
+ static elementEnd = { name: "ɵɵelementEnd", moduleName: CORE };
+ static domElement = { name: "ɵɵdomElement", moduleName: CORE };
+ static domElementStart = { name: "ɵɵdomElementStart", moduleName: CORE };
+ static domElementEnd = { name: "ɵɵdomElementEnd", moduleName: CORE };
+ static domElementContainer = {
+ name: "ɵɵdomElementContainer",
+ moduleName: CORE
+ };
+ static domElementContainerStart = {
+ name: "ɵɵdomElementContainerStart",
+ moduleName: CORE
+ };
+ static domElementContainerEnd = {
+ name: "ɵɵdomElementContainerEnd",
+ moduleName: CORE
+ };
+ static domTemplate = { name: "ɵɵdomTemplate", moduleName: CORE };
+ static domListener = { name: "ɵɵdomListener", moduleName: CORE };
+ static advance = { name: "ɵɵadvance", moduleName: CORE };
+ static syntheticHostProperty = {
+ name: "ɵɵsyntheticHostProperty",
+ moduleName: CORE
+ };
+ static syntheticHostListener = {
+ name: "ɵɵsyntheticHostListener",
+ moduleName: CORE
+ };
+ static attribute = { name: "ɵɵattribute", moduleName: CORE };
+ static classProp = { name: "ɵɵclassProp", moduleName: CORE };
+ static elementContainerStart = {
+ name: "ɵɵelementContainerStart",
+ moduleName: CORE
+ };
+ static elementContainerEnd = {
+ name: "ɵɵelementContainerEnd",
+ moduleName: CORE
+ };
+ static elementContainer = { name: "ɵɵelementContainer", moduleName: CORE };
+ static styleMap = { name: "ɵɵstyleMap", moduleName: CORE };
+ static classMap = { name: "ɵɵclassMap", moduleName: CORE };
+ static styleProp = { name: "ɵɵstyleProp", moduleName: CORE };
+ static interpolate = {
+ name: "ɵɵinterpolate",
+ moduleName: CORE
+ };
+ static interpolate1 = {
+ name: "ɵɵinterpolate1",
+ moduleName: CORE
+ };
+ static interpolate2 = {
+ name: "ɵɵinterpolate2",
+ moduleName: CORE
+ };
+ static interpolate3 = {
+ name: "ɵɵinterpolate3",
+ moduleName: CORE
+ };
+ static interpolate4 = {
+ name: "ɵɵinterpolate4",
+ moduleName: CORE
+ };
+ static interpolate5 = {
+ name: "ɵɵinterpolate5",
+ moduleName: CORE
+ };
+ static interpolate6 = {
+ name: "ɵɵinterpolate6",
+ moduleName: CORE
+ };
+ static interpolate7 = {
+ name: "ɵɵinterpolate7",
+ moduleName: CORE
+ };
+ static interpolate8 = {
+ name: "ɵɵinterpolate8",
+ moduleName: CORE
+ };
+ static interpolateV = {
+ name: "ɵɵinterpolateV",
+ moduleName: CORE
+ };
+ static nextContext = { name: "ɵɵnextContext", moduleName: CORE };
+ static resetView = { name: "ɵɵresetView", moduleName: CORE };
+ static templateCreate = { name: "ɵɵtemplate", moduleName: CORE };
+ static defer = { name: "ɵɵdefer", moduleName: CORE };
+ static deferWhen = { name: "ɵɵdeferWhen", moduleName: CORE };
+ static deferOnIdle = { name: "ɵɵdeferOnIdle", moduleName: CORE };
+ static deferOnImmediate = { name: "ɵɵdeferOnImmediate", moduleName: CORE };
+ static deferOnTimer = { name: "ɵɵdeferOnTimer", moduleName: CORE };
+ static deferOnHover = { name: "ɵɵdeferOnHover", moduleName: CORE };
+ static deferOnInteraction = { name: "ɵɵdeferOnInteraction", moduleName: CORE };
+ static deferOnViewport = { name: "ɵɵdeferOnViewport", moduleName: CORE };
+ static deferPrefetchWhen = { name: "ɵɵdeferPrefetchWhen", moduleName: CORE };
+ static deferPrefetchOnIdle = {
+ name: "ɵɵdeferPrefetchOnIdle",
+ moduleName: CORE
+ };
+ static deferPrefetchOnImmediate = {
+ name: "ɵɵdeferPrefetchOnImmediate",
+ moduleName: CORE
+ };
+ static deferPrefetchOnTimer = {
+ name: "ɵɵdeferPrefetchOnTimer",
+ moduleName: CORE
+ };
+ static deferPrefetchOnHover = {
+ name: "ɵɵdeferPrefetchOnHover",
+ moduleName: CORE
+ };
+ static deferPrefetchOnInteraction = {
+ name: "ɵɵdeferPrefetchOnInteraction",
+ moduleName: CORE
+ };
+ static deferPrefetchOnViewport = {
+ name: "ɵɵdeferPrefetchOnViewport",
+ moduleName: CORE
+ };
+ static deferHydrateWhen = { name: "ɵɵdeferHydrateWhen", moduleName: CORE };
+ static deferHydrateNever = { name: "ɵɵdeferHydrateNever", moduleName: CORE };
+ static deferHydrateOnIdle = {
+ name: "ɵɵdeferHydrateOnIdle",
+ moduleName: CORE
+ };
+ static deferHydrateOnImmediate = {
+ name: "ɵɵdeferHydrateOnImmediate",
+ moduleName: CORE
+ };
+ static deferHydrateOnTimer = {
+ name: "ɵɵdeferHydrateOnTimer",
+ moduleName: CORE
+ };
+ static deferHydrateOnHover = {
+ name: "ɵɵdeferHydrateOnHover",
+ moduleName: CORE
+ };
+ static deferHydrateOnInteraction = {
+ name: "ɵɵdeferHydrateOnInteraction",
+ moduleName: CORE
+ };
+ static deferHydrateOnViewport = {
+ name: "ɵɵdeferHydrateOnViewport",
+ moduleName: CORE
+ };
+ static deferEnableTimerScheduling = {
+ name: "ɵɵdeferEnableTimerScheduling",
+ moduleName: CORE
+ };
+ static conditionalCreate = { name: "ɵɵconditionalCreate", moduleName: CORE };
+ static conditionalBranchCreate = {
+ name: "ɵɵconditionalBranchCreate",
+ moduleName: CORE
+ };
+ static conditional = { name: "ɵɵconditional", moduleName: CORE };
+ static repeater = { name: "ɵɵrepeater", moduleName: CORE };
+ static repeaterCreate = { name: "ɵɵrepeaterCreate", moduleName: CORE };
+ static repeaterTrackByIndex = {
+ name: "ɵɵrepeaterTrackByIndex",
+ moduleName: CORE
+ };
+ static repeaterTrackByIdentity = {
+ name: "ɵɵrepeaterTrackByIdentity",
+ moduleName: CORE
+ };
+ static componentInstance = { name: "ɵɵcomponentInstance", moduleName: CORE };
+ static text = { name: "ɵɵtext", moduleName: CORE };
+ static enableBindings = { name: "ɵɵenableBindings", moduleName: CORE };
+ static disableBindings = { name: "ɵɵdisableBindings", moduleName: CORE };
+ static getCurrentView = { name: "ɵɵgetCurrentView", moduleName: CORE };
+ static textInterpolate = { name: "ɵɵtextInterpolate", moduleName: CORE };
+ static textInterpolate1 = { name: "ɵɵtextInterpolate1", moduleName: CORE };
+ static textInterpolate2 = { name: "ɵɵtextInterpolate2", moduleName: CORE };
+ static textInterpolate3 = { name: "ɵɵtextInterpolate3", moduleName: CORE };
+ static textInterpolate4 = { name: "ɵɵtextInterpolate4", moduleName: CORE };
+ static textInterpolate5 = { name: "ɵɵtextInterpolate5", moduleName: CORE };
+ static textInterpolate6 = { name: "ɵɵtextInterpolate6", moduleName: CORE };
+ static textInterpolate7 = { name: "ɵɵtextInterpolate7", moduleName: CORE };
+ static textInterpolate8 = { name: "ɵɵtextInterpolate8", moduleName: CORE };
+ static textInterpolateV = { name: "ɵɵtextInterpolateV", moduleName: CORE };
+ static restoreView = { name: "ɵɵrestoreView", moduleName: CORE };
+ static pureFunction0 = { name: "ɵɵpureFunction0", moduleName: CORE };
+ static pureFunction1 = { name: "ɵɵpureFunction1", moduleName: CORE };
+ static pureFunction2 = { name: "ɵɵpureFunction2", moduleName: CORE };
+ static pureFunction3 = { name: "ɵɵpureFunction3", moduleName: CORE };
+ static pureFunction4 = { name: "ɵɵpureFunction4", moduleName: CORE };
+ static pureFunction5 = { name: "ɵɵpureFunction5", moduleName: CORE };
+ static pureFunction6 = { name: "ɵɵpureFunction6", moduleName: CORE };
+ static pureFunction7 = { name: "ɵɵpureFunction7", moduleName: CORE };
+ static pureFunction8 = { name: "ɵɵpureFunction8", moduleName: CORE };
+ static pureFunctionV = { name: "ɵɵpureFunctionV", moduleName: CORE };
+ static pipeBind1 = { name: "ɵɵpipeBind1", moduleName: CORE };
+ static pipeBind2 = { name: "ɵɵpipeBind2", moduleName: CORE };
+ static pipeBind3 = { name: "ɵɵpipeBind3", moduleName: CORE };
+ static pipeBind4 = { name: "ɵɵpipeBind4", moduleName: CORE };
+ static pipeBindV = { name: "ɵɵpipeBindV", moduleName: CORE };
+ static domProperty = { name: "ɵɵdomProperty", moduleName: CORE };
+ static property = { name: "ɵɵproperty", moduleName: CORE };
+ static i18n = { name: "ɵɵi18n", moduleName: CORE };
+ static i18nAttributes = { name: "ɵɵi18nAttributes", moduleName: CORE };
+ static i18nExp = { name: "ɵɵi18nExp", moduleName: CORE };
+ static i18nStart = { name: "ɵɵi18nStart", moduleName: CORE };
+ static i18nEnd = { name: "ɵɵi18nEnd", moduleName: CORE };
+ static i18nApply = { name: "ɵɵi18nApply", moduleName: CORE };
+ static i18nPostprocess = { name: "ɵɵi18nPostprocess", moduleName: CORE };
+ static pipe = { name: "ɵɵpipe", moduleName: CORE };
+ static projection = { name: "ɵɵprojection", moduleName: CORE };
+ static projectionDef = { name: "ɵɵprojectionDef", moduleName: CORE };
+ static reference = { name: "ɵɵreference", moduleName: CORE };
+ static inject = { name: "ɵɵinject", moduleName: CORE };
+ static injectAttribute = { name: "ɵɵinjectAttribute", moduleName: CORE };
+ static directiveInject = { name: "ɵɵdirectiveInject", moduleName: CORE };
+ static invalidFactory = { name: "ɵɵinvalidFactory", moduleName: CORE };
+ static invalidFactoryDep = { name: "ɵɵinvalidFactoryDep", moduleName: CORE };
+ static templateRefExtractor = {
+ name: "ɵɵtemplateRefExtractor",
+ moduleName: CORE
+ };
+ static forwardRef = { name: "forwardRef", moduleName: CORE };
+ static resolveForwardRef = { name: "resolveForwardRef", moduleName: CORE };
+ static replaceMetadata = { name: "ɵɵreplaceMetadata", moduleName: CORE };
+ static getReplaceMetadataURL = {
+ name: "ɵɵgetReplaceMetadataURL",
+ moduleName: CORE
+ };
+ static ɵɵdefineInjectable = { name: "ɵɵdefineInjectable", moduleName: CORE };
+ static declareInjectable = { name: "ɵɵngDeclareInjectable", moduleName: CORE };
+ static InjectableDeclaration = {
+ name: "ɵɵInjectableDeclaration",
+ moduleName: CORE
+ };
+ static resolveWindow = { name: "ɵɵresolveWindow", moduleName: CORE };
+ static resolveDocument = { name: "ɵɵresolveDocument", moduleName: CORE };
+ static resolveBody = { name: "ɵɵresolveBody", moduleName: CORE };
+ static getComponentDepsFactory = {
+ name: "ɵɵgetComponentDepsFactory",
+ moduleName: CORE
+ };
+ static defineComponent = { name: "ɵɵdefineComponent", moduleName: CORE };
+ static declareComponent = { name: "ɵɵngDeclareComponent", moduleName: CORE };
+ static setComponentScope = { name: "ɵɵsetComponentScope", moduleName: CORE };
+ static ChangeDetectionStrategy = {
+ name: "ChangeDetectionStrategy",
+ moduleName: CORE
+ };
+ static ViewEncapsulation = {
+ name: "ViewEncapsulation",
+ moduleName: CORE
+ };
+ static ComponentDeclaration = {
+ name: "ɵɵComponentDeclaration",
+ moduleName: CORE
+ };
+ static FactoryDeclaration = {
+ name: "ɵɵFactoryDeclaration",
+ moduleName: CORE
+ };
+ static declareFactory = { name: "ɵɵngDeclareFactory", moduleName: CORE };
+ static FactoryTarget = { name: "ɵɵFactoryTarget", moduleName: CORE };
+ static defineDirective = { name: "ɵɵdefineDirective", moduleName: CORE };
+ static declareDirective = { name: "ɵɵngDeclareDirective", moduleName: CORE };
+ static DirectiveDeclaration = {
+ name: "ɵɵDirectiveDeclaration",
+ moduleName: CORE
+ };
+ static InjectorDef = { name: "ɵɵInjectorDef", moduleName: CORE };
+ static InjectorDeclaration = {
+ name: "ɵɵInjectorDeclaration",
+ moduleName: CORE
+ };
+ static defineInjector = { name: "ɵɵdefineInjector", moduleName: CORE };
+ static declareInjector = { name: "ɵɵngDeclareInjector", moduleName: CORE };
+ static NgModuleDeclaration = {
+ name: "ɵɵNgModuleDeclaration",
+ moduleName: CORE
+ };
+ static ModuleWithProviders = {
+ name: "ModuleWithProviders",
+ moduleName: CORE
+ };
+ static defineNgModule = { name: "ɵɵdefineNgModule", moduleName: CORE };
+ static declareNgModule = { name: "ɵɵngDeclareNgModule", moduleName: CORE };
+ static setNgModuleScope = { name: "ɵɵsetNgModuleScope", moduleName: CORE };
+ static registerNgModuleType = {
+ name: "ɵɵregisterNgModuleType",
+ moduleName: CORE
+ };
+ static PipeDeclaration = { name: "ɵɵPipeDeclaration", moduleName: CORE };
+ static definePipe = { name: "ɵɵdefinePipe", moduleName: CORE };
+ static declarePipe = { name: "ɵɵngDeclarePipe", moduleName: CORE };
+ static declareClassMetadata = {
+ name: "ɵɵngDeclareClassMetadata",
+ moduleName: CORE
+ };
+ static declareClassMetadataAsync = {
+ name: "ɵɵngDeclareClassMetadataAsync",
+ moduleName: CORE
+ };
+ static setClassMetadata = { name: "ɵsetClassMetadata", moduleName: CORE };
+ static setClassMetadataAsync = {
+ name: "ɵsetClassMetadataAsync",
+ moduleName: CORE
+ };
+ static setClassDebugInfo = { name: "ɵsetClassDebugInfo", moduleName: CORE };
+ static queryRefresh = { name: "ɵɵqueryRefresh", moduleName: CORE };
+ static viewQuery = { name: "ɵɵviewQuery", moduleName: CORE };
+ static loadQuery = { name: "ɵɵloadQuery", moduleName: CORE };
+ static contentQuery = { name: "ɵɵcontentQuery", moduleName: CORE };
+ // Signal queries
+ static viewQuerySignal = { name: "ɵɵviewQuerySignal", moduleName: CORE };
+ static contentQuerySignal = { name: "ɵɵcontentQuerySignal", moduleName: CORE };
+ static queryAdvance = { name: "ɵɵqueryAdvance", moduleName: CORE };
+ // Two-way bindings
+ static twoWayProperty = { name: "ɵɵtwoWayProperty", moduleName: CORE };
+ static twoWayBindingSet = { name: "ɵɵtwoWayBindingSet", moduleName: CORE };
+ static twoWayListener = { name: "ɵɵtwoWayListener", moduleName: CORE };
+ static declareLet = { name: "ɵɵdeclareLet", moduleName: CORE };
+ static storeLet = { name: "ɵɵstoreLet", moduleName: CORE };
+ static readContextLet = { name: "ɵɵreadContextLet", moduleName: CORE };
+ static attachSourceLocations = {
+ name: "ɵɵattachSourceLocations",
+ moduleName: CORE
+ };
+ static NgOnChangesFeature = { name: "ɵɵNgOnChangesFeature", moduleName: CORE };
+ static InheritDefinitionFeature = {
+ name: "ɵɵInheritDefinitionFeature",
+ moduleName: CORE
+ };
+ static CopyDefinitionFeature = {
+ name: "ɵɵCopyDefinitionFeature",
+ moduleName: CORE
+ };
+ static ProvidersFeature = { name: "ɵɵProvidersFeature", moduleName: CORE };
+ static HostDirectivesFeature = {
+ name: "ɵɵHostDirectivesFeature",
+ moduleName: CORE
+ };
+ static ExternalStylesFeature = {
+ name: "ɵɵExternalStylesFeature",
+ moduleName: CORE
+ };
+ static listener = { name: "ɵɵlistener", moduleName: CORE };
+ static getInheritedFactory = {
+ name: "ɵɵgetInheritedFactory",
+ moduleName: CORE
+ };
+ // sanitization-related functions
+ static sanitizeHtml = { name: "ɵɵsanitizeHtml", moduleName: CORE };
+ static sanitizeStyle = { name: "ɵɵsanitizeStyle", moduleName: CORE };
+ static sanitizeResourceUrl = {
+ name: "ɵɵsanitizeResourceUrl",
+ moduleName: CORE
+ };
+ static sanitizeScript = { name: "ɵɵsanitizeScript", moduleName: CORE };
+ static sanitizeUrl = { name: "ɵɵsanitizeUrl", moduleName: CORE };
+ static sanitizeUrlOrResourceUrl = {
+ name: "ɵɵsanitizeUrlOrResourceUrl",
+ moduleName: CORE
+ };
+ static trustConstantHtml = { name: "ɵɵtrustConstantHtml", moduleName: CORE };
+ static trustConstantResourceUrl = {
+ name: "ɵɵtrustConstantResourceUrl",
+ moduleName: CORE
+ };
+ static validateIframeAttribute = {
+ name: "ɵɵvalidateIframeAttribute",
+ moduleName: CORE
+ };
+ // type-checking
+ static InputSignalBrandWriteType = { name: "ɵINPUT_SIGNAL_BRAND_WRITE_TYPE", moduleName: CORE };
+ static UnwrapDirectiveSignalInputs = { name: "ɵUnwrapDirectiveSignalInputs", moduleName: CORE };
+ static unwrapWritableSignal = { name: "ɵunwrapWritableSignal", moduleName: CORE };
+ static assertType = { name: "ɵassertType", moduleName: CORE };
+};
+var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
+function dashCaseToCamelCase(input) {
+ return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
+}
+function splitAtColon(input, defaultValues) {
+ return _splitAt(input, ":", defaultValues);
+}
+function splitAtPeriod(input, defaultValues) {
+ return _splitAt(input, ".", defaultValues);
+}
+function _splitAt(input, character, defaultValues) {
+ const characterIndex = input.indexOf(character);
+ if (characterIndex == -1)
+ return defaultValues;
+ return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
+}
+function noUndefined(val) {
+ return val === void 0 ? null : val;
+}
+function escapeRegExp(s) {
+ return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
+}
+function utf8Encode(str) {
+ let encoded = [];
+ for (let index = 0; index < str.length; index++) {
+ let codePoint = str.charCodeAt(index);
+ if (codePoint >= 55296 && codePoint <= 56319 && str.length > index + 1) {
+ const low = str.charCodeAt(index + 1);
+ if (low >= 56320 && low <= 57343) {
+ index++;
+ codePoint = (codePoint - 55296 << 10) + low - 56320 + 65536;
+ }
+ }
+ if (codePoint <= 127) {
+ encoded.push(codePoint);
+ } else if (codePoint <= 2047) {
+ encoded.push(codePoint >> 6 & 31 | 192, codePoint & 63 | 128);
+ } else if (codePoint <= 65535) {
+ encoded.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
+ } else if (codePoint <= 2097151) {
+ encoded.push(codePoint >> 18 & 7 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
+ }
+ }
+ return encoded;
+}
+function stringify(token) {
+ if (typeof token === "string") {
+ return token;
+ }
+ if (Array.isArray(token)) {
+ return `[${token.map(stringify).join(", ")}]`;
+ }
+ if (token == null) {
+ return "" + token;
+ }
+ const name = token.overriddenName || token.name;
+ if (name) {
+ return `${name}`;
+ }
+ if (!token.toString) {
+ return "object";
+ }
+ const result = token.toString();
+ if (result == null) {
+ return "" + result;
+ }
+ const newLineIndex = result.indexOf("\n");
+ return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result;
+}
+var Version = class {
+ full;
+ major;
+ minor;
+ patch;
+ constructor(full) {
+ this.full = full;
+ const splits = full.split(".");
+ this.major = splits[0];
+ this.minor = splits[1];
+ this.patch = splits.slice(2).join(".");
+ }
+};
+var _global = globalThis;
+var V1_TO_18 = /^([1-9]|1[0-8])\./;
+function getJitStandaloneDefaultForVersion(version) {
+ if (version.startsWith("0.")) {
+ return true;
+ }
+ if (V1_TO_18.test(version)) {
+ return false;
+ }
+ return true;
+}
+var VERSION$1 = 3;
+var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
+var SourceMapGenerator = class {
+ file;
+ sourcesContent = /* @__PURE__ */ new Map();
+ lines = [];
+ lastCol0 = 0;
+ hasMappings = false;
+ constructor(file = null) {
+ this.file = file;
+ }
+ // The content is `null` when the content is expected to be loaded using the URL
+ addSource(url, content = null) {
+ if (!this.sourcesContent.has(url)) {
+ this.sourcesContent.set(url, content);
+ }
+ return this;
+ }
+ addLine() {
+ this.lines.push([]);
+ this.lastCol0 = 0;
+ return this;
+ }
+ addMapping(col0, sourceUrl, sourceLine0, sourceCol0) {
+ if (!this.currentLine) {
+ throw new Error(`A line must be added before mappings can be added`);
+ }
+ if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {
+ throw new Error(`Unknown source file "${sourceUrl}"`);
+ }
+ if (col0 == null) {
+ throw new Error(`The column in the generated code must be provided`);
+ }
+ if (col0 < this.lastCol0) {
+ throw new Error(`Mapping should be added in output order`);
+ }
+ if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {
+ throw new Error(`The source location must be provided when a source url is provided`);
+ }
+ this.hasMappings = true;
+ this.lastCol0 = col0;
+ this.currentLine.push({ col0, sourceUrl, sourceLine0, sourceCol0 });
+ return this;
+ }
+ /**
+ * @internal strip this from published d.ts files due to
+ * https://github.com/microsoft/TypeScript/issues/36216
+ */
+ get currentLine() {
+ return this.lines.slice(-1)[0];
+ }
+ toJSON() {
+ if (!this.hasMappings) {
+ return null;
+ }
+ const sourcesIndex = /* @__PURE__ */ new Map();
+ const sources = [];
+ const sourcesContent = [];
+ Array.from(this.sourcesContent.keys()).forEach((url, i) => {
+ sourcesIndex.set(url, i);
+ sources.push(url);
+ sourcesContent.push(this.sourcesContent.get(url) || null);
+ });
+ let mappings = "";
+ let lastCol0 = 0;
+ let lastSourceIndex = 0;
+ let lastSourceLine0 = 0;
+ let lastSourceCol0 = 0;
+ this.lines.forEach((segments) => {
+ lastCol0 = 0;
+ mappings += segments.map((segment) => {
+ let segAsStr = toBase64VLQ(segment.col0 - lastCol0);
+ lastCol0 = segment.col0;
+ if (segment.sourceUrl != null) {
+ segAsStr += toBase64VLQ(sourcesIndex.get(segment.sourceUrl) - lastSourceIndex);
+ lastSourceIndex = sourcesIndex.get(segment.sourceUrl);
+ segAsStr += toBase64VLQ(segment.sourceLine0 - lastSourceLine0);
+ lastSourceLine0 = segment.sourceLine0;
+ segAsStr += toBase64VLQ(segment.sourceCol0 - lastSourceCol0);
+ lastSourceCol0 = segment.sourceCol0;
+ }
+ return segAsStr;
+ }).join(",");
+ mappings += ";";
+ });
+ mappings = mappings.slice(0, -1);
+ return {
+ "file": this.file || "",
+ "version": VERSION$1,
+ "sourceRoot": "",
+ "sources": sources,
+ "sourcesContent": sourcesContent,
+ "mappings": mappings
+ };
+ }
+ toJsComment() {
+ return this.hasMappings ? "//" + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) : "";
+ }
+};
+function toBase64String(value) {
+ let b64 = "";
+ const encoded = utf8Encode(value);
+ for (let i = 0; i < encoded.length; ) {
+ const i1 = encoded[i++];
+ const i2 = i < encoded.length ? encoded[i++] : null;
+ const i3 = i < encoded.length ? encoded[i++] : null;
+ b64 += toBase64Digit(i1 >> 2);
+ b64 += toBase64Digit((i1 & 3) << 4 | (i2 === null ? 0 : i2 >> 4));
+ b64 += i2 === null ? "=" : toBase64Digit((i2 & 15) << 2 | (i3 === null ? 0 : i3 >> 6));
+ b64 += i2 === null || i3 === null ? "=" : toBase64Digit(i3 & 63);
+ }
+ return b64;
+}
+function toBase64VLQ(value) {
+ value = value < 0 ? (-value << 1) + 1 : value << 1;
+ let out = "";
+ do {
+ let digit = value & 31;
+ value = value >> 5;
+ if (value > 0) {
+ digit = digit | 32;
+ }
+ out += toBase64Digit(digit);
+ } while (value > 0);
+ return out;
+}
+var B64_DIGITS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+function toBase64Digit(value) {
+ if (value < 0 || value >= 64) {
+ throw new Error(`Can only encode value in the range [0, 63]`);
+ }
+ return B64_DIGITS[value];
+}
+var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
+var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
+var _INDENT_WITH = " ";
+var _EmittedLine = class {
+ indent;
+ partsLength = 0;
+ parts = [];
+ srcSpans = [];
+ constructor(indent) {
+ this.indent = indent;
+ }
+};
+var BINARY_OPERATORS$1 = /* @__PURE__ */ new Map([
+ [BinaryOperator.And, "&&"],
+ [BinaryOperator.Bigger, ">"],
+ [BinaryOperator.BiggerEquals, ">="],
+ [BinaryOperator.BitwiseOr, "|"],
+ [BinaryOperator.BitwiseAnd, "&"],
+ [BinaryOperator.Divide, "/"],
+ [BinaryOperator.Assign, "="],
+ [BinaryOperator.Equals, "=="],
+ [BinaryOperator.Identical, "==="],
+ [BinaryOperator.Lower, "<"],
+ [BinaryOperator.LowerEquals, "<="],
+ [BinaryOperator.Minus, "-"],
+ [BinaryOperator.Modulo, "%"],
+ [BinaryOperator.Exponentiation, "**"],
+ [BinaryOperator.Multiply, "*"],
+ [BinaryOperator.NotEquals, "!="],
+ [BinaryOperator.NotIdentical, "!=="],
+ [BinaryOperator.NullishCoalesce, "??"],
+ [BinaryOperator.Or, "||"],
+ [BinaryOperator.Plus, "+"],
+ [BinaryOperator.In, "in"],
+ [BinaryOperator.AdditionAssignment, "+="],
+ [BinaryOperator.SubtractionAssignment, "-="],
+ [BinaryOperator.MultiplicationAssignment, "*="],
+ [BinaryOperator.DivisionAssignment, "/="],
+ [BinaryOperator.RemainderAssignment, "%="],
+ [BinaryOperator.ExponentiationAssignment, "**="],
+ [BinaryOperator.AndAssignment, "&&="],
+ [BinaryOperator.OrAssignment, "||="],
+ [BinaryOperator.NullishCoalesceAssignment, "??="]
+]);
+var EmitterVisitorContext = class _EmitterVisitorContext {
+ _indent;
+ static createRoot() {
+ return new _EmitterVisitorContext(0);
+ }
+ _lines;
+ constructor(_indent) {
+ this._indent = _indent;
+ this._lines = [new _EmittedLine(_indent)];
+ }
+ /**
+ * @internal strip this from published d.ts files due to
+ * https://github.com/microsoft/TypeScript/issues/36216
+ */
+ get _currentLine() {
+ return this._lines[this._lines.length - 1];
+ }
+ println(from, lastPart = "") {
+ this.print(from || null, lastPart, true);
+ }
+ lineIsEmpty() {
+ return this._currentLine.parts.length === 0;
+ }
+ lineLength() {
+ return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;
+ }
+ print(from, part, newLine = false) {
+ if (part.length > 0) {
+ this._currentLine.parts.push(part);
+ this._currentLine.partsLength += part.length;
+ this._currentLine.srcSpans.push(from && from.sourceSpan || null);
+ }
+ if (newLine) {
+ this._lines.push(new _EmittedLine(this._indent));
+ }
+ }
+ removeEmptyLastLine() {
+ if (this.lineIsEmpty()) {
+ this._lines.pop();
+ }
+ }
+ incIndent() {
+ this._indent++;
+ if (this.lineIsEmpty()) {
+ this._currentLine.indent = this._indent;
+ }
+ }
+ decIndent() {
+ this._indent--;
+ if (this.lineIsEmpty()) {
+ this._currentLine.indent = this._indent;
+ }
+ }
+ toSource() {
+ return this.sourceLines.map((l) => l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join("") : "").join("\n");
+ }
+ toSourceMapGenerator(genFilePath, startsAtLine = 0) {
+ const map = new SourceMapGenerator(genFilePath);
+ let firstOffsetMapped = false;
+ const mapFirstOffsetIfNeeded = () => {
+ if (!firstOffsetMapped) {
+ map.addSource(genFilePath, " ").addMapping(0, genFilePath, 0, 0);
+ firstOffsetMapped = true;
+ }
+ };
+ for (let i = 0; i < startsAtLine; i++) {
+ map.addLine();
+ mapFirstOffsetIfNeeded();
+ }
+ this.sourceLines.forEach((line, lineIdx) => {
+ map.addLine();
+ const spans = line.srcSpans;
+ const parts = line.parts;
+ let col0 = line.indent * _INDENT_WITH.length;
+ let spanIdx = 0;
+ while (spanIdx < spans.length && !spans[spanIdx]) {
+ col0 += parts[spanIdx].length;
+ spanIdx++;
+ }
+ if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {
+ firstOffsetMapped = true;
+ } else {
+ mapFirstOffsetIfNeeded();
+ }
+ while (spanIdx < spans.length) {
+ const span = spans[spanIdx];
+ const source = span.start.file;
+ const sourceLine = span.start.line;
+ const sourceCol = span.start.col;
+ map.addSource(source.url, source.content).addMapping(col0, source.url, sourceLine, sourceCol);
+ col0 += parts[spanIdx].length;
+ spanIdx++;
+ while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {
+ col0 += parts[spanIdx].length;
+ spanIdx++;
+ }
+ }
+ });
+ return map;
+ }
+ spanOf(line, column) {
+ const emittedLine = this._lines[line];
+ if (emittedLine) {
+ let columnsLeft = column - _createIndent(emittedLine.indent).length;
+ for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {
+ const part = emittedLine.parts[partIndex];
+ if (part.length > columnsLeft) {
+ return emittedLine.srcSpans[partIndex];
+ }
+ columnsLeft -= part.length;
+ }
+ }
+ return null;
+ }
+ /**
+ * @internal strip this from published d.ts files due to
+ * https://github.com/microsoft/TypeScript/issues/36216
+ */
+ get sourceLines() {
+ if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {
+ return this._lines.slice(0, -1);
+ }
+ return this._lines;
+ }
+};
+var AbstractEmitterVisitor = class {
+ _escapeDollarInStrings;
+ lastIfCondition = null;
+ constructor(_escapeDollarInStrings) {
+ this._escapeDollarInStrings = _escapeDollarInStrings;
+ }
+ printLeadingComments(stmt, ctx) {
+ if (stmt.leadingComments === void 0) {
+ return;
+ }
+ for (const comment of stmt.leadingComments) {
+ if (comment instanceof JSDocComment) {
+ ctx.print(stmt, `/*${comment.toString()}*/`, comment.trailingNewline);
+ } else {
+ if (comment.multiline) {
+ ctx.print(stmt, `/* ${comment.text} */`, comment.trailingNewline);
+ } else {
+ comment.text.split("\n").forEach((line) => {
+ ctx.println(stmt, `// ${line}`);
+ });
+ }
+ }
+ }
+ }
+ visitExpressionStmt(stmt, ctx) {
+ this.printLeadingComments(stmt, ctx);
+ stmt.expr.visitExpression(this, ctx);
+ ctx.println(stmt, ";");
+ return null;
+ }
+ visitReturnStmt(stmt, ctx) {
+ this.printLeadingComments(stmt, ctx);
+ ctx.print(stmt, `return `);
+ stmt.value.visitExpression(this, ctx);
+ ctx.println(stmt, ";");
+ return null;
+ }
+ visitIfStmt(stmt, ctx) {
+ this.printLeadingComments(stmt, ctx);
+ ctx.print(stmt, `if (`);
+ this.lastIfCondition = stmt.condition;
+ stmt.condition.visitExpression(this, ctx);
+ this.lastIfCondition = null;
+ ctx.print(stmt, `) {`);
+ const hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;
+ if (stmt.trueCase.length <= 1 && !hasElseCase) {
+ ctx.print(stmt, ` `);
+ this.visitAllStatements(stmt.trueCase, ctx);
+ ctx.removeEmptyLastLine();
+ ctx.print(stmt, ` `);
+ } else {
+ ctx.println();
+ ctx.incIndent();
+ this.visitAllStatements(stmt.trueCase, ctx);
+ ctx.decIndent();
+ if (hasElseCase) {
+ ctx.println(stmt, `} else {`);
+ ctx.incIndent();
+ this.visitAllStatements(stmt.falseCase, ctx);
+ ctx.decIndent();
+ }
+ }
+ ctx.println(stmt, `}`);
+ return null;
+ }
+ visitInvokeFunctionExpr(expr, ctx) {
+ const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;
+ if (shouldParenthesize) {
+ ctx.print(expr.fn, "(");
+ }
+ expr.fn.visitExpression(this, ctx);
+ if (shouldParenthesize) {
+ ctx.print(expr.fn, ")");
+ }
+ ctx.print(expr, `(`);
+ this.visitAllExpressions(expr.args, ctx, ",");
+ ctx.print(expr, `)`);
+ return null;
+ }
+ visitTaggedTemplateLiteralExpr(expr, ctx) {
+ expr.tag.visitExpression(this, ctx);
+ expr.template.visitExpression(this, ctx);
+ return null;
+ }
+ visitTemplateLiteralExpr(expr, ctx) {
+ ctx.print(expr, "`");
+ for (let i = 0; i < expr.elements.length; i++) {
+ expr.elements[i].visitExpression(this, ctx);
+ const expression = i < expr.expressions.length ? expr.expressions[i] : null;
+ if (expression !== null) {
+ ctx.print(expression, "${");
+ expression.visitExpression(this, ctx);
+ ctx.print(expression, "}");
+ }
+ }
+ ctx.print(expr, "`");
+ }
+ visitTemplateLiteralElementExpr(expr, ctx) {
+ ctx.print(expr, expr.rawText);
+ }
+ visitWrappedNodeExpr(ast, ctx) {
+ throw new Error("Abstract emitter cannot visit WrappedNodeExpr.");
+ }
+ visitTypeofExpr(expr, ctx) {
+ ctx.print(expr, "typeof ");
+ expr.expr.visitExpression(this, ctx);
+ }
+ visitVoidExpr(expr, ctx) {
+ ctx.print(expr, "void ");
+ expr.expr.visitExpression(this, ctx);
+ }
+ visitReadVarExpr(ast, ctx) {
+ ctx.print(ast, ast.name);
+ return null;
+ }
+ visitInstantiateExpr(ast, ctx) {
+ ctx.print(ast, `new `);
+ ast.classExpr.visitExpression(this, ctx);
+ ctx.print(ast, `(`);
+ this.visitAllExpressions(ast.args, ctx, ",");
+ ctx.print(ast, `)`);
+ return null;
+ }
+ visitLiteralExpr(ast, ctx) {
+ const value = ast.value;
+ if (typeof value === "string") {
+ ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));
+ } else {
+ ctx.print(ast, `${value}`);
+ }
+ return null;
+ }
+ visitLocalizedString(ast, ctx) {
+ const head = ast.serializeI18nHead();
+ ctx.print(ast, "$localize `" + head.raw);
+ for (let i = 1; i < ast.messageParts.length; i++) {
+ ctx.print(ast, "${");
+ ast.expressions[i - 1].visitExpression(this, ctx);
+ ctx.print(ast, `}${ast.serializeI18nTemplatePart(i).raw}`);
+ }
+ ctx.print(ast, "`");
+ return null;
+ }
+ visitConditionalExpr(ast, ctx) {
+ ctx.print(ast, `(`);
+ ast.condition.visitExpression(this, ctx);
+ ctx.print(ast, "? ");
+ ast.trueCase.visitExpression(this, ctx);
+ ctx.print(ast, ": ");
+ ast.falseCase.visitExpression(this, ctx);
+ ctx.print(ast, `)`);
+ return null;
+ }
+ visitDynamicImportExpr(ast, ctx) {
+ ctx.print(ast, `import(${ast.url})`);
+ }
+ visitNotExpr(ast, ctx) {
+ ctx.print(ast, "!");
+ ast.condition.visitExpression(this, ctx);
+ return null;
+ }
+ visitUnaryOperatorExpr(ast, ctx) {
+ let opStr;
+ switch (ast.operator) {
+ case UnaryOperator.Plus:
+ opStr = "+";
+ break;
+ case UnaryOperator.Minus:
+ opStr = "-";
+ break;
+ default:
+ throw new Error(`Unknown operator ${ast.operator}`);
+ }
+ const parens = ast !== this.lastIfCondition;
+ if (parens)
+ ctx.print(ast, `(`);
+ ctx.print(ast, opStr);
+ ast.expr.visitExpression(this, ctx);
+ if (parens)
+ ctx.print(ast, `)`);
+ return null;
+ }
+ visitBinaryOperatorExpr(ast, ctx) {
+ const operator = BINARY_OPERATORS$1.get(ast.operator);
+ if (!operator) {
+ throw new Error(`Unknown operator ${ast.operator}`);
+ }
+ const parens = ast !== this.lastIfCondition;
+ if (parens)
+ ctx.print(ast, `(`);
+ ast.lhs.visitExpression(this, ctx);
+ ctx.print(ast, ` ${operator} `);
+ ast.rhs.visitExpression(this, ctx);
+ if (parens)
+ ctx.print(ast, `)`);
+ return null;
+ }
+ visitReadPropExpr(ast, ctx) {
+ ast.receiver.visitExpression(this, ctx);
+ ctx.print(ast, `.`);
+ ctx.print(ast, ast.name);
+ return null;
+ }
+ visitReadKeyExpr(ast, ctx) {
+ ast.receiver.visitExpression(this, ctx);
+ ctx.print(ast, `[`);
+ ast.index.visitExpression(this, ctx);
+ ctx.print(ast, `]`);
+ return null;
+ }
+ visitLiteralArrayExpr(ast, ctx) {
+ ctx.print(ast, `[`);
+ this.visitAllExpressions(ast.entries, ctx, ",");
+ ctx.print(ast, `]`);
+ return null;
+ }
+ visitLiteralMapExpr(ast, ctx) {
+ ctx.print(ast, `{`);
+ this.visitAllObjects((entry) => {
+ ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`);
+ entry.value.visitExpression(this, ctx);
+ }, ast.entries, ctx, ",");
+ ctx.print(ast, `}`);
+ return null;
+ }
+ visitCommaExpr(ast, ctx) {
+ ctx.print(ast, "(");
+ this.visitAllExpressions(ast.parts, ctx, ",");
+ ctx.print(ast, ")");
+ return null;
+ }
+ visitParenthesizedExpr(ast, ctx) {
+ ast.expr.visitExpression(this, ctx);
+ }
+ visitAllExpressions(expressions, ctx, separator) {
+ this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);
+ }
+ visitAllObjects(handler, expressions, ctx, separator) {
+ let incrementedIndent = false;
+ for (let i = 0; i < expressions.length; i++) {
+ if (i > 0) {
+ if (ctx.lineLength() > 80) {
+ ctx.print(null, separator, true);
+ if (!incrementedIndent) {
+ ctx.incIndent();
+ ctx.incIndent();
+ incrementedIndent = true;
+ }
+ } else {
+ ctx.print(null, separator, false);
+ }
+ }
+ handler(expressions[i]);
+ }
+ if (incrementedIndent) {
+ ctx.decIndent();
+ ctx.decIndent();
+ }
+ }
+ visitAllStatements(statements, ctx) {
+ statements.forEach((stmt) => stmt.visitStatement(this, ctx));
+ }
+};
+function escapeIdentifier(input, escapeDollar, alwaysQuote = true) {
+ if (input == null) {
+ return null;
+ }
+ const body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, (...match) => {
+ if (match[0] == "$") {
+ return escapeDollar ? "\\$" : "$";
+ } else if (match[0] == "\n") {
+ return "\\n";
+ } else if (match[0] == "\r") {
+ return "\\r";
+ } else {
+ return `\\${match[0]}`;
+ }
+ });
+ const requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);
+ return requiresQuotes ? `'${body}'` : body;
+}
+function _createIndent(count) {
+ let res = "";
+ for (let i = 0; i < count; i++) {
+ res += _INDENT_WITH;
+ }
+ return res;
+}
+function typeWithParameters(type, numParams) {
+ if (numParams === 0) {
+ return expressionType(type);
+ }
+ const params = [];
+ for (let i = 0; i < numParams; i++) {
+ params.push(DYNAMIC_TYPE);
+ }
+ return expressionType(type, void 0, params);
+}
+function getSafePropertyAccessString(accessor, name) {
+ const escapedName = escapeIdentifier(name, false, false);
+ return escapedName !== name ? `${accessor}[${escapedName}]` : `${accessor}.${name}`;
+}
+function jitOnlyGuardedExpression(expr) {
+ return guardedExpression("ngJitMode", expr);
+}
+function devOnlyGuardedExpression(expr) {
+ return guardedExpression("ngDevMode", expr);
+}
+function guardedExpression(guard, expr) {
+ const guardExpr = new ExternalExpr({ name: guard, moduleName: null });
+ const guardNotDefined = new BinaryOperatorExpr(BinaryOperator.Identical, new TypeofExpr(guardExpr), literal("undefined"));
+ const guardUndefinedOrTrue = new BinaryOperatorExpr(
+ BinaryOperator.Or,
+ guardNotDefined,
+ guardExpr,
+ /* type */
+ void 0,
+ /* sourceSpan */
+ void 0
+ );
+ return new BinaryOperatorExpr(BinaryOperator.And, guardUndefinedOrTrue, expr);
+}
+function wrapReference(value) {
+ const wrapped = new WrappedNodeExpr(value);
+ return { value: wrapped, type: wrapped };
+}
+function refsToArray(refs, shouldForwardDeclare) {
+ const values = literalArr(refs.map((ref) => ref.value));
+ return shouldForwardDeclare ? arrowFn([], values) : values;
+}
+function createMayBeForwardRefExpression(expression, forwardRef) {
+ return { expression, forwardRef };
+}
+function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
+ switch (forwardRef) {
+ case 0:
+ case 1:
+ return expression;
+ case 2:
+ return generateForwardRef(expression);
+ }
+}
+function generateForwardRef(expr) {
+ return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
+}
+var R3FactoryDelegateType;
+(function(R3FactoryDelegateType2) {
+ R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
+ R3FactoryDelegateType2[R3FactoryDelegateType2["Function"] = 1] = "Function";
+})(R3FactoryDelegateType || (R3FactoryDelegateType = {}));
+function compileFactoryFunction(meta) {
+ const t = variable("__ngFactoryType__");
+ let baseFactoryVar = null;
+ const typeForCtor = !isDelegatedFactoryMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value) : t;
+ let ctorExpr = null;
+ if (meta.deps !== null) {
+ if (meta.deps !== "invalid") {
+ ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target));
+ }
+ } else {
+ baseFactoryVar = variable(`ɵ${meta.name}_BaseFactory`);
+ ctorExpr = baseFactoryVar.callFn([typeForCtor]);
+ }
+ const body = [];
+ let retExpr = null;
+ function makeConditionalFactory(nonCtorExpr) {
+ const r = variable("__ngConditionalFactory__");
+ body.push(new DeclareVarStmt(r.name, NULL_EXPR, INFERRED_TYPE));
+ const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() : importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
+ body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));
+ return r;
+ }
+ if (isDelegatedFactoryMetadata(meta)) {
+ const delegateArgs = injectDependencies(meta.delegateDeps, meta.target);
+ const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ? InstantiateExpr : InvokeFunctionExpr)(meta.delegate, delegateArgs);
+ retExpr = makeConditionalFactory(factoryExpr);
+ } else if (isExpressionFactoryMetadata(meta)) {
+ retExpr = makeConditionalFactory(meta.expression);
+ } else {
+ retExpr = ctorExpr;
+ }
+ if (retExpr === null) {
+ body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt());
+ } else if (baseFactoryVar !== null) {
+ const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);
+ const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
+ body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
+ } else {
+ body.push(new ReturnStatement(retExpr));
+ }
+ let factoryFn = fn([new FnParam(t.name, DYNAMIC_TYPE)], body, INFERRED_TYPE, void 0, `${meta.name}_Factory`);
+ if (baseFactoryVar !== null) {
+ factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)]).callFn(
+ [],
+ /* sourceSpan */
+ void 0,
+ /* pure */
+ true
+ );
+ }
+ return {
+ expression: factoryFn,
+ statements: [],
+ type: createFactoryType(meta)
+ };
+}
+function createFactoryType(meta) {
+ const ctorDepsType = meta.deps !== null && meta.deps !== "invalid" ? createCtorDepsType(meta.deps) : NONE_TYPE;
+ return expressionType(importExpr(Identifiers.FactoryDeclaration, [
+ typeWithParameters(meta.type.type, meta.typeArgumentCount),
+ ctorDepsType
+ ]));
+}
+function injectDependencies(deps, target) {
+ return deps.map((dep, index) => compileInjectDependency(dep, target, index));
+}
+function compileInjectDependency(dep, target, index) {
+ if (dep.token === null) {
+ return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]);
+ } else if (dep.attributeNameType === null) {
+ const flags = 0 | (dep.self ? 2 : 0) | (dep.skipSelf ? 4 : 0) | (dep.host ? 1 : 0) | (dep.optional ? 8 : 0) | (target === FactoryTarget.Pipe ? 16 : 0);
+ let flagsParam = flags !== 0 || dep.optional ? literal(flags) : null;
+ const injectArgs = [dep.token];
+ if (flagsParam) {
+ injectArgs.push(flagsParam);
+ }
+ const injectFn = getInjectFn(target);
+ return importExpr(injectFn).callFn(injectArgs);
+ } else {
+ return importExpr(Identifiers.injectAttribute).callFn([dep.token]);
+ }
+}
+function createCtorDepsType(deps) {
+ let hasTypes = false;
+ const attributeTypes = deps.map((dep) => {
+ const type = createCtorDepType(dep);
+ if (type !== null) {
+ hasTypes = true;
+ return type;
+ } else {
+ return literal(null);
+ }
+ });
+ if (hasTypes) {
+ return expressionType(literalArr(attributeTypes));
+ } else {
+ return NONE_TYPE;
+ }
+}
+function createCtorDepType(dep) {
+ const entries = [];
+ if (dep.attributeNameType !== null) {
+ entries.push({ key: "attribute", value: dep.attributeNameType, quoted: false });
+ }
+ if (dep.optional) {
+ entries.push({ key: "optional", value: literal(true), quoted: false });
+ }
+ if (dep.host) {
+ entries.push({ key: "host", value: literal(true), quoted: false });
+ }
+ if (dep.self) {
+ entries.push({ key: "self", value: literal(true), quoted: false });
+ }
+ if (dep.skipSelf) {
+ entries.push({ key: "skipSelf", value: literal(true), quoted: false });
+ }
+ return entries.length > 0 ? literalMap(entries) : null;
+}
+function isDelegatedFactoryMetadata(meta) {
+ return meta.delegateType !== void 0;
+}
+function isExpressionFactoryMetadata(meta) {
+ return meta.expression !== void 0;
+}
+function getInjectFn(target) {
+ switch (target) {
+ case FactoryTarget.Component:
+ case FactoryTarget.Directive:
+ case FactoryTarget.Pipe:
+ return Identifiers.directiveInject;
+ case FactoryTarget.NgModule:
+ case FactoryTarget.Injectable:
+ default:
+ return Identifiers.inject;
+ }
+}
+var ParseSpan = class {
+ start;
+ end;
+ constructor(start, end) {
+ this.start = start;
+ this.end = end;
+ }
+ toAbsolute(absoluteOffset) {
+ return new AbsoluteSourceSpan(absoluteOffset + this.start, absoluteOffset + this.end);
+ }
+};
+var AST = class {
+ span;
+ sourceSpan;
+ constructor(span, sourceSpan) {
+ this.span = span;
+ this.sourceSpan = sourceSpan;
+ }
+ toString() {
+ return "AST";
+ }
+};
+var ASTWithName = class extends AST {
+ nameSpan;
+ constructor(span, sourceSpan, nameSpan) {
+ super(span, sourceSpan);
+ this.nameSpan = nameSpan;
+ }
+};
+var EmptyExpr$1 = class EmptyExpr extends AST {
+ visit(visitor, context = null) {
+ }
+};
+var ImplicitReceiver = class extends AST {
+ visit(visitor, context = null) {
+ return visitor.visitImplicitReceiver(this, context);
+ }
+};
+var ThisReceiver = class extends ImplicitReceiver {
+ visit(visitor, context = null) {
+ return visitor.visitThisReceiver?.(this, context);
+ }
+};
+var Chain = class extends AST {
+ expressions;
+ constructor(span, sourceSpan, expressions) {
+ super(span, sourceSpan);
+ this.expressions = expressions;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitChain(this, context);
+ }
+};
+var Conditional = class extends AST {
+ condition;
+ trueExp;
+ falseExp;
+ constructor(span, sourceSpan, condition, trueExp, falseExp) {
+ super(span, sourceSpan);
+ this.condition = condition;
+ this.trueExp = trueExp;
+ this.falseExp = falseExp;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitConditional(this, context);
+ }
+};
+var PropertyRead = class extends ASTWithName {
+ receiver;
+ name;
+ constructor(span, sourceSpan, nameSpan, receiver, name) {
+ super(span, sourceSpan, nameSpan);
+ this.receiver = receiver;
+ this.name = name;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitPropertyRead(this, context);
+ }
+};
+var SafePropertyRead = class extends ASTWithName {
+ receiver;
+ name;
+ constructor(span, sourceSpan, nameSpan, receiver, name) {
+ super(span, sourceSpan, nameSpan);
+ this.receiver = receiver;
+ this.name = name;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitSafePropertyRead(this, context);
+ }
+};
+var KeyedRead = class extends AST {
+ receiver;
+ key;
+ constructor(span, sourceSpan, receiver, key) {
+ super(span, sourceSpan);
+ this.receiver = receiver;
+ this.key = key;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitKeyedRead(this, context);
+ }
+};
+var SafeKeyedRead = class extends AST {
+ receiver;
+ key;
+ constructor(span, sourceSpan, receiver, key) {
+ super(span, sourceSpan);
+ this.receiver = receiver;
+ this.key = key;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitSafeKeyedRead(this, context);
+ }
+};
+var BindingPipeType;
+(function(BindingPipeType2) {
+ BindingPipeType2[BindingPipeType2["ReferencedByName"] = 0] = "ReferencedByName";
+ BindingPipeType2[BindingPipeType2["ReferencedDirectly"] = 1] = "ReferencedDirectly";
+})(BindingPipeType || (BindingPipeType = {}));
+var BindingPipe = class extends ASTWithName {
+ exp;
+ name;
+ args;
+ type;
+ constructor(span, sourceSpan, exp, name, args, type, nameSpan) {
+ super(span, sourceSpan, nameSpan);
+ this.exp = exp;
+ this.name = name;
+ this.args = args;
+ this.type = type;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitPipe(this, context);
+ }
+};
+var LiteralPrimitive = class extends AST {
+ value;
+ constructor(span, sourceSpan, value) {
+ super(span, sourceSpan);
+ this.value = value;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitLiteralPrimitive(this, context);
+ }
+};
+var LiteralArray = class extends AST {
+ expressions;
+ constructor(span, sourceSpan, expressions) {
+ super(span, sourceSpan);
+ this.expressions = expressions;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitLiteralArray(this, context);
+ }
+};
+var LiteralMap = class extends AST {
+ keys;
+ values;
+ constructor(span, sourceSpan, keys, values) {
+ super(span, sourceSpan);
+ this.keys = keys;
+ this.values = values;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitLiteralMap(this, context);
+ }
+};
+var Interpolation$1 = class Interpolation extends AST {
+ strings;
+ expressions;
+ constructor(span, sourceSpan, strings, expressions) {
+ super(span, sourceSpan);
+ this.strings = strings;
+ this.expressions = expressions;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitInterpolation(this, context);
+ }
+};
+var Binary = class extends AST {
+ operation;
+ left;
+ right;
+ constructor(span, sourceSpan, operation, left, right) {
+ super(span, sourceSpan);
+ this.operation = operation;
+ this.left = left;
+ this.right = right;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitBinary(this, context);
+ }
+ static isAssignmentOperation(op) {
+ return op === "=" || op === "+=" || op === "-=" || op === "*=" || op === "/=" || op === "%=" || op === "**=" || op === "&&=" || op === "||=" || op === "??=";
+ }
+};
+var Unary = class _Unary extends Binary {
+ operator;
+ expr;
+ // Redeclare the properties that are inherited from `Binary` as `never`, as consumers should not
+ // depend on these fields when operating on `Unary`.
+ left = null;
+ right = null;
+ operation = null;
+ /**
+ * Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
+ */
+ static createMinus(span, sourceSpan, expr) {
+ return new _Unary(span, sourceSpan, "-", expr, "-", new LiteralPrimitive(span, sourceSpan, 0), expr);
+ }
+ /**
+ * Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
+ */
+ static createPlus(span, sourceSpan, expr) {
+ return new _Unary(span, sourceSpan, "+", expr, "-", expr, new LiteralPrimitive(span, sourceSpan, 0));
+ }
+ /**
+ * During the deprecation period this constructor is private, to avoid consumers from creating
+ * a `Unary` with the fallback properties for `Binary`.
+ */
+ constructor(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) {
+ super(span, sourceSpan, binaryOp, binaryLeft, binaryRight);
+ this.operator = operator;
+ this.expr = expr;
+ }
+ visit(visitor, context = null) {
+ if (visitor.visitUnary !== void 0) {
+ return visitor.visitUnary(this, context);
+ }
+ return visitor.visitBinary(this, context);
+ }
+};
+var PrefixNot = class extends AST {
+ expression;
+ constructor(span, sourceSpan, expression) {
+ super(span, sourceSpan);
+ this.expression = expression;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitPrefixNot(this, context);
+ }
+};
+var TypeofExpression = class extends AST {
+ expression;
+ constructor(span, sourceSpan, expression) {
+ super(span, sourceSpan);
+ this.expression = expression;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitTypeofExpression(this, context);
+ }
+};
+var VoidExpression = class extends AST {
+ expression;
+ constructor(span, sourceSpan, expression) {
+ super(span, sourceSpan);
+ this.expression = expression;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitVoidExpression(this, context);
+ }
+};
+var NonNullAssert = class extends AST {
+ expression;
+ constructor(span, sourceSpan, expression) {
+ super(span, sourceSpan);
+ this.expression = expression;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitNonNullAssert(this, context);
+ }
+};
+var Call = class extends AST {
+ receiver;
+ args;
+ argumentSpan;
+ constructor(span, sourceSpan, receiver, args, argumentSpan) {
+ super(span, sourceSpan);
+ this.receiver = receiver;
+ this.args = args;
+ this.argumentSpan = argumentSpan;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitCall(this, context);
+ }
+};
+var SafeCall = class extends AST {
+ receiver;
+ args;
+ argumentSpan;
+ constructor(span, sourceSpan, receiver, args, argumentSpan) {
+ super(span, sourceSpan);
+ this.receiver = receiver;
+ this.args = args;
+ this.argumentSpan = argumentSpan;
+ }
+ visit(visitor, context = null) {
+ return visitor.visitSafeCall(this, context);
+ }
+};
+var TaggedTemplateLiteral = class extends AST {
+ tag;
+ template;
+ constructor(span, sourceSpan, tag, template2) {
+ super(span, sourceSpan);
+ this.tag = tag;
+ this.template = template2;
+ }
+ visit(visitor, context) {
+ return visitor.visitTaggedTemplateLiteral(this, context);
+ }
+};
+var TemplateLiteral = class extends AST {
+ elements;
+ expressions;
+ constructor(span, sourceSpan, elements, expressions) {
+ super(span, sourceSpan);
+ this.elements = elements;
+ this.expressions = expressions;
+ }
+ visit(visitor, context) {
+ return visitor.visitTemplateLiteral(this, context);
+ }
+};
+var TemplateLiteralElement = class extends AST {
+ text;
+ constructor(span, sourceSpan, text2) {
+ super(span, sourceSpan);
+ this.text = text2;
+ }
+ visit(visitor, context) {
+ return visitor.visitTemplateLiteralElement(this, context);
+ }
+};
+var ParenthesizedExpression = class extends AST {
+ expression;
+ constructor(span, sourceSpan, expression) {
+ super(span, sourceSpan);
+ this.expression = expression;
+ }
+ visit(visitor, context) {
+ return visitor.visitParenthesizedExpression(this, context);
+ }
+};
+var AbsoluteSourceSpan = class {
+ start;
+ end;
+ constructor(start, end) {
+ this.start = start;
+ this.end = end;
+ }
+};
+var ASTWithSource = class extends AST {
+ ast;
+ source;
+ location;
+ errors;
+ constructor(ast, source, location, absoluteOffset, errors) {
+ super(new ParseSpan(0, source === null ? 0 : source.length), new AbsoluteSourceSpan(absoluteOffset, source === null ? absoluteOffset : absoluteOffset + source.length));
+ this.ast = ast;
+ this.source = source;
+ this.location = location;
+ this.errors = errors;
+ }
+ visit(visitor, context = null) {
+ if (visitor.visitASTWithSource) {
+ return visitor.visitASTWithSource(this, context);
+ }
+ return this.ast.visit(visitor, context);
+ }
+ toString() {
+ return `${this.source} in ${this.location}`;
+ }
+};
+var VariableBinding = class {
+ sourceSpan;
+ key;
+ value;
+ /**
+ * @param sourceSpan entire span of the binding.
+ * @param key name of the LHS along with its span.
+ * @param value optional value for the RHS along with its span.
+ */
+ constructor(sourceSpan, key, value) {
+ this.sourceSpan = sourceSpan;
+ this.key = key;
+ this.value = value;
+ }
+};
+var ExpressionBinding = class {
+ sourceSpan;
+ key;
+ value;
+ /**
+ * @param sourceSpan entire span of the binding.
+ * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its
+ * span. Note that the length of the span may not be the same as
+ * `key.source.length`. For example,
+ * 1. key.source = ngFor, key.span is for "ngFor"
+ * 2. key.source = ngForOf, key.span is for "of"
+ * 3. key.source = ngForTrackBy, key.span is for "trackBy"
+ * @param value optional expression for the RHS.
+ */
+ constructor(sourceSpan, key, value) {
+ this.sourceSpan = sourceSpan;
+ this.key = key;
+ this.value = value;
+ }
+};
+var RecursiveAstVisitor2 = class {
+ visit(ast, context) {
+ ast.visit(this, context);
+ }
+ visitUnary(ast, context) {
+ this.visit(ast.expr, context);
+ }
+ visitBinary(ast, context) {
+ this.visit(ast.left, context);
+ this.visit(ast.right, context);
+ }
+ visitChain(ast, context) {
+ this.visitAll(ast.expressions, context);
+ }
+ visitConditional(ast, context) {
+ this.visit(ast.condition, context);
+ this.visit(ast.trueExp, context);
+ this.visit(ast.falseExp, context);
+ }
+ visitPipe(ast, context) {
+ this.visit(ast.exp, context);
+ this.visitAll(ast.args, context);
+ }
+ visitImplicitReceiver(ast, context) {
+ }
+ visitThisReceiver(ast, context) {
+ }
+ visitInterpolation(ast, context) {
+ this.visitAll(ast.expressions, context);
+ }
+ visitKeyedRead(ast, context) {
+ this.visit(ast.receiver, context);
+ this.visit(ast.key, context);
+ }
+ visitLiteralArray(ast, context) {
+ this.visitAll(ast.expressions, context);
+ }
+ visitLiteralMap(ast, context) {
+ this.visitAll(ast.values, context);
+ }
+ visitLiteralPrimitive(ast, context) {
+ }
+ visitPrefixNot(ast, context) {
+ this.visit(ast.expression, context);
+ }
+ visitTypeofExpression(ast, context) {
+ this.visit(ast.expression, context);
+ }
+ visitVoidExpression(ast, context) {
+ this.visit(ast.expression, context);
+ }
+ visitNonNullAssert(ast, context) {
+ this.visit(ast.expression, context);
+ }
+ visitPropertyRead(ast, context) {
+ this.visit(ast.receiver, context);
+ }
+ visitSafePropertyRead(ast, context) {
+ this.visit(ast.receiver, context);
+ }
+ visitSafeKeyedRead(ast, context) {
+ this.visit(ast.receiver, context);
+ this.visit(ast.key, context);
+ }
+ visitCall(ast, context) {
+ this.visit(ast.receiver, context);
+ this.visitAll(ast.args, context);
+ }
+ visitSafeCall(ast, context) {
+ this.visit(ast.receiver, context);
+ this.visitAll(ast.args, context);
+ }
+ visitTemplateLiteral(ast, context) {
+ for (let i = 0; i < ast.elements.length; i++) {
+ this.visit(ast.elements[i], context);
+ const expression = i < ast.expressions.length ? ast.expressions[i] : null;
+ if (expression !== null) {
+ this.visit(expression, context);
+ }
+ }
+ }
+ visitTemplateLiteralElement(ast, context) {
+ }
+ visitTaggedTemplateLiteral(ast, context) {
+ this.visit(ast.tag, context);
+ this.visit(ast.template, context);
+ }
+ visitParenthesizedExpression(ast, context) {
+ this.visit(ast.expression, context);
+ }
+ // This is not part of the AstVisitor interface, just a helper method
+ visitAll(asts, context) {
+ for (const ast of asts) {
+ this.visit(ast, context);
+ }
+ }
+};
+var ParsedProperty = class {
+ name;
+ expression;
+ type;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ isLiteral;
+ isLegacyAnimation;
+ constructor(name, expression, type, sourceSpan, keySpan, valueSpan) {
+ this.name = name;
+ this.expression = expression;
+ this.type = type;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ this.isLiteral = this.type === ParsedPropertyType.LITERAL_ATTR;
+ this.isLegacyAnimation = this.type === ParsedPropertyType.LEGACY_ANIMATION;
+ }
+};
+var ParsedPropertyType;
+(function(ParsedPropertyType2) {
+ ParsedPropertyType2[ParsedPropertyType2["DEFAULT"] = 0] = "DEFAULT";
+ ParsedPropertyType2[ParsedPropertyType2["LITERAL_ATTR"] = 1] = "LITERAL_ATTR";
+ ParsedPropertyType2[ParsedPropertyType2["LEGACY_ANIMATION"] = 2] = "LEGACY_ANIMATION";
+ ParsedPropertyType2[ParsedPropertyType2["TWO_WAY"] = 3] = "TWO_WAY";
+})(ParsedPropertyType || (ParsedPropertyType = {}));
+var ParsedEventType;
+(function(ParsedEventType2) {
+ ParsedEventType2[ParsedEventType2["Regular"] = 0] = "Regular";
+ ParsedEventType2[ParsedEventType2["LegacyAnimation"] = 1] = "LegacyAnimation";
+ ParsedEventType2[ParsedEventType2["TwoWay"] = 2] = "TwoWay";
+})(ParsedEventType || (ParsedEventType = {}));
+var ParsedEvent = class {
+ name;
+ targetOrPhase;
+ type;
+ handler;
+ sourceSpan;
+ handlerSpan;
+ keySpan;
+ constructor(name, targetOrPhase, type, handler, sourceSpan, handlerSpan, keySpan) {
+ this.name = name;
+ this.targetOrPhase = targetOrPhase;
+ this.type = type;
+ this.handler = handler;
+ this.sourceSpan = sourceSpan;
+ this.handlerSpan = handlerSpan;
+ this.keySpan = keySpan;
+ }
+};
+var ParsedVariable = class {
+ name;
+ value;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ constructor(name, value, sourceSpan, keySpan, valueSpan) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ }
+};
+var BindingType;
+(function(BindingType2) {
+ BindingType2[BindingType2["Property"] = 0] = "Property";
+ BindingType2[BindingType2["Attribute"] = 1] = "Attribute";
+ BindingType2[BindingType2["Class"] = 2] = "Class";
+ BindingType2[BindingType2["Style"] = 3] = "Style";
+ BindingType2[BindingType2["LegacyAnimation"] = 4] = "LegacyAnimation";
+ BindingType2[BindingType2["TwoWay"] = 5] = "TwoWay";
+})(BindingType || (BindingType = {}));
+var BoundElementProperty = class {
+ name;
+ type;
+ securityContext;
+ value;
+ unit;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan) {
+ this.name = name;
+ this.type = type;
+ this.securityContext = securityContext;
+ this.value = value;
+ this.unit = unit;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ }
+};
+var TagContentType;
+(function(TagContentType2) {
+ TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
+ TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
+ TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
+})(TagContentType || (TagContentType = {}));
+function splitNsName(elementName, fatal = true) {
+ if (elementName[0] != ":") {
+ return [null, elementName];
+ }
+ const colonIndex = elementName.indexOf(":", 1);
+ if (colonIndex === -1) {
+ if (fatal) {
+ throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
+ } else {
+ return [null, elementName];
+ }
+ }
+ return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
+}
+function isNgContainer(tagName) {
+ return splitNsName(tagName)[1] === "ng-container";
+}
+function isNgContent(tagName) {
+ return splitNsName(tagName)[1] === "ng-content";
+}
+function isNgTemplate(tagName) {
+ return splitNsName(tagName)[1] === "ng-template";
+}
+function getNsPrefix(fullName) {
+ return fullName === null ? null : splitNsName(fullName)[0];
+}
+function mergeNsAndName(prefix, localName) {
+ return prefix ? `:${prefix}:${localName}` : localName;
+}
+var Comment$1 = class Comment {
+ value;
+ sourceSpan;
+ constructor(value, sourceSpan) {
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(_visitor2) {
+ throw new Error("visit() not implemented for Comment");
+ }
+};
+var Text$3 = class Text {
+ value;
+ sourceSpan;
+ constructor(value, sourceSpan) {
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor) {
+ return visitor.visitText(this);
+ }
+};
+var BoundText = class {
+ value;
+ sourceSpan;
+ i18n;
+ constructor(value, sourceSpan, i18n2) {
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitBoundText(this);
+ }
+};
+var TextAttribute = class {
+ name;
+ value;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ i18n;
+ constructor(name, value, sourceSpan, keySpan, valueSpan, i18n2) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitTextAttribute(this);
+ }
+};
+var BoundAttribute = class _BoundAttribute {
+ name;
+ type;
+ securityContext;
+ value;
+ unit;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ i18n;
+ constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n2) {
+ this.name = name;
+ this.type = type;
+ this.securityContext = securityContext;
+ this.value = value;
+ this.unit = unit;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ this.i18n = i18n2;
+ }
+ static fromBoundElementProperty(prop, i18n2) {
+ if (prop.keySpan === void 0) {
+ throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`);
+ }
+ return new _BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n2);
+ }
+ visit(visitor) {
+ return visitor.visitBoundAttribute(this);
+ }
+};
+var BoundEvent = class _BoundEvent {
+ name;
+ type;
+ handler;
+ target;
+ phase;
+ sourceSpan;
+ handlerSpan;
+ keySpan;
+ constructor(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) {
+ this.name = name;
+ this.type = type;
+ this.handler = handler;
+ this.target = target;
+ this.phase = phase;
+ this.sourceSpan = sourceSpan;
+ this.handlerSpan = handlerSpan;
+ this.keySpan = keySpan;
+ }
+ static fromParsedEvent(event) {
+ const target = event.type === ParsedEventType.Regular ? event.targetOrPhase : null;
+ const phase = event.type === ParsedEventType.LegacyAnimation ? event.targetOrPhase : null;
+ if (event.keySpan === void 0) {
+ throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);
+ }
+ return new _BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan);
+ }
+ visit(visitor) {
+ return visitor.visitBoundEvent(this);
+ }
+};
+var Element$1 = class Element {
+ name;
+ attributes;
+ inputs;
+ outputs;
+ directives;
+ children;
+ references;
+ isSelfClosing;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ isVoid;
+ i18n;
+ constructor(name, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, isVoid, i18n2) {
+ this.name = name;
+ this.attributes = attributes;
+ this.inputs = inputs;
+ this.outputs = outputs;
+ this.directives = directives;
+ this.children = children;
+ this.references = references;
+ this.isSelfClosing = isSelfClosing;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.isVoid = isVoid;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitElement(this);
+ }
+};
+var DeferredTrigger = class {
+ nameSpan;
+ sourceSpan;
+ prefetchSpan;
+ whenOrOnSourceSpan;
+ hydrateSpan;
+ constructor(nameSpan, sourceSpan, prefetchSpan, whenOrOnSourceSpan, hydrateSpan) {
+ this.nameSpan = nameSpan;
+ this.sourceSpan = sourceSpan;
+ this.prefetchSpan = prefetchSpan;
+ this.whenOrOnSourceSpan = whenOrOnSourceSpan;
+ this.hydrateSpan = hydrateSpan;
+ }
+ visit(visitor) {
+ return visitor.visitDeferredTrigger(this);
+ }
+};
+var BoundDeferredTrigger = class extends DeferredTrigger {
+ value;
+ constructor(value, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan) {
+ super(
+ /** nameSpan */
+ null,
+ sourceSpan,
+ prefetchSpan,
+ whenSourceSpan,
+ hydrateSpan
+ );
+ this.value = value;
+ }
+};
+var NeverDeferredTrigger = class extends DeferredTrigger {
+};
+var IdleDeferredTrigger = class extends DeferredTrigger {
+};
+var ImmediateDeferredTrigger = class extends DeferredTrigger {
+};
+var HoverDeferredTrigger = class extends DeferredTrigger {
+ reference;
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+ this.reference = reference2;
+ }
+};
+var TimerDeferredTrigger = class extends DeferredTrigger {
+ delay;
+ constructor(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+ this.delay = delay;
+ }
+};
+var InteractionDeferredTrigger = class extends DeferredTrigger {
+ reference;
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+ this.reference = reference2;
+ }
+};
+var ViewportDeferredTrigger = class extends DeferredTrigger {
+ reference;
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+ this.reference = reference2;
+ }
+};
+var BlockNode = class {
+ nameSpan;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
+ this.nameSpan = nameSpan;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+};
+var DeferredBlockPlaceholder = class extends BlockNode {
+ children;
+ minimumTime;
+ i18n;
+ constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.children = children;
+ this.minimumTime = minimumTime;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitDeferredBlockPlaceholder(this);
+ }
+};
+var DeferredBlockLoading = class extends BlockNode {
+ children;
+ afterTime;
+ minimumTime;
+ i18n;
+ constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.children = children;
+ this.afterTime = afterTime;
+ this.minimumTime = minimumTime;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitDeferredBlockLoading(this);
+ }
+};
+var DeferredBlockError = class extends BlockNode {
+ children;
+ i18n;
+ constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.children = children;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitDeferredBlockError(this);
+ }
+};
+var DeferredBlock = class extends BlockNode {
+ children;
+ placeholder;
+ loading;
+ error;
+ mainBlockSpan;
+ i18n;
+ triggers;
+ prefetchTriggers;
+ hydrateTriggers;
+ definedTriggers;
+ definedPrefetchTriggers;
+ definedHydrateTriggers;
+ constructor(children, triggers, prefetchTriggers, hydrateTriggers, placeholder, loading, error, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.children = children;
+ this.placeholder = placeholder;
+ this.loading = loading;
+ this.error = error;
+ this.mainBlockSpan = mainBlockSpan;
+ this.i18n = i18n2;
+ this.triggers = triggers;
+ this.prefetchTriggers = prefetchTriggers;
+ this.hydrateTriggers = hydrateTriggers;
+ this.definedTriggers = Object.keys(triggers);
+ this.definedPrefetchTriggers = Object.keys(prefetchTriggers);
+ this.definedHydrateTriggers = Object.keys(hydrateTriggers);
+ }
+ visit(visitor) {
+ return visitor.visitDeferredBlock(this);
+ }
+ visitAll(visitor) {
+ this.visitTriggers(this.definedHydrateTriggers, this.hydrateTriggers, visitor);
+ this.visitTriggers(this.definedTriggers, this.triggers, visitor);
+ this.visitTriggers(this.definedPrefetchTriggers, this.prefetchTriggers, visitor);
+ visitAll$1(visitor, this.children);
+ const remainingBlocks = [this.placeholder, this.loading, this.error].filter((x) => x !== null);
+ visitAll$1(visitor, remainingBlocks);
+ }
+ visitTriggers(keys, triggers, visitor) {
+ visitAll$1(visitor, keys.map((k) => triggers[k]));
+ }
+};
+var SwitchBlock = class extends BlockNode {
+ expression;
+ cases;
+ unknownBlocks;
+ constructor(expression, cases, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.expression = expression;
+ this.cases = cases;
+ this.unknownBlocks = unknownBlocks;
+ }
+ visit(visitor) {
+ return visitor.visitSwitchBlock(this);
+ }
+};
+var SwitchBlockCase = class extends BlockNode {
+ expression;
+ children;
+ i18n;
+ constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.expression = expression;
+ this.children = children;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitSwitchBlockCase(this);
+ }
+};
+var ForLoopBlock = class extends BlockNode {
+ item;
+ expression;
+ trackBy;
+ trackKeywordSpan;
+ contextVariables;
+ children;
+ empty;
+ mainBlockSpan;
+ i18n;
+ constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.item = item;
+ this.expression = expression;
+ this.trackBy = trackBy;
+ this.trackKeywordSpan = trackKeywordSpan;
+ this.contextVariables = contextVariables;
+ this.children = children;
+ this.empty = empty;
+ this.mainBlockSpan = mainBlockSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitForLoopBlock(this);
+ }
+};
+var ForLoopBlockEmpty = class extends BlockNode {
+ children;
+ i18n;
+ constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.children = children;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitForLoopBlockEmpty(this);
+ }
+};
+var IfBlock = class extends BlockNode {
+ branches;
+ constructor(branches, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.branches = branches;
+ }
+ visit(visitor) {
+ return visitor.visitIfBlock(this);
+ }
+};
+var IfBlockBranch = class extends BlockNode {
+ expression;
+ children;
+ expressionAlias;
+ i18n;
+ constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
+ this.expression = expression;
+ this.children = children;
+ this.expressionAlias = expressionAlias;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitIfBlockBranch(this);
+ }
+};
+var UnknownBlock = class {
+ name;
+ sourceSpan;
+ nameSpan;
+ constructor(name, sourceSpan, nameSpan) {
+ this.name = name;
+ this.sourceSpan = sourceSpan;
+ this.nameSpan = nameSpan;
+ }
+ visit(visitor) {
+ return visitor.visitUnknownBlock(this);
+ }
+};
+var LetDeclaration$1 = class LetDeclaration {
+ name;
+ value;
+ sourceSpan;
+ nameSpan;
+ valueSpan;
+ constructor(name, value, sourceSpan, nameSpan, valueSpan) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.nameSpan = nameSpan;
+ this.valueSpan = valueSpan;
+ }
+ visit(visitor) {
+ return visitor.visitLetDeclaration(this);
+ }
+};
+var Component$1 = class Component {
+ componentName;
+ tagName;
+ fullName;
+ attributes;
+ inputs;
+ outputs;
+ directives;
+ children;
+ references;
+ isSelfClosing;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ i18n;
+ constructor(componentName, tagName, fullName, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ this.componentName = componentName;
+ this.tagName = tagName;
+ this.fullName = fullName;
+ this.attributes = attributes;
+ this.inputs = inputs;
+ this.outputs = outputs;
+ this.directives = directives;
+ this.children = children;
+ this.references = references;
+ this.isSelfClosing = isSelfClosing;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitComponent(this);
+ }
+};
+var Directive$1 = class Directive {
+ name;
+ attributes;
+ inputs;
+ outputs;
+ references;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ i18n;
+ constructor(name, attributes, inputs, outputs, references, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ this.name = name;
+ this.attributes = attributes;
+ this.inputs = inputs;
+ this.outputs = outputs;
+ this.references = references;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitDirective(this);
+ }
+};
+var Template = class {
+ tagName;
+ attributes;
+ inputs;
+ outputs;
+ directives;
+ templateAttrs;
+ children;
+ references;
+ variables;
+ isSelfClosing;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ i18n;
+ constructor(tagName, attributes, inputs, outputs, directives, templateAttrs, children, references, variables, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ this.tagName = tagName;
+ this.attributes = attributes;
+ this.inputs = inputs;
+ this.outputs = outputs;
+ this.directives = directives;
+ this.templateAttrs = templateAttrs;
+ this.children = children;
+ this.references = references;
+ this.variables = variables;
+ this.isSelfClosing = isSelfClosing;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitTemplate(this);
+ }
+};
+var Content = class {
+ selector;
+ attributes;
+ children;
+ isSelfClosing;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ i18n;
+ name = "ng-content";
+ constructor(selector, attributes, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
+ this.selector = selector;
+ this.attributes = attributes;
+ this.children = children;
+ this.isSelfClosing = isSelfClosing;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitContent(this);
+ }
+};
+var Variable = class {
+ name;
+ value;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ constructor(name, value, sourceSpan, keySpan, valueSpan) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ }
+ visit(visitor) {
+ return visitor.visitVariable(this);
+ }
+};
+var Reference = class {
+ name;
+ value;
+ sourceSpan;
+ keySpan;
+ valueSpan;
+ constructor(name, value, sourceSpan, keySpan, valueSpan) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ }
+ visit(visitor) {
+ return visitor.visitReference(this);
+ }
+};
+var Icu$1 = class Icu {
+ vars;
+ placeholders;
+ sourceSpan;
+ i18n;
+ constructor(vars, placeholders, sourceSpan, i18n2) {
+ this.vars = vars;
+ this.placeholders = placeholders;
+ this.sourceSpan = sourceSpan;
+ this.i18n = i18n2;
+ }
+ visit(visitor) {
+ return visitor.visitIcu(this);
+ }
+};
+var HostElement = class {
+ tagNames;
+ bindings;
+ listeners;
+ sourceSpan;
+ constructor(tagNames, bindings, listeners, sourceSpan) {
+ this.tagNames = tagNames;
+ this.bindings = bindings;
+ this.listeners = listeners;
+ this.sourceSpan = sourceSpan;
+ if (tagNames.length === 0) {
+ throw new Error("HostElement must have at least one tag name.");
+ }
+ }
+ visit() {
+ throw new Error(`HostElement cannot be visited`);
+ }
+};
+var RecursiveVisitor$1 = class RecursiveVisitor {
+ visitElement(element2) {
+ visitAll$1(this, element2.attributes);
+ visitAll$1(this, element2.inputs);
+ visitAll$1(this, element2.outputs);
+ visitAll$1(this, element2.directives);
+ visitAll$1(this, element2.children);
+ visitAll$1(this, element2.references);
+ }
+ visitTemplate(template2) {
+ visitAll$1(this, template2.attributes);
+ visitAll$1(this, template2.inputs);
+ visitAll$1(this, template2.outputs);
+ visitAll$1(this, template2.directives);
+ visitAll$1(this, template2.children);
+ visitAll$1(this, template2.references);
+ visitAll$1(this, template2.variables);
+ }
+ visitDeferredBlock(deferred) {
+ deferred.visitAll(this);
+ }
+ visitDeferredBlockPlaceholder(block) {
+ visitAll$1(this, block.children);
+ }
+ visitDeferredBlockError(block) {
+ visitAll$1(this, block.children);
+ }
+ visitDeferredBlockLoading(block) {
+ visitAll$1(this, block.children);
+ }
+ visitSwitchBlock(block) {
+ visitAll$1(this, block.cases);
+ }
+ visitSwitchBlockCase(block) {
+ visitAll$1(this, block.children);
+ }
+ visitForLoopBlock(block) {
+ const blockItems = [block.item, ...block.contextVariables, ...block.children];
+ block.empty && blockItems.push(block.empty);
+ visitAll$1(this, blockItems);
+ }
+ visitForLoopBlockEmpty(block) {
+ visitAll$1(this, block.children);
+ }
+ visitIfBlock(block) {
+ visitAll$1(this, block.branches);
+ }
+ visitIfBlockBranch(block) {
+ const blockItems = block.children;
+ block.expressionAlias && blockItems.push(block.expressionAlias);
+ visitAll$1(this, blockItems);
+ }
+ visitContent(content) {
+ visitAll$1(this, content.children);
+ }
+ visitComponent(component) {
+ visitAll$1(this, component.attributes);
+ visitAll$1(this, component.inputs);
+ visitAll$1(this, component.outputs);
+ visitAll$1(this, component.directives);
+ visitAll$1(this, component.children);
+ visitAll$1(this, component.references);
+ }
+ visitDirective(directive) {
+ visitAll$1(this, directive.attributes);
+ visitAll$1(this, directive.inputs);
+ visitAll$1(this, directive.outputs);
+ visitAll$1(this, directive.references);
+ }
+ visitVariable(variable2) {
+ }
+ visitReference(reference2) {
+ }
+ visitTextAttribute(attribute2) {
+ }
+ visitBoundAttribute(attribute2) {
+ }
+ visitBoundEvent(attribute2) {
+ }
+ visitText(text2) {
+ }
+ visitBoundText(text2) {
+ }
+ visitIcu(icu) {
+ }
+ visitDeferredTrigger(trigger) {
+ }
+ visitUnknownBlock(block) {
+ }
+ visitLetDeclaration(decl) {
+ }
+};
+function visitAll$1(visitor, nodes) {
+ const result = [];
+ if (visitor.visit) {
+ for (const node of nodes) {
+ visitor.visit(node);
+ }
+ } else {
+ for (const node of nodes) {
+ const newNode = node.visit(visitor);
+ if (newNode) {
+ result.push(newNode);
+ }
+ }
+ }
+ return result;
+}
+var Message = class {
+ nodes;
+ placeholders;
+ placeholderToMessage;
+ meaning;
+ description;
+ customId;
+ sources;
+ id;
+ /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */
+ legacyIds = [];
+ messageString;
+ /**
+ * @param nodes message AST
+ * @param placeholders maps placeholder names to static content and their source spans
+ * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)
+ * @param meaning
+ * @param description
+ * @param customId
+ */
+ constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
+ this.nodes = nodes;
+ this.placeholders = placeholders;
+ this.placeholderToMessage = placeholderToMessage;
+ this.meaning = meaning;
+ this.description = description;
+ this.customId = customId;
+ this.id = this.customId;
+ this.messageString = serializeMessage(this.nodes);
+ if (nodes.length) {
+ this.sources = [
+ {
+ filePath: nodes[0].sourceSpan.start.file.url,
+ startLine: nodes[0].sourceSpan.start.line + 1,
+ startCol: nodes[0].sourceSpan.start.col + 1,
+ endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,
+ endCol: nodes[0].sourceSpan.start.col + 1
+ }
+ ];
+ } else {
+ this.sources = [];
+ }
+ }
+};
+var Text$2 = class Text2 {
+ value;
+ sourceSpan;
+ constructor(value, sourceSpan) {
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitText(this, context);
+ }
+};
+var Container = class {
+ children;
+ sourceSpan;
+ constructor(children, sourceSpan) {
+ this.children = children;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitContainer(this, context);
+ }
+};
+var Icu2 = class {
+ expression;
+ type;
+ cases;
+ sourceSpan;
+ expressionPlaceholder;
+ constructor(expression, type, cases, sourceSpan, expressionPlaceholder) {
+ this.expression = expression;
+ this.type = type;
+ this.cases = cases;
+ this.sourceSpan = sourceSpan;
+ this.expressionPlaceholder = expressionPlaceholder;
+ }
+ visit(visitor, context) {
+ return visitor.visitIcu(this, context);
+ }
+};
+var TagPlaceholder = class {
+ tag;
+ attrs;
+ startName;
+ closeName;
+ children;
+ isVoid;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(tag, attrs, startName, closeName, children, isVoid, sourceSpan, startSourceSpan, endSourceSpan) {
+ this.tag = tag;
+ this.attrs = attrs;
+ this.startName = startName;
+ this.closeName = closeName;
+ this.children = children;
+ this.isVoid = isVoid;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitTagPlaceholder(this, context);
+ }
+};
+var Placeholder = class {
+ value;
+ name;
+ sourceSpan;
+ constructor(value, name, sourceSpan) {
+ this.value = value;
+ this.name = name;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitPlaceholder(this, context);
+ }
+};
+var IcuPlaceholder = class {
+ value;
+ name;
+ sourceSpan;
+ /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */
+ previousMessage;
+ constructor(value, name, sourceSpan) {
+ this.value = value;
+ this.name = name;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitIcuPlaceholder(this, context);
+ }
+};
+var BlockPlaceholder = class {
+ name;
+ parameters;
+ startName;
+ closeName;
+ children;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(name, parameters, startName, closeName, children, sourceSpan, startSourceSpan, endSourceSpan) {
+ this.name = name;
+ this.parameters = parameters;
+ this.startName = startName;
+ this.closeName = closeName;
+ this.children = children;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitBlockPlaceholder(this, context);
+ }
+};
+var CloneVisitor = class {
+ visitText(text2, context) {
+ return new Text$2(text2.value, text2.sourceSpan);
+ }
+ visitContainer(container, context) {
+ const children = container.children.map((n) => n.visit(this, context));
+ return new Container(children, container.sourceSpan);
+ }
+ visitIcu(icu, context) {
+ const cases = {};
+ Object.keys(icu.cases).forEach((key) => cases[key] = icu.cases[key].visit(this, context));
+ const msg = new Icu2(icu.expression, icu.type, cases, icu.sourceSpan, icu.expressionPlaceholder);
+ return msg;
+ }
+ visitTagPlaceholder(ph, context) {
+ const children = ph.children.map((n) => n.visit(this, context));
+ return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
+ }
+ visitPlaceholder(ph, context) {
+ return new Placeholder(ph.value, ph.name, ph.sourceSpan);
+ }
+ visitIcuPlaceholder(ph, context) {
+ return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);
+ }
+ visitBlockPlaceholder(ph, context) {
+ const children = ph.children.map((n) => n.visit(this, context));
+ return new BlockPlaceholder(ph.name, ph.parameters, ph.startName, ph.closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
+ }
+};
+var RecurseVisitor = class {
+ visitText(text2, context) {
+ }
+ visitContainer(container, context) {
+ container.children.forEach((child) => child.visit(this));
+ }
+ visitIcu(icu, context) {
+ Object.keys(icu.cases).forEach((k) => {
+ icu.cases[k].visit(this);
+ });
+ }
+ visitTagPlaceholder(ph, context) {
+ ph.children.forEach((child) => child.visit(this));
+ }
+ visitPlaceholder(ph, context) {
+ }
+ visitIcuPlaceholder(ph, context) {
+ }
+ visitBlockPlaceholder(ph, context) {
+ ph.children.forEach((child) => child.visit(this));
+ }
+};
+function serializeMessage(messageNodes) {
+ const visitor = new LocalizeMessageStringVisitor();
+ const str = messageNodes.map((n) => n.visit(visitor)).join("");
+ return str;
+}
+var LocalizeMessageStringVisitor = class {
+ visitText(text2) {
+ return text2.value;
+ }
+ visitContainer(container) {
+ return container.children.map((child) => child.visit(this)).join("");
+ }
+ visitIcu(icu) {
+ const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
+ return `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`;
+ }
+ visitTagPlaceholder(ph) {
+ const children = ph.children.map((child) => child.visit(this)).join("");
+ return `{$${ph.startName}}${children}{$${ph.closeName}}`;
+ }
+ visitPlaceholder(ph) {
+ return `{$${ph.name}}`;
+ }
+ visitIcuPlaceholder(ph) {
+ return `{$${ph.name}}`;
+ }
+ visitBlockPlaceholder(ph) {
+ const children = ph.children.map((child) => child.visit(this)).join("");
+ return `{$${ph.startName}}${children}{$${ph.closeName}}`;
+ }
+};
+var Serializer = class {
+ // Creates a name mapper, see `PlaceholderMapper`
+ // Returning `null` means that no name mapping is used.
+ createNameMapper(message) {
+ return null;
+ }
+};
+var SimplePlaceholderMapper = class extends RecurseVisitor {
+ mapName;
+ internalToPublic = {};
+ publicToNextId = {};
+ publicToInternal = {};
+ // create a mapping from the message
+ constructor(message, mapName) {
+ super();
+ this.mapName = mapName;
+ message.nodes.forEach((node) => node.visit(this));
+ }
+ toPublicName(internalName) {
+ return this.internalToPublic.hasOwnProperty(internalName) ? this.internalToPublic[internalName] : null;
+ }
+ toInternalName(publicName) {
+ return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] : null;
+ }
+ visitText(text2, context) {
+ return null;
+ }
+ visitTagPlaceholder(ph, context) {
+ this.visitPlaceholderName(ph.startName);
+ super.visitTagPlaceholder(ph, context);
+ this.visitPlaceholderName(ph.closeName);
+ }
+ visitPlaceholder(ph, context) {
+ this.visitPlaceholderName(ph.name);
+ }
+ visitBlockPlaceholder(ph, context) {
+ this.visitPlaceholderName(ph.startName);
+ super.visitBlockPlaceholder(ph, context);
+ this.visitPlaceholderName(ph.closeName);
+ }
+ visitIcuPlaceholder(ph, context) {
+ this.visitPlaceholderName(ph.name);
+ }
+ // XMB placeholders could only contains A-Z, 0-9 and _
+ visitPlaceholderName(internalName) {
+ if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {
+ return;
+ }
+ let publicName = this.mapName(internalName);
+ if (this.publicToInternal.hasOwnProperty(publicName)) {
+ const nextId = this.publicToNextId[publicName];
+ this.publicToNextId[publicName] = nextId + 1;
+ publicName = `${publicName}_${nextId}`;
+ } else {
+ this.publicToNextId[publicName] = 1;
+ }
+ this.internalToPublic[internalName] = publicName;
+ this.publicToInternal[publicName] = internalName;
+ }
+};
+var _Visitor$2 = class _Visitor {
+ visitTag(tag) {
+ const strAttrs = this._serializeAttributes(tag.attrs);
+ if (tag.children.length == 0) {
+ return `<${tag.name}${strAttrs}/>`;
+ }
+ const strChildren = tag.children.map((node) => node.visit(this));
+ return `<${tag.name}${strAttrs}>${strChildren.join("")}${tag.name}>`;
+ }
+ visitText(text2) {
+ return text2.value;
+ }
+ visitDeclaration(decl) {
+ return ``;
+ }
+ _serializeAttributes(attrs) {
+ const strAttrs = Object.keys(attrs).map((name) => `${name}="${attrs[name]}"`).join(" ");
+ return strAttrs.length > 0 ? " " + strAttrs : "";
+ }
+ visitDoctype(doctype) {
+ return ``;
+ }
+};
+var _visitor = new _Visitor$2();
+function serialize$1(nodes) {
+ return nodes.map((node) => node.visit(_visitor)).join("");
+}
+var Declaration = class {
+ attrs = {};
+ constructor(unescapedAttrs) {
+ Object.keys(unescapedAttrs).forEach((k) => {
+ this.attrs[k] = escapeXml(unescapedAttrs[k]);
+ });
+ }
+ visit(visitor) {
+ return visitor.visitDeclaration(this);
+ }
+};
+var Doctype = class {
+ rootTag;
+ dtd;
+ constructor(rootTag, dtd) {
+ this.rootTag = rootTag;
+ this.dtd = dtd;
+ }
+ visit(visitor) {
+ return visitor.visitDoctype(this);
+ }
+};
+var Tag = class {
+ name;
+ children;
+ attrs = {};
+ constructor(name, unescapedAttrs = {}, children = []) {
+ this.name = name;
+ this.children = children;
+ Object.keys(unescapedAttrs).forEach((k) => {
+ this.attrs[k] = escapeXml(unescapedAttrs[k]);
+ });
+ }
+ visit(visitor) {
+ return visitor.visitTag(this);
+ }
+};
+var Text$1 = class Text3 {
+ value;
+ constructor(unescapedValue) {
+ this.value = escapeXml(unescapedValue);
+ }
+ visit(visitor) {
+ return visitor.visitText(this);
+ }
+};
+var CR = class extends Text$1 {
+ constructor(ws = 0) {
+ super(`
+${new Array(ws + 1).join(" ")}`);
+ }
+};
+var _ESCAPED_CHARS = [
+ [/&/g, "&"],
+ [/"/g, """],
+ [/'/g, "'"],
+ [//g, ">"]
+];
+function escapeXml(text2) {
+ return _ESCAPED_CHARS.reduce((text3, entry) => text3.replace(entry[0], entry[1]), text2);
+}
+var _XMB_HANDLER = "angular";
+var _MESSAGES_TAG = "messagebundle";
+var _MESSAGE_TAG = "msg";
+var _PLACEHOLDER_TAG$3 = "ph";
+var _EXAMPLE_TAG = "ex";
+var _SOURCE_TAG$2 = "source";
+var _DOCTYPE = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+var Xmb = class extends Serializer {
+ write(messages, locale) {
+ const exampleVisitor = new ExampleVisitor();
+ const visitor = new _Visitor$1();
+ const rootNode = new Tag(_MESSAGES_TAG);
+ rootNode.attrs["handler"] = _XMB_HANDLER;
+ messages.forEach((message) => {
+ const attrs = { id: message.id };
+ if (message.description) {
+ attrs["desc"] = message.description;
+ }
+ if (message.meaning) {
+ attrs["meaning"] = message.meaning;
+ }
+ let sourceTags = [];
+ message.sources.forEach((source) => {
+ sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [
+ new Text$1(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? "," + source.endLine : ""}`)
+ ]));
+ });
+ rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, [...sourceTags, ...visitor.serialize(message.nodes)]));
+ });
+ rootNode.children.push(new CR());
+ return serialize$1([
+ new Declaration({ version: "1.0", encoding: "UTF-8" }),
+ new CR(),
+ new Doctype(_MESSAGES_TAG, _DOCTYPE),
+ new CR(),
+ exampleVisitor.addDefaultExamples(rootNode),
+ new CR()
+ ]);
+ }
+ load(content, url) {
+ throw new Error("Unsupported");
+ }
+ digest(message) {
+ return digest(message);
+ }
+ createNameMapper(message) {
+ return new SimplePlaceholderMapper(message, toPublicName);
+ }
+};
+var _Visitor$1 = class _Visitor2 {
+ visitText(text2, context) {
+ return [new Text$1(text2.value)];
+ }
+ visitContainer(container, context) {
+ const nodes = [];
+ container.children.forEach((node) => nodes.push(...node.visit(this)));
+ return nodes;
+ }
+ visitIcu(icu, context) {
+ const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];
+ Object.keys(icu.cases).forEach((c) => {
+ nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `));
+ });
+ nodes.push(new Text$1(`}`));
+ return nodes;
+ }
+ visitTagPlaceholder(ph, context) {
+ const startTagAsText = new Text$1(`<${ph.tag}>`);
+ const startEx = new Tag(_EXAMPLE_TAG, {}, [startTagAsText]);
+ const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.startName }, [
+ startEx,
+ startTagAsText
+ ]);
+ if (ph.isVoid) {
+ return [startTagPh];
+ }
+ const closeTagAsText = new Text$1(`${ph.tag}>`);
+ const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeTagAsText]);
+ const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.closeName }, [
+ closeEx,
+ closeTagAsText
+ ]);
+ return [startTagPh, ...this.serialize(ph.children), closeTagPh];
+ }
+ visitPlaceholder(ph, context) {
+ const interpolationAsText = new Text$1(`{{${ph.value}}}`);
+ const exTag = new Tag(_EXAMPLE_TAG, {}, [interpolationAsText]);
+ return [
+ // TC requires PH to have a non empty EX, and uses the text node to show the "original" value.
+ new Tag(_PLACEHOLDER_TAG$3, { name: ph.name }, [exTag, interpolationAsText])
+ ];
+ }
+ visitBlockPlaceholder(ph, context) {
+ const startAsText = new Text$1(`@${ph.name}`);
+ const startEx = new Tag(_EXAMPLE_TAG, {}, [startAsText]);
+ const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.startName }, [startEx, startAsText]);
+ const closeAsText = new Text$1(`}`);
+ const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeAsText]);
+ const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.closeName }, [closeEx, closeAsText]);
+ return [startTagPh, ...this.serialize(ph.children), closeTagPh];
+ }
+ visitIcuPlaceholder(ph, context) {
+ const icuExpression = ph.value.expression;
+ const icuType = ph.value.type;
+ const icuCases = Object.keys(ph.value.cases).map((value) => value + " {...}").join(" ");
+ const icuAsText = new Text$1(`{${icuExpression}, ${icuType}, ${icuCases}}`);
+ const exTag = new Tag(_EXAMPLE_TAG, {}, [icuAsText]);
+ return [
+ // TC requires PH to have a non empty EX, and uses the text node to show the "original" value.
+ new Tag(_PLACEHOLDER_TAG$3, { name: ph.name }, [exTag, icuAsText])
+ ];
+ }
+ serialize(nodes) {
+ return [].concat(...nodes.map((node) => node.visit(this)));
+ }
+};
+function digest(message) {
+ return decimalDigest(message);
+}
+var ExampleVisitor = class {
+ addDefaultExamples(node) {
+ node.visit(this);
+ return node;
+ }
+ visitTag(tag) {
+ if (tag.name === _PLACEHOLDER_TAG$3) {
+ if (!tag.children || tag.children.length == 0) {
+ const exText = new Text$1(tag.attrs["name"] || "...");
+ tag.children = [new Tag(_EXAMPLE_TAG, {}, [exText])];
+ }
+ } else if (tag.children) {
+ tag.children.forEach((node) => node.visit(this));
+ }
+ }
+ visitText(text2) {
+ }
+ visitDeclaration(decl) {
+ }
+ visitDoctype(doctype) {
+ }
+};
+function toPublicName(internalName) {
+ return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
+}
+var I18N_ATTR = "i18n";
+var I18N_ATTR_PREFIX = "i18n-";
+var I18N_ICU_VAR_PREFIX = "VAR_";
+function isI18nAttribute(name) {
+ return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX);
+}
+function hasI18nAttrs(node) {
+ return node.attrs.some((attr) => isI18nAttribute(attr.name));
+}
+function icuFromI18nMessage(message) {
+ return message.nodes[0];
+}
+function formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) {
+ const _params = {};
+ if (params && Object.keys(params).length) {
+ Object.keys(params).forEach((key) => _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]);
+ }
+ return _params;
+}
+function formatI18nPlaceholderName(name, useCamelCase = true) {
+ const publicName = toPublicName(name);
+ if (!useCamelCase) {
+ return publicName;
+ }
+ const chunks = publicName.split("_");
+ if (chunks.length === 1) {
+ return name.toLowerCase();
+ }
+ let postfix;
+ if (/^\d+$/.test(chunks[chunks.length - 1])) {
+ postfix = chunks.pop();
+ }
+ let raw = chunks.shift().toLowerCase();
+ if (chunks.length) {
+ raw += chunks.map((c) => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase()).join("");
+ }
+ return postfix ? `${raw}_${postfix}` : raw;
+}
+var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
+var TEMPORARY_NAME = "_t";
+var CONTEXT_NAME = "ctx";
+var RENDER_FLAGS = "rf";
+function temporaryAllocator(pushStatement, name) {
+ let temp = null;
+ return () => {
+ if (!temp) {
+ pushStatement(new DeclareVarStmt(TEMPORARY_NAME, void 0, DYNAMIC_TYPE));
+ temp = variable(name);
+ }
+ return temp;
+ };
+}
+function asLiteral(value) {
+ if (Array.isArray(value)) {
+ return literalArr(value.map(asLiteral));
+ }
+ return literal(value, INFERRED_TYPE);
+}
+function conditionallyCreateDirectiveBindingLiteral(map, forInputs) {
+ const keys = Object.getOwnPropertyNames(map);
+ if (keys.length === 0) {
+ return null;
+ }
+ return literalMap(keys.map((key) => {
+ const value = map[key];
+ let declaredName;
+ let publicName;
+ let minifiedName;
+ let expressionValue;
+ if (typeof value === "string") {
+ declaredName = key;
+ minifiedName = key;
+ publicName = value;
+ expressionValue = asLiteral(publicName);
+ } else {
+ minifiedName = key;
+ declaredName = value.classPropertyName;
+ publicName = value.bindingPropertyName;
+ const differentDeclaringName = publicName !== declaredName;
+ const hasDecoratorInputTransform = value.transformFunction !== null;
+ let flags = InputFlags.None;
+ if (value.isSignal) {
+ flags |= InputFlags.SignalBased;
+ }
+ if (hasDecoratorInputTransform) {
+ flags |= InputFlags.HasDecoratorInputTransform;
+ }
+ if (forInputs && (differentDeclaringName || hasDecoratorInputTransform || flags !== InputFlags.None)) {
+ const result = [literal(flags), asLiteral(publicName)];
+ if (differentDeclaringName || hasDecoratorInputTransform) {
+ result.push(asLiteral(declaredName));
+ if (hasDecoratorInputTransform) {
+ result.push(value.transformFunction);
+ }
+ }
+ expressionValue = literalArr(result);
+ } else {
+ expressionValue = asLiteral(publicName);
+ }
+ }
+ return {
+ key: minifiedName,
+ // put quotes around keys that contain potentially unsafe characters
+ quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),
+ value: expressionValue
+ };
+ }));
+}
+var DefinitionMap = class {
+ values = [];
+ set(key, value) {
+ if (value) {
+ const existing = this.values.find((value2) => value2.key === key);
+ if (existing) {
+ existing.value = value;
+ } else {
+ this.values.push({ key, value, quoted: false });
+ }
+ }
+ }
+ toLiteralMap() {
+ return literalMap(this.values);
+ }
+};
+function createCssSelectorFromNode(node) {
+ const elementName = node instanceof Element$1 ? node.name : "ng-template";
+ const attributes = getAttrsForDirectiveMatching(node);
+ const cssSelector = new CssSelector();
+ const elementNameNoNs = splitNsName(elementName)[1];
+ cssSelector.setElement(elementNameNoNs);
+ Object.getOwnPropertyNames(attributes).forEach((name) => {
+ const nameNoNs = splitNsName(name)[1];
+ const value = attributes[name];
+ cssSelector.addAttribute(nameNoNs, value);
+ if (name.toLowerCase() === "class") {
+ const classes = value.trim().split(/\s+/);
+ classes.forEach((className) => cssSelector.addClassName(className));
+ }
+ });
+ return cssSelector;
+}
+function getAttrsForDirectiveMatching(elOrTpl) {
+ const attributesMap = {};
+ if (elOrTpl instanceof Template && elOrTpl.tagName !== "ng-template") {
+ elOrTpl.templateAttrs.forEach((a) => attributesMap[a.name] = "");
+ } else {
+ elOrTpl.attributes.forEach((a) => {
+ if (!isI18nAttribute(a.name)) {
+ attributesMap[a.name] = a.value;
+ }
+ });
+ elOrTpl.inputs.forEach((i) => {
+ if (i.type === BindingType.Property || i.type === BindingType.TwoWay) {
+ attributesMap[i.name] = "";
+ }
+ });
+ elOrTpl.outputs.forEach((o) => {
+ attributesMap[o.name] = "";
+ });
+ }
+ return attributesMap;
+}
+function compileInjectable(meta, resolveForwardRefs) {
+ let result = null;
+ const factoryMeta = {
+ name: meta.name,
+ type: meta.type,
+ typeArgumentCount: meta.typeArgumentCount,
+ deps: [],
+ target: FactoryTarget.Injectable
+ };
+ if (meta.useClass !== void 0) {
+ const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value);
+ let deps = void 0;
+ if (meta.deps !== void 0) {
+ deps = meta.deps;
+ }
+ if (deps !== void 0) {
+ result = compileFactoryFunction(__spreadProps(__spreadValues({}, factoryMeta), {
+ delegate: meta.useClass.expression,
+ delegateDeps: deps,
+ delegateType: R3FactoryDelegateType.Class
+ }));
+ } else if (useClassOnSelf) {
+ result = compileFactoryFunction(factoryMeta);
+ } else {
+ result = {
+ statements: [],
+ expression: delegateToFactory(meta.type.value, meta.useClass.expression, resolveForwardRefs)
+ };
+ }
+ } else if (meta.useFactory !== void 0) {
+ if (meta.deps !== void 0) {
+ result = compileFactoryFunction(__spreadProps(__spreadValues({}, factoryMeta), {
+ delegate: meta.useFactory,
+ delegateDeps: meta.deps || [],
+ delegateType: R3FactoryDelegateType.Function
+ }));
+ } else {
+ result = { statements: [], expression: arrowFn([], meta.useFactory.callFn([])) };
+ }
+ } else if (meta.useValue !== void 0) {
+ result = compileFactoryFunction(__spreadProps(__spreadValues({}, factoryMeta), {
+ expression: meta.useValue.expression
+ }));
+ } else if (meta.useExisting !== void 0) {
+ result = compileFactoryFunction(__spreadProps(__spreadValues({}, factoryMeta), {
+ expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression])
+ }));
+ } else {
+ result = {
+ statements: [],
+ expression: delegateToFactory(meta.type.value, meta.type.value, resolveForwardRefs)
+ };
+ }
+ const token = meta.type.value;
+ const injectableProps = new DefinitionMap();
+ injectableProps.set("token", token);
+ injectableProps.set("factory", result.expression);
+ if (meta.providedIn.expression.value !== null) {
+ injectableProps.set("providedIn", convertFromMaybeForwardRefExpression(meta.providedIn));
+ }
+ const expression = importExpr(Identifiers.ɵɵdefineInjectable).callFn([injectableProps.toLiteralMap()], void 0, true);
+ return {
+ expression,
+ type: createInjectableType(meta),
+ statements: result.statements
+ };
+}
+function createInjectableType(meta) {
+ return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [
+ typeWithParameters(meta.type.type, meta.typeArgumentCount)
+ ]));
+}
+function delegateToFactory(type, useType, unwrapForwardRefs) {
+ if (type.node === useType.node) {
+ return useType.prop("ɵfac");
+ }
+ if (!unwrapForwardRefs) {
+ return createFactoryFunction(useType);
+ }
+ const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([useType]);
+ return createFactoryFunction(unwrappedType);
+}
+function createFactoryFunction(type) {
+ const t = new FnParam("__ngFactoryType__", DYNAMIC_TYPE);
+ return arrowFn([t], type.prop("ɵfac").callFn([variable(t.name)]));
+}
+var UNUSABLE_INTERPOLATION_REGEXPS = [
+ /@/,
+ // control flow reserved symbol
+ /^\s*$/,
+ // empty
+ /[<>]/,
+ // html tag
+ /^[{}]$/,
+ // i18n expansion
+ /&(#|[a-z])/i,
+ // character reference,
+ /^\/\//
+ // comment
+];
+function assertInterpolationSymbols(identifier, value) {
+ if (value != null && !(Array.isArray(value) && value.length == 2)) {
+ throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
+ } else if (value != null) {
+ const start = value[0];
+ const end = value[1];
+ UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp) => {
+ if (regexp.test(start) || regexp.test(end)) {
+ throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
+ }
+ });
+ }
+}
+var InterpolationConfig = class _InterpolationConfig {
+ start;
+ end;
+ static fromArray(markers) {
+ if (!markers) {
+ return DEFAULT_INTERPOLATION_CONFIG;
+ }
+ assertInterpolationSymbols("interpolation", markers);
+ return new _InterpolationConfig(markers[0], markers[1]);
+ }
+ constructor(start, end) {
+ this.start = start;
+ this.end = end;
+ }
+};
+var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
+var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
+var $EOF = 0;
+var $BSPACE = 8;
+var $TAB = 9;
+var $LF = 10;
+var $VTAB = 11;
+var $FF = 12;
+var $CR = 13;
+var $SPACE = 32;
+var $BANG = 33;
+var $DQ = 34;
+var $HASH = 35;
+var $$ = 36;
+var $PERCENT = 37;
+var $AMPERSAND = 38;
+var $SQ = 39;
+var $LPAREN = 40;
+var $RPAREN = 41;
+var $STAR = 42;
+var $PLUS = 43;
+var $COMMA = 44;
+var $MINUS = 45;
+var $PERIOD = 46;
+var $SLASH = 47;
+var $COLON = 58;
+var $SEMICOLON = 59;
+var $LT = 60;
+var $EQ = 61;
+var $GT = 62;
+var $QUESTION = 63;
+var $0 = 48;
+var $7 = 55;
+var $9 = 57;
+var $A = 65;
+var $E = 69;
+var $F = 70;
+var $X = 88;
+var $Z = 90;
+var $LBRACKET = 91;
+var $BACKSLASH = 92;
+var $RBRACKET = 93;
+var $CARET = 94;
+var $_ = 95;
+var $a = 97;
+var $b = 98;
+var $e = 101;
+var $f = 102;
+var $n = 110;
+var $r = 114;
+var $t = 116;
+var $u = 117;
+var $v = 118;
+var $x = 120;
+var $z = 122;
+var $LBRACE = 123;
+var $BAR = 124;
+var $RBRACE = 125;
+var $NBSP = 160;
+var $AT = 64;
+var $BT = 96;
+function isWhitespace(code) {
+ return code >= $TAB && code <= $SPACE || code == $NBSP;
+}
+function isDigit(code) {
+ return $0 <= code && code <= $9;
+}
+function isAsciiLetter(code) {
+ return code >= $a && code <= $z || code >= $A && code <= $Z;
+}
+function isAsciiHexDigit(code) {
+ return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);
+}
+function isNewLine(code) {
+ return code === $LF || code === $CR;
+}
+function isOctalDigit(code) {
+ return $0 <= code && code <= $7;
+}
+function isQuote(code) {
+ return code === $SQ || code === $DQ || code === $BT;
+}
+var ParseLocation = class _ParseLocation {
+ file;
+ offset;
+ line;
+ col;
+ constructor(file, offset, line, col) {
+ this.file = file;
+ this.offset = offset;
+ this.line = line;
+ this.col = col;
+ }
+ toString() {
+ return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;
+ }
+ moveBy(delta) {
+ const source = this.file.content;
+ const len = source.length;
+ let offset = this.offset;
+ let line = this.line;
+ let col = this.col;
+ while (offset > 0 && delta < 0) {
+ offset--;
+ delta++;
+ const ch = source.charCodeAt(offset);
+ if (ch == $LF) {
+ line--;
+ const priorLine = source.substring(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
+ col = priorLine > 0 ? offset - priorLine : offset;
+ } else {
+ col--;
+ }
+ }
+ while (offset < len && delta > 0) {
+ const ch = source.charCodeAt(offset);
+ offset++;
+ delta--;
+ if (ch == $LF) {
+ line++;
+ col = 0;
+ } else {
+ col++;
+ }
+ }
+ return new _ParseLocation(this.file, offset, line, col);
+ }
+ // Return the source around the location
+ // Up to `maxChars` or `maxLines` on each side of the location
+ getContext(maxChars, maxLines) {
+ const content = this.file.content;
+ let startOffset = this.offset;
+ if (startOffset != null) {
+ if (startOffset > content.length - 1) {
+ startOffset = content.length - 1;
+ }
+ let endOffset = startOffset;
+ let ctxChars = 0;
+ let ctxLines = 0;
+ while (ctxChars < maxChars && startOffset > 0) {
+ startOffset--;
+ ctxChars++;
+ if (content[startOffset] == "\n") {
+ if (++ctxLines == maxLines) {
+ break;
+ }
+ }
+ }
+ ctxChars = 0;
+ ctxLines = 0;
+ while (ctxChars < maxChars && endOffset < content.length - 1) {
+ endOffset++;
+ ctxChars++;
+ if (content[endOffset] == "\n") {
+ if (++ctxLines == maxLines) {
+ break;
+ }
+ }
+ }
+ return {
+ before: content.substring(startOffset, this.offset),
+ after: content.substring(this.offset, endOffset + 1)
+ };
+ }
+ return null;
+ }
+};
+var ParseSourceFile = class {
+ content;
+ url;
+ constructor(content, url) {
+ this.content = content;
+ this.url = url;
+ }
+};
+var ParseSourceSpan = class {
+ start;
+ end;
+ fullStart;
+ details;
+ /**
+ * Create an object that holds information about spans of tokens/nodes captured during
+ * lexing/parsing of text.
+ *
+ * @param start
+ * The location of the start of the span (having skipped leading trivia).
+ * Skipping leading trivia makes source-spans more "user friendly", since things like HTML
+ * elements will appear to begin at the start of the opening tag, rather than at the start of any
+ * leading trivia, which could include newlines.
+ *
+ * @param end
+ * The location of the end of the span.
+ *
+ * @param fullStart
+ * The start of the token without skipping the leading trivia.
+ * This is used by tooling that splits tokens further, such as extracting Angular interpolations
+ * from text tokens. Such tooling creates new source-spans relative to the original token's
+ * source-span. If leading trivia characters have been skipped then the new source-spans may be
+ * incorrectly offset.
+ *
+ * @param details
+ * Additional information (such as identifier names) that should be associated with the span.
+ */
+ constructor(start, end, fullStart = start, details = null) {
+ this.start = start;
+ this.end = end;
+ this.fullStart = fullStart;
+ this.details = details;
+ }
+ toString() {
+ return this.start.file.content.substring(this.start.offset, this.end.offset);
+ }
+};
+var ParseErrorLevel;
+(function(ParseErrorLevel2) {
+ ParseErrorLevel2[ParseErrorLevel2["WARNING"] = 0] = "WARNING";
+ ParseErrorLevel2[ParseErrorLevel2["ERROR"] = 1] = "ERROR";
+})(ParseErrorLevel || (ParseErrorLevel = {}));
+var ParseError = class extends Error {
+ span;
+ msg;
+ level;
+ relatedError;
+ constructor(span, msg, level = ParseErrorLevel.ERROR, relatedError) {
+ super(msg);
+ this.span = span;
+ this.msg = msg;
+ this.level = level;
+ this.relatedError = relatedError;
+ Object.setPrototypeOf(this, new.target.prototype);
+ }
+ contextualMessage() {
+ const ctx = this.span.start.getContext(100, 3);
+ return ctx ? `${this.msg} ("${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}")` : this.msg;
+ }
+ toString() {
+ const details = this.span.details ? `, ${this.span.details}` : "";
+ return `${this.contextualMessage()}: ${this.span.start}${details}`;
+ }
+};
+function r3JitTypeSourceSpan(kind, typeName, sourceUrl) {
+ const sourceFileName = `in ${kind} ${typeName} in ${sourceUrl}`;
+ const sourceFile = new ParseSourceFile("", sourceFileName);
+ return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));
+}
+var _anonymousTypeIndex = 0;
+function identifierName(compileIdentifier) {
+ if (!compileIdentifier || !compileIdentifier.reference) {
+ return null;
+ }
+ const ref = compileIdentifier.reference;
+ if (ref["__anonymousType"]) {
+ return ref["__anonymousType"];
+ }
+ if (ref["__forward_ref__"]) {
+ return "__forward_ref__";
+ }
+ let identifier = stringify(ref);
+ if (identifier.indexOf("(") >= 0) {
+ identifier = `anonymous_${_anonymousTypeIndex++}`;
+ ref["__anonymousType"] = identifier;
+ } else {
+ identifier = sanitizeIdentifier(identifier);
+ }
+ return identifier;
+}
+function sanitizeIdentifier(name) {
+ return name.replace(/\W/g, "_");
+}
+var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
+var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
+ constructor() {
+ super(false);
+ }
+ visitWrappedNodeExpr(ast, ctx) {
+ throw new Error("Cannot emit a WrappedNodeExpr in Javascript.");
+ }
+ visitDeclareVarStmt(stmt, ctx) {
+ ctx.print(stmt, `var ${stmt.name}`);
+ if (stmt.value) {
+ ctx.print(stmt, " = ");
+ stmt.value.visitExpression(this, ctx);
+ }
+ ctx.println(stmt, `;`);
+ return null;
+ }
+ visitTaggedTemplateLiteralExpr(ast, ctx) {
+ const elements = ast.template.elements;
+ ast.tag.visitExpression(this, ctx);
+ ctx.print(ast, `(${makeTemplateObjectPolyfill}(`);
+ ctx.print(ast, `[${elements.map((part) => escapeIdentifier(part.text, false)).join(", ")}], `);
+ ctx.print(ast, `[${elements.map((part) => escapeIdentifier(part.rawText, false)).join(", ")}])`);
+ ast.template.expressions.forEach((expression) => {
+ ctx.print(ast, ", ");
+ expression.visitExpression(this, ctx);
+ });
+ ctx.print(ast, ")");
+ return null;
+ }
+ visitTemplateLiteralExpr(expr, ctx) {
+ ctx.print(expr, "`");
+ for (let i = 0; i < expr.elements.length; i++) {
+ expr.elements[i].visitExpression(this, ctx);
+ const expression = i < expr.expressions.length ? expr.expressions[i] : null;
+ if (expression !== null) {
+ ctx.print(expression, "${");
+ expression.visitExpression(this, ctx);
+ ctx.print(expression, "}");
+ }
+ }
+ ctx.print(expr, "`");
+ }
+ visitTemplateLiteralElementExpr(expr, ctx) {
+ ctx.print(expr, expr.rawText);
+ return null;
+ }
+ visitFunctionExpr(ast, ctx) {
+ ctx.print(ast, `function${ast.name ? " " + ast.name : ""}(`);
+ this._visitParams(ast.params, ctx);
+ ctx.println(ast, `) {`);
+ ctx.incIndent();
+ this.visitAllStatements(ast.statements, ctx);
+ ctx.decIndent();
+ ctx.print(ast, `}`);
+ return null;
+ }
+ visitArrowFunctionExpr(ast, ctx) {
+ ctx.print(ast, "(");
+ this._visitParams(ast.params, ctx);
+ ctx.print(ast, ") =>");
+ if (Array.isArray(ast.body)) {
+ ctx.println(ast, `{`);
+ ctx.incIndent();
+ this.visitAllStatements(ast.body, ctx);
+ ctx.decIndent();
+ ctx.print(ast, `}`);
+ } else {
+ const isObjectLiteral = ast.body instanceof LiteralMapExpr;
+ if (isObjectLiteral) {
+ ctx.print(ast, "(");
+ }
+ ast.body.visitExpression(this, ctx);
+ if (isObjectLiteral) {
+ ctx.print(ast, ")");
+ }
+ }
+ return null;
+ }
+ visitDeclareFunctionStmt(stmt, ctx) {
+ ctx.print(stmt, `function ${stmt.name}(`);
+ this._visitParams(stmt.params, ctx);
+ ctx.println(stmt, `) {`);
+ ctx.incIndent();
+ this.visitAllStatements(stmt.statements, ctx);
+ ctx.decIndent();
+ ctx.println(stmt, `}`);
+ return null;
+ }
+ visitLocalizedString(ast, ctx) {
+ ctx.print(ast, `$localize(${makeTemplateObjectPolyfill}(`);
+ const parts = [ast.serializeI18nHead()];
+ for (let i = 1; i < ast.messageParts.length; i++) {
+ parts.push(ast.serializeI18nTemplatePart(i));
+ }
+ ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.cooked, false)).join(", ")}], `);
+ ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.raw, false)).join(", ")}])`);
+ ast.expressions.forEach((expression) => {
+ ctx.print(ast, ", ");
+ expression.visitExpression(this, ctx);
+ });
+ ctx.print(ast, ")");
+ return null;
+ }
+ _visitParams(params, ctx) {
+ this.visitAllObjects((param) => ctx.print(null, param.name), params, ctx, ",");
+ }
+};
+var policy;
+function getPolicy() {
+ if (policy === void 0) {
+ const trustedTypes = _global["trustedTypes"];
+ policy = null;
+ if (trustedTypes) {
+ try {
+ policy = trustedTypes.createPolicy("angular#unsafe-jit", {
+ createScript: (s) => s
+ });
+ } catch {
+ }
+ }
+ }
+ return policy;
+}
+function trustedScriptFromString(script) {
+ return getPolicy()?.createScript(script) || script;
+}
+function newTrustedFunctionForJIT(...args) {
+ if (!_global["trustedTypes"]) {
+ return new Function(...args);
+ }
+ const fnArgs = args.slice(0, -1).join(",");
+ const fnBody = args[args.length - 1];
+ const body = `(function anonymous(${fnArgs}
+) { ${fnBody}
+})`;
+ const fn2 = _global["eval"](trustedScriptFromString(body));
+ if (fn2.bind === void 0) {
+ return new Function(...args);
+ }
+ fn2.toString = () => body;
+ return fn2.bind(_global);
+}
+var JitEvaluator = class {
+ /**
+ *
+ * @param sourceUrl The URL of the generated code.
+ * @param statements An array of Angular statement AST nodes to be evaluated.
+ * @param refResolver Resolves `o.ExternalReference`s into values.
+ * @param createSourceMaps If true then create a source-map for the generated code and include it
+ * inline as a source-map comment.
+ * @returns A map of all the variables in the generated code.
+ */
+ evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
+ const converter = new JitEmitterVisitor(refResolver);
+ const ctx = EmitterVisitorContext.createRoot();
+ if (statements.length > 0 && !isUseStrictStatement(statements[0])) {
+ statements = [literal("use strict").toStmt(), ...statements];
+ }
+ converter.visitAllStatements(statements, ctx);
+ converter.createReturnStmt(ctx);
+ return this.evaluateCode(sourceUrl, ctx, converter.getArgs(), createSourceMaps);
+ }
+ /**
+ * Evaluate a piece of JIT generated code.
+ * @param sourceUrl The URL of this generated code.
+ * @param ctx A context object that contains an AST of the code to be evaluated.
+ * @param vars A map containing the names and values of variables that the evaluated code might
+ * reference.
+ * @param createSourceMap If true then create a source-map for the generated code and include it
+ * inline as a source-map comment.
+ * @returns The result of evaluating the code.
+ */
+ evaluateCode(sourceUrl, ctx, vars, createSourceMap) {
+ let fnBody = `"use strict";${ctx.toSource()}
+//# sourceURL=${sourceUrl}`;
+ const fnArgNames = [];
+ const fnArgValues = [];
+ for (const argName in vars) {
+ fnArgValues.push(vars[argName]);
+ fnArgNames.push(argName);
+ }
+ if (createSourceMap) {
+ const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat("return null;")).toString();
+ const headerLines = emptyFn.slice(0, emptyFn.indexOf("return null;")).split("\n").length - 1;
+ fnBody += `
+${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;
+ }
+ const fn2 = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));
+ return this.executeFunction(fn2, fnArgValues);
+ }
+ /**
+ * Execute a JIT generated function by calling it.
+ *
+ * This method can be overridden in tests to capture the functions that are generated
+ * by this `JitEvaluator` class.
+ *
+ * @param fn A function to execute.
+ * @param args The arguments to pass to the function being executed.
+ * @returns The return value of the executed function.
+ */
+ executeFunction(fn2, args) {
+ return fn2(...args);
+ }
+};
+var JitEmitterVisitor = class extends AbstractJsEmitterVisitor {
+ refResolver;
+ _evalArgNames = [];
+ _evalArgValues = [];
+ _evalExportedVars = [];
+ constructor(refResolver) {
+ super();
+ this.refResolver = refResolver;
+ }
+ createReturnStmt(ctx) {
+ const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new LiteralMapEntry(resultVar, variable(resultVar), false))));
+ stmt.visitStatement(this, ctx);
+ }
+ getArgs() {
+ const result = {};
+ for (let i = 0; i < this._evalArgNames.length; i++) {
+ result[this._evalArgNames[i]] = this._evalArgValues[i];
+ }
+ return result;
+ }
+ visitExternalExpr(ast, ctx) {
+ this._emitReferenceToExternal(ast, this.refResolver.resolveExternalReference(ast.value), ctx);
+ return null;
+ }
+ visitWrappedNodeExpr(ast, ctx) {
+ this._emitReferenceToExternal(ast, ast.node, ctx);
+ return null;
+ }
+ visitDeclareVarStmt(stmt, ctx) {
+ if (stmt.hasModifier(StmtModifier.Exported)) {
+ this._evalExportedVars.push(stmt.name);
+ }
+ return super.visitDeclareVarStmt(stmt, ctx);
+ }
+ visitDeclareFunctionStmt(stmt, ctx) {
+ if (stmt.hasModifier(StmtModifier.Exported)) {
+ this._evalExportedVars.push(stmt.name);
+ }
+ return super.visitDeclareFunctionStmt(stmt, ctx);
+ }
+ _emitReferenceToExternal(ast, value, ctx) {
+ let id = this._evalArgValues.indexOf(value);
+ if (id === -1) {
+ id = this._evalArgValues.length;
+ this._evalArgValues.push(value);
+ const name = identifierName({ reference: value }) || "val";
+ this._evalArgNames.push(`jit_${name}_${id}`);
+ }
+ ctx.print(ast, this._evalArgNames[id]);
+ }
+};
+function isUseStrictStatement(statement) {
+ return statement.isEquivalent(literal("use strict").toStmt());
+}
+function compileInjector(meta) {
+ const definitionMap = new DefinitionMap();
+ if (meta.providers !== null) {
+ definitionMap.set("providers", meta.providers);
+ }
+ if (meta.imports.length > 0) {
+ definitionMap.set("imports", literalArr(meta.imports));
+ }
+ const expression = importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()], void 0, true);
+ const type = createInjectorType(meta);
+ return { expression, type, statements: [] };
+}
+function createInjectorType(meta) {
+ return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
+}
+var R3JitReflector = class {
+ context;
+ constructor(context) {
+ this.context = context;
+ }
+ resolveExternalReference(ref) {
+ if (ref.moduleName !== "@angular/core") {
+ throw new Error(`Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`);
+ }
+ if (!this.context.hasOwnProperty(ref.name)) {
+ throw new Error(`No value provided for @angular/core symbol '${ref.name}'.`);
+ }
+ return this.context[ref.name];
+ }
+};
+var R3SelectorScopeMode;
+(function(R3SelectorScopeMode2) {
+ R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
+ R3SelectorScopeMode2[R3SelectorScopeMode2["SideEffect"] = 1] = "SideEffect";
+ R3SelectorScopeMode2[R3SelectorScopeMode2["Omit"] = 2] = "Omit";
+})(R3SelectorScopeMode || (R3SelectorScopeMode = {}));
+var R3NgModuleMetadataKind;
+(function(R3NgModuleMetadataKind2) {
+ R3NgModuleMetadataKind2[R3NgModuleMetadataKind2["Global"] = 0] = "Global";
+ R3NgModuleMetadataKind2[R3NgModuleMetadataKind2["Local"] = 1] = "Local";
+})(R3NgModuleMetadataKind || (R3NgModuleMetadataKind = {}));
+function compileNgModule(meta) {
+ const statements = [];
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("type", meta.type.value);
+ if (meta.kind === R3NgModuleMetadataKind.Global && meta.bootstrap.length > 0) {
+ definitionMap.set("bootstrap", refsToArray(meta.bootstrap, meta.containsForwardDecls));
+ }
+ if (meta.selectorScopeMode === R3SelectorScopeMode.Inline) {
+ if (meta.declarations.length > 0) {
+ definitionMap.set("declarations", refsToArray(meta.declarations, meta.containsForwardDecls));
+ }
+ if (meta.imports.length > 0) {
+ definitionMap.set("imports", refsToArray(meta.imports, meta.containsForwardDecls));
+ }
+ if (meta.exports.length > 0) {
+ definitionMap.set("exports", refsToArray(meta.exports, meta.containsForwardDecls));
+ }
+ } else if (meta.selectorScopeMode === R3SelectorScopeMode.SideEffect) {
+ const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);
+ if (setNgModuleScopeCall !== null) {
+ statements.push(setNgModuleScopeCall);
+ }
+ } else ;
+ if (meta.schemas !== null && meta.schemas.length > 0) {
+ definitionMap.set("schemas", literalArr(meta.schemas.map((ref) => ref.value)));
+ }
+ if (meta.id !== null) {
+ definitionMap.set("id", meta.id);
+ statements.push(importExpr(Identifiers.registerNgModuleType).callFn([meta.type.value, meta.id]).toStmt());
+ }
+ const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], void 0, true);
+ const type = createNgModuleType(meta);
+ return { expression, type, statements };
+}
+function compileNgModuleDeclarationExpression(meta) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("type", new WrappedNodeExpr(meta.type));
+ if (meta.bootstrap !== void 0) {
+ definitionMap.set("bootstrap", new WrappedNodeExpr(meta.bootstrap));
+ }
+ if (meta.declarations !== void 0) {
+ definitionMap.set("declarations", new WrappedNodeExpr(meta.declarations));
+ }
+ if (meta.imports !== void 0) {
+ definitionMap.set("imports", new WrappedNodeExpr(meta.imports));
+ }
+ if (meta.exports !== void 0) {
+ definitionMap.set("exports", new WrappedNodeExpr(meta.exports));
+ }
+ if (meta.schemas !== void 0) {
+ definitionMap.set("schemas", new WrappedNodeExpr(meta.schemas));
+ }
+ if (meta.id !== void 0) {
+ definitionMap.set("id", new WrappedNodeExpr(meta.id));
+ }
+ return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);
+}
+function createNgModuleType(meta) {
+ if (meta.kind === R3NgModuleMetadataKind.Local) {
+ return new ExpressionType(meta.type.value);
+ }
+ const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes } = meta;
+ return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [
+ new ExpressionType(moduleType.type),
+ publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes),
+ includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,
+ tupleTypeOf(exports)
+ ]));
+}
+function generateSetNgModuleScopeCall(meta) {
+ const scopeMap = new DefinitionMap();
+ if (meta.kind === R3NgModuleMetadataKind.Global) {
+ if (meta.declarations.length > 0) {
+ scopeMap.set("declarations", refsToArray(meta.declarations, meta.containsForwardDecls));
+ }
+ } else {
+ if (meta.declarationsExpression) {
+ scopeMap.set("declarations", meta.declarationsExpression);
+ }
+ }
+ if (meta.kind === R3NgModuleMetadataKind.Global) {
+ if (meta.imports.length > 0) {
+ scopeMap.set("imports", refsToArray(meta.imports, meta.containsForwardDecls));
+ }
+ } else {
+ if (meta.importsExpression) {
+ scopeMap.set("imports", meta.importsExpression);
+ }
+ }
+ if (meta.kind === R3NgModuleMetadataKind.Global) {
+ if (meta.exports.length > 0) {
+ scopeMap.set("exports", refsToArray(meta.exports, meta.containsForwardDecls));
+ }
+ } else {
+ if (meta.exportsExpression) {
+ scopeMap.set("exports", meta.exportsExpression);
+ }
+ }
+ if (meta.kind === R3NgModuleMetadataKind.Local && meta.bootstrapExpression) {
+ scopeMap.set("bootstrap", meta.bootstrapExpression);
+ }
+ if (Object.keys(scopeMap.values).length === 0) {
+ return null;
+ }
+ const fnCall = new InvokeFunctionExpr(
+ /* fn */
+ importExpr(Identifiers.setNgModuleScope),
+ /* args */
+ [meta.type.value, scopeMap.toLiteralMap()]
+ );
+ const guardedCall = jitOnlyGuardedExpression(fnCall);
+ const iife = new FunctionExpr(
+ /* params */
+ [],
+ /* statements */
+ [guardedCall.toStmt()]
+ );
+ const iifeCall = new InvokeFunctionExpr(
+ /* fn */
+ iife,
+ /* args */
+ []
+ );
+ return iifeCall.toStmt();
+}
+function tupleTypeOf(exp) {
+ const types = exp.map((ref) => typeofExpr(ref.type));
+ return exp.length > 0 ? expressionType(literalArr(types)) : NONE_TYPE;
+}
+function tupleOfTypes(types) {
+ const typeofTypes = types.map((type) => typeofExpr(type));
+ return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
+}
+function compilePipeFromMetadata(metadata) {
+ const definitionMapValues = [];
+ definitionMapValues.push({
+ key: "name",
+ value: literal(metadata.pipeName ?? metadata.name),
+ quoted: false
+ });
+ definitionMapValues.push({ key: "type", value: metadata.type.value, quoted: false });
+ definitionMapValues.push({ key: "pure", value: literal(metadata.pure), quoted: false });
+ if (metadata.isStandalone === false) {
+ definitionMapValues.push({ key: "standalone", value: literal(false), quoted: false });
+ }
+ const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], void 0, true);
+ const type = createPipeType(metadata);
+ return { expression, type, statements: [] };
+}
+function createPipeType(metadata) {
+ return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
+ typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
+ new ExpressionType(new LiteralExpr(metadata.pipeName)),
+ new ExpressionType(new LiteralExpr(metadata.isStandalone))
+ ]));
+}
+var R3TemplateDependencyKind;
+(function(R3TemplateDependencyKind2) {
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["Pipe"] = 1] = "Pipe";
+ R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
+})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
+var animationKeywords = /* @__PURE__ */ new Set([
+ // global values
+ "inherit",
+ "initial",
+ "revert",
+ "unset",
+ // animation-direction
+ "alternate",
+ "alternate-reverse",
+ "normal",
+ "reverse",
+ // animation-fill-mode
+ "backwards",
+ "both",
+ "forwards",
+ "none",
+ // animation-play-state
+ "paused",
+ "running",
+ // animation-timing-function
+ "ease",
+ "ease-in",
+ "ease-in-out",
+ "ease-out",
+ "linear",
+ "step-start",
+ "step-end",
+ // `steps()` function
+ "end",
+ "jump-both",
+ "jump-end",
+ "jump-none",
+ "jump-start",
+ "start"
+]);
+var scopedAtRuleIdentifiers = [
+ "@media",
+ "@supports",
+ "@document",
+ "@layer",
+ "@container",
+ "@scope",
+ "@starting-style"
+];
+var ShadowCss = class {
+ /*
+ * Shim some cssText with the given selector. Returns cssText that can be included in the document
+ *
+ * The selector is the attribute added to all elements inside the host,
+ * The hostSelector is the attribute added to the host itself.
+ */
+ shimCssText(cssText, selector, hostSelector = "") {
+ const comments = [];
+ cssText = cssText.replace(_commentRe, (m) => {
+ if (m.match(_commentWithHashRe)) {
+ comments.push(m);
+ } else {
+ const newLinesMatches = m.match(_newLinesRe);
+ comments.push((newLinesMatches?.join("") ?? "") + "\n");
+ }
+ return COMMENT_PLACEHOLDER;
+ });
+ cssText = this._insertDirectives(cssText);
+ const scopedCssText = this._scopeCssText(cssText, selector, hostSelector);
+ let commentIdx = 0;
+ return scopedCssText.replace(_commentWithHashPlaceHolderRe, () => comments[commentIdx++]);
+ }
+ _insertDirectives(cssText) {
+ cssText = this._insertPolyfillDirectivesInCssText(cssText);
+ return this._insertPolyfillRulesInCssText(cssText);
+ }
+ /**
+ * Process styles to add scope to keyframes.
+ *
+ * Modify both the names of the keyframes defined in the component styles and also the css
+ * animation rules using them.
+ *
+ * Animation rules using keyframes defined elsewhere are not modified to allow for globally
+ * defined keyframes.
+ *
+ * For example, we convert this css:
+ *
+ * ```scss
+ * .box {
+ * animation: box-animation 1s forwards;
+ * }
+ *
+ * @keyframes box-animation {
+ * to {
+ * background-color: green;
+ * }
+ * }
+ * ```
+ *
+ * to this:
+ *
+ * ```scss
+ * .box {
+ * animation: scopeName_box-animation 1s forwards;
+ * }
+ *
+ * @keyframes scopeName_box-animation {
+ * to {
+ * background-color: green;
+ * }
+ * }
+ * ```
+ *
+ * @param cssText the component's css text that needs to be scoped.
+ * @param scopeSelector the component's scope selector.
+ *
+ * @returns the scoped css text.
+ */
+ _scopeKeyframesRelatedCss(cssText, scopeSelector) {
+ const unscopedKeyframesSet = /* @__PURE__ */ new Set();
+ const scopedKeyframesCssText = processRules(cssText, (rule) => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));
+ return processRules(scopedKeyframesCssText, (rule) => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));
+ }
+ /**
+ * Scopes local keyframes names, returning the updated css rule and it also
+ * adds the original keyframe name to a provided set to collect all keyframes names
+ * so that it can later be used to scope the animation rules.
+ *
+ * For example, it takes a rule such as:
+ *
+ * ```scss
+ * @keyframes box-animation {
+ * to {
+ * background-color: green;
+ * }
+ * }
+ * ```
+ *
+ * and returns:
+ *
+ * ```scss
+ * @keyframes scopeName_box-animation {
+ * to {
+ * background-color: green;
+ * }
+ * }
+ * ```
+ * and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set
+ *
+ * @param cssRule the css rule to process.
+ * @param scopeSelector the component's scope selector.
+ * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be
+ * modified as a side effect)
+ *
+ * @returns the css rule modified with the scoped keyframes name.
+ */
+ _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
+ return __spreadProps(__spreadValues({}, rule), {
+ selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
+ unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
+ return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
+ })
+ });
+ }
+ /**
+ * Function used to scope a keyframes name (obtained from an animation declaration)
+ * using an existing set of unscopedKeyframes names to discern if the scoping needs to be
+ * performed (keyframes names of keyframes not defined in the component's css need not to be
+ * scoped).
+ *
+ * @param keyframe the keyframes name to check.
+ * @param scopeSelector the component's scope selector.
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
+ *
+ * @returns the scoped name of the keyframe, or the original name is the name need not to be
+ * scoped.
+ */
+ _scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {
+ return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
+ name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + "_" : ""}${name}`;
+ return `${spaces1}${quote}${name}${quote}${spaces2}`;
+ });
+ }
+ /**
+ * Regular expression used to extrapolate the possible keyframes from an
+ * animation declaration (with possibly multiple animation definitions)
+ *
+ * The regular expression can be divided in three parts
+ * - (^|\s+|,)
+ * captures how many (if any) leading whitespaces are present or a comma
+ * - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
+ * captures two different possible keyframes, ones which are quoted or ones which are valid css
+ * indents (custom properties excluded)
+ * - (?=[,\s;]|$)
+ * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
+ * semicolon or the end of the string
+ */
+ _animationDeclarationKeyframesRe = /(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
+ /**
+ * Scope an animation rule so that the keyframes mentioned in such rule
+ * are scoped if defined in the component's css and left untouched otherwise.
+ *
+ * It can scope values of both the 'animation' and 'animation-name' properties.
+ *
+ * @param rule css rule to scope.
+ * @param scopeSelector the component's scope selector.
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
+ *
+ * @returns the updated css rule.
+ **/
+ _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
+ let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
+ if (quotedName) {
+ return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
+ } else {
+ return animationKeywords.has(nonQuotedName) ? original : `${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;
+ }
+ }));
+ content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(",").map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet)).join(",")}`);
+ return __spreadProps(__spreadValues({}, rule), { content });
+ }
+ /*
+ * Process styles to convert native ShadowDOM rules that will trip
+ * up the css parser; we rely on decorating the stylesheet with inert rules.
+ *
+ * For example, we convert this rule:
+ *
+ * polyfill-next-selector { content: ':host menu-item'; }
+ * ::content menu-item {
+ *
+ * to this:
+ *
+ * scopeName menu-item {
+ *
+ **/
+ _insertPolyfillDirectivesInCssText(cssText) {
+ return cssText.replace(_cssContentNextSelectorRe, function(...m) {
+ return m[2] + "{";
+ });
+ }
+ /*
+ * Process styles to add rules which will only apply under the polyfill
+ *
+ * For example, we convert this rule:
+ *
+ * polyfill-rule {
+ * content: ':host menu-item';
+ * ...
+ * }
+ *
+ * to this:
+ *
+ * scopeName menu-item {...}
+ *
+ **/
+ _insertPolyfillRulesInCssText(cssText) {
+ return cssText.replace(_cssContentRuleRe, (...m) => {
+ const rule = m[0].replace(m[1], "").replace(m[2], "");
+ return m[4] + rule;
+ });
+ }
+ /* Ensure styles are scoped. Pseudo-scoping takes a rule like:
+ *
+ * .foo {... }
+ *
+ * and converts this to
+ *
+ * scopeName .foo { ... }
+ */
+ _scopeCssText(cssText, scopeSelector, hostSelector) {
+ const unscopedRules = this._extractUnscopedRulesFromCssText(cssText);
+ cssText = this._insertPolyfillHostInCssText(cssText);
+ cssText = this._convertColonHost(cssText);
+ cssText = this._convertColonHostContext(cssText);
+ cssText = this._convertShadowDOMSelectors(cssText);
+ if (scopeSelector) {
+ cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);
+ cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
+ }
+ cssText = cssText + "\n" + unscopedRules;
+ return cssText.trim();
+ }
+ /*
+ * Process styles to add rules which will only apply under the polyfill
+ * and do not process via CSSOM. (CSSOM is destructive to rules on rare
+ * occasions, e.g. -webkit-calc on Safari.)
+ * For example, we convert this rule:
+ *
+ * @polyfill-unscoped-rule {
+ * content: 'menu-item';
+ * ... }
+ *
+ * to this:
+ *
+ * menu-item {...}
+ *
+ **/
+ _extractUnscopedRulesFromCssText(cssText) {
+ let r = "";
+ let m;
+ _cssContentUnscopedRuleRe.lastIndex = 0;
+ while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {
+ const rule = m[0].replace(m[2], "").replace(m[1], m[4]);
+ r += rule + "\n\n";
+ }
+ return r;
+ }
+ /*
+ * convert a rule like :host(.foo) > .bar { }
+ *
+ * to
+ *
+ * .foo > .bar
+ */
+ _convertColonHost(cssText) {
+ return cssText.replace(_cssColonHostRe, (_, hostSelectors, otherSelectors) => {
+ if (hostSelectors) {
+ const convertedSelectors = [];
+ const hostSelectorArray = hostSelectors.split(",").map((p) => p.trim());
+ for (const hostSelector of hostSelectorArray) {
+ if (!hostSelector)
+ break;
+ const convertedSelector = _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, "") + otherSelectors;
+ convertedSelectors.push(convertedSelector);
+ }
+ return convertedSelectors.join(",");
+ } else {
+ return _polyfillHostNoCombinator + otherSelectors;
+ }
+ });
+ }
+ /*
+ * convert a rule like :host-context(.foo) > .bar { }
+ *
+ * to
+ *
+ * .foo > .bar, .foo > .bar { }
+ *
+ * and
+ *
+ * :host-context(.foo:host) .bar { ... }
+ *
+ * to
+ *
+ * .foo .bar { ... }
+ */
+ _convertColonHostContext(cssText) {
+ const length = cssText.length;
+ let parens = 0;
+ let prev = 0;
+ let result = "";
+ for (let i = 0; i < length; i++) {
+ const char = cssText[i];
+ if (char === "," && parens === 0) {
+ result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ",";
+ prev = i + 1;
+ continue;
+ }
+ if (i === length - 1) {
+ result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));
+ break;
+ }
+ if (char === "(") {
+ parens++;
+ } else if (char === ")") {
+ parens--;
+ }
+ }
+ return result;
+ }
+ _convertColonHostContextInSelectorPart(cssText) {
+ return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
+ const contextSelectorGroups = [[]];
+ let match;
+ while (match = _cssColonHostContextRe.exec(selectorText)) {
+ const newContextSelectors = (match[1] ?? "").trim().split(",").map((m) => m.trim()).filter((m) => m !== "");
+ const contextSelectorGroupsLength = contextSelectorGroups.length;
+ repeatGroups(contextSelectorGroups, newContextSelectors.length);
+ for (let i = 0; i < newContextSelectors.length; i++) {
+ for (let j = 0; j < contextSelectorGroupsLength; j++) {
+ contextSelectorGroups[j + i * contextSelectorGroupsLength].push(newContextSelectors[i]);
+ }
+ }
+ selectorText = match[2];
+ }
+ return contextSelectorGroups.map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix)).join(", ");
+ });
+ }
+ /*
+ * Convert combinators like ::shadow and pseudo-elements like ::content
+ * by replacing with space.
+ */
+ _convertShadowDOMSelectors(cssText) {
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, " "), cssText);
+ }
+ // change a selector like 'div' to 'name div'
+ _scopeSelectors(cssText, scopeSelector, hostSelector) {
+ return processRules(cssText, (rule) => {
+ let selector = rule.selector;
+ let content = rule.content;
+ if (rule.selector[0] !== "@") {
+ selector = this._scopeSelector({
+ selector,
+ scopeSelector,
+ hostSelector,
+ isParentSelector: true
+ });
+ } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
+ content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
+ } else if (rule.selector.startsWith("@font-face") || rule.selector.startsWith("@page")) {
+ content = this._stripScopingSelectors(rule.content);
+ }
+ return new CssRule(selector, content);
+ });
+ }
+ /**
+ * Handle a css text that is within a rule that should not contain scope selectors by simply
+ * removing them! An example of such a rule is `@font-face`.
+ *
+ * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.
+ * Normally this would be a syntax error by the author of the styles. But in some rare cases, such
+ * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we
+ * can end up with broken css if the imported styles happen to contain @font-face rules.
+ *
+ * For example:
+ *
+ * ```
+ * :host ::ng-deep {
+ * import 'some/lib/containing/font-face';
+ * }
+ *
+ * Similar logic applies to `@page` rules which can contain a particular set of properties,
+ * as well as some specific at-rules. Since they can't be encapsulated, we have to strip
+ * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3
+ * ```
+ */
+ _stripScopingSelectors(cssText) {
+ return processRules(cssText, (rule) => {
+ const selector = rule.selector.replace(_shadowDeepSelectors, " ").replace(_polyfillHostNoCombinatorRe, " ");
+ return new CssRule(selector, rule.content);
+ });
+ }
+ _safeSelector;
+ _shouldScopeIndicator;
+ // `isParentSelector` is used to distinguish the selectors which are coming from
+ // the initial selector string and any nested selectors, parsed recursively,
+ // for example `selector = 'a:where(.one)'` could be the parent, while recursive call
+ // would have `selector = '.one'`.
+ _scopeSelector({ selector, scopeSelector, hostSelector, isParentSelector = false }) {
+ const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;
+ return selector.split(selectorSplitRe).map((part) => part.split(_shadowDeepSelectors)).map((deepParts) => {
+ const [shallowPart, ...otherParts] = deepParts;
+ const applyScope = (shallowPart2) => {
+ if (this._selectorNeedsScoping(shallowPart2, scopeSelector)) {
+ return this._applySelectorScope({
+ selector: shallowPart2,
+ scopeSelector,
+ hostSelector,
+ isParentSelector
+ });
+ } else {
+ return shallowPart2;
+ }
+ };
+ return [applyScope(shallowPart), ...otherParts].join(" ");
+ }).join(", ");
+ }
+ _selectorNeedsScoping(selector, scopeSelector) {
+ const re = this._makeScopeMatcher(scopeSelector);
+ return !re.test(selector);
+ }
+ _makeScopeMatcher(scopeSelector) {
+ const lre = /\[/g;
+ const rre = /\]/g;
+ scopeSelector = scopeSelector.replace(lre, "\\[").replace(rre, "\\]");
+ return new RegExp("^(" + scopeSelector + ")" + _selectorReSuffix, "m");
+ }
+ // scope via name and [is=name]
+ _applySimpleSelectorScope(selector, scopeSelector, hostSelector) {
+ _polyfillHostRe.lastIndex = 0;
+ if (_polyfillHostRe.test(selector)) {
+ const replaceBy = `[${hostSelector}]`;
+ let result = selector;
+ while (result.match(_polyfillHostNoCombinatorRe)) {
+ result = result.replace(_polyfillHostNoCombinatorRe, (_hnc, selector2) => {
+ return selector2.replace(/([^:\)]*)(:*)(.*)/, (_, before, colon, after) => {
+ return before + replaceBy + colon + after;
+ });
+ });
+ }
+ return result.replace(_polyfillHostRe, replaceBy);
+ }
+ return scopeSelector + " " + selector;
+ }
+ // return a selector with [name] suffix on each simple selector
+ // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
+ _applySelectorScope({ selector, scopeSelector, hostSelector, isParentSelector }) {
+ const isRe = /\[is=([^\]]*)\]/g;
+ scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
+ const attrName = `[${scopeSelector}]`;
+ const _scopeSelectorPart = (p) => {
+ let scopedP = p.trim();
+ if (!scopedP) {
+ return p;
+ }
+ if (p.includes(_polyfillHostNoCombinator)) {
+ scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
+ if (!p.match(_polyfillHostNoCombinatorOutsidePseudoFunction)) {
+ const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)([\s\S]*)/);
+ scopedP = before + attrName + colon + after;
+ }
+ } else {
+ const t = p.replace(_polyfillHostRe, "");
+ if (t.length > 0) {
+ const matches = t.match(/([^:]*)(:*)([\s\S]*)/);
+ if (matches) {
+ scopedP = matches[1] + attrName + matches[2] + matches[3];
+ }
+ }
+ }
+ return scopedP;
+ };
+ const _pseudoFunctionAwareScopeSelectorPart = (selectorPart) => {
+ let scopedPart = "";
+ const pseudoSelectorParts = [];
+ let pseudoSelectorMatch;
+ while ((pseudoSelectorMatch = _cssPrefixWithPseudoSelectorFunction.exec(selectorPart)) !== null) {
+ let openedBrackets = 1;
+ let index = _cssPrefixWithPseudoSelectorFunction.lastIndex;
+ while (index < selectorPart.length) {
+ const currentSymbol = selectorPart[index];
+ index++;
+ if (currentSymbol === "(") {
+ openedBrackets++;
+ continue;
+ }
+ if (currentSymbol === ")") {
+ openedBrackets--;
+ if (openedBrackets === 0) {
+ break;
+ }
+ continue;
+ }
+ }
+ pseudoSelectorParts.push(`${pseudoSelectorMatch[0]}${selectorPart.slice(_cssPrefixWithPseudoSelectorFunction.lastIndex, index)}`);
+ _cssPrefixWithPseudoSelectorFunction.lastIndex = index;
+ }
+ if (pseudoSelectorParts.join("") === selectorPart) {
+ scopedPart = pseudoSelectorParts.map((selectorPart2) => {
+ const [cssPseudoSelectorFunction] = selectorPart2.match(_cssPrefixWithPseudoSelectorFunction) ?? [];
+ const selectorToScope = selectorPart2.slice(cssPseudoSelectorFunction?.length, -1);
+ if (selectorToScope.includes(_polyfillHostNoCombinator)) {
+ this._shouldScopeIndicator = true;
+ }
+ const scopedInnerPart = this._scopeSelector({
+ selector: selectorToScope,
+ scopeSelector,
+ hostSelector
+ });
+ return `${cssPseudoSelectorFunction}${scopedInnerPart})`;
+ }).join("");
+ } else {
+ this._shouldScopeIndicator = this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);
+ scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;
+ }
+ return scopedPart;
+ };
+ if (isParentSelector) {
+ this._safeSelector = new SafeSelector(selector);
+ selector = this._safeSelector.content();
+ }
+ let scopedSelector = "";
+ let startIndex = 0;
+ let res;
+ const sep = /( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g;
+ const hasHost = selector.includes(_polyfillHostNoCombinator);
+ if (isParentSelector || this._shouldScopeIndicator) {
+ this._shouldScopeIndicator = !hasHost;
+ }
+ while ((res = sep.exec(selector)) !== null) {
+ const separator = res[1];
+ const part2 = selector.slice(startIndex, res.index);
+ if (part2.match(/__esc-ph-(\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\d]/)) {
+ continue;
+ }
+ const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part2);
+ scopedSelector += `${scopedPart} ${separator} `;
+ startIndex = sep.lastIndex;
+ }
+ const part = selector.substring(startIndex);
+ scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);
+ return this._safeSelector.restore(scopedSelector);
+ }
+ _insertPolyfillHostInCssText(selector) {
+ return selector.replace(_colonHostContextRe, _polyfillHostContext).replace(_colonHostRe, _polyfillHost);
+ }
+};
+var SafeSelector = class {
+ placeholders = [];
+ index = 0;
+ _content;
+ constructor(selector) {
+ selector = this._escapeRegexMatches(selector, /(\[[^\]]*\])/g);
+ selector = selector.replace(/(\\.)/g, (_, keep) => {
+ const replaceBy = `__esc-ph-${this.index}__`;
+ this.placeholders.push(keep);
+ this.index++;
+ return replaceBy;
+ });
+ this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
+ const replaceBy = `__ph-${this.index}__`;
+ this.placeholders.push(exp);
+ this.index++;
+ return pseudo + replaceBy;
+ });
+ }
+ restore(content) {
+ return content.replace(/__(?:ph|esc-ph)-(\d+)__/g, (_ph, index) => this.placeholders[+index]);
+ }
+ content() {
+ return this._content;
+ }
+ /**
+ * Replaces all of the substrings that match a regex within a
+ * special string (e.g. `__ph-0__`, `__ph-1__`, etc).
+ */
+ _escapeRegexMatches(content, pattern) {
+ return content.replace(pattern, (_, keep) => {
+ const replaceBy = `__ph-${this.index}__`;
+ this.placeholders.push(keep);
+ this.index++;
+ return replaceBy;
+ });
+ }
+};
+var _cssScopedPseudoFunctionPrefix = "(:(where|is)\\()?";
+var _cssPrefixWithPseudoSelectorFunction = /:(where|is)\(/gi;
+var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
+var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
+var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
+var _polyfillHost = "-shadowcsshost";
+var _polyfillHostContext = "-shadowcsscontext";
+var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))";
+var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + "?([^,{]*)", "gim");
+var _hostContextPattern = _polyfillHostContext + _parenSuffix + "?([^{]*)";
+var _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, "gim");
+var _cssColonHostContextRe = new RegExp(_hostContextPattern, "im");
+var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
+var _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\))`, "g");
+var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s,]*)/;
+var _shadowDOMSelectorsRe = [
+ /::shadow/g,
+ /::content/g,
+ // Deprecated selectors
+ /\/shadow-deep\//g,
+ /\/shadow\//g
+];
+var _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g;
+var _selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$";
+var _polyfillHostRe = /-shadowcsshost/gim;
+var _colonHostRe = /:host/gim;
+var _colonHostContextRe = /:host-context/gim;
+var _newLinesRe = /\r?\n/g;
+var _commentRe = /\/\*[\s\S]*?\*\//g;
+var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=/g;
+var COMMENT_PLACEHOLDER = "%COMMENT%";
+var _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, "g");
+var BLOCK_PLACEHOLDER = "%BLOCK%";
+var _ruleRe = new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, "g");
+var CONTENT_PAIRS = /* @__PURE__ */ new Map([["{", "}"]]);
+var COMMA_IN_PLACEHOLDER = "%COMMA_IN_PLACEHOLDER%";
+var SEMI_IN_PLACEHOLDER = "%SEMI_IN_PLACEHOLDER%";
+var COLON_IN_PLACEHOLDER = "%COLON_IN_PLACEHOLDER%";
+var _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, "g");
+var _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, "g");
+var _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, "g");
+var CssRule = class {
+ selector;
+ content;
+ constructor(selector, content) {
+ this.selector = selector;
+ this.content = content;
+ }
+};
+function processRules(input, ruleCallback) {
+ const escaped = escapeInStrings(input);
+ const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
+ let nextBlockIndex = 0;
+ const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
+ const selector = m[2];
+ let content = "";
+ let suffix = m[4];
+ let contentPrefix = "";
+ if (suffix && suffix.startsWith("{" + BLOCK_PLACEHOLDER)) {
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
+ contentPrefix = "{";
+ }
+ const rule = ruleCallback(new CssRule(selector, content));
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
+ });
+ return unescapeInStrings(escapedResult);
+}
+var StringWithEscapedBlocks = class {
+ escapedString;
+ blocks;
+ constructor(escapedString, blocks) {
+ this.escapedString = escapedString;
+ this.blocks = blocks;
+ }
+};
+function escapeBlocks(input, charPairs, placeholder) {
+ const resultParts = [];
+ const escapedBlocks = [];
+ let openCharCount = 0;
+ let nonBlockStartIndex = 0;
+ let blockStartIndex = -1;
+ let openChar;
+ let closeChar;
+ for (let i = 0; i < input.length; i++) {
+ const char = input[i];
+ if (char === "\\") {
+ i++;
+ } else if (char === closeChar) {
+ openCharCount--;
+ if (openCharCount === 0) {
+ escapedBlocks.push(input.substring(blockStartIndex, i));
+ resultParts.push(placeholder);
+ nonBlockStartIndex = i;
+ blockStartIndex = -1;
+ openChar = closeChar = void 0;
+ }
+ } else if (char === openChar) {
+ openCharCount++;
+ } else if (openCharCount === 0 && charPairs.has(char)) {
+ openChar = char;
+ closeChar = charPairs.get(char);
+ openCharCount = 1;
+ blockStartIndex = i + 1;
+ resultParts.push(input.substring(nonBlockStartIndex, blockStartIndex));
+ }
+ }
+ if (blockStartIndex !== -1) {
+ escapedBlocks.push(input.substring(blockStartIndex));
+ resultParts.push(placeholder);
+ } else {
+ resultParts.push(input.substring(nonBlockStartIndex));
+ }
+ return new StringWithEscapedBlocks(resultParts.join(""), escapedBlocks);
+}
+var ESCAPE_IN_STRING_MAP = {
+ ";": SEMI_IN_PLACEHOLDER,
+ ",": COMMA_IN_PLACEHOLDER,
+ ":": COLON_IN_PLACEHOLDER
+};
+function escapeInStrings(input) {
+ let result = input;
+ let currentQuoteChar = null;
+ for (let i = 0; i < result.length; i++) {
+ const char = result[i];
+ if (char === "\\") {
+ i++;
+ } else {
+ if (currentQuoteChar !== null) {
+ if (char === currentQuoteChar) {
+ currentQuoteChar = null;
+ } else {
+ const placeholder = ESCAPE_IN_STRING_MAP[char];
+ if (placeholder) {
+ result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;
+ i += placeholder.length - 1;
+ }
+ }
+ } else if (char === "'" || char === '"') {
+ currentQuoteChar = char;
+ }
+ }
+ }
+ return result;
+}
+function unescapeInStrings(input) {
+ let result = input.replace(_cssCommaInPlaceholderReGlobal, ",");
+ result = result.replace(_cssSemiInPlaceholderReGlobal, ";");
+ result = result.replace(_cssColonInPlaceholderReGlobal, ":");
+ return result;
+}
+function unescapeQuotes(str, isQuoted) {
+ return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, "$1");
+}
+function _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = "") {
+ const hostMarker = _polyfillHostNoCombinator;
+ _polyfillHostRe.lastIndex = 0;
+ const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);
+ if (contextSelectors.length === 0) {
+ return hostMarker + otherSelectors;
+ }
+ const combined = [contextSelectors.pop() || ""];
+ while (contextSelectors.length > 0) {
+ const length = combined.length;
+ const contextSelector = contextSelectors.pop();
+ for (let i = 0; i < length; i++) {
+ const previousSelectors = combined[i];
+ combined[length * 2 + i] = previousSelectors + " " + contextSelector;
+ combined[length + i] = contextSelector + " " + previousSelectors;
+ combined[i] = contextSelector + previousSelectors;
+ }
+ }
+ return combined.map((s) => otherSelectorsHasHost ? `${pseudoPrefix}${s}${otherSelectors}` : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`).join(",");
+}
+function repeatGroups(groups, multiples) {
+ const length = groups.length;
+ for (let i = 1; i < multiples; i++) {
+ for (let j = 0; j < length; j++) {
+ groups[j + i * length] = groups[j].slice(0);
+ }
+ }
+}
+var OpKind;
+(function(OpKind2) {
+ OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
+ OpKind2[OpKind2["Statement"] = 1] = "Statement";
+ OpKind2[OpKind2["Variable"] = 2] = "Variable";
+ OpKind2[OpKind2["ElementStart"] = 3] = "ElementStart";
+ OpKind2[OpKind2["Element"] = 4] = "Element";
+ OpKind2[OpKind2["Template"] = 5] = "Template";
+ OpKind2[OpKind2["ElementEnd"] = 6] = "ElementEnd";
+ OpKind2[OpKind2["ContainerStart"] = 7] = "ContainerStart";
+ OpKind2[OpKind2["Container"] = 8] = "Container";
+ OpKind2[OpKind2["ContainerEnd"] = 9] = "ContainerEnd";
+ OpKind2[OpKind2["DisableBindings"] = 10] = "DisableBindings";
+ OpKind2[OpKind2["ConditionalCreate"] = 11] = "ConditionalCreate";
+ OpKind2[OpKind2["ConditionalBranchCreate"] = 12] = "ConditionalBranchCreate";
+ OpKind2[OpKind2["Conditional"] = 13] = "Conditional";
+ OpKind2[OpKind2["EnableBindings"] = 14] = "EnableBindings";
+ OpKind2[OpKind2["Text"] = 15] = "Text";
+ OpKind2[OpKind2["Listener"] = 16] = "Listener";
+ OpKind2[OpKind2["InterpolateText"] = 17] = "InterpolateText";
+ OpKind2[OpKind2["Binding"] = 18] = "Binding";
+ OpKind2[OpKind2["Property"] = 19] = "Property";
+ OpKind2[OpKind2["StyleProp"] = 20] = "StyleProp";
+ OpKind2[OpKind2["ClassProp"] = 21] = "ClassProp";
+ OpKind2[OpKind2["StyleMap"] = 22] = "StyleMap";
+ OpKind2[OpKind2["ClassMap"] = 23] = "ClassMap";
+ OpKind2[OpKind2["Advance"] = 24] = "Advance";
+ OpKind2[OpKind2["Pipe"] = 25] = "Pipe";
+ OpKind2[OpKind2["Attribute"] = 26] = "Attribute";
+ OpKind2[OpKind2["ExtractedAttribute"] = 27] = "ExtractedAttribute";
+ OpKind2[OpKind2["Defer"] = 28] = "Defer";
+ OpKind2[OpKind2["DeferOn"] = 29] = "DeferOn";
+ OpKind2[OpKind2["DeferWhen"] = 30] = "DeferWhen";
+ OpKind2[OpKind2["I18nMessage"] = 31] = "I18nMessage";
+ OpKind2[OpKind2["DomProperty"] = 32] = "DomProperty";
+ OpKind2[OpKind2["Namespace"] = 33] = "Namespace";
+ OpKind2[OpKind2["ProjectionDef"] = 34] = "ProjectionDef";
+ OpKind2[OpKind2["Projection"] = 35] = "Projection";
+ OpKind2[OpKind2["RepeaterCreate"] = 36] = "RepeaterCreate";
+ OpKind2[OpKind2["Repeater"] = 37] = "Repeater";
+ OpKind2[OpKind2["TwoWayProperty"] = 38] = "TwoWayProperty";
+ OpKind2[OpKind2["TwoWayListener"] = 39] = "TwoWayListener";
+ OpKind2[OpKind2["DeclareLet"] = 40] = "DeclareLet";
+ OpKind2[OpKind2["StoreLet"] = 41] = "StoreLet";
+ OpKind2[OpKind2["I18nStart"] = 42] = "I18nStart";
+ OpKind2[OpKind2["I18n"] = 43] = "I18n";
+ OpKind2[OpKind2["I18nEnd"] = 44] = "I18nEnd";
+ OpKind2[OpKind2["I18nExpression"] = 45] = "I18nExpression";
+ OpKind2[OpKind2["I18nApply"] = 46] = "I18nApply";
+ OpKind2[OpKind2["IcuStart"] = 47] = "IcuStart";
+ OpKind2[OpKind2["IcuEnd"] = 48] = "IcuEnd";
+ OpKind2[OpKind2["IcuPlaceholder"] = 49] = "IcuPlaceholder";
+ OpKind2[OpKind2["I18nContext"] = 50] = "I18nContext";
+ OpKind2[OpKind2["I18nAttributes"] = 51] = "I18nAttributes";
+ OpKind2[OpKind2["SourceLocation"] = 52] = "SourceLocation";
+})(OpKind || (OpKind = {}));
+var ExpressionKind;
+(function(ExpressionKind2) {
+ ExpressionKind2[ExpressionKind2["LexicalRead"] = 0] = "LexicalRead";
+ ExpressionKind2[ExpressionKind2["Context"] = 1] = "Context";
+ ExpressionKind2[ExpressionKind2["TrackContext"] = 2] = "TrackContext";
+ ExpressionKind2[ExpressionKind2["ReadVariable"] = 3] = "ReadVariable";
+ ExpressionKind2[ExpressionKind2["NextContext"] = 4] = "NextContext";
+ ExpressionKind2[ExpressionKind2["Reference"] = 5] = "Reference";
+ ExpressionKind2[ExpressionKind2["StoreLet"] = 6] = "StoreLet";
+ ExpressionKind2[ExpressionKind2["ContextLetReference"] = 7] = "ContextLetReference";
+ ExpressionKind2[ExpressionKind2["GetCurrentView"] = 8] = "GetCurrentView";
+ ExpressionKind2[ExpressionKind2["RestoreView"] = 9] = "RestoreView";
+ ExpressionKind2[ExpressionKind2["ResetView"] = 10] = "ResetView";
+ ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 11] = "PureFunctionExpr";
+ ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 12] = "PureFunctionParameterExpr";
+ ExpressionKind2[ExpressionKind2["PipeBinding"] = 13] = "PipeBinding";
+ ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 14] = "PipeBindingVariadic";
+ ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 15] = "SafePropertyRead";
+ ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 16] = "SafeKeyedRead";
+ ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 17] = "SafeInvokeFunction";
+ ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 18] = "SafeTernaryExpr";
+ ExpressionKind2[ExpressionKind2["EmptyExpr"] = 19] = "EmptyExpr";
+ ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 20] = "AssignTemporaryExpr";
+ ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 21] = "ReadTemporaryExpr";
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 24] = "ConstCollected";
+ ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 25] = "TwoWayBindingSet";
+})(ExpressionKind || (ExpressionKind = {}));
+var VariableFlags;
+(function(VariableFlags2) {
+ VariableFlags2[VariableFlags2["None"] = 0] = "None";
+ VariableFlags2[VariableFlags2["AlwaysInline"] = 1] = "AlwaysInline";
+})(VariableFlags || (VariableFlags = {}));
+var SemanticVariableKind;
+(function(SemanticVariableKind2) {
+ SemanticVariableKind2[SemanticVariableKind2["Context"] = 0] = "Context";
+ SemanticVariableKind2[SemanticVariableKind2["Identifier"] = 1] = "Identifier";
+ SemanticVariableKind2[SemanticVariableKind2["SavedView"] = 2] = "SavedView";
+ SemanticVariableKind2[SemanticVariableKind2["Alias"] = 3] = "Alias";
+})(SemanticVariableKind || (SemanticVariableKind = {}));
+var CompatibilityMode;
+(function(CompatibilityMode2) {
+ CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
+ CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
+})(CompatibilityMode || (CompatibilityMode = {}));
+var BindingKind;
+(function(BindingKind2) {
+ BindingKind2[BindingKind2["Attribute"] = 0] = "Attribute";
+ BindingKind2[BindingKind2["ClassName"] = 1] = "ClassName";
+ BindingKind2[BindingKind2["StyleProperty"] = 2] = "StyleProperty";
+ BindingKind2[BindingKind2["Property"] = 3] = "Property";
+ BindingKind2[BindingKind2["Template"] = 4] = "Template";
+ BindingKind2[BindingKind2["I18n"] = 5] = "I18n";
+ BindingKind2[BindingKind2["LegacyAnimation"] = 6] = "LegacyAnimation";
+ BindingKind2[BindingKind2["TwoWayProperty"] = 7] = "TwoWayProperty";
+})(BindingKind || (BindingKind = {}));
+var I18nParamResolutionTime;
+(function(I18nParamResolutionTime2) {
+ I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
+ I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
+})(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
+var I18nExpressionFor;
+(function(I18nExpressionFor2) {
+ I18nExpressionFor2[I18nExpressionFor2["I18nText"] = 0] = "I18nText";
+ I18nExpressionFor2[I18nExpressionFor2["I18nAttribute"] = 1] = "I18nAttribute";
+})(I18nExpressionFor || (I18nExpressionFor = {}));
+var I18nParamValueFlags;
+(function(I18nParamValueFlags2) {
+ I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
+ I18nParamValueFlags2[I18nParamValueFlags2["ElementTag"] = 1] = "ElementTag";
+ I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
+ I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
+ I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
+ I18nParamValueFlags2[I18nParamValueFlags2["ExpressionIndex"] = 16] = "ExpressionIndex";
+})(I18nParamValueFlags || (I18nParamValueFlags = {}));
+var Namespace;
+(function(Namespace2) {
+ Namespace2[Namespace2["HTML"] = 0] = "HTML";
+ Namespace2[Namespace2["SVG"] = 1] = "SVG";
+ Namespace2[Namespace2["Math"] = 2] = "Math";
+})(Namespace || (Namespace = {}));
+var DeferTriggerKind;
+(function(DeferTriggerKind2) {
+ DeferTriggerKind2[DeferTriggerKind2["Idle"] = 0] = "Idle";
+ DeferTriggerKind2[DeferTriggerKind2["Immediate"] = 1] = "Immediate";
+ DeferTriggerKind2[DeferTriggerKind2["Timer"] = 2] = "Timer";
+ DeferTriggerKind2[DeferTriggerKind2["Hover"] = 3] = "Hover";
+ DeferTriggerKind2[DeferTriggerKind2["Interaction"] = 4] = "Interaction";
+ DeferTriggerKind2[DeferTriggerKind2["Viewport"] = 5] = "Viewport";
+ DeferTriggerKind2[DeferTriggerKind2["Never"] = 6] = "Never";
+})(DeferTriggerKind || (DeferTriggerKind = {}));
+var I18nContextKind;
+(function(I18nContextKind2) {
+ I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
+ I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
+ I18nContextKind2[I18nContextKind2["Attr"] = 2] = "Attr";
+})(I18nContextKind || (I18nContextKind = {}));
+var TemplateKind;
+(function(TemplateKind2) {
+ TemplateKind2[TemplateKind2["NgTemplate"] = 0] = "NgTemplate";
+ TemplateKind2[TemplateKind2["Structural"] = 1] = "Structural";
+ TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
+})(TemplateKind || (TemplateKind = {}));
+var ConsumesSlot = Symbol("ConsumesSlot");
+var DependsOnSlotContext = Symbol("DependsOnSlotContext");
+var ConsumesVarsTrait = Symbol("ConsumesVars");
+var UsesVarOffset = Symbol("UsesVarOffset");
+var TRAIT_CONSUMES_SLOT = {
+ [ConsumesSlot]: true,
+ numSlotsUsed: 1
+};
+var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
+ [DependsOnSlotContext]: true
+};
+var TRAIT_CONSUMES_VARS = {
+ [ConsumesVarsTrait]: true
+};
+function hasConsumesSlotTrait(op) {
+ return op[ConsumesSlot] === true;
+}
+function hasDependsOnSlotContextTrait(value) {
+ return value[DependsOnSlotContext] === true;
+}
+function hasConsumesVarsTrait(value) {
+ return value[ConsumesVarsTrait] === true;
+}
+function hasUsesVarOffsetTrait(expr) {
+ return expr[UsesVarOffset] === true;
+}
+function createStatementOp(statement) {
+ return __spreadValues({
+ kind: OpKind.Statement,
+ statement
+ }, NEW_OP);
+}
+function createVariableOp(xref, variable2, initializer, flags) {
+ return __spreadValues({
+ kind: OpKind.Variable,
+ xref,
+ variable: variable2,
+ initializer,
+ flags
+ }, NEW_OP);
+}
+var NEW_OP = {
+ debugListId: null,
+ prev: null,
+ next: null
+};
+function createInterpolateTextOp(xref, interpolation, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.InterpolateText,
+ target: xref,
+ interpolation,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+var Interpolation2 = class {
+ strings;
+ expressions;
+ i18nPlaceholders;
+ constructor(strings, expressions, i18nPlaceholders) {
+ this.strings = strings;
+ this.expressions = expressions;
+ this.i18nPlaceholders = i18nPlaceholders;
+ if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {
+ throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);
+ }
+ }
+};
+function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.Binding,
+ bindingKind: kind,
+ target,
+ name,
+ expression,
+ unit,
+ securityContext,
+ isTextAttribute,
+ isStructuralTemplateAttribute,
+ templateKind,
+ i18nContext: null,
+ i18nMessage,
+ sourceSpan
+ }, NEW_OP);
+}
+function createPropertyOp(target, name, expression, isLegacyAnimationTrigger, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.Property,
+ target,
+ name,
+ expression,
+ isLegacyAnimationTrigger,
+ securityContext,
+ sanitizer: null,
+ isStructuralTemplateAttribute,
+ templateKind,
+ i18nContext,
+ i18nMessage,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createTwoWayPropertyOp(target, name, expression, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.TwoWayProperty,
+ target,
+ name,
+ expression,
+ securityContext,
+ sanitizer: null,
+ isStructuralTemplateAttribute,
+ templateKind,
+ i18nContext,
+ i18nMessage,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createStylePropOp(xref, name, expression, unit, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.StyleProp,
+ target: xref,
+ name,
+ expression,
+ unit,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createClassPropOp(xref, name, expression, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.ClassProp,
+ target: xref,
+ name,
+ expression,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createStyleMapOp(xref, expression, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.StyleMap,
+ target: xref,
+ expression,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createClassMapOp(xref, expression, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.ClassMap,
+ target: xref,
+ expression,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createAttributeOp(target, namespace, name, expression, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.Attribute,
+ target,
+ namespace,
+ name,
+ expression,
+ securityContext,
+ sanitizer: null,
+ isTextAttribute,
+ isStructuralTemplateAttribute,
+ templateKind,
+ i18nContext: null,
+ i18nMessage,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function createAdvanceOp(delta, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.Advance,
+ delta,
+ sourceSpan
+ }, NEW_OP);
+}
+function createConditionalOp(target, test, conditions, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.Conditional,
+ target,
+ test,
+ conditions,
+ processed: null,
+ sourceSpan,
+ contextValue: null
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
+}
+function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.Repeater,
+ target: repeaterCreate2,
+ targetSlot,
+ collection,
+ sourceSpan
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
+}
+function createDeferWhenOp(target, expr, modifier, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.DeferWhen,
+ target,
+ expr,
+ modifier,
+ sourceSpan
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
+}
+function createI18nExpressionOp(context, target, i18nOwner, handle, expression, icuPlaceholder, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.I18nExpression,
+ context,
+ target,
+ i18nOwner,
+ handle,
+ expression,
+ icuPlaceholder,
+ i18nPlaceholder,
+ resolutionTime,
+ usage,
+ name,
+ sourceSpan
+ }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
+}
+function createI18nApplyOp(owner, handle, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.I18nApply,
+ owner,
+ handle,
+ sourceSpan
+ }, NEW_OP);
+}
+function createStoreLetOp(target, declaredName, value, sourceSpan) {
+ return __spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.StoreLet,
+ target,
+ declaredName,
+ value,
+ sourceSpan
+ }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
+}
+function isIrExpression(expr) {
+ return expr instanceof ExpressionBase;
+}
+var ExpressionBase = class extends Expression {
+ constructor(sourceSpan = null) {
+ super(null, sourceSpan);
+ }
+};
+var LexicalReadExpr = class _LexicalReadExpr extends ExpressionBase {
+ name;
+ kind = ExpressionKind.LexicalRead;
+ constructor(name) {
+ super();
+ this.name = name;
+ }
+ visitExpression(visitor, context) {
+ }
+ isEquivalent(other) {
+ return this.name === other.name;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _LexicalReadExpr(this.name);
+ }
+};
+var ReferenceExpr = class _ReferenceExpr extends ExpressionBase {
+ target;
+ targetSlot;
+ offset;
+ kind = ExpressionKind.Reference;
+ constructor(target, targetSlot, offset) {
+ super();
+ this.target = target;
+ this.targetSlot = targetSlot;
+ this.offset = offset;
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _ReferenceExpr && e.target === this.target;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _ReferenceExpr(this.target, this.targetSlot, this.offset);
+ }
+};
+var StoreLetExpr = class _StoreLetExpr extends ExpressionBase {
+ target;
+ value;
+ sourceSpan;
+ kind = ExpressionKind.StoreLet;
+ [ConsumesVarsTrait] = true;
+ [DependsOnSlotContext] = true;
+ constructor(target, value, sourceSpan) {
+ super();
+ this.target = target;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value);
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.value = transformExpressionsInExpression(this.value, transform2, flags);
+ }
+ clone() {
+ return new _StoreLetExpr(this.target, this.value, this.sourceSpan);
+ }
+};
+var ContextLetReferenceExpr = class _ContextLetReferenceExpr extends ExpressionBase {
+ target;
+ targetSlot;
+ kind = ExpressionKind.ContextLetReference;
+ constructor(target, targetSlot) {
+ super();
+ this.target = target;
+ this.targetSlot = targetSlot;
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _ContextLetReferenceExpr && e.target === this.target;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _ContextLetReferenceExpr(this.target, this.targetSlot);
+ }
+};
+var ContextExpr = class _ContextExpr extends ExpressionBase {
+ view;
+ kind = ExpressionKind.Context;
+ constructor(view) {
+ super();
+ this.view = view;
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _ContextExpr && e.view === this.view;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _ContextExpr(this.view);
+ }
+};
+var TrackContextExpr = class _TrackContextExpr extends ExpressionBase {
+ view;
+ kind = ExpressionKind.TrackContext;
+ constructor(view) {
+ super();
+ this.view = view;
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _TrackContextExpr && e.view === this.view;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _TrackContextExpr(this.view);
+ }
+};
+var NextContextExpr = class _NextContextExpr extends ExpressionBase {
+ kind = ExpressionKind.NextContext;
+ steps = 1;
+ constructor() {
+ super();
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _NextContextExpr && e.steps === this.steps;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ const expr = new _NextContextExpr();
+ expr.steps = this.steps;
+ return expr;
+ }
+};
+var GetCurrentViewExpr = class _GetCurrentViewExpr extends ExpressionBase {
+ kind = ExpressionKind.GetCurrentView;
+ constructor() {
+ super();
+ }
+ visitExpression() {
+ }
+ isEquivalent(e) {
+ return e instanceof _GetCurrentViewExpr;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _GetCurrentViewExpr();
+ }
+};
+var RestoreViewExpr = class _RestoreViewExpr extends ExpressionBase {
+ view;
+ kind = ExpressionKind.RestoreView;
+ constructor(view) {
+ super();
+ this.view = view;
+ }
+ visitExpression(visitor, context) {
+ if (typeof this.view !== "number") {
+ this.view.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent(e) {
+ if (!(e instanceof _RestoreViewExpr) || typeof e.view !== typeof this.view) {
+ return false;
+ }
+ if (typeof this.view === "number") {
+ return this.view === e.view;
+ } else {
+ return this.view.isEquivalent(e.view);
+ }
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ if (typeof this.view !== "number") {
+ this.view = transformExpressionsInExpression(this.view, transform2, flags);
+ }
+ }
+ clone() {
+ return new _RestoreViewExpr(this.view instanceof Expression ? this.view.clone() : this.view);
+ }
+};
+var ResetViewExpr = class _ResetViewExpr extends ExpressionBase {
+ expr;
+ kind = ExpressionKind.ResetView;
+ constructor(expr) {
+ super();
+ this.expr = expr;
+ }
+ visitExpression(visitor, context) {
+ this.expr.visitExpression(visitor, context);
+ }
+ isEquivalent(e) {
+ return e instanceof _ResetViewExpr && this.expr.isEquivalent(e.expr);
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.expr = transformExpressionsInExpression(this.expr, transform2, flags);
+ }
+ clone() {
+ return new _ResetViewExpr(this.expr.clone());
+ }
+};
+var TwoWayBindingSetExpr = class _TwoWayBindingSetExpr extends ExpressionBase {
+ target;
+ value;
+ kind = ExpressionKind.TwoWayBindingSet;
+ constructor(target, value) {
+ super();
+ this.target = target;
+ this.value = value;
+ }
+ visitExpression(visitor, context) {
+ this.target.visitExpression(visitor, context);
+ this.value.visitExpression(visitor, context);
+ }
+ isEquivalent(other) {
+ return this.target.isEquivalent(other.target) && this.value.isEquivalent(other.value);
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.target = transformExpressionsInExpression(this.target, transform2, flags);
+ this.value = transformExpressionsInExpression(this.value, transform2, flags);
+ }
+ clone() {
+ return new _TwoWayBindingSetExpr(this.target, this.value);
+ }
+};
+var ReadVariableExpr = class _ReadVariableExpr extends ExpressionBase {
+ xref;
+ kind = ExpressionKind.ReadVariable;
+ name = null;
+ constructor(xref) {
+ super();
+ this.xref = xref;
+ }
+ visitExpression() {
+ }
+ isEquivalent(other) {
+ return other instanceof _ReadVariableExpr && other.xref === this.xref;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ const expr = new _ReadVariableExpr(this.xref);
+ expr.name = this.name;
+ return expr;
+ }
+};
+var PureFunctionExpr = class _PureFunctionExpr extends ExpressionBase {
+ kind = ExpressionKind.PureFunctionExpr;
+ [ConsumesVarsTrait] = true;
+ [UsesVarOffset] = true;
+ varOffset = null;
+ /**
+ * The expression which should be memoized as a pure computation.
+ *
+ * This expression contains internal `PureFunctionParameterExpr`s, which are placeholders for the
+ * positional argument expressions in `args.
+ */
+ body;
+ /**
+ * Positional arguments to the pure function which will memoize the `body` expression, which act
+ * as memoization keys.
+ */
+ args;
+ /**
+ * Once extracted to the `ConstantPool`, a reference to the function which defines the computation
+ * of `body`.
+ */
+ fn = null;
+ constructor(expression, args) {
+ super();
+ this.body = expression;
+ this.args = args;
+ }
+ visitExpression(visitor, context) {
+ this.body?.visitExpression(visitor, context);
+ for (const arg of this.args) {
+ arg.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent(other) {
+ if (!(other instanceof _PureFunctionExpr) || other.args.length !== this.args.length) {
+ return false;
+ }
+ return other.body !== null && this.body !== null && other.body.isEquivalent(this.body) && other.args.every((arg, idx) => arg.isEquivalent(this.args[idx]));
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ if (this.body !== null) {
+ this.body = transformExpressionsInExpression(this.body, transform2, flags | VisitorContextFlag.InChildOperation);
+ } else if (this.fn !== null) {
+ this.fn = transformExpressionsInExpression(this.fn, transform2, flags);
+ }
+ for (let i = 0; i < this.args.length; i++) {
+ this.args[i] = transformExpressionsInExpression(this.args[i], transform2, flags);
+ }
+ }
+ clone() {
+ const expr = new _PureFunctionExpr(this.body?.clone() ?? null, this.args.map((arg) => arg.clone()));
+ expr.fn = this.fn?.clone() ?? null;
+ expr.varOffset = this.varOffset;
+ return expr;
+ }
+};
+var PureFunctionParameterExpr = class _PureFunctionParameterExpr extends ExpressionBase {
+ index;
+ kind = ExpressionKind.PureFunctionParameterExpr;
+ constructor(index) {
+ super();
+ this.index = index;
+ }
+ visitExpression() {
+ }
+ isEquivalent(other) {
+ return other instanceof _PureFunctionParameterExpr && other.index === this.index;
+ }
+ isConstant() {
+ return true;
+ }
+ transformInternalExpressions() {
+ }
+ clone() {
+ return new _PureFunctionParameterExpr(this.index);
+ }
+};
+var PipeBindingExpr = class _PipeBindingExpr extends ExpressionBase {
+ target;
+ targetSlot;
+ name;
+ args;
+ kind = ExpressionKind.PipeBinding;
+ [ConsumesVarsTrait] = true;
+ [UsesVarOffset] = true;
+ varOffset = null;
+ constructor(target, targetSlot, name, args) {
+ super();
+ this.target = target;
+ this.targetSlot = targetSlot;
+ this.name = name;
+ this.args = args;
+ }
+ visitExpression(visitor, context) {
+ for (const arg of this.args) {
+ arg.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ for (let idx = 0; idx < this.args.length; idx++) {
+ this.args[idx] = transformExpressionsInExpression(this.args[idx], transform2, flags);
+ }
+ }
+ clone() {
+ const r = new _PipeBindingExpr(this.target, this.targetSlot, this.name, this.args.map((a) => a.clone()));
+ r.varOffset = this.varOffset;
+ return r;
+ }
+};
+var PipeBindingVariadicExpr = class _PipeBindingVariadicExpr extends ExpressionBase {
+ target;
+ targetSlot;
+ name;
+ args;
+ numArgs;
+ kind = ExpressionKind.PipeBindingVariadic;
+ [ConsumesVarsTrait] = true;
+ [UsesVarOffset] = true;
+ varOffset = null;
+ constructor(target, targetSlot, name, args, numArgs) {
+ super();
+ this.target = target;
+ this.targetSlot = targetSlot;
+ this.name = name;
+ this.args = args;
+ this.numArgs = numArgs;
+ }
+ visitExpression(visitor, context) {
+ this.args.visitExpression(visitor, context);
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.args = transformExpressionsInExpression(this.args, transform2, flags);
+ }
+ clone() {
+ const r = new _PipeBindingVariadicExpr(this.target, this.targetSlot, this.name, this.args.clone(), this.numArgs);
+ r.varOffset = this.varOffset;
+ return r;
+ }
+};
+var SafePropertyReadExpr = class _SafePropertyReadExpr extends ExpressionBase {
+ receiver;
+ name;
+ kind = ExpressionKind.SafePropertyRead;
+ constructor(receiver, name) {
+ super();
+ this.receiver = receiver;
+ this.name = name;
+ }
+ // An alias for name, which allows other logic to handle property reads and keyed reads together.
+ get index() {
+ return this.name;
+ }
+ visitExpression(visitor, context) {
+ this.receiver.visitExpression(visitor, context);
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.receiver = transformExpressionsInExpression(this.receiver, transform2, flags);
+ }
+ clone() {
+ return new _SafePropertyReadExpr(this.receiver.clone(), this.name);
+ }
+};
+var SafeKeyedReadExpr = class _SafeKeyedReadExpr extends ExpressionBase {
+ receiver;
+ index;
+ kind = ExpressionKind.SafeKeyedRead;
+ constructor(receiver, index, sourceSpan) {
+ super(sourceSpan);
+ this.receiver = receiver;
+ this.index = index;
+ }
+ visitExpression(visitor, context) {
+ this.receiver.visitExpression(visitor, context);
+ this.index.visitExpression(visitor, context);
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.receiver = transformExpressionsInExpression(this.receiver, transform2, flags);
+ this.index = transformExpressionsInExpression(this.index, transform2, flags);
+ }
+ clone() {
+ return new _SafeKeyedReadExpr(this.receiver.clone(), this.index.clone(), this.sourceSpan);
+ }
+};
+var SafeInvokeFunctionExpr = class _SafeInvokeFunctionExpr extends ExpressionBase {
+ receiver;
+ args;
+ kind = ExpressionKind.SafeInvokeFunction;
+ constructor(receiver, args) {
+ super();
+ this.receiver = receiver;
+ this.args = args;
+ }
+ visitExpression(visitor, context) {
+ this.receiver.visitExpression(visitor, context);
+ for (const a of this.args) {
+ a.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.receiver = transformExpressionsInExpression(this.receiver, transform2, flags);
+ for (let i = 0; i < this.args.length; i++) {
+ this.args[i] = transformExpressionsInExpression(this.args[i], transform2, flags);
+ }
+ }
+ clone() {
+ return new _SafeInvokeFunctionExpr(this.receiver.clone(), this.args.map((a) => a.clone()));
+ }
+};
+var SafeTernaryExpr = class _SafeTernaryExpr extends ExpressionBase {
+ guard;
+ expr;
+ kind = ExpressionKind.SafeTernaryExpr;
+ constructor(guard, expr) {
+ super();
+ this.guard = guard;
+ this.expr = expr;
+ }
+ visitExpression(visitor, context) {
+ this.guard.visitExpression(visitor, context);
+ this.expr.visitExpression(visitor, context);
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.guard = transformExpressionsInExpression(this.guard, transform2, flags);
+ this.expr = transformExpressionsInExpression(this.expr, transform2, flags);
+ }
+ clone() {
+ return new _SafeTernaryExpr(this.guard.clone(), this.expr.clone());
+ }
+};
+var EmptyExpr2 = class _EmptyExpr extends ExpressionBase {
+ kind = ExpressionKind.EmptyExpr;
+ visitExpression(visitor, context) {
+ }
+ isEquivalent(e) {
+ return e instanceof _EmptyExpr;
+ }
+ isConstant() {
+ return true;
+ }
+ clone() {
+ return new _EmptyExpr();
+ }
+ transformInternalExpressions() {
+ }
+};
+var AssignTemporaryExpr = class _AssignTemporaryExpr extends ExpressionBase {
+ expr;
+ xref;
+ kind = ExpressionKind.AssignTemporaryExpr;
+ name = null;
+ constructor(expr, xref) {
+ super();
+ this.expr = expr;
+ this.xref = xref;
+ }
+ visitExpression(visitor, context) {
+ this.expr.visitExpression(visitor, context);
+ }
+ isEquivalent() {
+ return false;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.expr = transformExpressionsInExpression(this.expr, transform2, flags);
+ }
+ clone() {
+ const a = new _AssignTemporaryExpr(this.expr.clone(), this.xref);
+ a.name = this.name;
+ return a;
+ }
+};
+var ReadTemporaryExpr = class _ReadTemporaryExpr extends ExpressionBase {
+ xref;
+ kind = ExpressionKind.ReadTemporaryExpr;
+ name = null;
+ constructor(xref) {
+ super();
+ this.xref = xref;
+ }
+ visitExpression(visitor, context) {
+ }
+ isEquivalent() {
+ return this.xref === this.xref;
+ }
+ isConstant() {
+ return false;
+ }
+ transformInternalExpressions(transform2, flags) {
+ }
+ clone() {
+ const r = new _ReadTemporaryExpr(this.xref);
+ r.name = this.name;
+ return r;
+ }
+};
+var SlotLiteralExpr = class _SlotLiteralExpr extends ExpressionBase {
+ slot;
+ kind = ExpressionKind.SlotLiteralExpr;
+ constructor(slot) {
+ super();
+ this.slot = slot;
+ }
+ visitExpression(visitor, context) {
+ }
+ isEquivalent(e) {
+ return e instanceof _SlotLiteralExpr && e.slot === this.slot;
+ }
+ isConstant() {
+ return true;
+ }
+ clone() {
+ return new _SlotLiteralExpr(this.slot);
+ }
+ transformInternalExpressions() {
+ }
+};
+var ConditionalCaseExpr = class _ConditionalCaseExpr extends ExpressionBase {
+ expr;
+ target;
+ targetSlot;
+ alias;
+ kind = ExpressionKind.ConditionalCase;
+ /**
+ * Create an expression for one branch of a conditional.
+ * @param expr The expression to be tested for this case. Might be null, as in an `else` case.
+ * @param target The Xref of the view to be displayed if this condition is true.
+ */
+ constructor(expr, target, targetSlot, alias = null) {
+ super();
+ this.expr = expr;
+ this.target = target;
+ this.targetSlot = targetSlot;
+ this.alias = alias;
+ }
+ visitExpression(visitor, context) {
+ if (this.expr !== null) {
+ this.expr.visitExpression(visitor, context);
+ }
+ }
+ isEquivalent(e) {
+ return e instanceof _ConditionalCaseExpr && e.expr === this.expr;
+ }
+ isConstant() {
+ return true;
+ }
+ clone() {
+ return new _ConditionalCaseExpr(this.expr, this.target, this.targetSlot);
+ }
+ transformInternalExpressions(transform2, flags) {
+ if (this.expr !== null) {
+ this.expr = transformExpressionsInExpression(this.expr, transform2, flags);
+ }
+ }
+};
+var ConstCollectedExpr = class _ConstCollectedExpr extends ExpressionBase {
+ expr;
+ kind = ExpressionKind.ConstCollected;
+ constructor(expr) {
+ super();
+ this.expr = expr;
+ }
+ transformInternalExpressions(transform2, flags) {
+ this.expr = transform2(this.expr, flags);
+ }
+ visitExpression(visitor, context) {
+ this.expr.visitExpression(visitor, context);
+ }
+ isEquivalent(e) {
+ if (!(e instanceof _ConstCollectedExpr)) {
+ return false;
+ }
+ return this.expr.isEquivalent(e.expr);
+ }
+ isConstant() {
+ return this.expr.isConstant();
+ }
+ clone() {
+ return new _ConstCollectedExpr(this.expr);
+ }
+};
+function visitExpressionsInOp(op, visitor) {
+ transformExpressionsInOp(op, (expr, flags) => {
+ visitor(expr, flags);
+ return expr;
+ }, VisitorContextFlag.None);
+}
+var VisitorContextFlag;
+(function(VisitorContextFlag2) {
+ VisitorContextFlag2[VisitorContextFlag2["None"] = 0] = "None";
+ VisitorContextFlag2[VisitorContextFlag2["InChildOperation"] = 1] = "InChildOperation";
+})(VisitorContextFlag || (VisitorContextFlag = {}));
+function transformExpressionsInInterpolation(interpolation, transform2, flags) {
+ for (let i = 0; i < interpolation.expressions.length; i++) {
+ interpolation.expressions[i] = transformExpressionsInExpression(interpolation.expressions[i], transform2, flags);
+ }
+}
+function transformExpressionsInOp(op, transform2, flags) {
+ switch (op.kind) {
+ case OpKind.StyleProp:
+ case OpKind.StyleMap:
+ case OpKind.ClassProp:
+ case OpKind.ClassMap:
+ case OpKind.Binding:
+ if (op.expression instanceof Interpolation2) {
+ transformExpressionsInInterpolation(op.expression, transform2, flags);
+ } else {
+ op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
+ }
+ break;
+ case OpKind.Property:
+ case OpKind.DomProperty:
+ case OpKind.Attribute:
+ if (op.expression instanceof Interpolation2) {
+ transformExpressionsInInterpolation(op.expression, transform2, flags);
+ } else {
+ op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
+ }
+ op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform2, flags);
+ break;
+ case OpKind.TwoWayProperty:
+ op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
+ op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform2, flags);
+ break;
+ case OpKind.I18nExpression:
+ op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
+ break;
+ case OpKind.InterpolateText:
+ transformExpressionsInInterpolation(op.interpolation, transform2, flags);
+ break;
+ case OpKind.Statement:
+ transformExpressionsInStatement(op.statement, transform2, flags);
+ break;
+ case OpKind.Variable:
+ op.initializer = transformExpressionsInExpression(op.initializer, transform2, flags);
+ break;
+ case OpKind.Conditional:
+ for (const condition of op.conditions) {
+ if (condition.expr === null) {
+ continue;
+ }
+ condition.expr = transformExpressionsInExpression(condition.expr, transform2, flags);
+ }
+ if (op.processed !== null) {
+ op.processed = transformExpressionsInExpression(op.processed, transform2, flags);
+ }
+ if (op.contextValue !== null) {
+ op.contextValue = transformExpressionsInExpression(op.contextValue, transform2, flags);
+ }
+ break;
+ case OpKind.Listener:
+ case OpKind.TwoWayListener:
+ for (const innerOp of op.handlerOps) {
+ transformExpressionsInOp(innerOp, transform2, flags | VisitorContextFlag.InChildOperation);
+ }
+ break;
+ case OpKind.ExtractedAttribute:
+ op.expression = op.expression && transformExpressionsInExpression(op.expression, transform2, flags);
+ op.trustedValueFn = op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform2, flags);
+ break;
+ case OpKind.RepeaterCreate:
+ if (op.trackByOps === null) {
+ op.track = transformExpressionsInExpression(op.track, transform2, flags);
+ } else {
+ for (const innerOp of op.trackByOps) {
+ transformExpressionsInOp(innerOp, transform2, flags | VisitorContextFlag.InChildOperation);
+ }
+ }
+ if (op.trackByFn !== null) {
+ op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform2, flags);
+ }
+ break;
+ case OpKind.Repeater:
+ op.collection = transformExpressionsInExpression(op.collection, transform2, flags);
+ break;
+ case OpKind.Defer:
+ if (op.loadingConfig !== null) {
+ op.loadingConfig = transformExpressionsInExpression(op.loadingConfig, transform2, flags);
+ }
+ if (op.placeholderConfig !== null) {
+ op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform2, flags);
+ }
+ if (op.resolverFn !== null) {
+ op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform2, flags);
+ }
+ break;
+ case OpKind.I18nMessage:
+ for (const [placeholder, expr] of op.params) {
+ op.params.set(placeholder, transformExpressionsInExpression(expr, transform2, flags));
+ }
+ for (const [placeholder, expr] of op.postprocessingParams) {
+ op.postprocessingParams.set(placeholder, transformExpressionsInExpression(expr, transform2, flags));
+ }
+ break;
+ case OpKind.DeferWhen:
+ op.expr = transformExpressionsInExpression(op.expr, transform2, flags);
+ break;
+ case OpKind.StoreLet:
+ op.value = transformExpressionsInExpression(op.value, transform2, flags);
+ break;
+ case OpKind.Advance:
+ case OpKind.Container:
+ case OpKind.ContainerEnd:
+ case OpKind.ContainerStart:
+ case OpKind.DeferOn:
+ case OpKind.DisableBindings:
+ case OpKind.Element:
+ case OpKind.ElementEnd:
+ case OpKind.ElementStart:
+ case OpKind.EnableBindings:
+ case OpKind.I18n:
+ case OpKind.I18nApply:
+ case OpKind.I18nContext:
+ case OpKind.I18nEnd:
+ case OpKind.I18nStart:
+ case OpKind.IcuEnd:
+ case OpKind.IcuStart:
+ case OpKind.Namespace:
+ case OpKind.Pipe:
+ case OpKind.Projection:
+ case OpKind.ProjectionDef:
+ case OpKind.Template:
+ case OpKind.Text:
+ case OpKind.I18nAttributes:
+ case OpKind.IcuPlaceholder:
+ case OpKind.DeclareLet:
+ case OpKind.SourceLocation:
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ break;
+ default:
+ throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
+ }
+}
+function transformExpressionsInExpression(expr, transform2, flags) {
+ if (expr instanceof ExpressionBase) {
+ expr.transformInternalExpressions(transform2, flags);
+ } else if (expr instanceof BinaryOperatorExpr) {
+ expr.lhs = transformExpressionsInExpression(expr.lhs, transform2, flags);
+ expr.rhs = transformExpressionsInExpression(expr.rhs, transform2, flags);
+ } else if (expr instanceof UnaryOperatorExpr) {
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
+ } else if (expr instanceof ReadPropExpr) {
+ expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
+ } else if (expr instanceof ReadKeyExpr) {
+ expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
+ expr.index = transformExpressionsInExpression(expr.index, transform2, flags);
+ } else if (expr instanceof InvokeFunctionExpr) {
+ expr.fn = transformExpressionsInExpression(expr.fn, transform2, flags);
+ for (let i = 0; i < expr.args.length; i++) {
+ expr.args[i] = transformExpressionsInExpression(expr.args[i], transform2, flags);
+ }
+ } else if (expr instanceof LiteralArrayExpr) {
+ for (let i = 0; i < expr.entries.length; i++) {
+ expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform2, flags);
+ }
+ } else if (expr instanceof LiteralMapExpr) {
+ for (let i = 0; i < expr.entries.length; i++) {
+ expr.entries[i].value = transformExpressionsInExpression(expr.entries[i].value, transform2, flags);
+ }
+ } else if (expr instanceof ConditionalExpr) {
+ expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
+ expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform2, flags);
+ if (expr.falseCase !== null) {
+ expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform2, flags);
+ }
+ } else if (expr instanceof TypeofExpr) {
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
+ } else if (expr instanceof VoidExpr) {
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
+ } else if (expr instanceof LocalizedString) {
+ for (let i = 0; i < expr.expressions.length; i++) {
+ expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
+ }
+ } else if (expr instanceof NotExpr) {
+ expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
+ } else if (expr instanceof TaggedTemplateLiteralExpr) {
+ expr.tag = transformExpressionsInExpression(expr.tag, transform2, flags);
+ expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform2, flags));
+ } else if (expr instanceof ArrowFunctionExpr) {
+ if (Array.isArray(expr.body)) {
+ for (let i = 0; i < expr.body.length; i++) {
+ transformExpressionsInStatement(expr.body[i], transform2, flags);
+ }
+ } else {
+ expr.body = transformExpressionsInExpression(expr.body, transform2, flags);
+ }
+ } else if (expr instanceof WrappedNodeExpr) ;
+ else if (expr instanceof TemplateLiteralExpr) {
+ for (let i = 0; i < expr.expressions.length; i++) {
+ expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
+ }
+ } else if (expr instanceof ParenthesizedExpr) {
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
+ } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) ;
+ else {
+ throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
+ }
+ return transform2(expr, flags);
+}
+function transformExpressionsInStatement(stmt, transform2, flags) {
+ if (stmt instanceof ExpressionStatement) {
+ stmt.expr = transformExpressionsInExpression(stmt.expr, transform2, flags);
+ } else if (stmt instanceof ReturnStatement) {
+ stmt.value = transformExpressionsInExpression(stmt.value, transform2, flags);
+ } else if (stmt instanceof DeclareVarStmt) {
+ if (stmt.value !== void 0) {
+ stmt.value = transformExpressionsInExpression(stmt.value, transform2, flags);
+ }
+ } else if (stmt instanceof IfStmt) {
+ stmt.condition = transformExpressionsInExpression(stmt.condition, transform2, flags);
+ for (const caseStatement of stmt.trueCase) {
+ transformExpressionsInStatement(caseStatement, transform2, flags);
+ }
+ for (const caseStatement of stmt.falseCase) {
+ transformExpressionsInStatement(caseStatement, transform2, flags);
+ }
+ } else {
+ throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);
+ }
+}
+function isStringLiteral(expr) {
+ return expr instanceof LiteralExpr && typeof expr.value === "string";
+}
+var OpList = class _OpList {
+ static nextListId = 0;
+ /**
+ * Debug ID of this `OpList` instance.
+ */
+ debugListId = _OpList.nextListId++;
+ // OpList uses static head/tail nodes of a special `ListEnd` type.
+ // This avoids the need for special casing of the first and last list
+ // elements in all list operations.
+ head = {
+ kind: OpKind.ListEnd,
+ next: null,
+ prev: null,
+ debugListId: this.debugListId
+ };
+ tail = {
+ kind: OpKind.ListEnd,
+ next: null,
+ prev: null,
+ debugListId: this.debugListId
+ };
+ constructor() {
+ this.head.next = this.tail;
+ this.tail.prev = this.head;
+ }
+ /**
+ * Push a new operation to the tail of the list.
+ */
+ push(op) {
+ if (Array.isArray(op)) {
+ for (const o of op) {
+ this.push(o);
+ }
+ return;
+ }
+ _OpList.assertIsNotEnd(op);
+ _OpList.assertIsUnowned(op);
+ op.debugListId = this.debugListId;
+ const oldLast = this.tail.prev;
+ op.prev = oldLast;
+ oldLast.next = op;
+ op.next = this.tail;
+ this.tail.prev = op;
+ }
+ /**
+ * Prepend one or more nodes to the start of the list.
+ */
+ prepend(ops) {
+ if (ops.length === 0) {
+ return;
+ }
+ for (const op of ops) {
+ _OpList.assertIsNotEnd(op);
+ _OpList.assertIsUnowned(op);
+ op.debugListId = this.debugListId;
+ }
+ const first = this.head.next;
+ let prev = this.head;
+ for (const op of ops) {
+ prev.next = op;
+ op.prev = prev;
+ prev = op;
+ }
+ prev.next = first;
+ first.prev = prev;
+ }
+ /**
+ * `OpList` is iterable via the iteration protocol.
+ *
+ * It's safe to mutate the part of the list that has already been returned by the iterator, up to
+ * and including the last operation returned. Mutations beyond that point _may_ be safe, but may
+ * also corrupt the iteration position and should be avoided.
+ */
+ *[Symbol.iterator]() {
+ let current = this.head.next;
+ while (current !== this.tail) {
+ _OpList.assertIsOwned(current, this.debugListId);
+ const next = current.next;
+ yield current;
+ current = next;
+ }
+ }
+ *reversed() {
+ let current = this.tail.prev;
+ while (current !== this.head) {
+ _OpList.assertIsOwned(current, this.debugListId);
+ const prev = current.prev;
+ yield current;
+ current = prev;
+ }
+ }
+ /**
+ * Replace `oldOp` with `newOp` in the list.
+ */
+ static replace(oldOp, newOp) {
+ _OpList.assertIsNotEnd(oldOp);
+ _OpList.assertIsNotEnd(newOp);
+ _OpList.assertIsOwned(oldOp);
+ _OpList.assertIsUnowned(newOp);
+ newOp.debugListId = oldOp.debugListId;
+ if (oldOp.prev !== null) {
+ oldOp.prev.next = newOp;
+ newOp.prev = oldOp.prev;
+ }
+ if (oldOp.next !== null) {
+ oldOp.next.prev = newOp;
+ newOp.next = oldOp.next;
+ }
+ oldOp.debugListId = null;
+ oldOp.prev = null;
+ oldOp.next = null;
+ }
+ /**
+ * Replace `oldOp` with some number of new operations in the list (which may include `oldOp`).
+ */
+ static replaceWithMany(oldOp, newOps) {
+ if (newOps.length === 0) {
+ _OpList.remove(oldOp);
+ return;
+ }
+ _OpList.assertIsNotEnd(oldOp);
+ _OpList.assertIsOwned(oldOp);
+ const listId = oldOp.debugListId;
+ oldOp.debugListId = null;
+ for (const newOp of newOps) {
+ _OpList.assertIsNotEnd(newOp);
+ _OpList.assertIsUnowned(newOp);
+ }
+ const { prev: oldPrev, next: oldNext } = oldOp;
+ oldOp.prev = null;
+ oldOp.next = null;
+ let prev = oldPrev;
+ for (const newOp of newOps) {
+ _OpList.assertIsUnowned(newOp);
+ newOp.debugListId = listId;
+ prev.next = newOp;
+ newOp.prev = prev;
+ newOp.next = null;
+ prev = newOp;
+ }
+ const first = newOps[0];
+ const last = prev;
+ if (oldPrev !== null) {
+ oldPrev.next = first;
+ first.prev = oldPrev;
+ }
+ if (oldNext !== null) {
+ oldNext.prev = last;
+ last.next = oldNext;
+ }
+ }
+ /**
+ * Remove the given node from the list which contains it.
+ */
+ static remove(op) {
+ _OpList.assertIsNotEnd(op);
+ _OpList.assertIsOwned(op);
+ op.prev.next = op.next;
+ op.next.prev = op.prev;
+ op.debugListId = null;
+ op.prev = null;
+ op.next = null;
+ }
+ /**
+ * Insert `op` before `target`.
+ */
+ static insertBefore(op, target) {
+ if (Array.isArray(op)) {
+ for (const o of op) {
+ _OpList.insertBefore(o, target);
+ }
+ return;
+ }
+ _OpList.assertIsOwned(target);
+ if (target.prev === null) {
+ throw new Error(`AssertionError: illegal operation on list start`);
+ }
+ _OpList.assertIsNotEnd(op);
+ _OpList.assertIsUnowned(op);
+ op.debugListId = target.debugListId;
+ op.prev = null;
+ target.prev.next = op;
+ op.prev = target.prev;
+ op.next = target;
+ target.prev = op;
+ }
+ /**
+ * Insert `op` after `target`.
+ */
+ static insertAfter(op, target) {
+ _OpList.assertIsOwned(target);
+ if (target.next === null) {
+ throw new Error(`AssertionError: illegal operation on list end`);
+ }
+ _OpList.assertIsNotEnd(op);
+ _OpList.assertIsUnowned(op);
+ op.debugListId = target.debugListId;
+ target.next.prev = op;
+ op.next = target.next;
+ op.prev = target;
+ target.next = op;
+ }
+ /**
+ * Asserts that `op` does not currently belong to a list.
+ */
+ static assertIsUnowned(op) {
+ if (op.debugListId !== null) {
+ throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);
+ }
+ }
+ /**
+ * Asserts that `op` currently belongs to a list. If `byList` is passed, `op` is asserted to
+ * specifically belong to that list.
+ */
+ static assertIsOwned(op, byList) {
+ if (op.debugListId === null) {
+ throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);
+ } else if (byList !== void 0 && op.debugListId !== byList) {
+ throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`);
+ }
+ }
+ /**
+ * Asserts that `op` is not a special `ListEnd` node.
+ */
+ static assertIsNotEnd(op) {
+ if (op.kind === OpKind.ListEnd) {
+ throw new Error(`AssertionError: illegal operation on list head or tail`);
+ }
+ }
+};
+var SlotHandle = class {
+ slot = null;
+};
+var elementContainerOpKinds = /* @__PURE__ */ new Set([
+ OpKind.Element,
+ OpKind.ElementStart,
+ OpKind.Container,
+ OpKind.ContainerStart,
+ OpKind.Template,
+ OpKind.RepeaterCreate,
+ OpKind.ConditionalCreate,
+ OpKind.ConditionalBranchCreate
+]);
+function isElementOrContainerOp(op) {
+ return elementContainerOpKinds.has(op.kind);
+}
+function createElementStartOp(tag, xref, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.ElementStart,
+ xref,
+ tag,
+ handle: new SlotHandle(),
+ attributes: null,
+ localRefs: [],
+ nonBindable: false,
+ namespace,
+ i18nPlaceholder,
+ startSourceSpan,
+ wholeSourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.Template,
+ xref,
+ templateKind,
+ attributes: null,
+ tag,
+ handle: new SlotHandle(),
+ functionNameSuffix,
+ decls: null,
+ vars: null,
+ localRefs: [],
+ nonBindable: false,
+ namespace,
+ i18nPlaceholder,
+ startSourceSpan,
+ wholeSourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createConditionalCreateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.ConditionalCreate,
+ xref,
+ templateKind,
+ attributes: null,
+ tag,
+ handle: new SlotHandle(),
+ functionNameSuffix,
+ decls: null,
+ vars: null,
+ localRefs: [],
+ nonBindable: false,
+ namespace,
+ i18nPlaceholder,
+ startSourceSpan,
+ wholeSourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createConditionalBranchCreateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.ConditionalBranchCreate,
+ xref,
+ templateKind,
+ attributes: null,
+ tag,
+ handle: new SlotHandle(),
+ functionNameSuffix,
+ decls: null,
+ vars: null,
+ localRefs: [],
+ nonBindable: false,
+ namespace,
+ i18nPlaceholder,
+ startSourceSpan,
+ wholeSourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
+ kind: OpKind.RepeaterCreate,
+ attributes: null,
+ xref: primaryView,
+ handle: new SlotHandle(),
+ emptyView,
+ track,
+ trackByFn: null,
+ trackByOps: null,
+ tag,
+ emptyTag,
+ emptyAttributes: null,
+ functionNameSuffix: "For",
+ namespace: Namespace.HTML,
+ nonBindable: false,
+ localRefs: [],
+ decls: null,
+ vars: null,
+ varNames,
+ usesComponentInstance: false,
+ i18nPlaceholder,
+ emptyI18nPlaceholder,
+ startSourceSpan,
+ wholeSourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP), TRAIT_CONSUMES_VARS), {
+ numSlotsUsed: emptyView === null ? 2 : 3
+ });
+}
+function createElementEndOp(xref, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.ElementEnd,
+ xref,
+ sourceSpan
+ }, NEW_OP);
+}
+function createDisableBindingsOp(xref) {
+ return __spreadValues({
+ kind: OpKind.DisableBindings,
+ xref
+ }, NEW_OP);
+}
+function createEnableBindingsOp(xref) {
+ return __spreadValues({
+ kind: OpKind.EnableBindings,
+ xref
+ }, NEW_OP);
+}
+function createTextOp(xref, initialValue, icuPlaceholder, sourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.Text,
+ xref,
+ handle: new SlotHandle(),
+ initialValue,
+ icuPlaceholder,
+ sourceSpan
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createListenerOp(target, targetSlot, name, tag, handlerOps, legacyAnimationPhase, eventTarget, hostListener, sourceSpan) {
+ const handlerList = new OpList();
+ handlerList.push(handlerOps);
+ return __spreadValues({
+ kind: OpKind.Listener,
+ target,
+ targetSlot,
+ tag,
+ hostListener,
+ name,
+ handlerOps: handlerList,
+ handlerFnName: null,
+ consumesDollarEvent: false,
+ isLegacyAnimationListener: legacyAnimationPhase !== null,
+ legacyAnimationPhase,
+ eventTarget,
+ sourceSpan
+ }, NEW_OP);
+}
+function createTwoWayListenerOp(target, targetSlot, name, tag, handlerOps, sourceSpan) {
+ const handlerList = new OpList();
+ handlerList.push(handlerOps);
+ return __spreadValues({
+ kind: OpKind.TwoWayListener,
+ target,
+ targetSlot,
+ tag,
+ name,
+ handlerOps: handlerList,
+ handlerFnName: null,
+ sourceSpan
+ }, NEW_OP);
+}
+function createPipeOp(xref, slot, name) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.Pipe,
+ xref,
+ handle: slot,
+ name
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
+}
+function createNamespaceOp(namespace) {
+ return __spreadValues({
+ kind: OpKind.Namespace,
+ active: namespace
+ }, NEW_OP);
+}
+function createProjectionDefOp(def) {
+ return __spreadValues({
+ kind: OpKind.ProjectionDef,
+ def
+ }, NEW_OP);
+}
+function createProjectionOp(xref, selector, i18nPlaceholder, fallbackView, sourceSpan) {
+ return __spreadProps(__spreadValues(__spreadValues({
+ kind: OpKind.Projection,
+ xref,
+ handle: new SlotHandle(),
+ selector,
+ i18nPlaceholder,
+ fallbackView,
+ projectionSlotIndex: 0,
+ attributes: null,
+ localRefs: [],
+ sourceSpan
+ }, NEW_OP), TRAIT_CONSUMES_SLOT), {
+ numSlotsUsed: fallbackView === null ? 1 : 2
+ });
+}
+function createExtractedAttributeOp(target, bindingKind, namespace, name, expression, i18nContext, i18nMessage, securityContext) {
+ return __spreadValues({
+ kind: OpKind.ExtractedAttribute,
+ target,
+ bindingKind,
+ namespace,
+ name,
+ expression,
+ i18nContext,
+ i18nMessage,
+ securityContext,
+ trustedValueFn: null
+ }, NEW_OP);
+}
+function createDeferOp(xref, main, mainSlot, ownResolverFn, resolverFn, sourceSpan) {
+ return __spreadProps(__spreadValues(__spreadValues({
+ kind: OpKind.Defer,
+ xref,
+ handle: new SlotHandle(),
+ mainView: main,
+ mainSlot,
+ loadingView: null,
+ loadingSlot: null,
+ loadingConfig: null,
+ loadingMinimumTime: null,
+ loadingAfterTime: null,
+ placeholderView: null,
+ placeholderSlot: null,
+ placeholderConfig: null,
+ placeholderMinimumTime: null,
+ errorView: null,
+ errorSlot: null,
+ ownResolverFn,
+ resolverFn,
+ flags: null,
+ sourceSpan
+ }, NEW_OP), TRAIT_CONSUMES_SLOT), {
+ numSlotsUsed: 2
+ });
+}
+function createDeferOnOp(defer2, trigger, modifier, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.DeferOn,
+ defer: defer2,
+ trigger,
+ modifier,
+ sourceSpan
+ }, NEW_OP);
+}
+function createDeclareLetOp(xref, declaredName, sourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.DeclareLet,
+ xref,
+ declaredName,
+ sourceSpan,
+ handle: new SlotHandle()
+ }, TRAIT_CONSUMES_SLOT), NEW_OP);
+}
+function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
+ return __spreadValues({
+ kind: OpKind.I18nMessage,
+ xref,
+ i18nContext,
+ i18nBlock,
+ message,
+ messagePlaceholder,
+ params,
+ postprocessingParams,
+ needsPostprocessing,
+ subMessages: []
+ }, NEW_OP);
+}
+function createI18nStartOp(xref, message, root, sourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.I18nStart,
+ xref,
+ handle: new SlotHandle(),
+ root: root ?? xref,
+ message,
+ messageIndex: null,
+ subTemplateIndex: null,
+ context: null,
+ sourceSpan
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
+}
+function createI18nEndOp(xref, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.I18nEnd,
+ xref,
+ sourceSpan
+ }, NEW_OP);
+}
+function createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) {
+ return __spreadValues({
+ kind: OpKind.IcuStart,
+ xref,
+ message,
+ messagePlaceholder,
+ context: null,
+ sourceSpan
+ }, NEW_OP);
+}
+function createIcuEndOp(xref) {
+ return __spreadValues({
+ kind: OpKind.IcuEnd,
+ xref
+ }, NEW_OP);
+}
+function createIcuPlaceholderOp(xref, name, strings) {
+ return __spreadValues({
+ kind: OpKind.IcuPlaceholder,
+ xref,
+ name,
+ strings,
+ expressionPlaceholders: []
+ }, NEW_OP);
+}
+function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
+ if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
+ throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
+ }
+ return __spreadValues({
+ kind: OpKind.I18nContext,
+ contextKind,
+ xref,
+ i18nBlock,
+ message,
+ sourceSpan,
+ params: /* @__PURE__ */ new Map(),
+ postprocessingParams: /* @__PURE__ */ new Map()
+ }, NEW_OP);
+}
+function createI18nAttributesOp(xref, handle, target) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.I18nAttributes,
+ xref,
+ handle,
+ target,
+ i18nAttributesConfig: null
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
+}
+function createSourceLocationOp(templatePath, locations) {
+ return __spreadValues({
+ kind: OpKind.SourceLocation,
+ templatePath,
+ locations
+ }, NEW_OP);
+}
+function createDomPropertyOp(name, expression, isLegacyAnimationTrigger, i18nContext, securityContext, sourceSpan) {
+ return __spreadValues(__spreadValues({
+ kind: OpKind.DomProperty,
+ name,
+ expression,
+ isLegacyAnimationTrigger,
+ i18nContext,
+ securityContext,
+ sanitizer: null,
+ sourceSpan
+ }, TRAIT_CONSUMES_VARS), NEW_OP);
+}
+var CTX_REF = "CTX_REF_MARKER";
+var CompilationJobKind;
+(function(CompilationJobKind2) {
+ CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
+ CompilationJobKind2[CompilationJobKind2["Host"] = 1] = "Host";
+ CompilationJobKind2[CompilationJobKind2["Both"] = 2] = "Both";
+})(CompilationJobKind || (CompilationJobKind = {}));
+var TemplateCompilationMode;
+(function(TemplateCompilationMode2) {
+ TemplateCompilationMode2[TemplateCompilationMode2["Full"] = 0] = "Full";
+ TemplateCompilationMode2[TemplateCompilationMode2["DomOnly"] = 1] = "DomOnly";
+})(TemplateCompilationMode || (TemplateCompilationMode = {}));
+var CompilationJob = class {
+ componentName;
+ pool;
+ compatibility;
+ mode;
+ constructor(componentName, pool, compatibility, mode) {
+ this.componentName = componentName;
+ this.pool = pool;
+ this.compatibility = compatibility;
+ this.mode = mode;
+ }
+ kind = CompilationJobKind.Both;
+ /**
+ * Generate a new unique `ir.XrefId` in this job.
+ */
+ allocateXrefId() {
+ return this.nextXrefId++;
+ }
+ /**
+ * Tracks the next `ir.XrefId` which can be assigned as template structures are ingested.
+ */
+ nextXrefId = 0;
+};
+var ComponentCompilationJob = class extends CompilationJob {
+ relativeContextFilePath;
+ i18nUseExternalIds;
+ deferMeta;
+ allDeferrableDepsFn;
+ relativeTemplatePath;
+ enableDebugLocations;
+ constructor(componentName, pool, compatibility, mode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
+ super(componentName, pool, compatibility, mode);
+ this.relativeContextFilePath = relativeContextFilePath;
+ this.i18nUseExternalIds = i18nUseExternalIds;
+ this.deferMeta = deferMeta;
+ this.allDeferrableDepsFn = allDeferrableDepsFn;
+ this.relativeTemplatePath = relativeTemplatePath;
+ this.enableDebugLocations = enableDebugLocations;
+ this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null);
+ this.views.set(this.root.xref, this.root);
+ }
+ kind = CompilationJobKind.Tmpl;
+ fnSuffix = "Template";
+ /**
+ * The root view, representing the component's template.
+ */
+ root;
+ views = /* @__PURE__ */ new Map();
+ /**
+ * Causes ngContentSelectors to be emitted, for content projection slots in the view. Possibly a
+ * reference into the constant pool.
+ */
+ contentSelectors = null;
+ /**
+ * Add a `ViewCompilation` for a new embedded view to this compilation.
+ */
+ allocateView(parent) {
+ const view = new ViewCompilationUnit(this, this.allocateXrefId(), parent);
+ this.views.set(view.xref, view);
+ return view;
+ }
+ get units() {
+ return this.views.values();
+ }
+ /**
+ * Add a constant `o.Expression` to the compilation and return its index in the `consts` array.
+ */
+ addConst(newConst, initializers) {
+ for (let idx2 = 0; idx2 < this.consts.length; idx2++) {
+ if (this.consts[idx2].isEquivalent(newConst)) {
+ return idx2;
+ }
+ }
+ const idx = this.consts.length;
+ this.consts.push(newConst);
+ if (initializers) {
+ this.constsInitializers.push(...initializers);
+ }
+ return idx;
+ }
+ /**
+ * Constant expressions used by operations within this component's compilation.
+ *
+ * This will eventually become the `consts` array in the component definition.
+ */
+ consts = [];
+ /**
+ * Initialization statements needed to set up the consts.
+ */
+ constsInitializers = [];
+};
+var CompilationUnit = class {
+ xref;
+ constructor(xref) {
+ this.xref = xref;
+ }
+ /**
+ * List of creation operations for this view.
+ *
+ * Creation operations may internally contain other operations, including update operations.
+ */
+ create = new OpList();
+ /**
+ * List of update operations for this view.
+ */
+ update = new OpList();
+ /**
+ * Name of the function which will be generated for this unit.
+ *
+ * May be `null` if not yet determined.
+ */
+ fnName = null;
+ /**
+ * Number of variable slots used within this view, or `null` if variables have not yet been
+ * counted.
+ */
+ vars = null;
+ /**
+ * Iterate over all `ir.Op`s within this view.
+ *
+ * Some operations may have child operations, which this iterator will visit.
+ */
+ *ops() {
+ for (const op of this.create) {
+ yield op;
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ for (const listenerOp of op.handlerOps) {
+ yield listenerOp;
+ }
+ } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
+ for (const trackOp of op.trackByOps) {
+ yield trackOp;
+ }
+ }
+ }
+ for (const op of this.update) {
+ yield op;
+ }
+ }
+};
+var ViewCompilationUnit = class extends CompilationUnit {
+ job;
+ parent;
+ constructor(job, xref, parent) {
+ super(xref);
+ this.job = job;
+ this.parent = parent;
+ }
+ /**
+ * Map of declared variables available within this view to the property on the context object
+ * which they alias.
+ */
+ contextVariables = /* @__PURE__ */ new Map();
+ /**
+ * Set of aliases available within this view. An alias is a variable whose provided expression is
+ * inlined at every location it is used. It may also depend on context variables, by name.
+ */
+ aliases = /* @__PURE__ */ new Set();
+ /**
+ * Number of declaration slots used within this view, or `null` if slots have not yet been
+ * allocated.
+ */
+ decls = null;
+};
+var HostBindingCompilationJob = class extends CompilationJob {
+ constructor(componentName, pool, compatibility, mode) {
+ super(componentName, pool, compatibility, mode);
+ this.root = new HostBindingCompilationUnit(this);
+ }
+ kind = CompilationJobKind.Host;
+ fnSuffix = "HostBindings";
+ root;
+ get units() {
+ return [this.root];
+ }
+};
+var HostBindingCompilationUnit = class extends CompilationUnit {
+ job;
+ constructor(job) {
+ super(0);
+ this.job = job;
+ }
+ /**
+ * Much like an element can have attributes, so can a host binding function.
+ */
+ attributes = null;
+};
+function deleteAnyCasts(job) {
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ transformExpressionsInOp(op, removeAnys, VisitorContextFlag.None);
+ }
+ }
+}
+function removeAnys(e) {
+ if (e instanceof InvokeFunctionExpr && e.fn instanceof LexicalReadExpr && e.fn.name === "$any") {
+ if (e.args.length !== 1) {
+ throw new Error("The $any builtin function expects exactly one argument.");
+ }
+ return e.args[0];
+ }
+ return e;
+}
+function applyI18nExpressions(job) {
+ const i18nContexts = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.I18nContext) {
+ i18nContexts.set(op.xref, op);
+ }
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
+ OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);
+ }
+ }
+ }
+}
+function needsApplication(i18nContexts, op) {
+ if (op.next?.kind !== OpKind.I18nExpression) {
+ return true;
+ }
+ const context = i18nContexts.get(op.context);
+ const nextContext2 = i18nContexts.get(op.next.context);
+ if (context === void 0) {
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");
+ }
+ if (nextContext2 === void 0) {
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");
+ }
+ if (context.i18nBlock !== null) {
+ if (context.i18nBlock !== nextContext2.i18nBlock) {
+ return true;
+ }
+ return false;
+ }
+ if (op.i18nOwner !== op.next.i18nOwner) {
+ return true;
+ }
+ return false;
+}
+function assignI18nSlotDependencies(job) {
+ for (const unit of job.units) {
+ let updateOp = unit.update.head;
+ let i18nExpressionsInProgress = [];
+ let state = null;
+ for (const createOp of unit.create) {
+ if (createOp.kind === OpKind.I18nStart) {
+ state = {
+ blockXref: createOp.xref,
+ lastSlotConsumer: createOp.xref
+ };
+ } else if (createOp.kind === OpKind.I18nEnd) {
+ for (const op of i18nExpressionsInProgress) {
+ op.target = state.lastSlotConsumer;
+ OpList.insertBefore(op, updateOp);
+ }
+ i18nExpressionsInProgress.length = 0;
+ state = null;
+ }
+ if (hasConsumesSlotTrait(createOp)) {
+ if (state !== null) {
+ state.lastSlotConsumer = createOp.xref;
+ }
+ while (true) {
+ if (updateOp.next === null) {
+ break;
+ }
+ if (state !== null && updateOp.kind === OpKind.I18nExpression && updateOp.usage === I18nExpressionFor.I18nText && updateOp.i18nOwner === state.blockXref) {
+ const opToRemove = updateOp;
+ updateOp = updateOp.next;
+ OpList.remove(opToRemove);
+ i18nExpressionsInProgress.push(opToRemove);
+ continue;
+ }
+ let hasDifferentTarget = false;
+ if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
+ hasDifferentTarget = true;
+ } else if (
+ // Some expressions may consume slots as well (e.g. `storeLet`).
+ updateOp.kind === OpKind.Statement || updateOp.kind === OpKind.Variable
+ ) {
+ visitExpressionsInOp(updateOp, (expr) => {
+ if (!hasDifferentTarget && hasDependsOnSlotContextTrait(expr) && expr.target !== createOp.xref) {
+ hasDifferentTarget = true;
+ }
+ });
+ }
+ if (hasDifferentTarget) {
+ break;
+ }
+ updateOp = updateOp.next;
+ }
+ }
+ }
+ }
+}
+function attachSourceLocations(job) {
+ if (!job.enableDebugLocations || job.relativeTemplatePath === null) {
+ return;
+ }
+ for (const unit of job.units) {
+ const locations = [];
+ for (const op of unit.create) {
+ if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {
+ const start = op.startSourceSpan.start;
+ locations.push({
+ targetSlot: op.handle,
+ offset: start.offset,
+ line: start.line,
+ column: start.col
+ });
+ }
+ }
+ if (locations.length > 0) {
+ unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));
+ }
+ }
+}
+function createOpXrefMap(unit) {
+ const map = /* @__PURE__ */ new Map();
+ for (const op of unit.create) {
+ if (!hasConsumesSlotTrait(op)) {
+ continue;
+ }
+ map.set(op.xref, op);
+ if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
+ map.set(op.emptyView, op);
+ }
+ }
+ return map;
+}
+function extractAttributes(job) {
+ for (const unit of job.units) {
+ const elements = createOpXrefMap(unit);
+ for (const op of unit.ops()) {
+ switch (op.kind) {
+ case OpKind.Attribute:
+ extractAttributeOp(unit, op, elements);
+ break;
+ case OpKind.Property:
+ if (!op.isLegacyAnimationTrigger) {
+ let bindingKind;
+ if (op.i18nMessage !== null && op.templateKind === null) {
+ bindingKind = BindingKind.I18n;
+ } else if (op.isStructuralTemplateAttribute) {
+ bindingKind = BindingKind.Template;
+ } else {
+ bindingKind = BindingKind.Property;
+ }
+ OpList.insertBefore(
+ // Deliberately null i18nMessage value
+ createExtractedAttributeOp(
+ op.target,
+ bindingKind,
+ null,
+ op.name,
+ /* expression */
+ null,
+ /* i18nContext */
+ null,
+ /* i18nMessage */
+ null,
+ op.securityContext
+ ),
+ lookupElement$2(elements, op.target)
+ );
+ }
+ break;
+ case OpKind.TwoWayProperty:
+ OpList.insertBefore(createExtractedAttributeOp(
+ op.target,
+ BindingKind.TwoWayProperty,
+ null,
+ op.name,
+ /* expression */
+ null,
+ /* i18nContext */
+ null,
+ /* i18nMessage */
+ null,
+ op.securityContext
+ ), lookupElement$2(elements, op.target));
+ break;
+ case OpKind.StyleProp:
+ case OpKind.ClassProp:
+ if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
+ OpList.insertBefore(createExtractedAttributeOp(
+ op.target,
+ BindingKind.Property,
+ null,
+ op.name,
+ /* expression */
+ null,
+ /* i18nContext */
+ null,
+ /* i18nMessage */
+ null,
+ SecurityContext.STYLE
+ ), lookupElement$2(elements, op.target));
+ }
+ break;
+ case OpKind.Listener:
+ if (!op.isLegacyAnimationListener) {
+ const extractedAttributeOp = createExtractedAttributeOp(
+ op.target,
+ BindingKind.Property,
+ null,
+ op.name,
+ /* expression */
+ null,
+ /* i18nContext */
+ null,
+ /* i18nMessage */
+ null,
+ SecurityContext.NONE
+ );
+ if (job.kind === CompilationJobKind.Host) {
+ if (job.compatibility) {
+ break;
+ }
+ unit.create.push(extractedAttributeOp);
+ } else {
+ OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target));
+ }
+ }
+ break;
+ case OpKind.TwoWayListener:
+ if (job.kind !== CompilationJobKind.Host) {
+ const extractedAttributeOp = createExtractedAttributeOp(
+ op.target,
+ BindingKind.Property,
+ null,
+ op.name,
+ /* expression */
+ null,
+ /* i18nContext */
+ null,
+ /* i18nMessage */
+ null,
+ SecurityContext.NONE
+ );
+ OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target));
+ }
+ break;
+ }
+ }
+ }
+}
+function lookupElement$2(elements, xref) {
+ const el = elements.get(xref);
+ if (el === void 0) {
+ throw new Error("All attributes should have an element-like target.");
+ }
+ return el;
+}
+function extractAttributeOp(unit, op, elements) {
+ if (op.expression instanceof Interpolation2) {
+ return;
+ }
+ let extractable = op.isTextAttribute || op.expression.isConstant();
+ if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
+ extractable &&= op.isTextAttribute;
+ }
+ if (extractable) {
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.namespace, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext);
+ if (unit.job.kind === CompilationJobKind.Host) {
+ unit.create.push(extractedAttributeOp);
+ } else {
+ const ownerOp = lookupElement$2(elements, op.target);
+ OpList.insertBefore(extractedAttributeOp, ownerOp);
+ }
+ OpList.remove(op);
+ }
+}
+function lookupElement$1(elements, xref) {
+ const el = elements.get(xref);
+ if (el === void 0) {
+ throw new Error("All attributes should have an element-like target.");
+ }
+ return el;
+}
+function specializeBindings(job) {
+ const elements = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (!isElementOrContainerOp(op)) {
+ continue;
+ }
+ elements.set(op.xref, op);
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ if (op.kind !== OpKind.Binding) {
+ continue;
+ }
+ switch (op.bindingKind) {
+ case BindingKind.Attribute:
+ if (op.name === "ngNonBindable") {
+ OpList.remove(op);
+ const target = lookupElement$1(elements, op.target);
+ target.nonBindable = true;
+ } else {
+ const [namespace, name] = splitNsName(op.name);
+ OpList.replace(op, createAttributeOp(op.target, namespace, name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
+ }
+ break;
+ case BindingKind.Property:
+ case BindingKind.LegacyAnimation:
+ if (job.kind === CompilationJobKind.Host) {
+ OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.LegacyAnimation, op.i18nContext, op.securityContext, op.sourceSpan));
+ } else {
+ OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.LegacyAnimation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
+ }
+ break;
+ case BindingKind.TwoWayProperty:
+ if (!(op.expression instanceof Expression)) {
+ throw new Error(`Expected value of two-way property binding "${op.name}" to be an expression`);
+ }
+ OpList.replace(op, createTwoWayPropertyOp(op.target, op.name, op.expression, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
+ break;
+ case BindingKind.I18n:
+ case BindingKind.ClassName:
+ case BindingKind.StyleProperty:
+ throw new Error(`Unhandled binding of kind ${BindingKind[op.bindingKind]}`);
+ }
+ }
+ }
+}
+var CHAIN_COMPATIBILITY = /* @__PURE__ */ new Map([
+ [Identifiers.attribute, Identifiers.attribute],
+ [Identifiers.classProp, Identifiers.classProp],
+ [Identifiers.element, Identifiers.element],
+ [Identifiers.elementContainer, Identifiers.elementContainer],
+ [Identifiers.elementContainerEnd, Identifiers.elementContainerEnd],
+ [Identifiers.elementContainerStart, Identifiers.elementContainerStart],
+ [Identifiers.elementEnd, Identifiers.elementEnd],
+ [Identifiers.elementStart, Identifiers.elementStart],
+ [Identifiers.domProperty, Identifiers.domProperty],
+ [Identifiers.i18nExp, Identifiers.i18nExp],
+ [Identifiers.listener, Identifiers.listener],
+ [Identifiers.listener, Identifiers.listener],
+ [Identifiers.property, Identifiers.property],
+ [Identifiers.styleProp, Identifiers.styleProp],
+ [Identifiers.syntheticHostListener, Identifiers.syntheticHostListener],
+ [Identifiers.syntheticHostProperty, Identifiers.syntheticHostProperty],
+ [Identifiers.templateCreate, Identifiers.templateCreate],
+ [Identifiers.twoWayProperty, Identifiers.twoWayProperty],
+ [Identifiers.twoWayListener, Identifiers.twoWayListener],
+ [Identifiers.declareLet, Identifiers.declareLet],
+ [Identifiers.conditionalCreate, Identifiers.conditionalBranchCreate],
+ [Identifiers.conditionalBranchCreate, Identifiers.conditionalBranchCreate],
+ [Identifiers.domElement, Identifiers.domElement],
+ [Identifiers.domElementStart, Identifiers.domElementStart],
+ [Identifiers.domElementEnd, Identifiers.domElementEnd],
+ [Identifiers.domElementContainer, Identifiers.domElementContainer],
+ [Identifiers.domElementContainerStart, Identifiers.domElementContainerStart],
+ [Identifiers.domElementContainerEnd, Identifiers.domElementContainerEnd],
+ [Identifiers.domListener, Identifiers.domListener],
+ [Identifiers.domTemplate, Identifiers.domTemplate]
+]);
+var MAX_CHAIN_LENGTH = 256;
+function chain(job) {
+ for (const unit of job.units) {
+ chainOperationsInList(unit.create);
+ chainOperationsInList(unit.update);
+ }
+}
+function chainOperationsInList(opList) {
+ let chain2 = null;
+ for (const op of opList) {
+ if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement)) {
+ chain2 = null;
+ continue;
+ }
+ if (!(op.statement.expr instanceof InvokeFunctionExpr) || !(op.statement.expr.fn instanceof ExternalExpr)) {
+ chain2 = null;
+ continue;
+ }
+ const instruction = op.statement.expr.fn.value;
+ if (!CHAIN_COMPATIBILITY.has(instruction)) {
+ chain2 = null;
+ continue;
+ }
+ if (chain2 !== null && CHAIN_COMPATIBILITY.get(chain2.instruction) === instruction && chain2.length < MAX_CHAIN_LENGTH) {
+ const expression = chain2.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
+ chain2.expression = expression;
+ chain2.op.statement = expression.toStmt();
+ chain2.length++;
+ OpList.remove(op);
+ } else {
+ chain2 = {
+ op,
+ instruction,
+ expression: op.statement.expr,
+ length: 1
+ };
+ }
+ }
+}
+function collapseSingletonInterpolations(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ const eligibleOpKind = op.kind === OpKind.Attribute || op.kind === OpKind.StyleProp || op.kind == OpKind.StyleMap || op.kind === OpKind.ClassMap;
+ if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
+ op.expression = op.expression.expressions[0];
+ }
+ }
+ }
+}
+function generateConditionalExpressions(job) {
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ if (op.kind !== OpKind.Conditional) {
+ continue;
+ }
+ let test;
+ const defaultCase = op.conditions.findIndex((cond) => cond.expr === null);
+ if (defaultCase >= 0) {
+ const slot = op.conditions.splice(defaultCase, 1)[0].targetSlot;
+ test = new SlotLiteralExpr(slot);
+ } else {
+ test = literal(-1);
+ }
+ let tmp = op.test == null ? null : new AssignTemporaryExpr(op.test, job.allocateXrefId());
+ for (let i = op.conditions.length - 1; i >= 0; i--) {
+ let conditionalCase = op.conditions[i];
+ if (conditionalCase.expr === null) {
+ continue;
+ }
+ if (tmp !== null) {
+ const useTmp = i === 0 ? tmp : new ReadTemporaryExpr(tmp.xref);
+ conditionalCase.expr = new BinaryOperatorExpr(BinaryOperator.Identical, useTmp, conditionalCase.expr);
+ } else if (conditionalCase.alias !== null) {
+ const caseExpressionTemporaryXref = job.allocateXrefId();
+ conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref);
+ op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref);
+ }
+ test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.targetSlot), test);
+ }
+ op.processed = test;
+ op.conditions = [];
+ }
+ }
+}
+var BINARY_OPERATORS = /* @__PURE__ */ new Map([
+ ["&&", BinaryOperator.And],
+ [">", BinaryOperator.Bigger],
+ [">=", BinaryOperator.BiggerEquals],
+ ["|", BinaryOperator.BitwiseOr],
+ ["&", BinaryOperator.BitwiseAnd],
+ ["/", BinaryOperator.Divide],
+ ["=", BinaryOperator.Assign],
+ ["==", BinaryOperator.Equals],
+ ["===", BinaryOperator.Identical],
+ ["<", BinaryOperator.Lower],
+ ["<=", BinaryOperator.LowerEquals],
+ ["-", BinaryOperator.Minus],
+ ["%", BinaryOperator.Modulo],
+ ["**", BinaryOperator.Exponentiation],
+ ["*", BinaryOperator.Multiply],
+ ["!=", BinaryOperator.NotEquals],
+ ["!==", BinaryOperator.NotIdentical],
+ ["??", BinaryOperator.NullishCoalesce],
+ ["||", BinaryOperator.Or],
+ ["+", BinaryOperator.Plus],
+ ["in", BinaryOperator.In],
+ ["+=", BinaryOperator.AdditionAssignment],
+ ["-=", BinaryOperator.SubtractionAssignment],
+ ["*=", BinaryOperator.MultiplicationAssignment],
+ ["/=", BinaryOperator.DivisionAssignment],
+ ["%=", BinaryOperator.RemainderAssignment],
+ ["**=", BinaryOperator.ExponentiationAssignment],
+ ["&&=", BinaryOperator.AndAssignment],
+ ["||=", BinaryOperator.OrAssignment],
+ ["??=", BinaryOperator.NullishCoalesceAssignment]
+]);
+function namespaceForKey(namespacePrefixKey) {
+ const NAMESPACES = /* @__PURE__ */ new Map([
+ ["svg", Namespace.SVG],
+ ["math", Namespace.Math]
+ ]);
+ if (namespacePrefixKey === null) {
+ return Namespace.HTML;
+ }
+ return NAMESPACES.get(namespacePrefixKey) ?? Namespace.HTML;
+}
+function keyForNamespace(namespace) {
+ const NAMESPACES = /* @__PURE__ */ new Map([
+ ["svg", Namespace.SVG],
+ ["math", Namespace.Math]
+ ]);
+ for (const [k, n] of NAMESPACES.entries()) {
+ if (n === namespace) {
+ return k;
+ }
+ }
+ return null;
+}
+function prefixWithNamespace(strippedTag, namespace) {
+ if (namespace === Namespace.HTML) {
+ return strippedTag;
+ }
+ return `:${keyForNamespace(namespace)}:${strippedTag}`;
+}
+function literalOrArrayLiteral(value) {
+ if (Array.isArray(value)) {
+ return literalArr(value.map(literalOrArrayLiteral));
+ }
+ return literal(value);
+}
+function collectElementConsts(job) {
+ const allElementAttributes = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.ExtractedAttribute) {
+ const attributes = allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility);
+ allElementAttributes.set(op.target, attributes);
+ attributes.add(op.bindingKind, op.name, op.expression, op.namespace, op.trustedValueFn);
+ OpList.remove(op);
+ }
+ }
+ }
+ if (job instanceof ComponentCompilationJob) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind == OpKind.Projection) {
+ const attributes = allElementAttributes.get(op.xref);
+ if (attributes !== void 0) {
+ const attrArray = serializeAttributes(attributes);
+ if (attrArray.entries.length > 0) {
+ op.attributes = attrArray;
+ }
+ }
+ } else if (isElementOrContainerOp(op)) {
+ op.attributes = getConstIndex(job, allElementAttributes, op.xref);
+ if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
+ op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView);
+ }
+ }
+ }
+ }
+ } else if (job instanceof HostBindingCompilationJob) {
+ for (const [xref, attributes] of allElementAttributes.entries()) {
+ if (xref !== job.root.xref) {
+ throw new Error(`An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`);
+ }
+ const attrArray = serializeAttributes(attributes);
+ if (attrArray.entries.length > 0) {
+ job.root.attributes = attrArray;
+ }
+ }
+ }
+}
+function getConstIndex(job, allElementAttributes, xref) {
+ const attributes = allElementAttributes.get(xref);
+ if (attributes !== void 0) {
+ const attrArray = serializeAttributes(attributes);
+ if (attrArray.entries.length > 0) {
+ return job.addConst(attrArray);
+ }
+ }
+ return null;
+}
+var FLYWEIGHT_ARRAY = Object.freeze([]);
+var ElementAttributes = class {
+ compatibility;
+ known = /* @__PURE__ */ new Map();
+ byKind = /* @__PURE__ */ new Map();
+ propertyBindings = null;
+ projectAs = null;
+ get attributes() {
+ return this.byKind.get(BindingKind.Attribute) ?? FLYWEIGHT_ARRAY;
+ }
+ get classes() {
+ return this.byKind.get(BindingKind.ClassName) ?? FLYWEIGHT_ARRAY;
+ }
+ get styles() {
+ return this.byKind.get(BindingKind.StyleProperty) ?? FLYWEIGHT_ARRAY;
+ }
+ get bindings() {
+ return this.propertyBindings ?? FLYWEIGHT_ARRAY;
+ }
+ get template() {
+ return this.byKind.get(BindingKind.Template) ?? FLYWEIGHT_ARRAY;
+ }
+ get i18n() {
+ return this.byKind.get(BindingKind.I18n) ?? FLYWEIGHT_ARRAY;
+ }
+ constructor(compatibility) {
+ this.compatibility = compatibility;
+ }
+ isKnown(kind, name) {
+ const nameToValue = this.known.get(kind) ?? /* @__PURE__ */ new Set();
+ this.known.set(kind, nameToValue);
+ if (nameToValue.has(name)) {
+ return true;
+ }
+ nameToValue.add(name);
+ return false;
+ }
+ add(kind, name, value, namespace, trustedValueFn) {
+ const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
+ if (!allowDuplicates && this.isKnown(kind, name)) {
+ return;
+ }
+ if (name === "ngProjectAs") {
+ if (value === null || !(value instanceof LiteralExpr) || value.value == null || typeof value.value?.toString() !== "string") {
+ throw Error("ngProjectAs must have a string literal value");
+ }
+ this.projectAs = value.value.toString();
+ }
+ const array = this.arrayFor(kind);
+ array.push(...getAttributeNameLiterals(namespace, name));
+ if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {
+ if (value === null) {
+ throw Error("Attribute, i18n attribute, & style element attributes must have a value");
+ }
+ if (trustedValueFn !== null) {
+ if (!isStringLiteral(value)) {
+ throw Error("AssertionError: extracted attribute value should be string literal");
+ }
+ array.push(taggedTemplate(trustedValueFn, new TemplateLiteralExpr([new TemplateLiteralElementExpr(value.value)], []), void 0, value.sourceSpan));
+ } else {
+ array.push(value);
+ }
+ }
+ }
+ arrayFor(kind) {
+ if (kind === BindingKind.Property || kind === BindingKind.TwoWayProperty) {
+ this.propertyBindings ??= [];
+ return this.propertyBindings;
+ } else {
+ if (!this.byKind.has(kind)) {
+ this.byKind.set(kind, []);
+ }
+ return this.byKind.get(kind);
+ }
+ }
+};
+function getAttributeNameLiterals(namespace, name) {
+ const nameLiteral = literal(name);
+ if (namespace) {
+ return [literal(
+ 0
+ /* core.AttributeMarker.NamespaceURI */
+ ), literal(namespace), nameLiteral];
+ }
+ return [nameLiteral];
+}
+function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, projectAs, styles, template: template2 }) {
+ const attrArray = [...attributes];
+ if (projectAs !== null) {
+ const parsedR3Selector = parseSelectorToR3Selector(projectAs)[0];
+ attrArray.push(literal(
+ 5
+ /* core.AttributeMarker.ProjectAs */
+ ), literalOrArrayLiteral(parsedR3Selector));
+ }
+ if (classes.length > 0) {
+ attrArray.push(literal(
+ 1
+ /* core.AttributeMarker.Classes */
+ ), ...classes);
+ }
+ if (styles.length > 0) {
+ attrArray.push(literal(
+ 2
+ /* core.AttributeMarker.Styles */
+ ), ...styles);
+ }
+ if (bindings.length > 0) {
+ attrArray.push(literal(
+ 3
+ /* core.AttributeMarker.Bindings */
+ ), ...bindings);
+ }
+ if (template2.length > 0) {
+ attrArray.push(literal(
+ 4
+ /* core.AttributeMarker.Template */
+ ), ...template2);
+ }
+ if (i18n2.length > 0) {
+ attrArray.push(literal(
+ 6
+ /* core.AttributeMarker.I18n */
+ ), ...i18n2);
+ }
+ return literalArr(attrArray);
+}
+function convertI18nBindings(job) {
+ const i18nAttributesByElem = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.I18nAttributes) {
+ i18nAttributesByElem.set(op.target, op);
+ }
+ }
+ for (const op of unit.update) {
+ switch (op.kind) {
+ case OpKind.Property:
+ case OpKind.Attribute:
+ if (op.i18nContext === null) {
+ continue;
+ }
+ if (!(op.expression instanceof Interpolation2)) {
+ continue;
+ }
+ const i18nAttributesForElem = i18nAttributesByElem.get(op.target);
+ if (i18nAttributesForElem === void 0) {
+ throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");
+ }
+ if (i18nAttributesForElem.target !== op.target) {
+ throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");
+ }
+ const ops = [];
+ for (let i = 0; i < op.expression.expressions.length; i++) {
+ const expr = op.expression.expressions[i];
+ if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
+ throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);
+ }
+ ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, null, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
+ }
+ OpList.replaceWithMany(op, ops);
+ break;
+ }
+ }
+ }
+}
+function createI18nContexts(job) {
+ const attrContextByMessage = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ switch (op.kind) {
+ case OpKind.Binding:
+ case OpKind.Property:
+ case OpKind.Attribute:
+ case OpKind.ExtractedAttribute:
+ if (op.i18nMessage === null) {
+ continue;
+ }
+ if (!attrContextByMessage.has(op.i18nMessage)) {
+ const i18nContext = createI18nContextOp(I18nContextKind.Attr, job.allocateXrefId(), null, op.i18nMessage, null);
+ unit.create.push(i18nContext);
+ attrContextByMessage.set(op.i18nMessage, i18nContext.xref);
+ }
+ op.i18nContext = attrContextByMessage.get(op.i18nMessage);
+ break;
+ }
+ }
+ }
+ const blockContextByI18nBlock = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ if (op.xref === op.root) {
+ const contextOp = createI18nContextOp(I18nContextKind.RootI18n, job.allocateXrefId(), op.xref, op.message, null);
+ unit.create.push(contextOp);
+ op.context = contextOp.xref;
+ blockContextByI18nBlock.set(op.xref, contextOp);
+ }
+ break;
+ }
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
+ const rootContext = blockContextByI18nBlock.get(op.root);
+ if (rootContext === void 0) {
+ throw Error("AssertionError: Root i18n block i18n context should have been created.");
+ }
+ op.context = rootContext.xref;
+ blockContextByI18nBlock.set(op.xref, rootContext);
+ }
+ }
+ }
+ let currentI18nOp = null;
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ currentI18nOp = op;
+ break;
+ case OpKind.I18nEnd:
+ currentI18nOp = null;
+ break;
+ case OpKind.IcuStart:
+ if (currentI18nOp === null) {
+ throw Error("AssertionError: Unexpected ICU outside of an i18n block.");
+ }
+ if (op.message.id !== currentI18nOp.message.id) {
+ const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.root, op.message, null);
+ unit.create.push(contextOp);
+ op.context = contextOp.xref;
+ } else {
+ op.context = currentI18nOp.context;
+ blockContextByI18nBlock.get(currentI18nOp.xref).contextKind = I18nContextKind.Icu;
+ }
+ break;
+ }
+ }
+ }
+}
+function deduplicateTextBindings(job) {
+ const seen = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.update.reversed()) {
+ if (op.kind === OpKind.Binding && op.isTextAttribute) {
+ const seenForElement = seen.get(op.target) || /* @__PURE__ */ new Set();
+ if (seenForElement.has(op.name)) {
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
+ if (op.name === "style" || op.name === "class") {
+ OpList.remove(op);
+ }
+ }
+ }
+ seenForElement.add(op.name);
+ seen.set(op.target, seenForElement);
+ }
+ }
+ }
+}
+function configureDeferInstructions(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.Defer) {
+ continue;
+ }
+ if (op.placeholderMinimumTime !== null) {
+ op.placeholderConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime]));
+ }
+ if (op.loadingMinimumTime !== null || op.loadingAfterTime !== null) {
+ op.loadingConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime, op.loadingAfterTime]));
+ }
+ }
+ }
+}
+function resolveDeferTargetNames(job) {
+ const scopes = /* @__PURE__ */ new Map();
+ function getScopeForView2(view) {
+ if (scopes.has(view.xref)) {
+ return scopes.get(view.xref);
+ }
+ const scope = new Scope$1();
+ for (const op of view.create) {
+ if (!isElementOrContainerOp(op) || op.localRefs === null) {
+ continue;
+ }
+ if (!Array.isArray(op.localRefs)) {
+ throw new Error("LocalRefs were already processed, but were needed to resolve defer targets.");
+ }
+ for (const ref of op.localRefs) {
+ if (ref.target !== "") {
+ continue;
+ }
+ scope.targets.set(ref.name, { xref: op.xref, slot: op.handle });
+ }
+ }
+ scopes.set(view.xref, scope);
+ return scope;
+ }
+ function resolveTrigger(deferOwnerView, op, placeholderView) {
+ switch (op.trigger.kind) {
+ case DeferTriggerKind.Idle:
+ case DeferTriggerKind.Never:
+ case DeferTriggerKind.Immediate:
+ case DeferTriggerKind.Timer:
+ return;
+ case DeferTriggerKind.Hover:
+ case DeferTriggerKind.Interaction:
+ case DeferTriggerKind.Viewport:
+ if (op.trigger.targetName === null) {
+ if (placeholderView === null) {
+ throw new Error("defer on trigger with no target name must have a placeholder block");
+ }
+ const placeholder = job.views.get(placeholderView);
+ if (placeholder == void 0) {
+ throw new Error("AssertionError: could not find placeholder view for defer on trigger");
+ }
+ for (const placeholderOp of placeholder.create) {
+ if (hasConsumesSlotTrait(placeholderOp) && (isElementOrContainerOp(placeholderOp) || placeholderOp.kind === OpKind.Projection)) {
+ op.trigger.targetXref = placeholderOp.xref;
+ op.trigger.targetView = placeholderView;
+ op.trigger.targetSlotViewSteps = -1;
+ op.trigger.targetSlot = placeholderOp.handle;
+ return;
+ }
+ }
+ return;
+ }
+ let view = placeholderView !== null ? job.views.get(placeholderView) : deferOwnerView;
+ let step = placeholderView !== null ? -1 : 0;
+ while (view !== null) {
+ const scope = getScopeForView2(view);
+ if (scope.targets.has(op.trigger.targetName)) {
+ const { xref, slot } = scope.targets.get(op.trigger.targetName);
+ op.trigger.targetXref = xref;
+ op.trigger.targetView = view.xref;
+ op.trigger.targetSlotViewSteps = step;
+ op.trigger.targetSlot = slot;
+ return;
+ }
+ view = view.parent !== null ? job.views.get(view.parent) : null;
+ step++;
+ }
+ break;
+ default:
+ throw new Error(`Trigger kind ${op.trigger.kind} not handled`);
+ }
+ }
+ for (const unit of job.units) {
+ const defers = /* @__PURE__ */ new Map();
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.Defer:
+ defers.set(op.xref, op);
+ break;
+ case OpKind.DeferOn:
+ const deferOp = defers.get(op.defer);
+ resolveTrigger(unit, op, op.modifier === "hydrate" ? deferOp.mainView : deferOp.placeholderView);
+ break;
+ }
+ }
+ }
+}
+var Scope$1 = class Scope {
+ targets = /* @__PURE__ */ new Map();
+};
+var REPLACEMENTS = /* @__PURE__ */ new Map([
+ [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
+ [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
+ [OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]]
+]);
+var IGNORED_OP_KINDS = /* @__PURE__ */ new Set([OpKind.Pipe]);
+function collapseEmptyInstructions(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ const opReplacements = REPLACEMENTS.get(op.kind);
+ if (opReplacements === void 0) {
+ continue;
+ }
+ const [startKind, mergedKind] = opReplacements;
+ let prevOp = op.prev;
+ while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {
+ prevOp = prevOp.prev;
+ }
+ if (prevOp !== null && prevOp.kind === startKind) {
+ prevOp.kind = mergedKind;
+ OpList.remove(op);
+ }
+ }
+ }
+}
+function expandSafeReads(job) {
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ transformExpressionsInOp(op, (e) => safeTransform(e, { job }), VisitorContextFlag.None);
+ transformExpressionsInOp(op, ternaryTransform, VisitorContextFlag.None);
+ }
+ }
+}
+function needsTemporaryInSafeAccess(e) {
+ if (e instanceof UnaryOperatorExpr) {
+ return needsTemporaryInSafeAccess(e.expr);
+ } else if (e instanceof BinaryOperatorExpr) {
+ return needsTemporaryInSafeAccess(e.lhs) || needsTemporaryInSafeAccess(e.rhs);
+ } else if (e instanceof ConditionalExpr) {
+ if (e.falseCase && needsTemporaryInSafeAccess(e.falseCase))
+ return true;
+ return needsTemporaryInSafeAccess(e.condition) || needsTemporaryInSafeAccess(e.trueCase);
+ } else if (e instanceof NotExpr) {
+ return needsTemporaryInSafeAccess(e.condition);
+ } else if (e instanceof AssignTemporaryExpr) {
+ return needsTemporaryInSafeAccess(e.expr);
+ } else if (e instanceof ReadPropExpr) {
+ return needsTemporaryInSafeAccess(e.receiver);
+ } else if (e instanceof ReadKeyExpr) {
+ return needsTemporaryInSafeAccess(e.receiver) || needsTemporaryInSafeAccess(e.index);
+ } else if (e instanceof ParenthesizedExpr) {
+ return needsTemporaryInSafeAccess(e.expr);
+ }
+ return e instanceof InvokeFunctionExpr || e instanceof LiteralArrayExpr || e instanceof LiteralMapExpr || e instanceof SafeInvokeFunctionExpr || e instanceof PipeBindingExpr;
+}
+function temporariesIn(e) {
+ const temporaries = /* @__PURE__ */ new Set();
+ transformExpressionsInExpression(e, (e2) => {
+ if (e2 instanceof AssignTemporaryExpr) {
+ temporaries.add(e2.xref);
+ }
+ return e2;
+ }, VisitorContextFlag.None);
+ return temporaries;
+}
+function eliminateTemporaryAssignments(e, tmps, ctx) {
+ transformExpressionsInExpression(e, (e2) => {
+ if (e2 instanceof AssignTemporaryExpr && tmps.has(e2.xref)) {
+ const read = new ReadTemporaryExpr(e2.xref);
+ return ctx.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder ? new AssignTemporaryExpr(read, read.xref) : read;
+ }
+ return e2;
+ }, VisitorContextFlag.None);
+ return e;
+}
+function safeTernaryWithTemporary(guard, body, ctx) {
+ let result;
+ if (needsTemporaryInSafeAccess(guard)) {
+ const xref = ctx.job.allocateXrefId();
+ result = [new AssignTemporaryExpr(guard, xref), new ReadTemporaryExpr(xref)];
+ } else {
+ result = [guard, guard.clone()];
+ eliminateTemporaryAssignments(result[1], temporariesIn(result[0]), ctx);
+ }
+ return new SafeTernaryExpr(result[0], body(result[1]));
+}
+function isSafeAccessExpression(e) {
+ return e instanceof SafePropertyReadExpr || e instanceof SafeKeyedReadExpr || e instanceof SafeInvokeFunctionExpr;
+}
+function isUnsafeAccessExpression(e) {
+ return e instanceof ReadPropExpr || e instanceof ReadKeyExpr || e instanceof InvokeFunctionExpr;
+}
+function isAccessExpression(e) {
+ return isSafeAccessExpression(e) || isUnsafeAccessExpression(e);
+}
+function deepestSafeTernary(e) {
+ if (isAccessExpression(e) && e.receiver instanceof SafeTernaryExpr) {
+ let st = e.receiver;
+ while (st.expr instanceof SafeTernaryExpr) {
+ st = st.expr;
+ }
+ return st;
+ }
+ return null;
+}
+function safeTransform(e, ctx) {
+ if (!isAccessExpression(e)) {
+ return e;
+ }
+ const dst = deepestSafeTernary(e);
+ if (dst) {
+ if (e instanceof InvokeFunctionExpr) {
+ dst.expr = dst.expr.callFn(e.args);
+ return e.receiver;
+ }
+ if (e instanceof ReadPropExpr) {
+ dst.expr = dst.expr.prop(e.name);
+ return e.receiver;
+ }
+ if (e instanceof ReadKeyExpr) {
+ dst.expr = dst.expr.key(e.index);
+ return e.receiver;
+ }
+ if (e instanceof SafeInvokeFunctionExpr) {
+ dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.callFn(e.args), ctx);
+ return e.receiver;
+ }
+ if (e instanceof SafePropertyReadExpr) {
+ dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.prop(e.name), ctx);
+ return e.receiver;
+ }
+ if (e instanceof SafeKeyedReadExpr) {
+ dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.key(e.index), ctx);
+ return e.receiver;
+ }
+ } else {
+ if (e instanceof SafeInvokeFunctionExpr) {
+ return safeTernaryWithTemporary(e.receiver, (r) => r.callFn(e.args), ctx);
+ }
+ if (e instanceof SafePropertyReadExpr) {
+ return safeTernaryWithTemporary(e.receiver, (r) => r.prop(e.name), ctx);
+ }
+ if (e instanceof SafeKeyedReadExpr) {
+ return safeTernaryWithTemporary(e.receiver, (r) => r.key(e.index), ctx);
+ }
+ }
+ return e;
+}
+function ternaryTransform(e) {
+ if (!(e instanceof SafeTernaryExpr)) {
+ return e;
+ }
+ return new ParenthesizedExpr(new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr));
+}
+var ESCAPE$1 = "�";
+var ELEMENT_MARKER = "#";
+var TEMPLATE_MARKER = "*";
+var TAG_CLOSE_MARKER = "/";
+var CONTEXT_MARKER = ":";
+var LIST_START_MARKER = "[";
+var LIST_END_MARKER = "]";
+var LIST_DELIMITER = "|";
+function extractI18nMessages(job) {
+ const i18nMessagesByContext = /* @__PURE__ */ new Map();
+ const i18nBlocks = /* @__PURE__ */ new Map();
+ const i18nContexts = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nContext:
+ const i18nMessageOp = createI18nMessage(job, op);
+ unit.create.push(i18nMessageOp);
+ i18nMessagesByContext.set(op.xref, i18nMessageOp);
+ i18nContexts.set(op.xref, op);
+ break;
+ case OpKind.I18nStart:
+ i18nBlocks.set(op.xref, op);
+ break;
+ }
+ }
+ }
+ let currentIcu = null;
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.IcuStart:
+ currentIcu = op;
+ OpList.remove(op);
+ const icuContext = i18nContexts.get(op.context);
+ if (icuContext.contextKind !== I18nContextKind.Icu) {
+ continue;
+ }
+ const i18nBlock = i18nBlocks.get(icuContext.i18nBlock);
+ if (i18nBlock.context === icuContext.xref) {
+ continue;
+ }
+ const rootI18nBlock = i18nBlocks.get(i18nBlock.root);
+ const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context);
+ if (rootMessage === void 0) {
+ throw Error("AssertionError: ICU sub-message should belong to a root message.");
+ }
+ const subMessage = i18nMessagesByContext.get(icuContext.xref);
+ subMessage.messagePlaceholder = op.messagePlaceholder;
+ rootMessage.subMessages.push(subMessage.xref);
+ break;
+ case OpKind.IcuEnd:
+ currentIcu = null;
+ OpList.remove(op);
+ break;
+ case OpKind.IcuPlaceholder:
+ if (currentIcu === null || currentIcu.context == null) {
+ throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");
+ }
+ const msg = i18nMessagesByContext.get(currentIcu.context);
+ msg.postprocessingParams.set(op.name, literal(formatIcuPlaceholder(op)));
+ OpList.remove(op);
+ break;
+ }
+ }
+ }
+}
+function createI18nMessage(job, context, messagePlaceholder) {
+ let formattedParams = formatParams(context.params);
+ const formattedPostprocessingParams = formatParams(context.postprocessingParams);
+ let needsPostprocessing = [...context.params.values()].some((v) => v.length > 1);
+ return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
+}
+function formatIcuPlaceholder(op) {
+ if (op.strings.length !== op.expressionPlaceholders.length + 1) {
+ throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
+ }
+ const values = op.expressionPlaceholders.map(formatValue);
+ return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
+}
+function formatParams(params) {
+ const formattedParams = /* @__PURE__ */ new Map();
+ for (const [placeholder, placeholderValues] of params) {
+ const serializedValues = formatParamValues(placeholderValues);
+ if (serializedValues !== null) {
+ formattedParams.set(placeholder, literal(serializedValues));
+ }
+ }
+ return formattedParams;
+}
+function formatParamValues(values) {
+ if (values.length === 0) {
+ return null;
+ }
+ const serializedValues = values.map((value) => formatValue(value));
+ return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
+}
+function formatValue(value) {
+ if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) {
+ if (typeof value.value !== "object") {
+ throw Error("AssertionError: Expected i18n param value to have an element and template slot");
+ }
+ const elementValue = formatValue(__spreadProps(__spreadValues({}, value), {
+ value: value.value.element,
+ flags: value.flags & ~I18nParamValueFlags.TemplateTag
+ }));
+ const templateValue = formatValue(__spreadProps(__spreadValues({}, value), {
+ value: value.value.template,
+ flags: value.flags & ~I18nParamValueFlags.ElementTag
+ }));
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
+ return `${templateValue}${elementValue}${templateValue}`;
+ }
+ return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`;
+ }
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
+ return `${formatValue(__spreadProps(__spreadValues({}, value), {
+ flags: value.flags & ~I18nParamValueFlags.CloseTag
+ }))}${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.OpenTag }))}`;
+ }
+ if (value.flags === I18nParamValueFlags.None) {
+ return `${value.value}`;
+ }
+ let tagMarker = "";
+ let closeMarker = "";
+ if (value.flags & I18nParamValueFlags.ElementTag) {
+ tagMarker = ELEMENT_MARKER;
+ } else if (value.flags & I18nParamValueFlags.TemplateTag) {
+ tagMarker = TEMPLATE_MARKER;
+ }
+ if (tagMarker !== "") {
+ closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
+ }
+ const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
+ return `${ESCAPE$1}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE$1}`;
+}
+function generateAdvance(job) {
+ for (const unit of job.units) {
+ const slotMap = /* @__PURE__ */ new Map();
+ for (const op of unit.create) {
+ if (!hasConsumesSlotTrait(op)) {
+ continue;
+ } else if (op.handle.slot === null) {
+ throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`);
+ }
+ slotMap.set(op.xref, op.handle.slot);
+ }
+ let slotContext = 0;
+ for (const op of unit.update) {
+ let consumer = null;
+ if (hasDependsOnSlotContextTrait(op)) {
+ consumer = op;
+ } else {
+ visitExpressionsInOp(op, (expr) => {
+ if (consumer === null && hasDependsOnSlotContextTrait(expr)) {
+ consumer = expr;
+ }
+ });
+ }
+ if (consumer === null) {
+ continue;
+ }
+ if (!slotMap.has(consumer.target)) {
+ throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`);
+ }
+ const slot = slotMap.get(consumer.target);
+ if (slotContext !== slot) {
+ const delta = slot - slotContext;
+ if (delta < 0) {
+ throw new Error(`AssertionError: slot counter should never need to move backwards`);
+ }
+ OpList.insertBefore(createAdvanceOp(delta, consumer.sourceSpan), op);
+ slotContext = slot;
+ }
+ }
+ }
+}
+function generateLocalLetReferences(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ if (op.kind !== OpKind.StoreLet) {
+ continue;
+ }
+ const variable2 = {
+ kind: SemanticVariableKind.Identifier,
+ name: null,
+ identifier: op.declaredName,
+ local: true
+ };
+ OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
+ }
+ }
+}
+function generateProjectionDefs(job) {
+ const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
+ const selectors = [];
+ let projectionSlotIndex = 0;
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.Projection) {
+ selectors.push(op.selector);
+ op.projectionSlotIndex = projectionSlotIndex++;
+ }
+ }
+ }
+ if (selectors.length > 0) {
+ let defExpr = null;
+ if (selectors.length > 1 || selectors[0] !== "*") {
+ const def = selectors.map((s) => s === "*" ? s : parseSelectorToR3Selector(s));
+ defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);
+ }
+ job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);
+ job.root.create.prepend([createProjectionDefOp(defExpr)]);
+ }
+}
+function generateVariables(job) {
+ recursivelyProcessView(
+ job.root,
+ /* there is no parent scope for the root view */
+ null
+ );
+}
+function recursivelyProcessView(view, parentScope) {
+ const scope = getScopeForView(view, parentScope);
+ for (const op of view.create) {
+ switch (op.kind) {
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ recursivelyProcessView(view.job.views.get(op.xref), scope);
+ break;
+ case OpKind.Projection:
+ if (op.fallbackView !== null) {
+ recursivelyProcessView(view.job.views.get(op.fallbackView), scope);
+ }
+ break;
+ case OpKind.RepeaterCreate:
+ recursivelyProcessView(view.job.views.get(op.xref), scope);
+ if (op.emptyView) {
+ recursivelyProcessView(view.job.views.get(op.emptyView), scope);
+ }
+ if (op.trackByOps !== null) {
+ op.trackByOps.prepend(generateVariablesInScopeForView(view, scope, false));
+ }
+ break;
+ case OpKind.Listener:
+ case OpKind.TwoWayListener:
+ op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true));
+ break;
+ }
+ }
+ view.update.prepend(generateVariablesInScopeForView(view, scope, false));
+}
+function getScopeForView(view, parent) {
+ const scope = {
+ view: view.xref,
+ viewContextVariable: {
+ kind: SemanticVariableKind.Context,
+ name: null,
+ view: view.xref
+ },
+ contextVariables: /* @__PURE__ */ new Map(),
+ aliases: view.aliases,
+ references: [],
+ letDeclarations: [],
+ parent
+ };
+ for (const identifier of view.contextVariables.keys()) {
+ scope.contextVariables.set(identifier, {
+ kind: SemanticVariableKind.Identifier,
+ name: null,
+ identifier,
+ local: false
+ });
+ }
+ for (const op of view.create) {
+ switch (op.kind) {
+ case OpKind.ElementStart:
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ if (!Array.isArray(op.localRefs)) {
+ throw new Error(`AssertionError: expected localRefs to be an array`);
+ }
+ for (let offset = 0; offset < op.localRefs.length; offset++) {
+ scope.references.push({
+ name: op.localRefs[offset].name,
+ targetId: op.xref,
+ targetSlot: op.handle,
+ offset,
+ variable: {
+ kind: SemanticVariableKind.Identifier,
+ name: null,
+ identifier: op.localRefs[offset].name,
+ local: false
+ }
+ });
+ }
+ break;
+ case OpKind.DeclareLet:
+ scope.letDeclarations.push({
+ targetId: op.xref,
+ targetSlot: op.handle,
+ variable: {
+ kind: SemanticVariableKind.Identifier,
+ name: null,
+ identifier: op.declaredName,
+ local: false
+ }
+ });
+ break;
+ }
+ }
+ return scope;
+}
+function generateVariablesInScopeForView(view, scope, isListener) {
+ const newOps = [];
+ if (scope.view !== view.xref) {
+ newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));
+ }
+ const scopeView = view.job.views.get(scope.view);
+ for (const [name, value] of scopeView.contextVariables) {
+ const context = new ContextExpr(scope.view);
+ const variable2 = value === CTX_REF ? context : new ReadPropExpr(context, value);
+ newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2, VariableFlags.None));
+ }
+ for (const alias of scopeView.aliases) {
+ newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline));
+ }
+ for (const ref of scope.references) {
+ newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None));
+ }
+ if (scope.view !== view.xref || isListener) {
+ for (const decl of scope.letDeclarations) {
+ newOps.push(createVariableOp(view.job.allocateXrefId(), decl.variable, new ContextLetReferenceExpr(decl.targetId, decl.targetSlot), VariableFlags.None));
+ }
+ }
+ if (scope.parent !== null) {
+ newOps.push(...generateVariablesInScopeForView(view, scope.parent, false));
+ }
+ return newOps;
+}
+function collectConstExpressions(job) {
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ transformExpressionsInOp(op, (expr) => {
+ if (!(expr instanceof ConstCollectedExpr)) {
+ return expr;
+ }
+ return literal(job.addConst(expr.expr));
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+var STYLE_DOT = "style.";
+var CLASS_DOT = "class.";
+var STYLE_BANG = "style!";
+var CLASS_BANG = "class!";
+var BANG_IMPORTANT = "!important";
+function parseHostStyleProperties(job) {
+ for (const op of job.root.update) {
+ if (!(op.kind === OpKind.Binding && op.bindingKind === BindingKind.Property)) {
+ continue;
+ }
+ if (op.name.endsWith(BANG_IMPORTANT)) {
+ op.name = op.name.substring(0, op.name.length - BANG_IMPORTANT.length);
+ }
+ if (op.name.startsWith(STYLE_DOT)) {
+ op.bindingKind = BindingKind.StyleProperty;
+ op.name = op.name.substring(STYLE_DOT.length);
+ if (!isCssCustomProperty(op.name)) {
+ op.name = hyphenate$1(op.name);
+ }
+ const { property: property2, suffix } = parseProperty(op.name);
+ op.name = property2;
+ op.unit = suffix;
+ } else if (op.name.startsWith(STYLE_BANG)) {
+ op.bindingKind = BindingKind.StyleProperty;
+ op.name = "style";
+ } else if (op.name.startsWith(CLASS_DOT)) {
+ op.bindingKind = BindingKind.ClassName;
+ op.name = parseProperty(op.name.substring(CLASS_DOT.length)).property;
+ } else if (op.name.startsWith(CLASS_BANG)) {
+ op.bindingKind = BindingKind.ClassName;
+ op.name = parseProperty(op.name.substring(CLASS_BANG.length)).property;
+ }
+ }
+}
+function isCssCustomProperty(name) {
+ return name.startsWith("--");
+}
+function hyphenate$1(value) {
+ return value.replace(/[a-z][A-Z]/g, (v) => {
+ return v.charAt(0) + "-" + v.charAt(1);
+ }).toLowerCase();
+}
+function parseProperty(name) {
+ const overrideIndex = name.indexOf("!important");
+ if (overrideIndex !== -1) {
+ name = overrideIndex > 0 ? name.substring(0, overrideIndex) : "";
+ }
+ let suffix = null;
+ let property2 = name;
+ const unitIndex = name.lastIndexOf(".");
+ if (unitIndex > 0) {
+ suffix = name.slice(unitIndex + 1);
+ property2 = name.substring(0, unitIndex);
+ }
+ return { property: property2, suffix };
+}
+function mapLiteral(obj, quoted = false) {
+ return literalMap(Object.keys(obj).map((key) => ({
+ key,
+ quoted,
+ value: obj[key]
+ })));
+}
+var IcuSerializerVisitor = class {
+ visitText(text2) {
+ return text2.value;
+ }
+ visitContainer(container) {
+ return container.children.map((child) => child.visit(this)).join("");
+ }
+ visitIcu(icu) {
+ const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
+ const result = `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(" ")}}`;
+ return result;
+ }
+ visitTagPlaceholder(ph) {
+ return ph.isVoid ? this.formatPh(ph.startName) : `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
+ }
+ visitPlaceholder(ph) {
+ return this.formatPh(ph.name);
+ }
+ visitBlockPlaceholder(ph) {
+ return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
+ }
+ visitIcuPlaceholder(ph, context) {
+ return this.formatPh(ph.name);
+ }
+ formatPh(value) {
+ return `{${formatI18nPlaceholderName(
+ value,
+ /* useCamelCase */
+ false
+ )}}`;
+ }
+};
+var serializer = new IcuSerializerVisitor();
+function serializeIcuNode(icu) {
+ return icu.visit(serializer);
+}
+var NodeWithI18n = class {
+ sourceSpan;
+ i18n;
+ constructor(sourceSpan, i18n2) {
+ this.sourceSpan = sourceSpan;
+ this.i18n = i18n2;
+ }
+};
+var Text4 = class extends NodeWithI18n {
+ value;
+ tokens;
+ constructor(value, sourceSpan, tokens, i18n2) {
+ super(sourceSpan, i18n2);
+ this.value = value;
+ this.tokens = tokens;
+ }
+ visit(visitor, context) {
+ return visitor.visitText(this, context);
+ }
+};
+var Expansion = class extends NodeWithI18n {
+ switchValue;
+ type;
+ cases;
+ switchValueSourceSpan;
+ constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n2) {
+ super(sourceSpan, i18n2);
+ this.switchValue = switchValue;
+ this.type = type;
+ this.cases = cases;
+ this.switchValueSourceSpan = switchValueSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitExpansion(this, context);
+ }
+};
+var ExpansionCase = class {
+ value;
+ expression;
+ sourceSpan;
+ valueSourceSpan;
+ expSourceSpan;
+ constructor(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {
+ this.value = value;
+ this.expression = expression;
+ this.sourceSpan = sourceSpan;
+ this.valueSourceSpan = valueSourceSpan;
+ this.expSourceSpan = expSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitExpansionCase(this, context);
+ }
+};
+var Attribute = class extends NodeWithI18n {
+ name;
+ value;
+ keySpan;
+ valueSpan;
+ valueTokens;
+ constructor(name, value, sourceSpan, keySpan, valueSpan, valueTokens, i18n2) {
+ super(sourceSpan, i18n2);
+ this.name = name;
+ this.value = value;
+ this.keySpan = keySpan;
+ this.valueSpan = valueSpan;
+ this.valueTokens = valueTokens;
+ }
+ visit(visitor, context) {
+ return visitor.visitAttribute(this, context);
+ }
+};
+var Element2 = class extends NodeWithI18n {
+ name;
+ attrs;
+ directives;
+ children;
+ isSelfClosing;
+ startSourceSpan;
+ endSourceSpan;
+ isVoid;
+ constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, isVoid, i18n2) {
+ super(sourceSpan, i18n2);
+ this.name = name;
+ this.attrs = attrs;
+ this.directives = directives;
+ this.children = children;
+ this.isSelfClosing = isSelfClosing;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ this.isVoid = isVoid;
+ }
+ visit(visitor, context) {
+ return visitor.visitElement(this, context);
+ }
+};
+var Comment2 = class {
+ value;
+ sourceSpan;
+ constructor(value, sourceSpan) {
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitComment(this, context);
+ }
+};
+var Block = class extends NodeWithI18n {
+ name;
+ parameters;
+ children;
+ nameSpan;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n2) {
+ super(sourceSpan, i18n2);
+ this.name = name;
+ this.parameters = parameters;
+ this.children = children;
+ this.nameSpan = nameSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitBlock(this, context);
+ }
+};
+var Component2 = class extends NodeWithI18n {
+ componentName;
+ tagName;
+ fullName;
+ attrs;
+ directives;
+ children;
+ isSelfClosing;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(componentName, tagName, fullName, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n2) {
+ super(sourceSpan, i18n2);
+ this.componentName = componentName;
+ this.tagName = tagName;
+ this.fullName = fullName;
+ this.attrs = attrs;
+ this.directives = directives;
+ this.children = children;
+ this.isSelfClosing = isSelfClosing;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitComponent(this, context);
+ }
+};
+var Directive2 = class {
+ name;
+ attrs;
+ sourceSpan;
+ startSourceSpan;
+ endSourceSpan;
+ constructor(name, attrs, sourceSpan, startSourceSpan, endSourceSpan = null) {
+ this.name = name;
+ this.attrs = attrs;
+ this.sourceSpan = sourceSpan;
+ this.startSourceSpan = startSourceSpan;
+ this.endSourceSpan = endSourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitDirective(this, context);
+ }
+};
+var BlockParameter = class {
+ expression;
+ sourceSpan;
+ constructor(expression, sourceSpan) {
+ this.expression = expression;
+ this.sourceSpan = sourceSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitBlockParameter(this, context);
+ }
+};
+var LetDeclaration2 = class {
+ name;
+ value;
+ sourceSpan;
+ nameSpan;
+ valueSpan;
+ constructor(name, value, sourceSpan, nameSpan, valueSpan) {
+ this.name = name;
+ this.value = value;
+ this.sourceSpan = sourceSpan;
+ this.nameSpan = nameSpan;
+ this.valueSpan = valueSpan;
+ }
+ visit(visitor, context) {
+ return visitor.visitLetDeclaration(this, context);
+ }
+};
+function visitAll(visitor, nodes, context = null) {
+ const result = [];
+ const visit = visitor.visit ? (ast) => visitor.visit(ast, context) || ast.visit(visitor, context) : (ast) => ast.visit(visitor, context);
+ nodes.forEach((ast) => {
+ const astResult = visit(ast);
+ if (astResult) {
+ result.push(astResult);
+ }
+ });
+ return result;
+}
+var RecursiveVisitor2 = class {
+ constructor() {
+ }
+ visitElement(ast, context) {
+ this.visitChildren(context, (visit) => {
+ visit(ast.attrs);
+ visit(ast.directives);
+ visit(ast.children);
+ });
+ }
+ visitAttribute(ast, context) {
+ }
+ visitText(ast, context) {
+ }
+ visitComment(ast, context) {
+ }
+ visitExpansion(ast, context) {
+ return this.visitChildren(context, (visit) => {
+ visit(ast.cases);
+ });
+ }
+ visitExpansionCase(ast, context) {
+ }
+ visitBlock(block, context) {
+ this.visitChildren(context, (visit) => {
+ visit(block.parameters);
+ visit(block.children);
+ });
+ }
+ visitBlockParameter(ast, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ this.visitChildren(context, (visit) => {
+ visit(component.attrs);
+ visit(component.children);
+ });
+ }
+ visitDirective(directive, context) {
+ this.visitChildren(context, (visit) => {
+ visit(directive.attrs);
+ });
+ }
+ visitChildren(context, cb) {
+ let results = [];
+ let t = this;
+ function visit(children) {
+ if (children)
+ results.push(visitAll(t, children, context));
+ }
+ cb(visit);
+ return Array.prototype.concat.apply([], results);
+ }
+};
+var NAMED_ENTITIES = {
+ "AElig": "Æ",
+ "AMP": "&",
+ "amp": "&",
+ "Aacute": "Á",
+ "Abreve": "Ă",
+ "Acirc": "Â",
+ "Acy": "А",
+ "Afr": "𝔄",
+ "Agrave": "À",
+ "Alpha": "Α",
+ "Amacr": "Ā",
+ "And": "⩓",
+ "Aogon": "Ą",
+ "Aopf": "𝔸",
+ "ApplyFunction": "",
+ "af": "",
+ "Aring": "Å",
+ "angst": "Å",
+ "Ascr": "𝒜",
+ "Assign": "≔",
+ "colone": "≔",
+ "coloneq": "≔",
+ "Atilde": "Ã",
+ "Auml": "Ä",
+ "Backslash": "∖",
+ "setminus": "∖",
+ "setmn": "∖",
+ "smallsetminus": "∖",
+ "ssetmn": "∖",
+ "Barv": "⫧",
+ "Barwed": "⌆",
+ "doublebarwedge": "⌆",
+ "Bcy": "Б",
+ "Because": "∵",
+ "becaus": "∵",
+ "because": "∵",
+ "Bernoullis": "ℬ",
+ "Bscr": "ℬ",
+ "bernou": "ℬ",
+ "Beta": "Β",
+ "Bfr": "𝔅",
+ "Bopf": "𝔹",
+ "Breve": "˘",
+ "breve": "˘",
+ "Bumpeq": "≎",
+ "HumpDownHump": "≎",
+ "bump": "≎",
+ "CHcy": "Ч",
+ "COPY": "©",
+ "copy": "©",
+ "Cacute": "Ć",
+ "Cap": "⋒",
+ "CapitalDifferentialD": "ⅅ",
+ "DD": "ⅅ",
+ "Cayleys": "ℭ",
+ "Cfr": "ℭ",
+ "Ccaron": "Č",
+ "Ccedil": "Ç",
+ "Ccirc": "Ĉ",
+ "Cconint": "∰",
+ "Cdot": "Ċ",
+ "Cedilla": "¸",
+ "cedil": "¸",
+ "CenterDot": "·",
+ "centerdot": "·",
+ "middot": "·",
+ "Chi": "Χ",
+ "CircleDot": "⊙",
+ "odot": "⊙",
+ "CircleMinus": "⊖",
+ "ominus": "⊖",
+ "CirclePlus": "⊕",
+ "oplus": "⊕",
+ "CircleTimes": "⊗",
+ "otimes": "⊗",
+ "ClockwiseContourIntegral": "∲",
+ "cwconint": "∲",
+ "CloseCurlyDoubleQuote": "”",
+ "rdquo": "”",
+ "rdquor": "”",
+ "CloseCurlyQuote": "’",
+ "rsquo": "’",
+ "rsquor": "’",
+ "Colon": "∷",
+ "Proportion": "∷",
+ "Colone": "⩴",
+ "Congruent": "≡",
+ "equiv": "≡",
+ "Conint": "∯",
+ "DoubleContourIntegral": "∯",
+ "ContourIntegral": "∮",
+ "conint": "∮",
+ "oint": "∮",
+ "Copf": "ℂ",
+ "complexes": "ℂ",
+ "Coproduct": "∐",
+ "coprod": "∐",
+ "CounterClockwiseContourIntegral": "∳",
+ "awconint": "∳",
+ "Cross": "⨯",
+ "Cscr": "𝒞",
+ "Cup": "⋓",
+ "CupCap": "≍",
+ "asympeq": "≍",
+ "DDotrahd": "⤑",
+ "DJcy": "Ђ",
+ "DScy": "Ѕ",
+ "DZcy": "Џ",
+ "Dagger": "‡",
+ "ddagger": "‡",
+ "Darr": "↡",
+ "Dashv": "⫤",
+ "DoubleLeftTee": "⫤",
+ "Dcaron": "Ď",
+ "Dcy": "Д",
+ "Del": "∇",
+ "nabla": "∇",
+ "Delta": "Δ",
+ "Dfr": "𝔇",
+ "DiacriticalAcute": "´",
+ "acute": "´",
+ "DiacriticalDot": "˙",
+ "dot": "˙",
+ "DiacriticalDoubleAcute": "˝",
+ "dblac": "˝",
+ "DiacriticalGrave": "`",
+ "grave": "`",
+ "DiacriticalTilde": "˜",
+ "tilde": "˜",
+ "Diamond": "⋄",
+ "diam": "⋄",
+ "diamond": "⋄",
+ "DifferentialD": "ⅆ",
+ "dd": "ⅆ",
+ "Dopf": "𝔻",
+ "Dot": "¨",
+ "DoubleDot": "¨",
+ "die": "¨",
+ "uml": "¨",
+ "DotDot": "⃜",
+ "DotEqual": "≐",
+ "doteq": "≐",
+ "esdot": "≐",
+ "DoubleDownArrow": "⇓",
+ "Downarrow": "⇓",
+ "dArr": "⇓",
+ "DoubleLeftArrow": "⇐",
+ "Leftarrow": "⇐",
+ "lArr": "⇐",
+ "DoubleLeftRightArrow": "⇔",
+ "Leftrightarrow": "⇔",
+ "hArr": "⇔",
+ "iff": "⇔",
+ "DoubleLongLeftArrow": "⟸",
+ "Longleftarrow": "⟸",
+ "xlArr": "⟸",
+ "DoubleLongLeftRightArrow": "⟺",
+ "Longleftrightarrow": "⟺",
+ "xhArr": "⟺",
+ "DoubleLongRightArrow": "⟹",
+ "Longrightarrow": "⟹",
+ "xrArr": "⟹",
+ "DoubleRightArrow": "⇒",
+ "Implies": "⇒",
+ "Rightarrow": "⇒",
+ "rArr": "⇒",
+ "DoubleRightTee": "⊨",
+ "vDash": "⊨",
+ "DoubleUpArrow": "⇑",
+ "Uparrow": "⇑",
+ "uArr": "⇑",
+ "DoubleUpDownArrow": "⇕",
+ "Updownarrow": "⇕",
+ "vArr": "⇕",
+ "DoubleVerticalBar": "∥",
+ "par": "∥",
+ "parallel": "∥",
+ "shortparallel": "∥",
+ "spar": "∥",
+ "DownArrow": "↓",
+ "ShortDownArrow": "↓",
+ "darr": "↓",
+ "downarrow": "↓",
+ "DownArrowBar": "⤓",
+ "DownArrowUpArrow": "⇵",
+ "duarr": "⇵",
+ "DownBreve": "̑",
+ "DownLeftRightVector": "⥐",
+ "DownLeftTeeVector": "⥞",
+ "DownLeftVector": "↽",
+ "leftharpoondown": "↽",
+ "lhard": "↽",
+ "DownLeftVectorBar": "⥖",
+ "DownRightTeeVector": "⥟",
+ "DownRightVector": "⇁",
+ "rhard": "⇁",
+ "rightharpoondown": "⇁",
+ "DownRightVectorBar": "⥗",
+ "DownTee": "⊤",
+ "top": "⊤",
+ "DownTeeArrow": "↧",
+ "mapstodown": "↧",
+ "Dscr": "𝒟",
+ "Dstrok": "Đ",
+ "ENG": "Ŋ",
+ "ETH": "Ð",
+ "Eacute": "É",
+ "Ecaron": "Ě",
+ "Ecirc": "Ê",
+ "Ecy": "Э",
+ "Edot": "Ė",
+ "Efr": "𝔈",
+ "Egrave": "È",
+ "Element": "∈",
+ "in": "∈",
+ "isin": "∈",
+ "isinv": "∈",
+ "Emacr": "Ē",
+ "EmptySmallSquare": "◻",
+ "EmptyVerySmallSquare": "▫",
+ "Eogon": "Ę",
+ "Eopf": "𝔼",
+ "Epsilon": "Ε",
+ "Equal": "⩵",
+ "EqualTilde": "≂",
+ "eqsim": "≂",
+ "esim": "≂",
+ "Equilibrium": "⇌",
+ "rightleftharpoons": "⇌",
+ "rlhar": "⇌",
+ "Escr": "ℰ",
+ "expectation": "ℰ",
+ "Esim": "⩳",
+ "Eta": "Η",
+ "Euml": "Ë",
+ "Exists": "∃",
+ "exist": "∃",
+ "ExponentialE": "ⅇ",
+ "ee": "ⅇ",
+ "exponentiale": "ⅇ",
+ "Fcy": "Ф",
+ "Ffr": "𝔉",
+ "FilledSmallSquare": "◼",
+ "FilledVerySmallSquare": "▪",
+ "blacksquare": "▪",
+ "squarf": "▪",
+ "squf": "▪",
+ "Fopf": "𝔽",
+ "ForAll": "∀",
+ "forall": "∀",
+ "Fouriertrf": "ℱ",
+ "Fscr": "ℱ",
+ "GJcy": "Ѓ",
+ "GT": ">",
+ "gt": ">",
+ "Gamma": "Γ",
+ "Gammad": "Ϝ",
+ "Gbreve": "Ğ",
+ "Gcedil": "Ģ",
+ "Gcirc": "Ĝ",
+ "Gcy": "Г",
+ "Gdot": "Ġ",
+ "Gfr": "𝔊",
+ "Gg": "⋙",
+ "ggg": "⋙",
+ "Gopf": "𝔾",
+ "GreaterEqual": "≥",
+ "ge": "≥",
+ "geq": "≥",
+ "GreaterEqualLess": "⋛",
+ "gel": "⋛",
+ "gtreqless": "⋛",
+ "GreaterFullEqual": "≧",
+ "gE": "≧",
+ "geqq": "≧",
+ "GreaterGreater": "⪢",
+ "GreaterLess": "≷",
+ "gl": "≷",
+ "gtrless": "≷",
+ "GreaterSlantEqual": "⩾",
+ "geqslant": "⩾",
+ "ges": "⩾",
+ "GreaterTilde": "≳",
+ "gsim": "≳",
+ "gtrsim": "≳",
+ "Gscr": "𝒢",
+ "Gt": "≫",
+ "NestedGreaterGreater": "≫",
+ "gg": "≫",
+ "HARDcy": "Ъ",
+ "Hacek": "ˇ",
+ "caron": "ˇ",
+ "Hat": "^",
+ "Hcirc": "Ĥ",
+ "Hfr": "ℌ",
+ "Poincareplane": "ℌ",
+ "HilbertSpace": "ℋ",
+ "Hscr": "ℋ",
+ "hamilt": "ℋ",
+ "Hopf": "ℍ",
+ "quaternions": "ℍ",
+ "HorizontalLine": "─",
+ "boxh": "─",
+ "Hstrok": "Ħ",
+ "HumpEqual": "≏",
+ "bumpe": "≏",
+ "bumpeq": "≏",
+ "IEcy": "Е",
+ "IJlig": "IJ",
+ "IOcy": "Ё",
+ "Iacute": "Í",
+ "Icirc": "Î",
+ "Icy": "И",
+ "Idot": "İ",
+ "Ifr": "ℑ",
+ "Im": "ℑ",
+ "image": "ℑ",
+ "imagpart": "ℑ",
+ "Igrave": "Ì",
+ "Imacr": "Ī",
+ "ImaginaryI": "ⅈ",
+ "ii": "ⅈ",
+ "Int": "∬",
+ "Integral": "∫",
+ "int": "∫",
+ "Intersection": "⋂",
+ "bigcap": "⋂",
+ "xcap": "⋂",
+ "InvisibleComma": "",
+ "ic": "",
+ "InvisibleTimes": "",
+ "it": "",
+ "Iogon": "Į",
+ "Iopf": "𝕀",
+ "Iota": "Ι",
+ "Iscr": "ℐ",
+ "imagline": "ℐ",
+ "Itilde": "Ĩ",
+ "Iukcy": "І",
+ "Iuml": "Ï",
+ "Jcirc": "Ĵ",
+ "Jcy": "Й",
+ "Jfr": "𝔍",
+ "Jopf": "𝕁",
+ "Jscr": "𝒥",
+ "Jsercy": "Ј",
+ "Jukcy": "Є",
+ "KHcy": "Х",
+ "KJcy": "Ќ",
+ "Kappa": "Κ",
+ "Kcedil": "Ķ",
+ "Kcy": "К",
+ "Kfr": "𝔎",
+ "Kopf": "𝕂",
+ "Kscr": "𝒦",
+ "LJcy": "Љ",
+ "LT": "<",
+ "lt": "<",
+ "Lacute": "Ĺ",
+ "Lambda": "Λ",
+ "Lang": "⟪",
+ "Laplacetrf": "ℒ",
+ "Lscr": "ℒ",
+ "lagran": "ℒ",
+ "Larr": "↞",
+ "twoheadleftarrow": "↞",
+ "Lcaron": "Ľ",
+ "Lcedil": "Ļ",
+ "Lcy": "Л",
+ "LeftAngleBracket": "⟨",
+ "lang": "⟨",
+ "langle": "⟨",
+ "LeftArrow": "←",
+ "ShortLeftArrow": "←",
+ "larr": "←",
+ "leftarrow": "←",
+ "slarr": "←",
+ "LeftArrowBar": "⇤",
+ "larrb": "⇤",
+ "LeftArrowRightArrow": "⇆",
+ "leftrightarrows": "⇆",
+ "lrarr": "⇆",
+ "LeftCeiling": "⌈",
+ "lceil": "⌈",
+ "LeftDoubleBracket": "⟦",
+ "lobrk": "⟦",
+ "LeftDownTeeVector": "⥡",
+ "LeftDownVector": "⇃",
+ "dharl": "⇃",
+ "downharpoonleft": "⇃",
+ "LeftDownVectorBar": "⥙",
+ "LeftFloor": "⌊",
+ "lfloor": "⌊",
+ "LeftRightArrow": "↔",
+ "harr": "↔",
+ "leftrightarrow": "↔",
+ "LeftRightVector": "⥎",
+ "LeftTee": "⊣",
+ "dashv": "⊣",
+ "LeftTeeArrow": "↤",
+ "mapstoleft": "↤",
+ "LeftTeeVector": "⥚",
+ "LeftTriangle": "⊲",
+ "vartriangleleft": "⊲",
+ "vltri": "⊲",
+ "LeftTriangleBar": "⧏",
+ "LeftTriangleEqual": "⊴",
+ "ltrie": "⊴",
+ "trianglelefteq": "⊴",
+ "LeftUpDownVector": "⥑",
+ "LeftUpTeeVector": "⥠",
+ "LeftUpVector": "↿",
+ "uharl": "↿",
+ "upharpoonleft": "↿",
+ "LeftUpVectorBar": "⥘",
+ "LeftVector": "↼",
+ "leftharpoonup": "↼",
+ "lharu": "↼",
+ "LeftVectorBar": "⥒",
+ "LessEqualGreater": "⋚",
+ "leg": "⋚",
+ "lesseqgtr": "⋚",
+ "LessFullEqual": "≦",
+ "lE": "≦",
+ "leqq": "≦",
+ "LessGreater": "≶",
+ "lessgtr": "≶",
+ "lg": "≶",
+ "LessLess": "⪡",
+ "LessSlantEqual": "⩽",
+ "leqslant": "⩽",
+ "les": "⩽",
+ "LessTilde": "≲",
+ "lesssim": "≲",
+ "lsim": "≲",
+ "Lfr": "𝔏",
+ "Ll": "⋘",
+ "Lleftarrow": "⇚",
+ "lAarr": "⇚",
+ "Lmidot": "Ŀ",
+ "LongLeftArrow": "⟵",
+ "longleftarrow": "⟵",
+ "xlarr": "⟵",
+ "LongLeftRightArrow": "⟷",
+ "longleftrightarrow": "⟷",
+ "xharr": "⟷",
+ "LongRightArrow": "⟶",
+ "longrightarrow": "⟶",
+ "xrarr": "⟶",
+ "Lopf": "𝕃",
+ "LowerLeftArrow": "↙",
+ "swarr": "↙",
+ "swarrow": "↙",
+ "LowerRightArrow": "↘",
+ "searr": "↘",
+ "searrow": "↘",
+ "Lsh": "↰",
+ "lsh": "↰",
+ "Lstrok": "Ł",
+ "Lt": "≪",
+ "NestedLessLess": "≪",
+ "ll": "≪",
+ "Map": "⤅",
+ "Mcy": "М",
+ "MediumSpace": " ",
+ "Mellintrf": "ℳ",
+ "Mscr": "ℳ",
+ "phmmat": "ℳ",
+ "Mfr": "𝔐",
+ "MinusPlus": "∓",
+ "mnplus": "∓",
+ "mp": "∓",
+ "Mopf": "𝕄",
+ "Mu": "Μ",
+ "NJcy": "Њ",
+ "Nacute": "Ń",
+ "Ncaron": "Ň",
+ "Ncedil": "Ņ",
+ "Ncy": "Н",
+ "NegativeMediumSpace": "",
+ "NegativeThickSpace": "",
+ "NegativeThinSpace": "",
+ "NegativeVeryThinSpace": "",
+ "ZeroWidthSpace": "",
+ "NewLine": "\n",
+ "Nfr": "𝔑",
+ "NoBreak": "",
+ "NonBreakingSpace": " ",
+ "nbsp": " ",
+ "Nopf": "ℕ",
+ "naturals": "ℕ",
+ "Not": "⫬",
+ "NotCongruent": "≢",
+ "nequiv": "≢",
+ "NotCupCap": "≭",
+ "NotDoubleVerticalBar": "∦",
+ "npar": "∦",
+ "nparallel": "∦",
+ "nshortparallel": "∦",
+ "nspar": "∦",
+ "NotElement": "∉",
+ "notin": "∉",
+ "notinva": "∉",
+ "NotEqual": "≠",
+ "ne": "≠",
+ "NotEqualTilde": "≂̸",
+ "nesim": "≂̸",
+ "NotExists": "∄",
+ "nexist": "∄",
+ "nexists": "∄",
+ "NotGreater": "≯",
+ "ngt": "≯",
+ "ngtr": "≯",
+ "NotGreaterEqual": "≱",
+ "nge": "≱",
+ "ngeq": "≱",
+ "NotGreaterFullEqual": "≧̸",
+ "ngE": "≧̸",
+ "ngeqq": "≧̸",
+ "NotGreaterGreater": "≫̸",
+ "nGtv": "≫̸",
+ "NotGreaterLess": "≹",
+ "ntgl": "≹",
+ "NotGreaterSlantEqual": "⩾̸",
+ "ngeqslant": "⩾̸",
+ "nges": "⩾̸",
+ "NotGreaterTilde": "≵",
+ "ngsim": "≵",
+ "NotHumpDownHump": "≎̸",
+ "nbump": "≎̸",
+ "NotHumpEqual": "≏̸",
+ "nbumpe": "≏̸",
+ "NotLeftTriangle": "⋪",
+ "nltri": "⋪",
+ "ntriangleleft": "⋪",
+ "NotLeftTriangleBar": "⧏̸",
+ "NotLeftTriangleEqual": "⋬",
+ "nltrie": "⋬",
+ "ntrianglelefteq": "⋬",
+ "NotLess": "≮",
+ "nless": "≮",
+ "nlt": "≮",
+ "NotLessEqual": "≰",
+ "nle": "≰",
+ "nleq": "≰",
+ "NotLessGreater": "≸",
+ "ntlg": "≸",
+ "NotLessLess": "≪̸",
+ "nLtv": "≪̸",
+ "NotLessSlantEqual": "⩽̸",
+ "nleqslant": "⩽̸",
+ "nles": "⩽̸",
+ "NotLessTilde": "≴",
+ "nlsim": "≴",
+ "NotNestedGreaterGreater": "⪢̸",
+ "NotNestedLessLess": "⪡̸",
+ "NotPrecedes": "⊀",
+ "npr": "⊀",
+ "nprec": "⊀",
+ "NotPrecedesEqual": "⪯̸",
+ "npre": "⪯̸",
+ "npreceq": "⪯̸",
+ "NotPrecedesSlantEqual": "⋠",
+ "nprcue": "⋠",
+ "NotReverseElement": "∌",
+ "notni": "∌",
+ "notniva": "∌",
+ "NotRightTriangle": "⋫",
+ "nrtri": "⋫",
+ "ntriangleright": "⋫",
+ "NotRightTriangleBar": "⧐̸",
+ "NotRightTriangleEqual": "⋭",
+ "nrtrie": "⋭",
+ "ntrianglerighteq": "⋭",
+ "NotSquareSubset": "⊏̸",
+ "NotSquareSubsetEqual": "⋢",
+ "nsqsube": "⋢",
+ "NotSquareSuperset": "⊐̸",
+ "NotSquareSupersetEqual": "⋣",
+ "nsqsupe": "⋣",
+ "NotSubset": "⊂⃒",
+ "nsubset": "⊂⃒",
+ "vnsub": "⊂⃒",
+ "NotSubsetEqual": "⊈",
+ "nsube": "⊈",
+ "nsubseteq": "⊈",
+ "NotSucceeds": "⊁",
+ "nsc": "⊁",
+ "nsucc": "⊁",
+ "NotSucceedsEqual": "⪰̸",
+ "nsce": "⪰̸",
+ "nsucceq": "⪰̸",
+ "NotSucceedsSlantEqual": "⋡",
+ "nsccue": "⋡",
+ "NotSucceedsTilde": "≿̸",
+ "NotSuperset": "⊃⃒",
+ "nsupset": "⊃⃒",
+ "vnsup": "⊃⃒",
+ "NotSupersetEqual": "⊉",
+ "nsupe": "⊉",
+ "nsupseteq": "⊉",
+ "NotTilde": "≁",
+ "nsim": "≁",
+ "NotTildeEqual": "≄",
+ "nsime": "≄",
+ "nsimeq": "≄",
+ "NotTildeFullEqual": "≇",
+ "ncong": "≇",
+ "NotTildeTilde": "≉",
+ "nap": "≉",
+ "napprox": "≉",
+ "NotVerticalBar": "∤",
+ "nmid": "∤",
+ "nshortmid": "∤",
+ "nsmid": "∤",
+ "Nscr": "𝒩",
+ "Ntilde": "Ñ",
+ "Nu": "Ν",
+ "OElig": "Œ",
+ "Oacute": "Ó",
+ "Ocirc": "Ô",
+ "Ocy": "О",
+ "Odblac": "Ő",
+ "Ofr": "𝔒",
+ "Ograve": "Ò",
+ "Omacr": "Ō",
+ "Omega": "Ω",
+ "ohm": "Ω",
+ "Omicron": "Ο",
+ "Oopf": "𝕆",
+ "OpenCurlyDoubleQuote": "“",
+ "ldquo": "“",
+ "OpenCurlyQuote": "‘",
+ "lsquo": "‘",
+ "Or": "⩔",
+ "Oscr": "𝒪",
+ "Oslash": "Ø",
+ "Otilde": "Õ",
+ "Otimes": "⨷",
+ "Ouml": "Ö",
+ "OverBar": "‾",
+ "oline": "‾",
+ "OverBrace": "⏞",
+ "OverBracket": "⎴",
+ "tbrk": "⎴",
+ "OverParenthesis": "⏜",
+ "PartialD": "∂",
+ "part": "∂",
+ "Pcy": "П",
+ "Pfr": "𝔓",
+ "Phi": "Φ",
+ "Pi": "Π",
+ "PlusMinus": "±",
+ "plusmn": "±",
+ "pm": "±",
+ "Popf": "ℙ",
+ "primes": "ℙ",
+ "Pr": "⪻",
+ "Precedes": "≺",
+ "pr": "≺",
+ "prec": "≺",
+ "PrecedesEqual": "⪯",
+ "pre": "⪯",
+ "preceq": "⪯",
+ "PrecedesSlantEqual": "≼",
+ "prcue": "≼",
+ "preccurlyeq": "≼",
+ "PrecedesTilde": "≾",
+ "precsim": "≾",
+ "prsim": "≾",
+ "Prime": "″",
+ "Product": "∏",
+ "prod": "∏",
+ "Proportional": "∝",
+ "prop": "∝",
+ "propto": "∝",
+ "varpropto": "∝",
+ "vprop": "∝",
+ "Pscr": "𝒫",
+ "Psi": "Ψ",
+ "QUOT": '"',
+ "quot": '"',
+ "Qfr": "𝔔",
+ "Qopf": "ℚ",
+ "rationals": "ℚ",
+ "Qscr": "𝒬",
+ "RBarr": "⤐",
+ "drbkarow": "⤐",
+ "REG": "®",
+ "circledR": "®",
+ "reg": "®",
+ "Racute": "Ŕ",
+ "Rang": "⟫",
+ "Rarr": "↠",
+ "twoheadrightarrow": "↠",
+ "Rarrtl": "⤖",
+ "Rcaron": "Ř",
+ "Rcedil": "Ŗ",
+ "Rcy": "Р",
+ "Re": "ℜ",
+ "Rfr": "ℜ",
+ "real": "ℜ",
+ "realpart": "ℜ",
+ "ReverseElement": "∋",
+ "SuchThat": "∋",
+ "ni": "∋",
+ "niv": "∋",
+ "ReverseEquilibrium": "⇋",
+ "leftrightharpoons": "⇋",
+ "lrhar": "⇋",
+ "ReverseUpEquilibrium": "⥯",
+ "duhar": "⥯",
+ "Rho": "Ρ",
+ "RightAngleBracket": "⟩",
+ "rang": "⟩",
+ "rangle": "⟩",
+ "RightArrow": "→",
+ "ShortRightArrow": "→",
+ "rarr": "→",
+ "rightarrow": "→",
+ "srarr": "→",
+ "RightArrowBar": "⇥",
+ "rarrb": "⇥",
+ "RightArrowLeftArrow": "⇄",
+ "rightleftarrows": "⇄",
+ "rlarr": "⇄",
+ "RightCeiling": "⌉",
+ "rceil": "⌉",
+ "RightDoubleBracket": "⟧",
+ "robrk": "⟧",
+ "RightDownTeeVector": "⥝",
+ "RightDownVector": "⇂",
+ "dharr": "⇂",
+ "downharpoonright": "⇂",
+ "RightDownVectorBar": "⥕",
+ "RightFloor": "⌋",
+ "rfloor": "⌋",
+ "RightTee": "⊢",
+ "vdash": "⊢",
+ "RightTeeArrow": "↦",
+ "map": "↦",
+ "mapsto": "↦",
+ "RightTeeVector": "⥛",
+ "RightTriangle": "⊳",
+ "vartriangleright": "⊳",
+ "vrtri": "⊳",
+ "RightTriangleBar": "⧐",
+ "RightTriangleEqual": "⊵",
+ "rtrie": "⊵",
+ "trianglerighteq": "⊵",
+ "RightUpDownVector": "⥏",
+ "RightUpTeeVector": "⥜",
+ "RightUpVector": "↾",
+ "uharr": "↾",
+ "upharpoonright": "↾",
+ "RightUpVectorBar": "⥔",
+ "RightVector": "⇀",
+ "rharu": "⇀",
+ "rightharpoonup": "⇀",
+ "RightVectorBar": "⥓",
+ "Ropf": "ℝ",
+ "reals": "ℝ",
+ "RoundImplies": "⥰",
+ "Rrightarrow": "⇛",
+ "rAarr": "⇛",
+ "Rscr": "ℛ",
+ "realine": "ℛ",
+ "Rsh": "↱",
+ "rsh": "↱",
+ "RuleDelayed": "⧴",
+ "SHCHcy": "Щ",
+ "SHcy": "Ш",
+ "SOFTcy": "Ь",
+ "Sacute": "Ś",
+ "Sc": "⪼",
+ "Scaron": "Š",
+ "Scedil": "Ş",
+ "Scirc": "Ŝ",
+ "Scy": "С",
+ "Sfr": "𝔖",
+ "ShortUpArrow": "↑",
+ "UpArrow": "↑",
+ "uarr": "↑",
+ "uparrow": "↑",
+ "Sigma": "Σ",
+ "SmallCircle": "∘",
+ "compfn": "∘",
+ "Sopf": "𝕊",
+ "Sqrt": "√",
+ "radic": "√",
+ "Square": "□",
+ "squ": "□",
+ "square": "□",
+ "SquareIntersection": "⊓",
+ "sqcap": "⊓",
+ "SquareSubset": "⊏",
+ "sqsub": "⊏",
+ "sqsubset": "⊏",
+ "SquareSubsetEqual": "⊑",
+ "sqsube": "⊑",
+ "sqsubseteq": "⊑",
+ "SquareSuperset": "⊐",
+ "sqsup": "⊐",
+ "sqsupset": "⊐",
+ "SquareSupersetEqual": "⊒",
+ "sqsupe": "⊒",
+ "sqsupseteq": "⊒",
+ "SquareUnion": "⊔",
+ "sqcup": "⊔",
+ "Sscr": "𝒮",
+ "Star": "⋆",
+ "sstarf": "⋆",
+ "Sub": "⋐",
+ "Subset": "⋐",
+ "SubsetEqual": "⊆",
+ "sube": "⊆",
+ "subseteq": "⊆",
+ "Succeeds": "≻",
+ "sc": "≻",
+ "succ": "≻",
+ "SucceedsEqual": "⪰",
+ "sce": "⪰",
+ "succeq": "⪰",
+ "SucceedsSlantEqual": "≽",
+ "sccue": "≽",
+ "succcurlyeq": "≽",
+ "SucceedsTilde": "≿",
+ "scsim": "≿",
+ "succsim": "≿",
+ "Sum": "∑",
+ "sum": "∑",
+ "Sup": "⋑",
+ "Supset": "⋑",
+ "Superset": "⊃",
+ "sup": "⊃",
+ "supset": "⊃",
+ "SupersetEqual": "⊇",
+ "supe": "⊇",
+ "supseteq": "⊇",
+ "THORN": "Þ",
+ "TRADE": "™",
+ "trade": "™",
+ "TSHcy": "Ћ",
+ "TScy": "Ц",
+ "Tab": " ",
+ "Tau": "Τ",
+ "Tcaron": "Ť",
+ "Tcedil": "Ţ",
+ "Tcy": "Т",
+ "Tfr": "𝔗",
+ "Therefore": "∴",
+ "there4": "∴",
+ "therefore": "∴",
+ "Theta": "Θ",
+ "ThickSpace": " ",
+ "ThinSpace": " ",
+ "thinsp": " ",
+ "Tilde": "∼",
+ "sim": "∼",
+ "thicksim": "∼",
+ "thksim": "∼",
+ "TildeEqual": "≃",
+ "sime": "≃",
+ "simeq": "≃",
+ "TildeFullEqual": "≅",
+ "cong": "≅",
+ "TildeTilde": "≈",
+ "ap": "≈",
+ "approx": "≈",
+ "asymp": "≈",
+ "thickapprox": "≈",
+ "thkap": "≈",
+ "Topf": "𝕋",
+ "TripleDot": "⃛",
+ "tdot": "⃛",
+ "Tscr": "𝒯",
+ "Tstrok": "Ŧ",
+ "Uacute": "Ú",
+ "Uarr": "↟",
+ "Uarrocir": "⥉",
+ "Ubrcy": "Ў",
+ "Ubreve": "Ŭ",
+ "Ucirc": "Û",
+ "Ucy": "У",
+ "Udblac": "Ű",
+ "Ufr": "𝔘",
+ "Ugrave": "Ù",
+ "Umacr": "Ū",
+ "UnderBar": "_",
+ "lowbar": "_",
+ "UnderBrace": "⏟",
+ "UnderBracket": "⎵",
+ "bbrk": "⎵",
+ "UnderParenthesis": "⏝",
+ "Union": "⋃",
+ "bigcup": "⋃",
+ "xcup": "⋃",
+ "UnionPlus": "⊎",
+ "uplus": "⊎",
+ "Uogon": "Ų",
+ "Uopf": "𝕌",
+ "UpArrowBar": "⤒",
+ "UpArrowDownArrow": "⇅",
+ "udarr": "⇅",
+ "UpDownArrow": "↕",
+ "updownarrow": "↕",
+ "varr": "↕",
+ "UpEquilibrium": "⥮",
+ "udhar": "⥮",
+ "UpTee": "⊥",
+ "bot": "⊥",
+ "bottom": "⊥",
+ "perp": "⊥",
+ "UpTeeArrow": "↥",
+ "mapstoup": "↥",
+ "UpperLeftArrow": "↖",
+ "nwarr": "↖",
+ "nwarrow": "↖",
+ "UpperRightArrow": "↗",
+ "nearr": "↗",
+ "nearrow": "↗",
+ "Upsi": "ϒ",
+ "upsih": "ϒ",
+ "Upsilon": "Υ",
+ "Uring": "Ů",
+ "Uscr": "𝒰",
+ "Utilde": "Ũ",
+ "Uuml": "Ü",
+ "VDash": "⊫",
+ "Vbar": "⫫",
+ "Vcy": "В",
+ "Vdash": "⊩",
+ "Vdashl": "⫦",
+ "Vee": "⋁",
+ "bigvee": "⋁",
+ "xvee": "⋁",
+ "Verbar": "‖",
+ "Vert": "‖",
+ "VerticalBar": "∣",
+ "mid": "∣",
+ "shortmid": "∣",
+ "smid": "∣",
+ "VerticalLine": "|",
+ "verbar": "|",
+ "vert": "|",
+ "VerticalSeparator": "❘",
+ "VerticalTilde": "≀",
+ "wr": "≀",
+ "wreath": "≀",
+ "VeryThinSpace": " ",
+ "hairsp": " ",
+ "Vfr": "𝔙",
+ "Vopf": "𝕍",
+ "Vscr": "𝒱",
+ "Vvdash": "⊪",
+ "Wcirc": "Ŵ",
+ "Wedge": "⋀",
+ "bigwedge": "⋀",
+ "xwedge": "⋀",
+ "Wfr": "𝔚",
+ "Wopf": "𝕎",
+ "Wscr": "𝒲",
+ "Xfr": "𝔛",
+ "Xi": "Ξ",
+ "Xopf": "𝕏",
+ "Xscr": "𝒳",
+ "YAcy": "Я",
+ "YIcy": "Ї",
+ "YUcy": "Ю",
+ "Yacute": "Ý",
+ "Ycirc": "Ŷ",
+ "Ycy": "Ы",
+ "Yfr": "𝔜",
+ "Yopf": "𝕐",
+ "Yscr": "𝒴",
+ "Yuml": "Ÿ",
+ "ZHcy": "Ж",
+ "Zacute": "Ź",
+ "Zcaron": "Ž",
+ "Zcy": "З",
+ "Zdot": "Ż",
+ "Zeta": "Ζ",
+ "Zfr": "ℨ",
+ "zeetrf": "ℨ",
+ "Zopf": "ℤ",
+ "integers": "ℤ",
+ "Zscr": "𝒵",
+ "aacute": "á",
+ "abreve": "ă",
+ "ac": "∾",
+ "mstpos": "∾",
+ "acE": "∾̳",
+ "acd": "∿",
+ "acirc": "â",
+ "acy": "а",
+ "aelig": "æ",
+ "afr": "𝔞",
+ "agrave": "à",
+ "alefsym": "ℵ",
+ "aleph": "ℵ",
+ "alpha": "α",
+ "amacr": "ā",
+ "amalg": "⨿",
+ "and": "∧",
+ "wedge": "∧",
+ "andand": "⩕",
+ "andd": "⩜",
+ "andslope": "⩘",
+ "andv": "⩚",
+ "ang": "∠",
+ "angle": "∠",
+ "ange": "⦤",
+ "angmsd": "∡",
+ "measuredangle": "∡",
+ "angmsdaa": "⦨",
+ "angmsdab": "⦩",
+ "angmsdac": "⦪",
+ "angmsdad": "⦫",
+ "angmsdae": "⦬",
+ "angmsdaf": "⦭",
+ "angmsdag": "⦮",
+ "angmsdah": "⦯",
+ "angrt": "∟",
+ "angrtvb": "⊾",
+ "angrtvbd": "⦝",
+ "angsph": "∢",
+ "angzarr": "⍼",
+ "aogon": "ą",
+ "aopf": "𝕒",
+ "apE": "⩰",
+ "apacir": "⩯",
+ "ape": "≊",
+ "approxeq": "≊",
+ "apid": "≋",
+ "apos": "'",
+ "aring": "å",
+ "ascr": "𝒶",
+ "ast": "*",
+ "midast": "*",
+ "atilde": "ã",
+ "auml": "ä",
+ "awint": "⨑",
+ "bNot": "⫭",
+ "backcong": "≌",
+ "bcong": "≌",
+ "backepsilon": "϶",
+ "bepsi": "϶",
+ "backprime": "‵",
+ "bprime": "‵",
+ "backsim": "∽",
+ "bsim": "∽",
+ "backsimeq": "⋍",
+ "bsime": "⋍",
+ "barvee": "⊽",
+ "barwed": "⌅",
+ "barwedge": "⌅",
+ "bbrktbrk": "⎶",
+ "bcy": "б",
+ "bdquo": "„",
+ "ldquor": "„",
+ "bemptyv": "⦰",
+ "beta": "β",
+ "beth": "ℶ",
+ "between": "≬",
+ "twixt": "≬",
+ "bfr": "𝔟",
+ "bigcirc": "◯",
+ "xcirc": "◯",
+ "bigodot": "⨀",
+ "xodot": "⨀",
+ "bigoplus": "⨁",
+ "xoplus": "⨁",
+ "bigotimes": "⨂",
+ "xotime": "⨂",
+ "bigsqcup": "⨆",
+ "xsqcup": "⨆",
+ "bigstar": "★",
+ "starf": "★",
+ "bigtriangledown": "▽",
+ "xdtri": "▽",
+ "bigtriangleup": "△",
+ "xutri": "△",
+ "biguplus": "⨄",
+ "xuplus": "⨄",
+ "bkarow": "⤍",
+ "rbarr": "⤍",
+ "blacklozenge": "⧫",
+ "lozf": "⧫",
+ "blacktriangle": "▴",
+ "utrif": "▴",
+ "blacktriangledown": "▾",
+ "dtrif": "▾",
+ "blacktriangleleft": "◂",
+ "ltrif": "◂",
+ "blacktriangleright": "▸",
+ "rtrif": "▸",
+ "blank": "␣",
+ "blk12": "▒",
+ "blk14": "░",
+ "blk34": "▓",
+ "block": "█",
+ "bne": "=⃥",
+ "bnequiv": "≡⃥",
+ "bnot": "⌐",
+ "bopf": "𝕓",
+ "bowtie": "⋈",
+ "boxDL": "╗",
+ "boxDR": "╔",
+ "boxDl": "╖",
+ "boxDr": "╓",
+ "boxH": "═",
+ "boxHD": "╦",
+ "boxHU": "╩",
+ "boxHd": "╤",
+ "boxHu": "╧",
+ "boxUL": "╝",
+ "boxUR": "╚",
+ "boxUl": "╜",
+ "boxUr": "╙",
+ "boxV": "║",
+ "boxVH": "╬",
+ "boxVL": "╣",
+ "boxVR": "╠",
+ "boxVh": "╫",
+ "boxVl": "╢",
+ "boxVr": "╟",
+ "boxbox": "⧉",
+ "boxdL": "╕",
+ "boxdR": "╒",
+ "boxdl": "┐",
+ "boxdr": "┌",
+ "boxhD": "╥",
+ "boxhU": "╨",
+ "boxhd": "┬",
+ "boxhu": "┴",
+ "boxminus": "⊟",
+ "minusb": "⊟",
+ "boxplus": "⊞",
+ "plusb": "⊞",
+ "boxtimes": "⊠",
+ "timesb": "⊠",
+ "boxuL": "╛",
+ "boxuR": "╘",
+ "boxul": "┘",
+ "boxur": "└",
+ "boxv": "│",
+ "boxvH": "╪",
+ "boxvL": "╡",
+ "boxvR": "╞",
+ "boxvh": "┼",
+ "boxvl": "┤",
+ "boxvr": "├",
+ "brvbar": "¦",
+ "bscr": "𝒷",
+ "bsemi": "⁏",
+ "bsol": "\\",
+ "bsolb": "⧅",
+ "bsolhsub": "⟈",
+ "bull": "•",
+ "bullet": "•",
+ "bumpE": "⪮",
+ "cacute": "ć",
+ "cap": "∩",
+ "capand": "⩄",
+ "capbrcup": "⩉",
+ "capcap": "⩋",
+ "capcup": "⩇",
+ "capdot": "⩀",
+ "caps": "∩︀",
+ "caret": "⁁",
+ "ccaps": "⩍",
+ "ccaron": "č",
+ "ccedil": "ç",
+ "ccirc": "ĉ",
+ "ccups": "⩌",
+ "ccupssm": "⩐",
+ "cdot": "ċ",
+ "cemptyv": "⦲",
+ "cent": "¢",
+ "cfr": "𝔠",
+ "chcy": "ч",
+ "check": "✓",
+ "checkmark": "✓",
+ "chi": "χ",
+ "cir": "○",
+ "cirE": "⧃",
+ "circ": "ˆ",
+ "circeq": "≗",
+ "cire": "≗",
+ "circlearrowleft": "↺",
+ "olarr": "↺",
+ "circlearrowright": "↻",
+ "orarr": "↻",
+ "circledS": "Ⓢ",
+ "oS": "Ⓢ",
+ "circledast": "⊛",
+ "oast": "⊛",
+ "circledcirc": "⊚",
+ "ocir": "⊚",
+ "circleddash": "⊝",
+ "odash": "⊝",
+ "cirfnint": "⨐",
+ "cirmid": "⫯",
+ "cirscir": "⧂",
+ "clubs": "♣",
+ "clubsuit": "♣",
+ "colon": ":",
+ "comma": ",",
+ "commat": "@",
+ "comp": "∁",
+ "complement": "∁",
+ "congdot": "⩭",
+ "copf": "𝕔",
+ "copysr": "℗",
+ "crarr": "↵",
+ "cross": "✗",
+ "cscr": "𝒸",
+ "csub": "⫏",
+ "csube": "⫑",
+ "csup": "⫐",
+ "csupe": "⫒",
+ "ctdot": "⋯",
+ "cudarrl": "⤸",
+ "cudarrr": "⤵",
+ "cuepr": "⋞",
+ "curlyeqprec": "⋞",
+ "cuesc": "⋟",
+ "curlyeqsucc": "⋟",
+ "cularr": "↶",
+ "curvearrowleft": "↶",
+ "cularrp": "⤽",
+ "cup": "∪",
+ "cupbrcap": "⩈",
+ "cupcap": "⩆",
+ "cupcup": "⩊",
+ "cupdot": "⊍",
+ "cupor": "⩅",
+ "cups": "∪︀",
+ "curarr": "↷",
+ "curvearrowright": "↷",
+ "curarrm": "⤼",
+ "curlyvee": "⋎",
+ "cuvee": "⋎",
+ "curlywedge": "⋏",
+ "cuwed": "⋏",
+ "curren": "¤",
+ "cwint": "∱",
+ "cylcty": "⌭",
+ "dHar": "⥥",
+ "dagger": "†",
+ "daleth": "ℸ",
+ "dash": "‐",
+ "hyphen": "‐",
+ "dbkarow": "⤏",
+ "rBarr": "⤏",
+ "dcaron": "ď",
+ "dcy": "д",
+ "ddarr": "⇊",
+ "downdownarrows": "⇊",
+ "ddotseq": "⩷",
+ "eDDot": "⩷",
+ "deg": "°",
+ "delta": "δ",
+ "demptyv": "⦱",
+ "dfisht": "⥿",
+ "dfr": "𝔡",
+ "diamondsuit": "♦",
+ "diams": "♦",
+ "digamma": "ϝ",
+ "gammad": "ϝ",
+ "disin": "⋲",
+ "div": "÷",
+ "divide": "÷",
+ "divideontimes": "⋇",
+ "divonx": "⋇",
+ "djcy": "ђ",
+ "dlcorn": "⌞",
+ "llcorner": "⌞",
+ "dlcrop": "⌍",
+ "dollar": "$",
+ "dopf": "𝕕",
+ "doteqdot": "≑",
+ "eDot": "≑",
+ "dotminus": "∸",
+ "minusd": "∸",
+ "dotplus": "∔",
+ "plusdo": "∔",
+ "dotsquare": "⊡",
+ "sdotb": "⊡",
+ "drcorn": "⌟",
+ "lrcorner": "⌟",
+ "drcrop": "⌌",
+ "dscr": "𝒹",
+ "dscy": "ѕ",
+ "dsol": "⧶",
+ "dstrok": "đ",
+ "dtdot": "⋱",
+ "dtri": "▿",
+ "triangledown": "▿",
+ "dwangle": "⦦",
+ "dzcy": "џ",
+ "dzigrarr": "⟿",
+ "eacute": "é",
+ "easter": "⩮",
+ "ecaron": "ě",
+ "ecir": "≖",
+ "eqcirc": "≖",
+ "ecirc": "ê",
+ "ecolon": "≕",
+ "eqcolon": "≕",
+ "ecy": "э",
+ "edot": "ė",
+ "efDot": "≒",
+ "fallingdotseq": "≒",
+ "efr": "𝔢",
+ "eg": "⪚",
+ "egrave": "è",
+ "egs": "⪖",
+ "eqslantgtr": "⪖",
+ "egsdot": "⪘",
+ "el": "⪙",
+ "elinters": "⏧",
+ "ell": "ℓ",
+ "els": "⪕",
+ "eqslantless": "⪕",
+ "elsdot": "⪗",
+ "emacr": "ē",
+ "empty": "∅",
+ "emptyset": "∅",
+ "emptyv": "∅",
+ "varnothing": "∅",
+ "emsp13": " ",
+ "emsp14": " ",
+ "emsp": " ",
+ "eng": "ŋ",
+ "ensp": " ",
+ "eogon": "ę",
+ "eopf": "𝕖",
+ "epar": "⋕",
+ "eparsl": "⧣",
+ "eplus": "⩱",
+ "epsi": "ε",
+ "epsilon": "ε",
+ "epsiv": "ϵ",
+ "straightepsilon": "ϵ",
+ "varepsilon": "ϵ",
+ "equals": "=",
+ "equest": "≟",
+ "questeq": "≟",
+ "equivDD": "⩸",
+ "eqvparsl": "⧥",
+ "erDot": "≓",
+ "risingdotseq": "≓",
+ "erarr": "⥱",
+ "escr": "ℯ",
+ "eta": "η",
+ "eth": "ð",
+ "euml": "ë",
+ "euro": "€",
+ "excl": "!",
+ "fcy": "ф",
+ "female": "♀",
+ "ffilig": "ffi",
+ "fflig": "ff",
+ "ffllig": "ffl",
+ "ffr": "𝔣",
+ "filig": "fi",
+ "fjlig": "fj",
+ "flat": "♭",
+ "fllig": "fl",
+ "fltns": "▱",
+ "fnof": "ƒ",
+ "fopf": "𝕗",
+ "fork": "⋔",
+ "pitchfork": "⋔",
+ "forkv": "⫙",
+ "fpartint": "⨍",
+ "frac12": "½",
+ "half": "½",
+ "frac13": "⅓",
+ "frac14": "¼",
+ "frac15": "⅕",
+ "frac16": "⅙",
+ "frac18": "⅛",
+ "frac23": "⅔",
+ "frac25": "⅖",
+ "frac34": "¾",
+ "frac35": "⅗",
+ "frac38": "⅜",
+ "frac45": "⅘",
+ "frac56": "⅚",
+ "frac58": "⅝",
+ "frac78": "⅞",
+ "frasl": "⁄",
+ "frown": "⌢",
+ "sfrown": "⌢",
+ "fscr": "𝒻",
+ "gEl": "⪌",
+ "gtreqqless": "⪌",
+ "gacute": "ǵ",
+ "gamma": "γ",
+ "gap": "⪆",
+ "gtrapprox": "⪆",
+ "gbreve": "ğ",
+ "gcirc": "ĝ",
+ "gcy": "г",
+ "gdot": "ġ",
+ "gescc": "⪩",
+ "gesdot": "⪀",
+ "gesdoto": "⪂",
+ "gesdotol": "⪄",
+ "gesl": "⋛︀",
+ "gesles": "⪔",
+ "gfr": "𝔤",
+ "gimel": "ℷ",
+ "gjcy": "ѓ",
+ "glE": "⪒",
+ "gla": "⪥",
+ "glj": "⪤",
+ "gnE": "≩",
+ "gneqq": "≩",
+ "gnap": "⪊",
+ "gnapprox": "⪊",
+ "gne": "⪈",
+ "gneq": "⪈",
+ "gnsim": "⋧",
+ "gopf": "𝕘",
+ "gscr": "ℊ",
+ "gsime": "⪎",
+ "gsiml": "⪐",
+ "gtcc": "⪧",
+ "gtcir": "⩺",
+ "gtdot": "⋗",
+ "gtrdot": "⋗",
+ "gtlPar": "⦕",
+ "gtquest": "⩼",
+ "gtrarr": "⥸",
+ "gvertneqq": "≩︀",
+ "gvnE": "≩︀",
+ "hardcy": "ъ",
+ "harrcir": "⥈",
+ "harrw": "↭",
+ "leftrightsquigarrow": "↭",
+ "hbar": "ℏ",
+ "hslash": "ℏ",
+ "planck": "ℏ",
+ "plankv": "ℏ",
+ "hcirc": "ĥ",
+ "hearts": "♥",
+ "heartsuit": "♥",
+ "hellip": "…",
+ "mldr": "…",
+ "hercon": "⊹",
+ "hfr": "𝔥",
+ "hksearow": "⤥",
+ "searhk": "⤥",
+ "hkswarow": "⤦",
+ "swarhk": "⤦",
+ "hoarr": "⇿",
+ "homtht": "∻",
+ "hookleftarrow": "↩",
+ "larrhk": "↩",
+ "hookrightarrow": "↪",
+ "rarrhk": "↪",
+ "hopf": "𝕙",
+ "horbar": "―",
+ "hscr": "𝒽",
+ "hstrok": "ħ",
+ "hybull": "⁃",
+ "iacute": "í",
+ "icirc": "î",
+ "icy": "и",
+ "iecy": "е",
+ "iexcl": "¡",
+ "ifr": "𝔦",
+ "igrave": "ì",
+ "iiiint": "⨌",
+ "qint": "⨌",
+ "iiint": "∭",
+ "tint": "∭",
+ "iinfin": "⧜",
+ "iiota": "℩",
+ "ijlig": "ij",
+ "imacr": "ī",
+ "imath": "ı",
+ "inodot": "ı",
+ "imof": "⊷",
+ "imped": "Ƶ",
+ "incare": "℅",
+ "infin": "∞",
+ "infintie": "⧝",
+ "intcal": "⊺",
+ "intercal": "⊺",
+ "intlarhk": "⨗",
+ "intprod": "⨼",
+ "iprod": "⨼",
+ "iocy": "ё",
+ "iogon": "į",
+ "iopf": "𝕚",
+ "iota": "ι",
+ "iquest": "¿",
+ "iscr": "𝒾",
+ "isinE": "⋹",
+ "isindot": "⋵",
+ "isins": "⋴",
+ "isinsv": "⋳",
+ "itilde": "ĩ",
+ "iukcy": "і",
+ "iuml": "ï",
+ "jcirc": "ĵ",
+ "jcy": "й",
+ "jfr": "𝔧",
+ "jmath": "ȷ",
+ "jopf": "𝕛",
+ "jscr": "𝒿",
+ "jsercy": "ј",
+ "jukcy": "є",
+ "kappa": "κ",
+ "kappav": "ϰ",
+ "varkappa": "ϰ",
+ "kcedil": "ķ",
+ "kcy": "к",
+ "kfr": "𝔨",
+ "kgreen": "ĸ",
+ "khcy": "х",
+ "kjcy": "ќ",
+ "kopf": "𝕜",
+ "kscr": "𝓀",
+ "lAtail": "⤛",
+ "lBarr": "⤎",
+ "lEg": "⪋",
+ "lesseqqgtr": "⪋",
+ "lHar": "⥢",
+ "lacute": "ĺ",
+ "laemptyv": "⦴",
+ "lambda": "λ",
+ "langd": "⦑",
+ "lap": "⪅",
+ "lessapprox": "⪅",
+ "laquo": "«",
+ "larrbfs": "⤟",
+ "larrfs": "⤝",
+ "larrlp": "↫",
+ "looparrowleft": "↫",
+ "larrpl": "⤹",
+ "larrsim": "⥳",
+ "larrtl": "↢",
+ "leftarrowtail": "↢",
+ "lat": "⪫",
+ "latail": "⤙",
+ "late": "⪭",
+ "lates": "⪭︀",
+ "lbarr": "⤌",
+ "lbbrk": "❲",
+ "lbrace": "{",
+ "lcub": "{",
+ "lbrack": "[",
+ "lsqb": "[",
+ "lbrke": "⦋",
+ "lbrksld": "⦏",
+ "lbrkslu": "⦍",
+ "lcaron": "ľ",
+ "lcedil": "ļ",
+ "lcy": "л",
+ "ldca": "⤶",
+ "ldrdhar": "⥧",
+ "ldrushar": "⥋",
+ "ldsh": "↲",
+ "le": "≤",
+ "leq": "≤",
+ "leftleftarrows": "⇇",
+ "llarr": "⇇",
+ "leftthreetimes": "⋋",
+ "lthree": "⋋",
+ "lescc": "⪨",
+ "lesdot": "⩿",
+ "lesdoto": "⪁",
+ "lesdotor": "⪃",
+ "lesg": "⋚︀",
+ "lesges": "⪓",
+ "lessdot": "⋖",
+ "ltdot": "⋖",
+ "lfisht": "⥼",
+ "lfr": "𝔩",
+ "lgE": "⪑",
+ "lharul": "⥪",
+ "lhblk": "▄",
+ "ljcy": "љ",
+ "llhard": "⥫",
+ "lltri": "◺",
+ "lmidot": "ŀ",
+ "lmoust": "⎰",
+ "lmoustache": "⎰",
+ "lnE": "≨",
+ "lneqq": "≨",
+ "lnap": "⪉",
+ "lnapprox": "⪉",
+ "lne": "⪇",
+ "lneq": "⪇",
+ "lnsim": "⋦",
+ "loang": "⟬",
+ "loarr": "⇽",
+ "longmapsto": "⟼",
+ "xmap": "⟼",
+ "looparrowright": "↬",
+ "rarrlp": "↬",
+ "lopar": "⦅",
+ "lopf": "𝕝",
+ "loplus": "⨭",
+ "lotimes": "⨴",
+ "lowast": "∗",
+ "loz": "◊",
+ "lozenge": "◊",
+ "lpar": "(",
+ "lparlt": "⦓",
+ "lrhard": "⥭",
+ "lrm": "",
+ "lrtri": "⊿",
+ "lsaquo": "‹",
+ "lscr": "𝓁",
+ "lsime": "⪍",
+ "lsimg": "⪏",
+ "lsquor": "‚",
+ "sbquo": "‚",
+ "lstrok": "ł",
+ "ltcc": "⪦",
+ "ltcir": "⩹",
+ "ltimes": "⋉",
+ "ltlarr": "⥶",
+ "ltquest": "⩻",
+ "ltrPar": "⦖",
+ "ltri": "◃",
+ "triangleleft": "◃",
+ "lurdshar": "⥊",
+ "luruhar": "⥦",
+ "lvertneqq": "≨︀",
+ "lvnE": "≨︀",
+ "mDDot": "∺",
+ "macr": "¯",
+ "strns": "¯",
+ "male": "♂",
+ "malt": "✠",
+ "maltese": "✠",
+ "marker": "▮",
+ "mcomma": "⨩",
+ "mcy": "м",
+ "mdash": "—",
+ "mfr": "𝔪",
+ "mho": "℧",
+ "micro": "µ",
+ "midcir": "⫰",
+ "minus": "−",
+ "minusdu": "⨪",
+ "mlcp": "⫛",
+ "models": "⊧",
+ "mopf": "𝕞",
+ "mscr": "𝓂",
+ "mu": "μ",
+ "multimap": "⊸",
+ "mumap": "⊸",
+ "nGg": "⋙̸",
+ "nGt": "≫⃒",
+ "nLeftarrow": "⇍",
+ "nlArr": "⇍",
+ "nLeftrightarrow": "⇎",
+ "nhArr": "⇎",
+ "nLl": "⋘̸",
+ "nLt": "≪⃒",
+ "nRightarrow": "⇏",
+ "nrArr": "⇏",
+ "nVDash": "⊯",
+ "nVdash": "⊮",
+ "nacute": "ń",
+ "nang": "∠⃒",
+ "napE": "⩰̸",
+ "napid": "≋̸",
+ "napos": "ʼn",
+ "natur": "♮",
+ "natural": "♮",
+ "ncap": "⩃",
+ "ncaron": "ň",
+ "ncedil": "ņ",
+ "ncongdot": "⩭̸",
+ "ncup": "⩂",
+ "ncy": "н",
+ "ndash": "–",
+ "neArr": "⇗",
+ "nearhk": "⤤",
+ "nedot": "≐̸",
+ "nesear": "⤨",
+ "toea": "⤨",
+ "nfr": "𝔫",
+ "nharr": "↮",
+ "nleftrightarrow": "↮",
+ "nhpar": "⫲",
+ "nis": "⋼",
+ "nisd": "⋺",
+ "njcy": "њ",
+ "nlE": "≦̸",
+ "nleqq": "≦̸",
+ "nlarr": "↚",
+ "nleftarrow": "↚",
+ "nldr": "‥",
+ "nopf": "𝕟",
+ "not": "¬",
+ "notinE": "⋹̸",
+ "notindot": "⋵̸",
+ "notinvb": "⋷",
+ "notinvc": "⋶",
+ "notnivb": "⋾",
+ "notnivc": "⋽",
+ "nparsl": "⫽⃥",
+ "npart": "∂̸",
+ "npolint": "⨔",
+ "nrarr": "↛",
+ "nrightarrow": "↛",
+ "nrarrc": "⤳̸",
+ "nrarrw": "↝̸",
+ "nscr": "𝓃",
+ "nsub": "⊄",
+ "nsubE": "⫅̸",
+ "nsubseteqq": "⫅̸",
+ "nsup": "⊅",
+ "nsupE": "⫆̸",
+ "nsupseteqq": "⫆̸",
+ "ntilde": "ñ",
+ "nu": "ν",
+ "num": "#",
+ "numero": "№",
+ "numsp": " ",
+ "nvDash": "⊭",
+ "nvHarr": "⤄",
+ "nvap": "≍⃒",
+ "nvdash": "⊬",
+ "nvge": "≥⃒",
+ "nvgt": ">⃒",
+ "nvinfin": "⧞",
+ "nvlArr": "⤂",
+ "nvle": "≤⃒",
+ "nvlt": "<⃒",
+ "nvltrie": "⊴⃒",
+ "nvrArr": "⤃",
+ "nvrtrie": "⊵⃒",
+ "nvsim": "∼⃒",
+ "nwArr": "⇖",
+ "nwarhk": "⤣",
+ "nwnear": "⤧",
+ "oacute": "ó",
+ "ocirc": "ô",
+ "ocy": "о",
+ "odblac": "ő",
+ "odiv": "⨸",
+ "odsold": "⦼",
+ "oelig": "œ",
+ "ofcir": "⦿",
+ "ofr": "𝔬",
+ "ogon": "˛",
+ "ograve": "ò",
+ "ogt": "⧁",
+ "ohbar": "⦵",
+ "olcir": "⦾",
+ "olcross": "⦻",
+ "olt": "⧀",
+ "omacr": "ō",
+ "omega": "ω",
+ "omicron": "ο",
+ "omid": "⦶",
+ "oopf": "𝕠",
+ "opar": "⦷",
+ "operp": "⦹",
+ "or": "∨",
+ "vee": "∨",
+ "ord": "⩝",
+ "order": "ℴ",
+ "orderof": "ℴ",
+ "oscr": "ℴ",
+ "ordf": "ª",
+ "ordm": "º",
+ "origof": "⊶",
+ "oror": "⩖",
+ "orslope": "⩗",
+ "orv": "⩛",
+ "oslash": "ø",
+ "osol": "⊘",
+ "otilde": "õ",
+ "otimesas": "⨶",
+ "ouml": "ö",
+ "ovbar": "⌽",
+ "para": "¶",
+ "parsim": "⫳",
+ "parsl": "⫽",
+ "pcy": "п",
+ "percnt": "%",
+ "period": ".",
+ "permil": "‰",
+ "pertenk": "‱",
+ "pfr": "𝔭",
+ "phi": "φ",
+ "phiv": "ϕ",
+ "straightphi": "ϕ",
+ "varphi": "ϕ",
+ "phone": "☎",
+ "pi": "π",
+ "piv": "ϖ",
+ "varpi": "ϖ",
+ "planckh": "ℎ",
+ "plus": "+",
+ "plusacir": "⨣",
+ "pluscir": "⨢",
+ "plusdu": "⨥",
+ "pluse": "⩲",
+ "plussim": "⨦",
+ "plustwo": "⨧",
+ "pointint": "⨕",
+ "popf": "𝕡",
+ "pound": "£",
+ "prE": "⪳",
+ "prap": "⪷",
+ "precapprox": "⪷",
+ "precnapprox": "⪹",
+ "prnap": "⪹",
+ "precneqq": "⪵",
+ "prnE": "⪵",
+ "precnsim": "⋨",
+ "prnsim": "⋨",
+ "prime": "′",
+ "profalar": "⌮",
+ "profline": "⌒",
+ "profsurf": "⌓",
+ "prurel": "⊰",
+ "pscr": "𝓅",
+ "psi": "ψ",
+ "puncsp": " ",
+ "qfr": "𝔮",
+ "qopf": "𝕢",
+ "qprime": "⁗",
+ "qscr": "𝓆",
+ "quatint": "⨖",
+ "quest": "?",
+ "rAtail": "⤜",
+ "rHar": "⥤",
+ "race": "∽̱",
+ "racute": "ŕ",
+ "raemptyv": "⦳",
+ "rangd": "⦒",
+ "range": "⦥",
+ "raquo": "»",
+ "rarrap": "⥵",
+ "rarrbfs": "⤠",
+ "rarrc": "⤳",
+ "rarrfs": "⤞",
+ "rarrpl": "⥅",
+ "rarrsim": "⥴",
+ "rarrtl": "↣",
+ "rightarrowtail": "↣",
+ "rarrw": "↝",
+ "rightsquigarrow": "↝",
+ "ratail": "⤚",
+ "ratio": "∶",
+ "rbbrk": "❳",
+ "rbrace": "}",
+ "rcub": "}",
+ "rbrack": "]",
+ "rsqb": "]",
+ "rbrke": "⦌",
+ "rbrksld": "⦎",
+ "rbrkslu": "⦐",
+ "rcaron": "ř",
+ "rcedil": "ŗ",
+ "rcy": "р",
+ "rdca": "⤷",
+ "rdldhar": "⥩",
+ "rdsh": "↳",
+ "rect": "▭",
+ "rfisht": "⥽",
+ "rfr": "𝔯",
+ "rharul": "⥬",
+ "rho": "ρ",
+ "rhov": "ϱ",
+ "varrho": "ϱ",
+ "rightrightarrows": "⇉",
+ "rrarr": "⇉",
+ "rightthreetimes": "⋌",
+ "rthree": "⋌",
+ "ring": "˚",
+ "rlm": "",
+ "rmoust": "⎱",
+ "rmoustache": "⎱",
+ "rnmid": "⫮",
+ "roang": "⟭",
+ "roarr": "⇾",
+ "ropar": "⦆",
+ "ropf": "𝕣",
+ "roplus": "⨮",
+ "rotimes": "⨵",
+ "rpar": ")",
+ "rpargt": "⦔",
+ "rppolint": "⨒",
+ "rsaquo": "›",
+ "rscr": "𝓇",
+ "rtimes": "⋊",
+ "rtri": "▹",
+ "triangleright": "▹",
+ "rtriltri": "⧎",
+ "ruluhar": "⥨",
+ "rx": "℞",
+ "sacute": "ś",
+ "scE": "⪴",
+ "scap": "⪸",
+ "succapprox": "⪸",
+ "scaron": "š",
+ "scedil": "ş",
+ "scirc": "ŝ",
+ "scnE": "⪶",
+ "succneqq": "⪶",
+ "scnap": "⪺",
+ "succnapprox": "⪺",
+ "scnsim": "⋩",
+ "succnsim": "⋩",
+ "scpolint": "⨓",
+ "scy": "с",
+ "sdot": "⋅",
+ "sdote": "⩦",
+ "seArr": "⇘",
+ "sect": "§",
+ "semi": ";",
+ "seswar": "⤩",
+ "tosa": "⤩",
+ "sext": "✶",
+ "sfr": "𝔰",
+ "sharp": "♯",
+ "shchcy": "щ",
+ "shcy": "ш",
+ "shy": "",
+ "sigma": "σ",
+ "sigmaf": "ς",
+ "sigmav": "ς",
+ "varsigma": "ς",
+ "simdot": "⩪",
+ "simg": "⪞",
+ "simgE": "⪠",
+ "siml": "⪝",
+ "simlE": "⪟",
+ "simne": "≆",
+ "simplus": "⨤",
+ "simrarr": "⥲",
+ "smashp": "⨳",
+ "smeparsl": "⧤",
+ "smile": "⌣",
+ "ssmile": "⌣",
+ "smt": "⪪",
+ "smte": "⪬",
+ "smtes": "⪬︀",
+ "softcy": "ь",
+ "sol": "/",
+ "solb": "⧄",
+ "solbar": "⌿",
+ "sopf": "𝕤",
+ "spades": "♠",
+ "spadesuit": "♠",
+ "sqcaps": "⊓︀",
+ "sqcups": "⊔︀",
+ "sscr": "𝓈",
+ "star": "☆",
+ "sub": "⊂",
+ "subset": "⊂",
+ "subE": "⫅",
+ "subseteqq": "⫅",
+ "subdot": "⪽",
+ "subedot": "⫃",
+ "submult": "⫁",
+ "subnE": "⫋",
+ "subsetneqq": "⫋",
+ "subne": "⊊",
+ "subsetneq": "⊊",
+ "subplus": "⪿",
+ "subrarr": "⥹",
+ "subsim": "⫇",
+ "subsub": "⫕",
+ "subsup": "⫓",
+ "sung": "♪",
+ "sup1": "¹",
+ "sup2": "²",
+ "sup3": "³",
+ "supE": "⫆",
+ "supseteqq": "⫆",
+ "supdot": "⪾",
+ "supdsub": "⫘",
+ "supedot": "⫄",
+ "suphsol": "⟉",
+ "suphsub": "⫗",
+ "suplarr": "⥻",
+ "supmult": "⫂",
+ "supnE": "⫌",
+ "supsetneqq": "⫌",
+ "supne": "⊋",
+ "supsetneq": "⊋",
+ "supplus": "⫀",
+ "supsim": "⫈",
+ "supsub": "⫔",
+ "supsup": "⫖",
+ "swArr": "⇙",
+ "swnwar": "⤪",
+ "szlig": "ß",
+ "target": "⌖",
+ "tau": "τ",
+ "tcaron": "ť",
+ "tcedil": "ţ",
+ "tcy": "т",
+ "telrec": "⌕",
+ "tfr": "𝔱",
+ "theta": "θ",
+ "thetasym": "ϑ",
+ "thetav": "ϑ",
+ "vartheta": "ϑ",
+ "thorn": "þ",
+ "times": "×",
+ "timesbar": "⨱",
+ "timesd": "⨰",
+ "topbot": "⌶",
+ "topcir": "⫱",
+ "topf": "𝕥",
+ "topfork": "⫚",
+ "tprime": "‴",
+ "triangle": "▵",
+ "utri": "▵",
+ "triangleq": "≜",
+ "trie": "≜",
+ "tridot": "◬",
+ "triminus": "⨺",
+ "triplus": "⨹",
+ "trisb": "⧍",
+ "tritime": "⨻",
+ "trpezium": "⏢",
+ "tscr": "𝓉",
+ "tscy": "ц",
+ "tshcy": "ћ",
+ "tstrok": "ŧ",
+ "uHar": "⥣",
+ "uacute": "ú",
+ "ubrcy": "ў",
+ "ubreve": "ŭ",
+ "ucirc": "û",
+ "ucy": "у",
+ "udblac": "ű",
+ "ufisht": "⥾",
+ "ufr": "𝔲",
+ "ugrave": "ù",
+ "uhblk": "▀",
+ "ulcorn": "⌜",
+ "ulcorner": "⌜",
+ "ulcrop": "⌏",
+ "ultri": "◸",
+ "umacr": "ū",
+ "uogon": "ų",
+ "uopf": "𝕦",
+ "upsi": "υ",
+ "upsilon": "υ",
+ "upuparrows": "⇈",
+ "uuarr": "⇈",
+ "urcorn": "⌝",
+ "urcorner": "⌝",
+ "urcrop": "⌎",
+ "uring": "ů",
+ "urtri": "◹",
+ "uscr": "𝓊",
+ "utdot": "⋰",
+ "utilde": "ũ",
+ "uuml": "ü",
+ "uwangle": "⦧",
+ "vBar": "⫨",
+ "vBarv": "⫩",
+ "vangrt": "⦜",
+ "varsubsetneq": "⊊︀",
+ "vsubne": "⊊︀",
+ "varsubsetneqq": "⫋︀",
+ "vsubnE": "⫋︀",
+ "varsupsetneq": "⊋︀",
+ "vsupne": "⊋︀",
+ "varsupsetneqq": "⫌︀",
+ "vsupnE": "⫌︀",
+ "vcy": "в",
+ "veebar": "⊻",
+ "veeeq": "≚",
+ "vellip": "⋮",
+ "vfr": "𝔳",
+ "vopf": "𝕧",
+ "vscr": "𝓋",
+ "vzigzag": "⦚",
+ "wcirc": "ŵ",
+ "wedbar": "⩟",
+ "wedgeq": "≙",
+ "weierp": "℘",
+ "wp": "℘",
+ "wfr": "𝔴",
+ "wopf": "𝕨",
+ "wscr": "𝓌",
+ "xfr": "𝔵",
+ "xi": "ξ",
+ "xnis": "⋻",
+ "xopf": "𝕩",
+ "xscr": "𝓍",
+ "yacute": "ý",
+ "yacy": "я",
+ "ycirc": "ŷ",
+ "ycy": "ы",
+ "yen": "¥",
+ "yfr": "𝔶",
+ "yicy": "ї",
+ "yopf": "𝕪",
+ "yscr": "𝓎",
+ "yucy": "ю",
+ "yuml": "ÿ",
+ "zacute": "ź",
+ "zcaron": "ž",
+ "zcy": "з",
+ "zdot": "ż",
+ "zeta": "ζ",
+ "zfr": "𝔷",
+ "zhcy": "ж",
+ "zigrarr": "⇝",
+ "zopf": "𝕫",
+ "zscr": "𝓏",
+ "zwj": "",
+ "zwnj": ""
+};
+var NGSP_UNICODE = "";
+NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
+var TokenizeResult = class {
+ tokens;
+ errors;
+ nonNormalizedIcuExpressions;
+ constructor(tokens, errors, nonNormalizedIcuExpressions) {
+ this.tokens = tokens;
+ this.errors = errors;
+ this.nonNormalizedIcuExpressions = nonNormalizedIcuExpressions;
+ }
+};
+function tokenize(source, url, getTagDefinition, options = {}) {
+ const tokenizer = new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options);
+ tokenizer.tokenize();
+ return new TokenizeResult(mergeTextTokens(tokenizer.tokens), tokenizer.errors, tokenizer.nonNormalizedIcuExpressions);
+}
+var _CR_OR_CRLF_REGEXP = /\r\n?/g;
+function _unexpectedCharacterErrorMsg(charCode) {
+ const char = charCode === $EOF ? "EOF" : String.fromCharCode(charCode);
+ return `Unexpected character "${char}"`;
+}
+function _unknownEntityErrorMsg(entitySrc) {
+ return `Unknown entity "${entitySrc}" - use the ";" or ";" syntax`;
+}
+function _unparsableEntityErrorMsg(type, entityStr) {
+ return `Unable to parse entity "${entityStr}" - ${type} character reference entities must end with ";"`;
+}
+var CharacterReferenceType;
+(function(CharacterReferenceType2) {
+ CharacterReferenceType2["HEX"] = "hexadecimal";
+ CharacterReferenceType2["DEC"] = "decimal";
+})(CharacterReferenceType || (CharacterReferenceType = {}));
+var SUPPORTED_BLOCKS = [
+ "@if",
+ "@else",
+ // Covers `@else if` as well
+ "@for",
+ "@switch",
+ "@case",
+ "@default",
+ "@empty",
+ "@defer",
+ "@placeholder",
+ "@loading",
+ "@error"
+];
+var _Tokenizer = class {
+ _getTagDefinition;
+ _cursor;
+ _tokenizeIcu;
+ _interpolationConfig;
+ _leadingTriviaCodePoints;
+ _currentTokenStart = null;
+ _currentTokenType = null;
+ _expansionCaseStack = [];
+ _openDirectiveCount = 0;
+ _inInterpolation = false;
+ _preserveLineEndings;
+ _i18nNormalizeLineEndingsInICUs;
+ _tokenizeBlocks;
+ _tokenizeLet;
+ _selectorlessEnabled;
+ tokens = [];
+ errors = [];
+ nonNormalizedIcuExpressions = [];
+ /**
+ * @param _file The html source file being tokenized.
+ * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name.
+ * @param options Configuration of the tokenization.
+ */
+ constructor(_file, _getTagDefinition, options) {
+ this._getTagDefinition = _getTagDefinition;
+ this._tokenizeIcu = options.tokenizeExpansionForms || false;
+ this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
+ this._leadingTriviaCodePoints = options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);
+ const range = options.range || {
+ endPos: _file.content.length,
+ startPos: 0,
+ startLine: 0,
+ startCol: 0
+ };
+ this._cursor = options.escapedString ? new EscapedCharacterCursor(_file, range) : new PlainCharacterCursor(_file, range);
+ this._preserveLineEndings = options.preserveLineEndings || false;
+ this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
+ this._tokenizeBlocks = options.tokenizeBlocks ?? true;
+ this._tokenizeLet = options.tokenizeLet ?? true;
+ this._selectorlessEnabled = options.selectorlessEnabled ?? false;
+ try {
+ this._cursor.init();
+ } catch (e) {
+ this.handleError(e);
+ }
+ }
+ _processCarriageReturns(content) {
+ if (this._preserveLineEndings) {
+ return content;
+ }
+ return content.replace(_CR_OR_CRLF_REGEXP, "\n");
+ }
+ tokenize() {
+ while (this._cursor.peek() !== $EOF) {
+ const start = this._cursor.clone();
+ try {
+ if (this._attemptCharCode($LT)) {
+ if (this._attemptCharCode($BANG)) {
+ if (this._attemptCharCode($LBRACKET)) {
+ this._consumeCdata(start);
+ } else if (this._attemptCharCode($MINUS)) {
+ this._consumeComment(start);
+ } else {
+ this._consumeDocType(start);
+ }
+ } else if (this._attemptCharCode($SLASH)) {
+ this._consumeTagClose(start);
+ } else {
+ this._consumeTagOpen(start);
+ }
+ } else if (this._tokenizeLet && // Use `peek` instead of `attempCharCode` since we
+ // don't want to advance in case it's not `@let`.
+ this._cursor.peek() === $AT && !this._inInterpolation && this._isLetStart()) {
+ this._consumeLetDeclaration(start);
+ } else if (this._tokenizeBlocks && this._isBlockStart()) {
+ this._consumeBlockStart(start);
+ } else if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansionCase() && !this._isInExpansionForm() && this._attemptCharCode($RBRACE)) {
+ this._consumeBlockEnd(start);
+ } else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
+ this._consumeWithInterpolation(5, 8, () => this._isTextEnd(), () => this._isTagStart());
+ }
+ } catch (e) {
+ this.handleError(e);
+ }
+ }
+ this._beginToken(
+ 41
+ /* TokenType.EOF */
+ );
+ this._endToken([]);
+ }
+ _getBlockName() {
+ let spacesInNameAllowed = false;
+ const nameCursor = this._cursor.clone();
+ this._attemptCharCodeUntilFn((code) => {
+ if (isWhitespace(code)) {
+ return !spacesInNameAllowed;
+ }
+ if (isBlockNameChar(code)) {
+ spacesInNameAllowed = true;
+ return false;
+ }
+ return true;
+ });
+ return this._cursor.getChars(nameCursor).trim();
+ }
+ _consumeBlockStart(start) {
+ this._requireCharCode($AT);
+ this._beginToken(24, start);
+ const startToken = this._endToken([this._getBlockName()]);
+ if (this._cursor.peek() === $LPAREN) {
+ this._cursor.advance();
+ this._consumeBlockParameters();
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ if (this._attemptCharCode($RPAREN)) {
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ } else {
+ startToken.type = 28;
+ return;
+ }
+ }
+ if (this._attemptCharCode($LBRACE)) {
+ this._beginToken(
+ 25
+ /* TokenType.BLOCK_OPEN_END */
+ );
+ this._endToken([]);
+ } else {
+ startToken.type = 28;
+ }
+ }
+ _consumeBlockEnd(start) {
+ this._beginToken(26, start);
+ this._endToken([]);
+ }
+ _consumeBlockParameters() {
+ this._attemptCharCodeUntilFn(isBlockParameterChar);
+ while (this._cursor.peek() !== $RPAREN && this._cursor.peek() !== $EOF) {
+ this._beginToken(
+ 27
+ /* TokenType.BLOCK_PARAMETER */
+ );
+ const start = this._cursor.clone();
+ let inQuote = null;
+ let openParens = 0;
+ while (this._cursor.peek() !== $SEMICOLON && this._cursor.peek() !== $EOF || inQuote !== null) {
+ const char = this._cursor.peek();
+ if (char === $BACKSLASH) {
+ this._cursor.advance();
+ } else if (char === inQuote) {
+ inQuote = null;
+ } else if (inQuote === null && isQuote(char)) {
+ inQuote = char;
+ } else if (char === $LPAREN && inQuote === null) {
+ openParens++;
+ } else if (char === $RPAREN && inQuote === null) {
+ if (openParens === 0) {
+ break;
+ } else if (openParens > 0) {
+ openParens--;
+ }
+ }
+ this._cursor.advance();
+ }
+ this._endToken([this._cursor.getChars(start)]);
+ this._attemptCharCodeUntilFn(isBlockParameterChar);
+ }
+ }
+ _consumeLetDeclaration(start) {
+ this._requireStr("@let");
+ this._beginToken(29, start);
+ if (isWhitespace(this._cursor.peek())) {
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ } else {
+ const token = this._endToken([this._cursor.getChars(start)]);
+ token.type = 32;
+ return;
+ }
+ const startToken = this._endToken([this._getLetDeclarationName()]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ if (!this._attemptCharCode($EQ)) {
+ startToken.type = 32;
+ return;
+ }
+ this._attemptCharCodeUntilFn((code) => isNotWhitespace(code) && !isNewLine(code));
+ this._consumeLetDeclarationValue();
+ const endChar = this._cursor.peek();
+ if (endChar === $SEMICOLON) {
+ this._beginToken(
+ 31
+ /* TokenType.LET_END */
+ );
+ this._endToken([]);
+ this._cursor.advance();
+ } else {
+ startToken.type = 32;
+ startToken.sourceSpan = this._cursor.getSpan(start);
+ }
+ }
+ _getLetDeclarationName() {
+ const nameCursor = this._cursor.clone();
+ let allowDigit = false;
+ this._attemptCharCodeUntilFn((code) => {
+ if (isAsciiLetter(code) || code === $$ || code === $_ || // `@let` names can't start with a digit, but digits are valid anywhere else in the name.
+ allowDigit && isDigit(code)) {
+ allowDigit = true;
+ return false;
+ }
+ return true;
+ });
+ return this._cursor.getChars(nameCursor).trim();
+ }
+ _consumeLetDeclarationValue() {
+ const start = this._cursor.clone();
+ this._beginToken(30, start);
+ while (this._cursor.peek() !== $EOF) {
+ const char = this._cursor.peek();
+ if (char === $SEMICOLON) {
+ break;
+ }
+ if (isQuote(char)) {
+ this._cursor.advance();
+ this._attemptCharCodeUntilFn((inner) => {
+ if (inner === $BACKSLASH) {
+ this._cursor.advance();
+ return false;
+ }
+ return inner === char;
+ });
+ }
+ this._cursor.advance();
+ }
+ this._endToken([this._cursor.getChars(start)]);
+ }
+ /**
+ * @returns whether an ICU token has been created
+ * @internal
+ */
+ _tokenizeExpansionForm() {
+ if (this.isExpansionFormStart()) {
+ this._consumeExpansionFormStart();
+ return true;
+ }
+ if (isExpansionCaseStart(this._cursor.peek()) && this._isInExpansionForm()) {
+ this._consumeExpansionCaseStart();
+ return true;
+ }
+ if (this._cursor.peek() === $RBRACE) {
+ if (this._isInExpansionCase()) {
+ this._consumeExpansionCaseEnd();
+ return true;
+ }
+ if (this._isInExpansionForm()) {
+ this._consumeExpansionFormEnd();
+ return true;
+ }
+ }
+ return false;
+ }
+ _beginToken(type, start = this._cursor.clone()) {
+ this._currentTokenStart = start;
+ this._currentTokenType = type;
+ }
+ _endToken(parts, end) {
+ if (this._currentTokenStart === null) {
+ throw new ParseError(this._cursor.getSpan(end), "Programming error - attempted to end a token when there was no start to the token");
+ }
+ if (this._currentTokenType === null) {
+ throw new ParseError(this._cursor.getSpan(this._currentTokenStart), "Programming error - attempted to end a token which has no token type");
+ }
+ const token = {
+ type: this._currentTokenType,
+ parts,
+ sourceSpan: (end ?? this._cursor).getSpan(this._currentTokenStart, this._leadingTriviaCodePoints)
+ };
+ this.tokens.push(token);
+ this._currentTokenStart = null;
+ this._currentTokenType = null;
+ return token;
+ }
+ _createError(msg, span) {
+ if (this._isInExpansionForm()) {
+ msg += ` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`;
+ }
+ const error = new ParseError(span, msg);
+ this._currentTokenStart = null;
+ this._currentTokenType = null;
+ return error;
+ }
+ handleError(e) {
+ if (e instanceof CursorError) {
+ e = this._createError(e.msg, this._cursor.getSpan(e.cursor));
+ }
+ if (e instanceof ParseError) {
+ this.errors.push(e);
+ } else {
+ throw e;
+ }
+ }
+ _attemptCharCode(charCode) {
+ if (this._cursor.peek() === charCode) {
+ this._cursor.advance();
+ return true;
+ }
+ return false;
+ }
+ _attemptCharCodeCaseInsensitive(charCode) {
+ if (compareCharCodeCaseInsensitive(this._cursor.peek(), charCode)) {
+ this._cursor.advance();
+ return true;
+ }
+ return false;
+ }
+ _requireCharCode(charCode) {
+ const location = this._cursor.clone();
+ if (!this._attemptCharCode(charCode)) {
+ throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));
+ }
+ }
+ _attemptStr(chars) {
+ const len = chars.length;
+ if (this._cursor.charsLeft() < len) {
+ return false;
+ }
+ const initialPosition = this._cursor.clone();
+ for (let i = 0; i < len; i++) {
+ if (!this._attemptCharCode(chars.charCodeAt(i))) {
+ this._cursor = initialPosition;
+ return false;
+ }
+ }
+ return true;
+ }
+ _attemptStrCaseInsensitive(chars) {
+ for (let i = 0; i < chars.length; i++) {
+ if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+ _requireStr(chars) {
+ const location = this._cursor.clone();
+ if (!this._attemptStr(chars)) {
+ throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));
+ }
+ }
+ _attemptCharCodeUntilFn(predicate) {
+ while (!predicate(this._cursor.peek())) {
+ this._cursor.advance();
+ }
+ }
+ _requireCharCodeUntilFn(predicate, len) {
+ const start = this._cursor.clone();
+ this._attemptCharCodeUntilFn(predicate);
+ if (this._cursor.diff(start) < len) {
+ throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
+ }
+ }
+ _attemptUntilChar(char) {
+ while (this._cursor.peek() !== char) {
+ this._cursor.advance();
+ }
+ }
+ _readChar() {
+ const char = String.fromCodePoint(this._cursor.peek());
+ this._cursor.advance();
+ return char;
+ }
+ _peekStr(chars) {
+ const len = chars.length;
+ if (this._cursor.charsLeft() < len) {
+ return false;
+ }
+ const cursor = this._cursor.clone();
+ for (let i = 0; i < len; i++) {
+ if (cursor.peek() !== chars.charCodeAt(i)) {
+ return false;
+ }
+ cursor.advance();
+ }
+ return true;
+ }
+ _isBlockStart() {
+ return this._cursor.peek() === $AT && SUPPORTED_BLOCKS.some((blockName) => this._peekStr(blockName));
+ }
+ _isLetStart() {
+ return this._cursor.peek() === $AT && this._peekStr("@let");
+ }
+ _consumeEntity(textTokenType) {
+ this._beginToken(
+ 9
+ /* TokenType.ENCODED_ENTITY */
+ );
+ const start = this._cursor.clone();
+ this._cursor.advance();
+ if (this._attemptCharCode($HASH)) {
+ const isHex = this._attemptCharCode($x) || this._attemptCharCode($X);
+ const codeStart = this._cursor.clone();
+ this._attemptCharCodeUntilFn(isDigitEntityEnd);
+ if (this._cursor.peek() != $SEMICOLON) {
+ this._cursor.advance();
+ const entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC;
+ throw this._createError(_unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)), this._cursor.getSpan());
+ }
+ const strNum = this._cursor.getChars(codeStart);
+ this._cursor.advance();
+ try {
+ const charCode = parseInt(strNum, isHex ? 16 : 10);
+ this._endToken([String.fromCharCode(charCode), this._cursor.getChars(start)]);
+ } catch {
+ throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan());
+ }
+ } else {
+ const nameStart = this._cursor.clone();
+ this._attemptCharCodeUntilFn(isNamedEntityEnd);
+ if (this._cursor.peek() != $SEMICOLON) {
+ this._beginToken(textTokenType, start);
+ this._cursor = nameStart;
+ this._endToken(["&"]);
+ } else {
+ const name = this._cursor.getChars(nameStart);
+ this._cursor.advance();
+ const char = NAMED_ENTITIES.hasOwnProperty(name) && NAMED_ENTITIES[name];
+ if (!char) {
+ throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start));
+ }
+ this._endToken([char, `&${name};`]);
+ }
+ }
+ }
+ _consumeRawText(consumeEntities, endMarkerPredicate) {
+ this._beginToken(
+ consumeEntities ? 6 : 7
+ /* TokenType.RAW_TEXT */
+ );
+ const parts = [];
+ while (true) {
+ const tagCloseStart = this._cursor.clone();
+ const foundEndMarker = endMarkerPredicate();
+ this._cursor = tagCloseStart;
+ if (foundEndMarker) {
+ break;
+ }
+ if (consumeEntities && this._cursor.peek() === $AMPERSAND) {
+ this._endToken([this._processCarriageReturns(parts.join(""))]);
+ parts.length = 0;
+ this._consumeEntity(
+ 6
+ /* TokenType.ESCAPABLE_RAW_TEXT */
+ );
+ this._beginToken(
+ 6
+ /* TokenType.ESCAPABLE_RAW_TEXT */
+ );
+ } else {
+ parts.push(this._readChar());
+ }
+ }
+ this._endToken([this._processCarriageReturns(parts.join(""))]);
+ }
+ _consumeComment(start) {
+ this._beginToken(10, start);
+ this._requireCharCode($MINUS);
+ this._endToken([]);
+ this._consumeRawText(false, () => this._attemptStr("-->"));
+ this._beginToken(
+ 11
+ /* TokenType.COMMENT_END */
+ );
+ this._requireStr("-->");
+ this._endToken([]);
+ }
+ _consumeCdata(start) {
+ this._beginToken(12, start);
+ this._requireStr("CDATA[");
+ this._endToken([]);
+ this._consumeRawText(false, () => this._attemptStr("]]>"));
+ this._beginToken(
+ 13
+ /* TokenType.CDATA_END */
+ );
+ this._requireStr("]]>");
+ this._endToken([]);
+ }
+ _consumeDocType(start) {
+ this._beginToken(18, start);
+ const contentStart = this._cursor.clone();
+ this._attemptUntilChar($GT);
+ const content = this._cursor.getChars(contentStart);
+ this._cursor.advance();
+ this._endToken([content]);
+ }
+ _consumePrefixAndName(endPredicate) {
+ const nameOrPrefixStart = this._cursor.clone();
+ let prefix = "";
+ while (this._cursor.peek() !== $COLON && !isPrefixEnd(this._cursor.peek())) {
+ this._cursor.advance();
+ }
+ let nameStart;
+ if (this._cursor.peek() === $COLON) {
+ prefix = this._cursor.getChars(nameOrPrefixStart);
+ this._cursor.advance();
+ nameStart = this._cursor.clone();
+ } else {
+ nameStart = nameOrPrefixStart;
+ }
+ this._requireCharCodeUntilFn(endPredicate, prefix === "" ? 0 : 1);
+ const name = this._cursor.getChars(nameStart);
+ return [prefix, name];
+ }
+ _consumeTagOpen(start) {
+ let tagName;
+ let prefix;
+ let closingTagName;
+ let openToken;
+ try {
+ if (this._selectorlessEnabled && isSelectorlessNameStart(this._cursor.peek())) {
+ openToken = this._consumeComponentOpenStart(start);
+ [closingTagName, prefix, tagName] = openToken.parts;
+ if (prefix) {
+ closingTagName += `:${prefix}`;
+ }
+ if (tagName) {
+ closingTagName += `:${tagName}`;
+ }
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ } else {
+ if (!isAsciiLetter(this._cursor.peek())) {
+ throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
+ }
+ openToken = this._consumeTagOpenStart(start);
+ prefix = openToken.parts[0];
+ tagName = closingTagName = openToken.parts[1];
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ }
+ while (!isAttributeTerminator(this._cursor.peek())) {
+ if (this._selectorlessEnabled && this._cursor.peek() === $AT) {
+ const start2 = this._cursor.clone();
+ const nameStart = start2.clone();
+ nameStart.advance();
+ if (isSelectorlessNameStart(nameStart.peek())) {
+ this._consumeDirective(start2, nameStart);
+ }
+ } else {
+ this._consumeAttribute();
+ }
+ }
+ if (openToken.type === 33) {
+ this._consumeComponentOpenEnd();
+ } else {
+ this._consumeTagOpenEnd();
+ }
+ } catch (e) {
+ if (e instanceof ParseError) {
+ if (openToken) {
+ openToken.type = openToken.type === 33 ? 37 : 4;
+ } else {
+ this._beginToken(5, start);
+ this._endToken(["<"]);
+ }
+ return;
+ }
+ throw e;
+ }
+ const contentTokenType = this._getTagDefinition(tagName).getContentType(prefix);
+ if (contentTokenType === TagContentType.RAW_TEXT) {
+ this._consumeRawTextWithTagClose(openToken, closingTagName, false);
+ } else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {
+ this._consumeRawTextWithTagClose(openToken, closingTagName, true);
+ }
+ }
+ _consumeRawTextWithTagClose(openToken, tagName, consumeEntities) {
+ this._consumeRawText(consumeEntities, () => {
+ if (!this._attemptCharCode($LT))
+ return false;
+ if (!this._attemptCharCode($SLASH))
+ return false;
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ if (!this._attemptStrCaseInsensitive(tagName))
+ return false;
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ return this._attemptCharCode($GT);
+ });
+ this._beginToken(
+ openToken.type === 33 ? 36 : 3
+ /* TokenType.TAG_CLOSE */
+ );
+ this._requireCharCodeUntilFn((code) => code === $GT, 3);
+ this._cursor.advance();
+ this._endToken(openToken.parts);
+ }
+ _consumeTagOpenStart(start) {
+ this._beginToken(0, start);
+ const parts = this._consumePrefixAndName(isNameEnd);
+ return this._endToken(parts);
+ }
+ _consumeComponentOpenStart(start) {
+ this._beginToken(33, start);
+ const parts = this._consumeComponentName();
+ return this._endToken(parts);
+ }
+ _consumeComponentName() {
+ const nameStart = this._cursor.clone();
+ while (isSelectorlessNameChar(this._cursor.peek())) {
+ this._cursor.advance();
+ }
+ const name = this._cursor.getChars(nameStart);
+ let prefix = "";
+ let tagName = "";
+ if (this._cursor.peek() === $COLON) {
+ this._cursor.advance();
+ [prefix, tagName] = this._consumePrefixAndName(isNameEnd);
+ }
+ return [name, prefix, tagName];
+ }
+ _consumeAttribute() {
+ this._consumeAttributeName();
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ if (this._attemptCharCode($EQ)) {
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._consumeAttributeValue();
+ }
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ }
+ _consumeAttributeName() {
+ const attrNameStart = this._cursor.peek();
+ if (attrNameStart === $SQ || attrNameStart === $DQ) {
+ throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());
+ }
+ this._beginToken(
+ 14
+ /* TokenType.ATTR_NAME */
+ );
+ let nameEndPredicate;
+ if (this._openDirectiveCount > 0) {
+ let openParens = 0;
+ nameEndPredicate = (code) => {
+ if (this._openDirectiveCount > 0) {
+ if (code === $LPAREN) {
+ openParens++;
+ } else if (code === $RPAREN) {
+ if (openParens === 0) {
+ return true;
+ }
+ openParens--;
+ }
+ }
+ return isNameEnd(code);
+ };
+ } else {
+ nameEndPredicate = isNameEnd;
+ }
+ const prefixAndName = this._consumePrefixAndName(nameEndPredicate);
+ this._endToken(prefixAndName);
+ }
+ _consumeAttributeValue() {
+ if (this._cursor.peek() === $SQ || this._cursor.peek() === $DQ) {
+ const quoteChar = this._cursor.peek();
+ this._consumeQuote(quoteChar);
+ const endPredicate = () => this._cursor.peek() === quoteChar;
+ this._consumeWithInterpolation(16, 17, endPredicate, endPredicate);
+ this._consumeQuote(quoteChar);
+ } else {
+ const endPredicate = () => isNameEnd(this._cursor.peek());
+ this._consumeWithInterpolation(16, 17, endPredicate, endPredicate);
+ }
+ }
+ _consumeQuote(quoteChar) {
+ this._beginToken(
+ 15
+ /* TokenType.ATTR_QUOTE */
+ );
+ this._requireCharCode(quoteChar);
+ this._endToken([String.fromCodePoint(quoteChar)]);
+ }
+ _consumeTagOpenEnd() {
+ const tokenType = this._attemptCharCode($SLASH) ? 2 : 1;
+ this._beginToken(tokenType);
+ this._requireCharCode($GT);
+ this._endToken([]);
+ }
+ _consumeComponentOpenEnd() {
+ const tokenType = this._attemptCharCode($SLASH) ? 35 : 34;
+ this._beginToken(tokenType);
+ this._requireCharCode($GT);
+ this._endToken([]);
+ }
+ _consumeTagClose(start) {
+ if (this._selectorlessEnabled) {
+ const clone = start.clone();
+ while (clone.peek() !== $GT && !isSelectorlessNameStart(clone.peek())) {
+ clone.advance();
+ }
+ if (isSelectorlessNameStart(clone.peek())) {
+ this._beginToken(36, start);
+ const parts = this._consumeComponentName();
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._requireCharCode($GT);
+ this._endToken(parts);
+ return;
+ }
+ }
+ this._beginToken(3, start);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ const prefixAndName = this._consumePrefixAndName(isNameEnd);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._requireCharCode($GT);
+ this._endToken(prefixAndName);
+ }
+ _consumeExpansionFormStart() {
+ this._beginToken(
+ 19
+ /* TokenType.EXPANSION_FORM_START */
+ );
+ this._requireCharCode($LBRACE);
+ this._endToken([]);
+ this._expansionCaseStack.push(
+ 19
+ /* TokenType.EXPANSION_FORM_START */
+ );
+ this._beginToken(
+ 7
+ /* TokenType.RAW_TEXT */
+ );
+ const condition = this._readUntil($COMMA);
+ const normalizedCondition = this._processCarriageReturns(condition);
+ if (this._i18nNormalizeLineEndingsInICUs) {
+ this._endToken([normalizedCondition]);
+ } else {
+ const conditionToken = this._endToken([condition]);
+ if (normalizedCondition !== condition) {
+ this.nonNormalizedIcuExpressions.push(conditionToken);
+ }
+ }
+ this._requireCharCode($COMMA);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._beginToken(
+ 7
+ /* TokenType.RAW_TEXT */
+ );
+ const type = this._readUntil($COMMA);
+ this._endToken([type]);
+ this._requireCharCode($COMMA);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ }
+ _consumeExpansionCaseStart() {
+ this._beginToken(
+ 20
+ /* TokenType.EXPANSION_CASE_VALUE */
+ );
+ const value = this._readUntil($LBRACE).trim();
+ this._endToken([value]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._beginToken(
+ 21
+ /* TokenType.EXPANSION_CASE_EXP_START */
+ );
+ this._requireCharCode($LBRACE);
+ this._endToken([]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._expansionCaseStack.push(
+ 21
+ /* TokenType.EXPANSION_CASE_EXP_START */
+ );
+ }
+ _consumeExpansionCaseEnd() {
+ this._beginToken(
+ 22
+ /* TokenType.EXPANSION_CASE_EXP_END */
+ );
+ this._requireCharCode($RBRACE);
+ this._endToken([]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._expansionCaseStack.pop();
+ }
+ _consumeExpansionFormEnd() {
+ this._beginToken(
+ 23
+ /* TokenType.EXPANSION_FORM_END */
+ );
+ this._requireCharCode($RBRACE);
+ this._endToken([]);
+ this._expansionCaseStack.pop();
+ }
+ /**
+ * Consume a string that may contain interpolation expressions.
+ *
+ * The first token consumed will be of `tokenType` and then there will be alternating
+ * `interpolationTokenType` and `tokenType` tokens until the `endPredicate()` returns true.
+ *
+ * If an interpolation token ends prematurely it will have no end marker in its `parts` array.
+ *
+ * @param textTokenType the kind of tokens to interleave around interpolation tokens.
+ * @param interpolationTokenType the kind of tokens that contain interpolation.
+ * @param endPredicate a function that should return true when we should stop consuming.
+ * @param endInterpolation a function that should return true if there is a premature end to an
+ * interpolation expression - i.e. before we get to the normal interpolation closing marker.
+ */
+ _consumeWithInterpolation(textTokenType, interpolationTokenType, endPredicate, endInterpolation) {
+ this._beginToken(textTokenType);
+ const parts = [];
+ while (!endPredicate()) {
+ const current = this._cursor.clone();
+ if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {
+ this._endToken([this._processCarriageReturns(parts.join(""))], current);
+ parts.length = 0;
+ this._consumeInterpolation(interpolationTokenType, current, endInterpolation);
+ this._beginToken(textTokenType);
+ } else if (this._cursor.peek() === $AMPERSAND) {
+ this._endToken([this._processCarriageReturns(parts.join(""))]);
+ parts.length = 0;
+ this._consumeEntity(textTokenType);
+ this._beginToken(textTokenType);
+ } else {
+ parts.push(this._readChar());
+ }
+ }
+ this._inInterpolation = false;
+ this._endToken([this._processCarriageReturns(parts.join(""))]);
+ }
+ /**
+ * Consume a block of text that has been interpreted as an Angular interpolation.
+ *
+ * @param interpolationTokenType the type of the interpolation token to generate.
+ * @param interpolationStart a cursor that points to the start of this interpolation.
+ * @param prematureEndPredicate a function that should return true if the next characters indicate
+ * an end to the interpolation before its normal closing marker.
+ */
+ _consumeInterpolation(interpolationTokenType, interpolationStart, prematureEndPredicate) {
+ const parts = [];
+ this._beginToken(interpolationTokenType, interpolationStart);
+ parts.push(this._interpolationConfig.start);
+ const expressionStart = this._cursor.clone();
+ let inQuote = null;
+ let inComment = false;
+ while (this._cursor.peek() !== $EOF && (prematureEndPredicate === null || !prematureEndPredicate())) {
+ const current = this._cursor.clone();
+ if (this._isTagStart()) {
+ this._cursor = current;
+ parts.push(this._getProcessedChars(expressionStart, current));
+ this._endToken(parts);
+ return;
+ }
+ if (inQuote === null) {
+ if (this._attemptStr(this._interpolationConfig.end)) {
+ parts.push(this._getProcessedChars(expressionStart, current));
+ parts.push(this._interpolationConfig.end);
+ this._endToken(parts);
+ return;
+ } else if (this._attemptStr("//")) {
+ inComment = true;
+ }
+ }
+ const char = this._cursor.peek();
+ this._cursor.advance();
+ if (char === $BACKSLASH) {
+ this._cursor.advance();
+ } else if (char === inQuote) {
+ inQuote = null;
+ } else if (!inComment && inQuote === null && isQuote(char)) {
+ inQuote = char;
+ }
+ }
+ parts.push(this._getProcessedChars(expressionStart, this._cursor));
+ this._endToken(parts);
+ }
+ _consumeDirective(start, nameStart) {
+ this._requireCharCode($AT);
+ this._cursor.advance();
+ while (isSelectorlessNameChar(this._cursor.peek())) {
+ this._cursor.advance();
+ }
+ this._beginToken(38, start);
+ const name = this._cursor.getChars(nameStart);
+ this._endToken([name]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ if (this._cursor.peek() !== $LPAREN) {
+ return;
+ }
+ this._openDirectiveCount++;
+ this._beginToken(
+ 39
+ /* TokenType.DIRECTIVE_OPEN */
+ );
+ this._cursor.advance();
+ this._endToken([]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ while (!isAttributeTerminator(this._cursor.peek()) && this._cursor.peek() !== $RPAREN) {
+ this._consumeAttribute();
+ }
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ this._openDirectiveCount--;
+ if (this._cursor.peek() !== $RPAREN) {
+ if (this._cursor.peek() === $GT || this._cursor.peek() === $SLASH) {
+ return;
+ }
+ throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
+ }
+ this._beginToken(
+ 40
+ /* TokenType.DIRECTIVE_CLOSE */
+ );
+ this._cursor.advance();
+ this._endToken([]);
+ this._attemptCharCodeUntilFn(isNotWhitespace);
+ }
+ _getProcessedChars(start, end) {
+ return this._processCarriageReturns(end.getChars(start));
+ }
+ _isTextEnd() {
+ if (this._isTagStart() || this._cursor.peek() === $EOF) {
+ return true;
+ }
+ if (this._tokenizeIcu && !this._inInterpolation) {
+ if (this.isExpansionFormStart()) {
+ return true;
+ }
+ if (this._cursor.peek() === $RBRACE && this._isInExpansionCase()) {
+ return true;
+ }
+ }
+ if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._isBlockStart() || this._isLetStart() || this._cursor.peek() === $RBRACE)) {
+ return true;
+ }
+ return false;
+ }
+ /**
+ * Returns true if the current cursor is pointing to the start of a tag
+ * (opening/closing/comments/cdata/etc).
+ */
+ _isTagStart() {
+ if (this._cursor.peek() === $LT) {
+ const tmp = this._cursor.clone();
+ tmp.advance();
+ const code = tmp.peek();
+ if ($a <= code && code <= $z || $A <= code && code <= $Z || code === $SLASH || code === $BANG) {
+ return true;
+ }
+ }
+ return false;
+ }
+ _readUntil(char) {
+ const start = this._cursor.clone();
+ this._attemptUntilChar(char);
+ return this._cursor.getChars(start);
+ }
+ _isInExpansion() {
+ return this._isInExpansionCase() || this._isInExpansionForm();
+ }
+ _isInExpansionCase() {
+ return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 21;
+ }
+ _isInExpansionForm() {
+ return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 19;
+ }
+ isExpansionFormStart() {
+ if (this._cursor.peek() !== $LBRACE) {
+ return false;
+ }
+ if (this._interpolationConfig) {
+ const start = this._cursor.clone();
+ const isInterpolation = this._attemptStr(this._interpolationConfig.start);
+ this._cursor = start;
+ return !isInterpolation;
+ }
+ return true;
+ }
+};
+function isNotWhitespace(code) {
+ return !isWhitespace(code) || code === $EOF;
+}
+function isNameEnd(code) {
+ return isWhitespace(code) || code === $GT || code === $LT || code === $SLASH || code === $SQ || code === $DQ || code === $EQ || code === $EOF;
+}
+function isPrefixEnd(code) {
+ return (code < $a || $z < code) && (code < $A || $Z < code) && (code < $0 || code > $9);
+}
+function isDigitEntityEnd(code) {
+ return code === $SEMICOLON || code === $EOF || !isAsciiHexDigit(code);
+}
+function isNamedEntityEnd(code) {
+ return code === $SEMICOLON || code === $EOF || !isAsciiLetter(code);
+}
+function isExpansionCaseStart(peek) {
+ return peek !== $RBRACE;
+}
+function compareCharCodeCaseInsensitive(code1, code2) {
+ return toUpperCaseCharCode(code1) === toUpperCaseCharCode(code2);
+}
+function toUpperCaseCharCode(code) {
+ return code >= $a && code <= $z ? code - $a + $A : code;
+}
+function isBlockNameChar(code) {
+ return isAsciiLetter(code) || isDigit(code) || code === $_;
+}
+function isBlockParameterChar(code) {
+ return code !== $SEMICOLON && isNotWhitespace(code);
+}
+function isSelectorlessNameStart(code) {
+ return code === $_ || code >= $A && code <= $Z;
+}
+function isSelectorlessNameChar(code) {
+ return isAsciiLetter(code) || isDigit(code) || code === $_;
+}
+function isAttributeTerminator(code) {
+ return code === $SLASH || code === $GT || code === $LT || code === $EOF;
+}
+function mergeTextTokens(srcTokens) {
+ const dstTokens = [];
+ let lastDstToken = void 0;
+ for (let i = 0; i < srcTokens.length; i++) {
+ const token = srcTokens[i];
+ if (lastDstToken && lastDstToken.type === 5 && token.type === 5 || lastDstToken && lastDstToken.type === 16 && token.type === 16) {
+ lastDstToken.parts[0] += token.parts[0];
+ lastDstToken.sourceSpan.end = token.sourceSpan.end;
+ } else {
+ lastDstToken = token;
+ dstTokens.push(lastDstToken);
+ }
+ }
+ return dstTokens;
+}
+var PlainCharacterCursor = class _PlainCharacterCursor {
+ state;
+ file;
+ input;
+ end;
+ constructor(fileOrCursor, range) {
+ if (fileOrCursor instanceof _PlainCharacterCursor) {
+ this.file = fileOrCursor.file;
+ this.input = fileOrCursor.input;
+ this.end = fileOrCursor.end;
+ const state = fileOrCursor.state;
+ this.state = {
+ peek: state.peek,
+ offset: state.offset,
+ line: state.line,
+ column: state.column
+ };
+ } else {
+ if (!range) {
+ throw new Error("Programming error: the range argument must be provided with a file argument.");
+ }
+ this.file = fileOrCursor;
+ this.input = fileOrCursor.content;
+ this.end = range.endPos;
+ this.state = {
+ peek: -1,
+ offset: range.startPos,
+ line: range.startLine,
+ column: range.startCol
+ };
+ }
+ }
+ clone() {
+ return new _PlainCharacterCursor(this);
+ }
+ peek() {
+ return this.state.peek;
+ }
+ charsLeft() {
+ return this.end - this.state.offset;
+ }
+ diff(other) {
+ return this.state.offset - other.state.offset;
+ }
+ advance() {
+ this.advanceState(this.state);
+ }
+ init() {
+ this.updatePeek(this.state);
+ }
+ getSpan(start, leadingTriviaCodePoints) {
+ start = start || this;
+ let fullStart = start;
+ if (leadingTriviaCodePoints) {
+ while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {
+ if (fullStart === start) {
+ start = start.clone();
+ }
+ start.advance();
+ }
+ }
+ const startLocation = this.locationFromCursor(start);
+ const endLocation = this.locationFromCursor(this);
+ const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;
+ return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);
+ }
+ getChars(start) {
+ return this.input.substring(start.state.offset, this.state.offset);
+ }
+ charAt(pos) {
+ return this.input.charCodeAt(pos);
+ }
+ advanceState(state) {
+ if (state.offset >= this.end) {
+ this.state = state;
+ throw new CursorError('Unexpected character "EOF"', this);
+ }
+ const currentChar = this.charAt(state.offset);
+ if (currentChar === $LF) {
+ state.line++;
+ state.column = 0;
+ } else if (!isNewLine(currentChar)) {
+ state.column++;
+ }
+ state.offset++;
+ this.updatePeek(state);
+ }
+ updatePeek(state) {
+ state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);
+ }
+ locationFromCursor(cursor) {
+ return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);
+ }
+};
+var EscapedCharacterCursor = class _EscapedCharacterCursor extends PlainCharacterCursor {
+ internalState;
+ constructor(fileOrCursor, range) {
+ if (fileOrCursor instanceof _EscapedCharacterCursor) {
+ super(fileOrCursor);
+ this.internalState = __spreadValues({}, fileOrCursor.internalState);
+ } else {
+ super(fileOrCursor, range);
+ this.internalState = this.state;
+ }
+ }
+ advance() {
+ this.state = this.internalState;
+ super.advance();
+ this.processEscapeSequence();
+ }
+ init() {
+ super.init();
+ this.processEscapeSequence();
+ }
+ clone() {
+ return new _EscapedCharacterCursor(this);
+ }
+ getChars(start) {
+ const cursor = start.clone();
+ let chars = "";
+ while (cursor.internalState.offset < this.internalState.offset) {
+ chars += String.fromCodePoint(cursor.peek());
+ cursor.advance();
+ }
+ return chars;
+ }
+ /**
+ * Process the escape sequence that starts at the current position in the text.
+ *
+ * This method is called to ensure that `peek` has the unescaped value of escape sequences.
+ */
+ processEscapeSequence() {
+ const peek = () => this.internalState.peek;
+ if (peek() === $BACKSLASH) {
+ this.internalState = __spreadValues({}, this.state);
+ this.advanceState(this.internalState);
+ if (peek() === $n) {
+ this.state.peek = $LF;
+ } else if (peek() === $r) {
+ this.state.peek = $CR;
+ } else if (peek() === $v) {
+ this.state.peek = $VTAB;
+ } else if (peek() === $t) {
+ this.state.peek = $TAB;
+ } else if (peek() === $b) {
+ this.state.peek = $BSPACE;
+ } else if (peek() === $f) {
+ this.state.peek = $FF;
+ } else if (peek() === $u) {
+ this.advanceState(this.internalState);
+ if (peek() === $LBRACE) {
+ this.advanceState(this.internalState);
+ const digitStart = this.clone();
+ let length = 0;
+ while (peek() !== $RBRACE) {
+ this.advanceState(this.internalState);
+ length++;
+ }
+ this.state.peek = this.decodeHexDigits(digitStart, length);
+ } else {
+ const digitStart = this.clone();
+ this.advanceState(this.internalState);
+ this.advanceState(this.internalState);
+ this.advanceState(this.internalState);
+ this.state.peek = this.decodeHexDigits(digitStart, 4);
+ }
+ } else if (peek() === $x) {
+ this.advanceState(this.internalState);
+ const digitStart = this.clone();
+ this.advanceState(this.internalState);
+ this.state.peek = this.decodeHexDigits(digitStart, 2);
+ } else if (isOctalDigit(peek())) {
+ let octal = "";
+ let length = 0;
+ let previous = this.clone();
+ while (isOctalDigit(peek()) && length < 3) {
+ previous = this.clone();
+ octal += String.fromCodePoint(peek());
+ this.advanceState(this.internalState);
+ length++;
+ }
+ this.state.peek = parseInt(octal, 8);
+ this.internalState = previous.internalState;
+ } else if (isNewLine(this.internalState.peek)) {
+ this.advanceState(this.internalState);
+ this.state = this.internalState;
+ } else {
+ this.state.peek = this.internalState.peek;
+ }
+ }
+ }
+ decodeHexDigits(start, length) {
+ const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);
+ const charCode = parseInt(hex, 16);
+ if (!isNaN(charCode)) {
+ return charCode;
+ } else {
+ start.state = start.internalState;
+ throw new CursorError("Invalid hexadecimal escape sequence", start);
+ }
+ }
+};
+var CursorError = class extends Error {
+ msg;
+ cursor;
+ constructor(msg, cursor) {
+ super(msg);
+ this.msg = msg;
+ this.cursor = cursor;
+ Object.setPrototypeOf(this, new.target.prototype);
+ }
+};
+var TreeError = class _TreeError extends ParseError {
+ elementName;
+ static create(elementName, span, msg) {
+ return new _TreeError(elementName, span, msg);
+ }
+ constructor(elementName, span, msg) {
+ super(span, msg);
+ this.elementName = elementName;
+ }
+};
+var ParseTreeResult = class {
+ rootNodes;
+ errors;
+ constructor(rootNodes, errors) {
+ this.rootNodes = rootNodes;
+ this.errors = errors;
+ }
+};
+var Parser$1 = class Parser {
+ getTagDefinition;
+ constructor(getTagDefinition) {
+ this.getTagDefinition = getTagDefinition;
+ }
+ parse(source, url, options) {
+ const tokenizeResult = tokenize(source, url, this.getTagDefinition, options);
+ const parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition);
+ parser.build();
+ return new ParseTreeResult(parser.rootNodes, [...tokenizeResult.errors, ...parser.errors]);
+ }
+};
+var _TreeBuilder = class __TreeBuilder {
+ tokens;
+ tagDefinitionResolver;
+ _index = -1;
+ // `_peek` will be initialized by the call to `_advance()` in the constructor.
+ _peek;
+ _containerStack = [];
+ rootNodes = [];
+ errors = [];
+ constructor(tokens, tagDefinitionResolver) {
+ this.tokens = tokens;
+ this.tagDefinitionResolver = tagDefinitionResolver;
+ this._advance();
+ }
+ build() {
+ while (this._peek.type !== 41) {
+ if (this._peek.type === 0 || this._peek.type === 4) {
+ this._consumeElementStartTag(this._advance());
+ } else if (this._peek.type === 3) {
+ this._consumeElementEndTag(this._advance());
+ } else if (this._peek.type === 12) {
+ this._closeVoidElement();
+ this._consumeCdata(this._advance());
+ } else if (this._peek.type === 10) {
+ this._closeVoidElement();
+ this._consumeComment(this._advance());
+ } else if (this._peek.type === 5 || this._peek.type === 7 || this._peek.type === 6) {
+ this._closeVoidElement();
+ this._consumeText(this._advance());
+ } else if (this._peek.type === 19) {
+ this._consumeExpansion(this._advance());
+ } else if (this._peek.type === 24) {
+ this._closeVoidElement();
+ this._consumeBlockOpen(this._advance());
+ } else if (this._peek.type === 26) {
+ this._closeVoidElement();
+ this._consumeBlockClose(this._advance());
+ } else if (this._peek.type === 28) {
+ this._closeVoidElement();
+ this._consumeIncompleteBlock(this._advance());
+ } else if (this._peek.type === 29) {
+ this._closeVoidElement();
+ this._consumeLet(this._advance());
+ } else if (this._peek.type === 32) {
+ this._closeVoidElement();
+ this._consumeIncompleteLet(this._advance());
+ } else if (this._peek.type === 33 || this._peek.type === 37) {
+ this._consumeComponentStartTag(this._advance());
+ } else if (this._peek.type === 36) {
+ this._consumeComponentEndTag(this._advance());
+ } else {
+ this._advance();
+ }
+ }
+ for (const leftoverContainer of this._containerStack) {
+ if (leftoverContainer instanceof Block) {
+ this.errors.push(TreeError.create(leftoverContainer.name, leftoverContainer.sourceSpan, `Unclosed block "${leftoverContainer.name}"`));
+ }
+ }
+ }
+ _advance() {
+ const prev = this._peek;
+ if (this._index < this.tokens.length - 1) {
+ this._index++;
+ }
+ this._peek = this.tokens[this._index];
+ return prev;
+ }
+ _advanceIf(type) {
+ if (this._peek.type === type) {
+ return this._advance();
+ }
+ return null;
+ }
+ _consumeCdata(_startToken) {
+ this._consumeText(this._advance());
+ this._advanceIf(
+ 13
+ /* TokenType.CDATA_END */
+ );
+ }
+ _consumeComment(token) {
+ const text2 = this._advanceIf(
+ 7
+ /* TokenType.RAW_TEXT */
+ );
+ const endToken = this._advanceIf(
+ 11
+ /* TokenType.COMMENT_END */
+ );
+ const value = text2 != null ? text2.parts[0].trim() : null;
+ const sourceSpan = endToken == null ? token.sourceSpan : new ParseSourceSpan(token.sourceSpan.start, endToken.sourceSpan.end, token.sourceSpan.fullStart);
+ this._addToParent(new Comment2(value, sourceSpan));
+ }
+ _consumeExpansion(token) {
+ const switchValue = this._advance();
+ const type = this._advance();
+ const cases = [];
+ while (this._peek.type === 20) {
+ const expCase = this._parseExpansionCase();
+ if (!expCase)
+ return;
+ cases.push(expCase);
+ }
+ if (this._peek.type !== 23) {
+ this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
+ return;
+ }
+ const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
+ this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
+ this._advance();
+ }
+ _parseExpansionCase() {
+ const value = this._advance();
+ if (this._peek.type !== 21) {
+ this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));
+ return null;
+ }
+ const start = this._advance();
+ const exp = this._collectExpansionExpTokens(start);
+ if (!exp)
+ return null;
+ const end = this._advance();
+ exp.push({ type: 41, parts: [], sourceSpan: end.sourceSpan });
+ const expansionCaseParser = new __TreeBuilder(exp, this.tagDefinitionResolver);
+ expansionCaseParser.build();
+ if (expansionCaseParser.errors.length > 0) {
+ this.errors = this.errors.concat(expansionCaseParser.errors);
+ return null;
+ }
+ const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);
+ const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);
+ return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
+ }
+ _collectExpansionExpTokens(start) {
+ const exp = [];
+ const expansionFormStack = [
+ 21
+ /* TokenType.EXPANSION_CASE_EXP_START */
+ ];
+ while (true) {
+ if (this._peek.type === 19 || this._peek.type === 21) {
+ expansionFormStack.push(this._peek.type);
+ }
+ if (this._peek.type === 22) {
+ if (lastOnStack(
+ expansionFormStack,
+ 21
+ /* TokenType.EXPANSION_CASE_EXP_START */
+ )) {
+ expansionFormStack.pop();
+ if (expansionFormStack.length === 0)
+ return exp;
+ } else {
+ this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
+ return null;
+ }
+ }
+ if (this._peek.type === 23) {
+ if (lastOnStack(
+ expansionFormStack,
+ 19
+ /* TokenType.EXPANSION_FORM_START */
+ )) {
+ expansionFormStack.pop();
+ } else {
+ this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
+ return null;
+ }
+ }
+ if (this._peek.type === 41) {
+ this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
+ return null;
+ }
+ exp.push(this._advance());
+ }
+ }
+ _consumeText(token) {
+ const tokens = [token];
+ const startSpan = token.sourceSpan;
+ let text2 = token.parts[0];
+ if (text2.length > 0 && text2[0] === "\n") {
+ const parent = this._getContainer();
+ if (parent != null && parent.children.length === 0 && this._getTagDefinition(parent)?.ignoreFirstLf) {
+ text2 = text2.substring(1);
+ tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text2] };
+ }
+ }
+ while (this._peek.type === 8 || this._peek.type === 5 || this._peek.type === 9) {
+ token = this._advance();
+ tokens.push(token);
+ if (token.type === 8) {
+ text2 += token.parts.join("").replace(/&([^;]+);/g, decodeEntity);
+ } else if (token.type === 9) {
+ text2 += token.parts[0];
+ } else {
+ text2 += token.parts.join("");
+ }
+ }
+ if (text2.length > 0) {
+ const endSpan = token.sourceSpan;
+ this._addToParent(new Text4(text2, new ParseSourceSpan(startSpan.start, endSpan.end, startSpan.fullStart, startSpan.details), tokens));
+ }
+ }
+ _closeVoidElement() {
+ const el = this._getContainer();
+ if (el !== null && this._getTagDefinition(el)?.isVoid) {
+ this._containerStack.pop();
+ }
+ }
+ _consumeElementStartTag(startTagToken) {
+ const attrs = [];
+ const directives = [];
+ this._consumeAttributesAndDirectives(attrs, directives);
+ const fullName = this._getElementFullName(startTagToken, this._getClosestElementLikeParent());
+ const tagDef = this._getTagDefinition(fullName);
+ let selfClosing = false;
+ if (this._peek.type === 2) {
+ this._advance();
+ selfClosing = true;
+ if (!(tagDef?.canSelfClose || getNsPrefix(fullName) !== null || tagDef?.isVoid)) {
+ this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`));
+ }
+ } else if (this._peek.type === 1) {
+ this._advance();
+ selfClosing = false;
+ }
+ const end = this._peek.sourceSpan.fullStart;
+ const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
+ const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
+ const el = new Element2(fullName, attrs, directives, [], selfClosing, span, startSpan, void 0, tagDef?.isVoid ?? false);
+ const parent = this._getContainer();
+ const isClosedByChild = parent !== null && !!this._getTagDefinition(parent)?.isClosedByChild(el.name);
+ this._pushContainer(el, isClosedByChild);
+ if (selfClosing) {
+ this._popContainer(fullName, Element2, span);
+ } else if (startTagToken.type === 4) {
+ this._popContainer(fullName, Element2, null);
+ this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
+ }
+ }
+ _consumeComponentStartTag(startToken) {
+ const componentName = startToken.parts[0];
+ const attrs = [];
+ const directives = [];
+ this._consumeAttributesAndDirectives(attrs, directives);
+ const closestElement = this._getClosestElementLikeParent();
+ const tagName = this._getComponentTagName(startToken, closestElement);
+ const fullName = this._getComponentFullName(startToken, closestElement);
+ const selfClosing = this._peek.type === 35;
+ this._advance();
+ const end = this._peek.sourceSpan.fullStart;
+ const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
+ const startSpan = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
+ const node = new Component2(componentName, tagName, fullName, attrs, directives, [], selfClosing, span, startSpan, void 0);
+ const parent = this._getContainer();
+ const isClosedByChild = parent !== null && node.tagName !== null && !!this._getTagDefinition(parent)?.isClosedByChild(node.tagName);
+ this._pushContainer(node, isClosedByChild);
+ if (selfClosing) {
+ this._popContainer(fullName, Component2, span);
+ } else if (startToken.type === 37) {
+ this._popContainer(fullName, Component2, null);
+ this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
+ }
+ }
+ _consumeAttributesAndDirectives(attributesResult, directivesResult) {
+ while (this._peek.type === 14 || this._peek.type === 38) {
+ if (this._peek.type === 38) {
+ directivesResult.push(this._consumeDirective(this._peek));
+ } else {
+ attributesResult.push(this._consumeAttr(this._advance()));
+ }
+ }
+ }
+ _consumeComponentEndTag(endToken) {
+ const fullName = this._getComponentFullName(endToken, this._getClosestElementLikeParent());
+ if (!this._popContainer(fullName, Component2, endToken.sourceSpan)) {
+ const container = this._containerStack[this._containerStack.length - 1];
+ let suffix;
+ if (container instanceof Component2 && container.componentName === endToken.parts[0]) {
+ suffix = `, did you mean "${container.fullName}"?`;
+ } else {
+ suffix = ". It may happen when the tag has already been closed by another tag.";
+ }
+ const errMsg = `Unexpected closing tag "${fullName}"${suffix}`;
+ this.errors.push(TreeError.create(fullName, endToken.sourceSpan, errMsg));
+ }
+ }
+ _getTagDefinition(nodeOrName) {
+ if (typeof nodeOrName === "string") {
+ return this.tagDefinitionResolver(nodeOrName);
+ } else if (nodeOrName instanceof Element2) {
+ return this.tagDefinitionResolver(nodeOrName.name);
+ } else if (nodeOrName instanceof Component2 && nodeOrName.tagName !== null) {
+ return this.tagDefinitionResolver(nodeOrName.tagName);
+ } else {
+ return null;
+ }
+ }
+ _pushContainer(node, isClosedByChild) {
+ if (isClosedByChild) {
+ this._containerStack.pop();
+ }
+ this._addToParent(node);
+ this._containerStack.push(node);
+ }
+ _consumeElementEndTag(endTagToken) {
+ const fullName = this._getElementFullName(endTagToken, this._getClosestElementLikeParent());
+ if (this._getTagDefinition(fullName)?.isVoid) {
+ this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, `Void elements do not have end tags "${endTagToken.parts[1]}"`));
+ } else if (!this._popContainer(fullName, Element2, endTagToken.sourceSpan)) {
+ const errMsg = `Unexpected closing tag "${fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;
+ this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));
+ }
+ }
+ /**
+ * Closes the nearest element with the tag name `fullName` in the parse tree.
+ * `endSourceSpan` is the span of the closing tag, or null if the element does
+ * not have a closing tag (for example, this happens when an incomplete
+ * opening tag is recovered).
+ */
+ _popContainer(expectedName, expectedType, endSourceSpan) {
+ let unexpectedCloseTagDetected = false;
+ for (let stackIndex = this._containerStack.length - 1; stackIndex >= 0; stackIndex--) {
+ const node = this._containerStack[stackIndex];
+ const nodeName = node instanceof Component2 ? node.fullName : node.name;
+ if ((nodeName === expectedName || expectedName === null) && node instanceof expectedType) {
+ node.endSourceSpan = endSourceSpan;
+ node.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : node.sourceSpan.end;
+ this._containerStack.splice(stackIndex, this._containerStack.length - stackIndex);
+ return !unexpectedCloseTagDetected;
+ }
+ if (node instanceof Block || !this._getTagDefinition(node)?.closedByParent) {
+ unexpectedCloseTagDetected = true;
+ }
+ }
+ return false;
+ }
+ _consumeAttr(attrName) {
+ const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
+ let attrEnd = attrName.sourceSpan.end;
+ if (this._peek.type === 15) {
+ this._advance();
+ }
+ let value = "";
+ const valueTokens = [];
+ let valueStartSpan = void 0;
+ let valueEnd = void 0;
+ const nextTokenType = this._peek.type;
+ if (nextTokenType === 16) {
+ valueStartSpan = this._peek.sourceSpan;
+ valueEnd = this._peek.sourceSpan.end;
+ while (this._peek.type === 16 || this._peek.type === 17 || this._peek.type === 9) {
+ const valueToken = this._advance();
+ valueTokens.push(valueToken);
+ if (valueToken.type === 17) {
+ value += valueToken.parts.join("").replace(/&([^;]+);/g, decodeEntity);
+ } else if (valueToken.type === 9) {
+ value += valueToken.parts[0];
+ } else {
+ value += valueToken.parts.join("");
+ }
+ valueEnd = attrEnd = valueToken.sourceSpan.end;
+ }
+ }
+ if (this._peek.type === 15) {
+ const quoteToken = this._advance();
+ attrEnd = quoteToken.sourceSpan.end;
+ }
+ const valueSpan = valueStartSpan && valueEnd && new ParseSourceSpan(valueStartSpan.start, valueEnd, valueStartSpan.fullStart);
+ return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart), attrName.sourceSpan, valueSpan, valueTokens.length > 0 ? valueTokens : void 0, void 0);
+ }
+ _consumeDirective(nameToken) {
+ const attributes = [];
+ let startSourceSpanEnd = nameToken.sourceSpan.end;
+ let endSourceSpan = null;
+ this._advance();
+ if (this._peek.type === 39) {
+ startSourceSpanEnd = this._peek.sourceSpan.end;
+ this._advance();
+ while (this._peek.type === 14) {
+ attributes.push(this._consumeAttr(this._advance()));
+ }
+ if (this._peek.type === 40) {
+ endSourceSpan = this._peek.sourceSpan;
+ this._advance();
+ } else {
+ this.errors.push(TreeError.create(null, nameToken.sourceSpan, "Unterminated directive definition"));
+ }
+ }
+ const startSourceSpan = new ParseSourceSpan(nameToken.sourceSpan.start, startSourceSpanEnd, nameToken.sourceSpan.fullStart);
+ const sourceSpan = new ParseSourceSpan(startSourceSpan.start, endSourceSpan === null ? nameToken.sourceSpan.end : endSourceSpan.end, startSourceSpan.fullStart);
+ return new Directive2(nameToken.parts[0], attributes, sourceSpan, startSourceSpan, endSourceSpan);
+ }
+ _consumeBlockOpen(token) {
+ const parameters = [];
+ while (this._peek.type === 27) {
+ const paramToken = this._advance();
+ parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
+ }
+ if (this._peek.type === 25) {
+ this._advance();
+ }
+ const end = this._peek.sourceSpan.fullStart;
+ const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
+ const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
+ const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
+ this._pushContainer(block, false);
+ }
+ _consumeBlockClose(token) {
+ if (!this._popContainer(null, Block, token.sourceSpan)) {
+ this.errors.push(TreeError.create(null, token.sourceSpan, `Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.`));
+ }
+ }
+ _consumeIncompleteBlock(token) {
+ const parameters = [];
+ while (this._peek.type === 27) {
+ const paramToken = this._advance();
+ parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
+ }
+ const end = this._peek.sourceSpan.fullStart;
+ const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
+ const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
+ const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
+ this._pushContainer(block, false);
+ this._popContainer(null, Block, null);
+ this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`));
+ }
+ _consumeLet(startToken) {
+ const name = startToken.parts[0];
+ let valueToken;
+ let endToken;
+ if (this._peek.type !== 30) {
+ this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Invalid @let declaration "${name}". Declaration must have a value.`));
+ return;
+ } else {
+ valueToken = this._advance();
+ }
+ if (this._peek.type !== 31) {
+ this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Unterminated @let declaration "${name}". Declaration must be terminated with a semicolon.`));
+ return;
+ } else {
+ endToken = this._advance();
+ }
+ const end = endToken.sourceSpan.fullStart;
+ const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
+ const startOffset = startToken.sourceSpan.toString().lastIndexOf(name);
+ const nameStart = startToken.sourceSpan.start.moveBy(startOffset);
+ const nameSpan = new ParseSourceSpan(nameStart, startToken.sourceSpan.end);
+ const node = new LetDeclaration2(name, valueToken.parts[0], span, nameSpan, valueToken.sourceSpan);
+ this._addToParent(node);
+ }
+ _consumeIncompleteLet(token) {
+ const name = token.parts[0] ?? "";
+ const nameString = name ? ` "${name}"` : "";
+ if (name.length > 0) {
+ const startOffset = token.sourceSpan.toString().lastIndexOf(name);
+ const nameStart = token.sourceSpan.start.moveBy(startOffset);
+ const nameSpan = new ParseSourceSpan(nameStart, token.sourceSpan.end);
+ const valueSpan = new ParseSourceSpan(token.sourceSpan.start, token.sourceSpan.start.moveBy(0));
+ const node = new LetDeclaration2(name, "", token.sourceSpan, nameSpan, valueSpan);
+ this._addToParent(node);
+ }
+ this.errors.push(TreeError.create(token.parts[0], token.sourceSpan, `Incomplete @let declaration${nameString}. @let declarations must be written as \`@let = ;\``));
+ }
+ _getContainer() {
+ return this._containerStack.length > 0 ? this._containerStack[this._containerStack.length - 1] : null;
+ }
+ _getClosestElementLikeParent() {
+ for (let i = this._containerStack.length - 1; i > -1; i--) {
+ const current = this._containerStack[i];
+ if (current instanceof Element2 || current instanceof Component2) {
+ return current;
+ }
+ }
+ return null;
+ }
+ _addToParent(node) {
+ const parent = this._getContainer();
+ if (parent === null) {
+ this.rootNodes.push(node);
+ } else {
+ parent.children.push(node);
+ }
+ }
+ _getElementFullName(token, parent) {
+ const prefix = this._getPrefix(token, parent);
+ return mergeNsAndName(prefix, token.parts[1]);
+ }
+ _getComponentFullName(token, parent) {
+ const componentName = token.parts[0];
+ const tagName = this._getComponentTagName(token, parent);
+ if (tagName === null) {
+ return componentName;
+ }
+ return tagName.startsWith(":") ? componentName + tagName : `${componentName}:${tagName}`;
+ }
+ _getComponentTagName(token, parent) {
+ const prefix = this._getPrefix(token, parent);
+ const tagName = token.parts[2];
+ if (!prefix && !tagName) {
+ return null;
+ } else if (!prefix && tagName) {
+ return tagName;
+ } else {
+ return mergeNsAndName(prefix, tagName || "ng-component");
+ }
+ }
+ _getPrefix(token, parent) {
+ let prefix;
+ let tagName;
+ if (token.type === 33 || token.type === 37 || token.type === 36) {
+ prefix = token.parts[1];
+ tagName = token.parts[2];
+ } else {
+ prefix = token.parts[0];
+ tagName = token.parts[1];
+ }
+ prefix = prefix || this._getTagDefinition(tagName)?.implicitNamespacePrefix || "";
+ if (!prefix && parent) {
+ const parentName = parent instanceof Element2 ? parent.name : parent.tagName;
+ if (parentName !== null) {
+ const parentTagName = splitNsName(parentName)[1];
+ const parentTagDefinition = this._getTagDefinition(parentTagName);
+ if (parentTagDefinition !== null && !parentTagDefinition.preventNamespaceInheritance) {
+ prefix = getNsPrefix(parentName);
+ }
+ }
+ }
+ return prefix;
+ }
+};
+function lastOnStack(stack, element2) {
+ return stack.length > 0 && stack[stack.length - 1] === element2;
+}
+function decodeEntity(match, entity) {
+ if (NAMED_ENTITIES[entity] !== void 0) {
+ return NAMED_ENTITIES[entity] || match;
+ }
+ if (/^#x[a-f0-9]+$/i.test(entity)) {
+ return String.fromCodePoint(parseInt(entity.slice(2), 16));
+ }
+ if (/^#\d+$/.test(entity)) {
+ return String.fromCodePoint(parseInt(entity.slice(1), 10));
+ }
+ return match;
+}
+var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
+var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
+var WS_CHARS = " \f\n\r \v - \u2028\u2029 \uFEFF";
+var NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);
+var WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, "g");
+function hasPreserveWhitespacesAttr(attrs) {
+ return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
+}
+function replaceNgsp(value) {
+ return value.replace(new RegExp(NGSP_UNICODE, "g"), " ");
+}
+var WhitespaceVisitor = class {
+ preserveSignificantWhitespace;
+ originalNodeMap;
+ requireContext;
+ // How many ICU expansions which are currently being visited. ICUs can be nested, so this
+ // tracks the current depth of nesting. If this depth is greater than 0, then this visitor is
+ // currently processing content inside an ICU expansion.
+ icuExpansionDepth = 0;
+ constructor(preserveSignificantWhitespace, originalNodeMap, requireContext = true) {
+ this.preserveSignificantWhitespace = preserveSignificantWhitespace;
+ this.originalNodeMap = originalNodeMap;
+ this.requireContext = requireContext;
+ }
+ visitElement(element2, context) {
+ if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
+ const newElement2 = new Element2(element2.name, visitAllWithSiblings(this, element2.attrs), visitAllWithSiblings(this, element2.directives), element2.children, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
+ this.originalNodeMap?.set(newElement2, element2);
+ return newElement2;
+ }
+ const newElement = new Element2(element2.name, element2.attrs, element2.directives, visitAllWithSiblings(this, element2.children), element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
+ this.originalNodeMap?.set(newElement, element2);
+ return newElement;
+ }
+ visitAttribute(attribute2, context) {
+ return attribute2.name !== PRESERVE_WS_ATTR_NAME ? attribute2 : null;
+ }
+ visitText(text2, context) {
+ const isNotBlank = text2.value.match(NO_WS_REGEXP);
+ const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);
+ const inIcuExpansion = this.icuExpansionDepth > 0;
+ if (inIcuExpansion && this.preserveSignificantWhitespace)
+ return text2;
+ if (isNotBlank || hasExpansionSibling) {
+ const tokens = text2.tokens.map((token) => token.type === 5 ? createWhitespaceProcessedTextToken(token) : token);
+ if (!this.preserveSignificantWhitespace && tokens.length > 0) {
+ const firstToken = tokens[0];
+ tokens.splice(0, 1, trimLeadingWhitespace(firstToken, context));
+ const lastToken = tokens[tokens.length - 1];
+ tokens.splice(tokens.length - 1, 1, trimTrailingWhitespace(lastToken, context));
+ }
+ const processed = processWhitespace(text2.value);
+ const value = this.preserveSignificantWhitespace ? processed : trimLeadingAndTrailingWhitespace(processed, context);
+ const result = new Text4(value, text2.sourceSpan, tokens, text2.i18n);
+ this.originalNodeMap?.set(result, text2);
+ return result;
+ }
+ return null;
+ }
+ visitComment(comment, context) {
+ return comment;
+ }
+ visitExpansion(expansion, context) {
+ this.icuExpansionDepth++;
+ let newExpansion;
+ try {
+ newExpansion = new Expansion(expansion.switchValue, expansion.type, visitAllWithSiblings(this, expansion.cases), expansion.sourceSpan, expansion.switchValueSourceSpan, expansion.i18n);
+ } finally {
+ this.icuExpansionDepth--;
+ }
+ this.originalNodeMap?.set(newExpansion, expansion);
+ return newExpansion;
+ }
+ visitExpansionCase(expansionCase, context) {
+ const newExpansionCase = new ExpansionCase(expansionCase.value, visitAllWithSiblings(this, expansionCase.expression), expansionCase.sourceSpan, expansionCase.valueSourceSpan, expansionCase.expSourceSpan);
+ this.originalNodeMap?.set(newExpansionCase, expansionCase);
+ return newExpansionCase;
+ }
+ visitBlock(block, context) {
+ const newBlock = new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
+ this.originalNodeMap?.set(newBlock, block);
+ return newBlock;
+ }
+ visitBlockParameter(parameter, context) {
+ return parameter;
+ }
+ visitLetDeclaration(decl, context) {
+ return decl;
+ }
+ visitComponent(node, context) {
+ if (node.tagName && SKIP_WS_TRIM_TAGS.has(node.tagName) || hasPreserveWhitespacesAttr(node.attrs)) {
+ const newElement2 = new Component2(node.componentName, node.tagName, node.fullName, visitAllWithSiblings(this, node.attrs), visitAllWithSiblings(this, node.directives), node.children, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
+ this.originalNodeMap?.set(newElement2, node);
+ return newElement2;
+ }
+ const newElement = new Component2(node.componentName, node.tagName, node.fullName, node.attrs, node.directives, visitAllWithSiblings(this, node.children), node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
+ this.originalNodeMap?.set(newElement, node);
+ return newElement;
+ }
+ visitDirective(directive, context) {
+ return directive;
+ }
+ visit(_node, context) {
+ if (this.requireContext && !context) {
+ throw new Error(`WhitespaceVisitor requires context. Visit via \`visitAllWithSiblings\` to get this context.`);
+ }
+ return false;
+ }
+};
+function trimLeadingWhitespace(token, context) {
+ if (token.type !== 5)
+ return token;
+ const isFirstTokenInTag = !context?.prev;
+ if (!isFirstTokenInTag)
+ return token;
+ return transformTextToken(token, (text2) => text2.trimStart());
+}
+function trimTrailingWhitespace(token, context) {
+ if (token.type !== 5)
+ return token;
+ const isLastTokenInTag = !context?.next;
+ if (!isLastTokenInTag)
+ return token;
+ return transformTextToken(token, (text2) => text2.trimEnd());
+}
+function trimLeadingAndTrailingWhitespace(text2, context) {
+ const isFirstTokenInTag = !context?.prev;
+ const isLastTokenInTag = !context?.next;
+ const maybeTrimmedStart = isFirstTokenInTag ? text2.trimStart() : text2;
+ const maybeTrimmed = isLastTokenInTag ? maybeTrimmedStart.trimEnd() : maybeTrimmedStart;
+ return maybeTrimmed;
+}
+function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
+ return { type, parts: [processWhitespace(parts[0])], sourceSpan };
+}
+function transformTextToken({ type, parts, sourceSpan }, transform2) {
+ return { type, parts: [transform2(parts[0])], sourceSpan };
+}
+function processWhitespace(text2) {
+ return replaceNgsp(text2).replace(WS_REPLACE_REGEXP, " ");
+}
+function visitAllWithSiblings(visitor, nodes) {
+ const result = [];
+ nodes.forEach((ast, i) => {
+ const context = { prev: nodes[i - 1], next: nodes[i + 1] };
+ const astResult = ast.visit(visitor, context);
+ if (astResult) {
+ result.push(astResult);
+ }
+ });
+ return result;
+}
+var TokenType;
+(function(TokenType2) {
+ TokenType2[TokenType2["Character"] = 0] = "Character";
+ TokenType2[TokenType2["Identifier"] = 1] = "Identifier";
+ TokenType2[TokenType2["PrivateIdentifier"] = 2] = "PrivateIdentifier";
+ TokenType2[TokenType2["Keyword"] = 3] = "Keyword";
+ TokenType2[TokenType2["String"] = 4] = "String";
+ TokenType2[TokenType2["Operator"] = 5] = "Operator";
+ TokenType2[TokenType2["Number"] = 6] = "Number";
+ TokenType2[TokenType2["Error"] = 7] = "Error";
+})(TokenType || (TokenType = {}));
+var StringTokenKind;
+(function(StringTokenKind2) {
+ StringTokenKind2[StringTokenKind2["Plain"] = 0] = "Plain";
+ StringTokenKind2[StringTokenKind2["TemplateLiteralPart"] = 1] = "TemplateLiteralPart";
+ StringTokenKind2[StringTokenKind2["TemplateLiteralEnd"] = 2] = "TemplateLiteralEnd";
+})(StringTokenKind || (StringTokenKind = {}));
+var KEYWORDS = [
+ "var",
+ "let",
+ "as",
+ "null",
+ "undefined",
+ "true",
+ "false",
+ "if",
+ "else",
+ "this",
+ "typeof",
+ "void",
+ "in"
+];
+var Lexer = class {
+ tokenize(text2) {
+ return new _Scanner(text2).scan();
+ }
+};
+var Token = class {
+ index;
+ end;
+ type;
+ numValue;
+ strValue;
+ constructor(index, end, type, numValue, strValue) {
+ this.index = index;
+ this.end = end;
+ this.type = type;
+ this.numValue = numValue;
+ this.strValue = strValue;
+ }
+ isCharacter(code) {
+ return this.type === TokenType.Character && this.numValue === code;
+ }
+ isNumber() {
+ return this.type === TokenType.Number;
+ }
+ isString() {
+ return this.type === TokenType.String;
+ }
+ isOperator(operator) {
+ return this.type === TokenType.Operator && this.strValue === operator;
+ }
+ isIdentifier() {
+ return this.type === TokenType.Identifier;
+ }
+ isPrivateIdentifier() {
+ return this.type === TokenType.PrivateIdentifier;
+ }
+ isKeyword() {
+ return this.type === TokenType.Keyword;
+ }
+ isKeywordLet() {
+ return this.type === TokenType.Keyword && this.strValue === "let";
+ }
+ isKeywordAs() {
+ return this.type === TokenType.Keyword && this.strValue === "as";
+ }
+ isKeywordNull() {
+ return this.type === TokenType.Keyword && this.strValue === "null";
+ }
+ isKeywordUndefined() {
+ return this.type === TokenType.Keyword && this.strValue === "undefined";
+ }
+ isKeywordTrue() {
+ return this.type === TokenType.Keyword && this.strValue === "true";
+ }
+ isKeywordFalse() {
+ return this.type === TokenType.Keyword && this.strValue === "false";
+ }
+ isKeywordThis() {
+ return this.type === TokenType.Keyword && this.strValue === "this";
+ }
+ isKeywordTypeof() {
+ return this.type === TokenType.Keyword && this.strValue === "typeof";
+ }
+ isKeywordVoid() {
+ return this.type === TokenType.Keyword && this.strValue === "void";
+ }
+ isKeywordIn() {
+ return this.type === TokenType.Keyword && this.strValue === "in";
+ }
+ isError() {
+ return this.type === TokenType.Error;
+ }
+ toNumber() {
+ return this.type === TokenType.Number ? this.numValue : -1;
+ }
+ isTemplateLiteralPart() {
+ return this.isString() && this.kind === StringTokenKind.TemplateLiteralPart;
+ }
+ isTemplateLiteralEnd() {
+ return this.isString() && this.kind === StringTokenKind.TemplateLiteralEnd;
+ }
+ isTemplateLiteralInterpolationStart() {
+ return this.isOperator("${");
+ }
+ isTemplateLiteralInterpolationEnd() {
+ return this.isOperator("}");
+ }
+ toString() {
+ switch (this.type) {
+ case TokenType.Character:
+ case TokenType.Identifier:
+ case TokenType.Keyword:
+ case TokenType.Operator:
+ case TokenType.PrivateIdentifier:
+ case TokenType.String:
+ case TokenType.Error:
+ return this.strValue;
+ case TokenType.Number:
+ return this.numValue.toString();
+ default:
+ return null;
+ }
+ }
+};
+var StringToken = class extends Token {
+ kind;
+ constructor(index, end, strValue, kind) {
+ super(index, end, TokenType.String, 0, strValue);
+ this.kind = kind;
+ }
+};
+function newCharacterToken(index, end, code) {
+ return new Token(index, end, TokenType.Character, code, String.fromCharCode(code));
+}
+function newIdentifierToken(index, end, text2) {
+ return new Token(index, end, TokenType.Identifier, 0, text2);
+}
+function newPrivateIdentifierToken(index, end, text2) {
+ return new Token(index, end, TokenType.PrivateIdentifier, 0, text2);
+}
+function newKeywordToken(index, end, text2) {
+ return new Token(index, end, TokenType.Keyword, 0, text2);
+}
+function newOperatorToken(index, end, text2) {
+ return new Token(index, end, TokenType.Operator, 0, text2);
+}
+function newNumberToken(index, end, n) {
+ return new Token(index, end, TokenType.Number, n, "");
+}
+function newErrorToken(index, end, message) {
+ return new Token(index, end, TokenType.Error, 0, message);
+}
+var EOF = new Token(-1, -1, TokenType.Character, 0, "");
+var _Scanner = class {
+ input;
+ tokens = [];
+ length;
+ peek = 0;
+ index = -1;
+ braceStack = [];
+ constructor(input) {
+ this.input = input;
+ this.length = input.length;
+ this.advance();
+ }
+ scan() {
+ let token = this.scanToken();
+ while (token !== null) {
+ this.tokens.push(token);
+ token = this.scanToken();
+ }
+ return this.tokens;
+ }
+ advance() {
+ this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);
+ }
+ scanToken() {
+ const input = this.input;
+ const length = this.length;
+ let peek = this.peek;
+ let index = this.index;
+ while (peek <= $SPACE) {
+ if (++index >= length) {
+ peek = $EOF;
+ break;
+ } else {
+ peek = input.charCodeAt(index);
+ }
+ }
+ this.peek = peek;
+ this.index = index;
+ if (index >= length) {
+ return null;
+ }
+ if (isIdentifierStart(peek)) {
+ return this.scanIdentifier();
+ }
+ if (isDigit(peek)) {
+ return this.scanNumber(index);
+ }
+ const start = index;
+ switch (peek) {
+ case $PERIOD:
+ this.advance();
+ return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, this.index, $PERIOD);
+ case $LPAREN:
+ case $RPAREN:
+ case $LBRACKET:
+ case $RBRACKET:
+ case $COMMA:
+ case $COLON:
+ case $SEMICOLON:
+ return this.scanCharacter(start, peek);
+ case $LBRACE:
+ return this.scanOpenBrace(start, peek);
+ case $RBRACE:
+ return this.scanCloseBrace(start, peek);
+ case $SQ:
+ case $DQ:
+ return this.scanString();
+ case $BT:
+ this.advance();
+ return this.scanTemplateLiteralPart(start);
+ case $HASH:
+ return this.scanPrivateIdentifier();
+ case $PLUS:
+ return this.scanComplexOperator(start, "+", $EQ, "=");
+ case $MINUS:
+ return this.scanComplexOperator(start, "-", $EQ, "=");
+ case $SLASH:
+ return this.scanComplexOperator(start, "/", $EQ, "=");
+ case $PERCENT:
+ return this.scanComplexOperator(start, "%", $EQ, "=");
+ case $CARET:
+ return this.scanOperator(start, "^");
+ case $STAR:
+ return this.scanStar(start);
+ case $QUESTION:
+ return this.scanQuestion(start);
+ case $LT:
+ case $GT:
+ return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, "=");
+ case $BANG:
+ case $EQ:
+ return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, "=", $EQ, "=");
+ case $AMPERSAND:
+ return this.scanComplexOperator(start, "&", $AMPERSAND, "&", $EQ, "=");
+ case $BAR:
+ return this.scanComplexOperator(start, "|", $BAR, "|", $EQ, "=");
+ case $NBSP:
+ while (isWhitespace(this.peek))
+ this.advance();
+ return this.scanToken();
+ }
+ this.advance();
+ return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);
+ }
+ scanCharacter(start, code) {
+ this.advance();
+ return newCharacterToken(start, this.index, code);
+ }
+ scanOperator(start, str) {
+ this.advance();
+ return newOperatorToken(start, this.index, str);
+ }
+ scanOpenBrace(start, code) {
+ this.braceStack.push("expression");
+ this.advance();
+ return newCharacterToken(start, this.index, code);
+ }
+ scanCloseBrace(start, code) {
+ this.advance();
+ const currentBrace = this.braceStack.pop();
+ if (currentBrace === "interpolation") {
+ this.tokens.push(newOperatorToken(start, this.index, "}"));
+ return this.scanTemplateLiteralPart(this.index);
+ }
+ return newCharacterToken(start, this.index, code);
+ }
+ /**
+ * Tokenize a 2/3 char long operator
+ *
+ * @param start start index in the expression
+ * @param one first symbol (always part of the operator)
+ * @param twoCode code point for the second symbol
+ * @param two second symbol (part of the operator when the second code point matches)
+ * @param threeCode code point for the third symbol
+ * @param three third symbol (part of the operator when provided and matches source expression)
+ */
+ scanComplexOperator(start, one, twoCode, two, threeCode, three) {
+ this.advance();
+ let str = one;
+ if (this.peek == twoCode) {
+ this.advance();
+ str += two;
+ }
+ if (threeCode != null && this.peek == threeCode) {
+ this.advance();
+ str += three;
+ }
+ return newOperatorToken(start, this.index, str);
+ }
+ scanIdentifier() {
+ const start = this.index;
+ this.advance();
+ while (isIdentifierPart(this.peek))
+ this.advance();
+ const str = this.input.substring(start, this.index);
+ return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) : newIdentifierToken(start, this.index, str);
+ }
+ /** Scans an ECMAScript private identifier. */
+ scanPrivateIdentifier() {
+ const start = this.index;
+ this.advance();
+ if (!isIdentifierStart(this.peek)) {
+ return this.error("Invalid character [#]", -1);
+ }
+ while (isIdentifierPart(this.peek))
+ this.advance();
+ const identifierName2 = this.input.substring(start, this.index);
+ return newPrivateIdentifierToken(start, this.index, identifierName2);
+ }
+ scanNumber(start) {
+ let simple = this.index === start;
+ let hasSeparators = false;
+ this.advance();
+ while (true) {
+ if (isDigit(this.peek)) ;
+ else if (this.peek === $_) {
+ if (!isDigit(this.input.charCodeAt(this.index - 1)) || !isDigit(this.input.charCodeAt(this.index + 1))) {
+ return this.error("Invalid numeric separator", 0);
+ }
+ hasSeparators = true;
+ } else if (this.peek === $PERIOD) {
+ simple = false;
+ } else if (isExponentStart(this.peek)) {
+ this.advance();
+ if (isExponentSign(this.peek))
+ this.advance();
+ if (!isDigit(this.peek))
+ return this.error("Invalid exponent", -1);
+ simple = false;
+ } else {
+ break;
+ }
+ this.advance();
+ }
+ let str = this.input.substring(start, this.index);
+ if (hasSeparators) {
+ str = str.replace(/_/g, "");
+ }
+ const value = simple ? parseIntAutoRadix(str) : parseFloat(str);
+ return newNumberToken(start, this.index, value);
+ }
+ scanString() {
+ const start = this.index;
+ const quote = this.peek;
+ this.advance();
+ let buffer = "";
+ let marker = this.index;
+ const input = this.input;
+ while (this.peek != quote) {
+ if (this.peek == $BACKSLASH) {
+ const result = this.scanStringBackslash(buffer, marker);
+ if (typeof result !== "string") {
+ return result;
+ }
+ buffer = result;
+ marker = this.index;
+ } else if (this.peek == $EOF) {
+ return this.error("Unterminated quote", 0);
+ } else {
+ this.advance();
+ }
+ }
+ const last = input.substring(marker, this.index);
+ this.advance();
+ return new StringToken(start, this.index, buffer + last, StringTokenKind.Plain);
+ }
+ scanQuestion(start) {
+ this.advance();
+ let operator = "?";
+ if (this.peek === $QUESTION) {
+ operator += "?";
+ this.advance();
+ if (this.peek === $EQ) {
+ operator += "=";
+ this.advance();
+ }
+ } else if (this.peek === $PERIOD) {
+ operator += ".";
+ this.advance();
+ }
+ return newOperatorToken(start, this.index, operator);
+ }
+ scanTemplateLiteralPart(start) {
+ let buffer = "";
+ let marker = this.index;
+ while (this.peek !== $BT) {
+ if (this.peek === $BACKSLASH) {
+ const result = this.scanStringBackslash(buffer, marker);
+ if (typeof result !== "string") {
+ return result;
+ }
+ buffer = result;
+ marker = this.index;
+ } else if (this.peek === $$) {
+ const dollar = this.index;
+ this.advance();
+ if (this.peek === $LBRACE) {
+ this.braceStack.push("interpolation");
+ this.tokens.push(new StringToken(start, dollar, buffer + this.input.substring(marker, dollar), StringTokenKind.TemplateLiteralPart));
+ this.advance();
+ return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index));
+ }
+ } else if (this.peek === $EOF) {
+ return this.error("Unterminated template literal", 0);
+ } else {
+ this.advance();
+ }
+ }
+ const last = this.input.substring(marker, this.index);
+ this.advance();
+ return new StringToken(start, this.index, buffer + last, StringTokenKind.TemplateLiteralEnd);
+ }
+ error(message, offset) {
+ const position = this.index + offset;
+ return newErrorToken(position, this.index, `Lexer Error: ${message} at column ${position} in expression [${this.input}]`);
+ }
+ scanStringBackslash(buffer, marker) {
+ buffer += this.input.substring(marker, this.index);
+ let unescapedCode;
+ this.advance();
+ if (this.peek === $u) {
+ const hex = this.input.substring(this.index + 1, this.index + 5);
+ if (/^[0-9a-f]+$/i.test(hex)) {
+ unescapedCode = parseInt(hex, 16);
+ } else {
+ return this.error(`Invalid unicode escape [\\u${hex}]`, 0);
+ }
+ for (let i = 0; i < 5; i++) {
+ this.advance();
+ }
+ } else {
+ unescapedCode = unescape(this.peek);
+ this.advance();
+ }
+ buffer += String.fromCharCode(unescapedCode);
+ return buffer;
+ }
+ scanStar(start) {
+ this.advance();
+ let operator = "*";
+ if (this.peek === $STAR) {
+ operator += "*";
+ this.advance();
+ if (this.peek === $EQ) {
+ operator += "=";
+ this.advance();
+ }
+ } else if (this.peek === $EQ) {
+ operator += "=";
+ this.advance();
+ }
+ return newOperatorToken(start, this.index, operator);
+ }
+};
+function isIdentifierStart(code) {
+ return $a <= code && code <= $z || $A <= code && code <= $Z || code == $_ || code == $$;
+}
+function isIdentifierPart(code) {
+ return isAsciiLetter(code) || isDigit(code) || code == $_ || code == $$;
+}
+function isExponentStart(code) {
+ return code == $e || code == $E;
+}
+function isExponentSign(code) {
+ return code == $MINUS || code == $PLUS;
+}
+function unescape(code) {
+ switch (code) {
+ case $n:
+ return $LF;
+ case $f:
+ return $FF;
+ case $r:
+ return $CR;
+ case $t:
+ return $TAB;
+ case $v:
+ return $VTAB;
+ default:
+ return code;
+ }
+}
+function parseIntAutoRadix(text2) {
+ const result = parseInt(text2);
+ if (isNaN(result)) {
+ throw new Error("Invalid integer literal when parsing " + text2);
+ }
+ return result;
+}
+var SplitInterpolation = class {
+ strings;
+ expressions;
+ offsets;
+ constructor(strings, expressions, offsets) {
+ this.strings = strings;
+ this.expressions = expressions;
+ this.offsets = offsets;
+ }
+};
+var TemplateBindingParseResult = class {
+ templateBindings;
+ warnings;
+ errors;
+ constructor(templateBindings, warnings, errors) {
+ this.templateBindings = templateBindings;
+ this.warnings = warnings;
+ this.errors = errors;
+ }
+};
+function getLocation(span) {
+ return span.start.toString() || "(unknown)";
+}
+var Parser2 = class {
+ _lexer;
+ _supportsDirectPipeReferences;
+ constructor(_lexer, _supportsDirectPipeReferences = false) {
+ this._lexer = _lexer;
+ this._supportsDirectPipeReferences = _supportsDirectPipeReferences;
+ }
+ parseAction(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
+ const errors = [];
+ this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);
+ const { stripped: sourceToLex } = this._stripComments(input);
+ const tokens = this._lexer.tokenize(sourceToLex);
+ const ast = new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 1, errors, 0, this._supportsDirectPipeReferences).parseChain();
+ return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
+ }
+ parseBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
+ const errors = [];
+ const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);
+ return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
+ }
+ checkSimpleExpression(ast) {
+ const checker = new SimpleExpressionChecker();
+ ast.visit(checker);
+ return checker.errors;
+ }
+ // Host bindings parsed here
+ parseSimpleBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
+ const errors = [];
+ const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);
+ const simplExpressionErrors = this.checkSimpleExpression(ast);
+ if (simplExpressionErrors.length > 0) {
+ errors.push(getParseError(`Host binding expression cannot contain ${simplExpressionErrors.join(" ")}`, input, "", parseSourceSpan));
+ }
+ return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
+ }
+ _parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors) {
+ this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);
+ const { stripped: sourceToLex } = this._stripComments(input);
+ const tokens = this._lexer.tokenize(sourceToLex);
+ return new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 0, errors, 0, this._supportsDirectPipeReferences).parseChain();
+ }
+ /**
+ * Parse microsyntax template expression and return a list of bindings or
+ * parsing errors in case the given expression is invalid.
+ *
+ * For example,
+ * ```html
+ *
+ * ^ ^ absoluteValueOffset for `templateValue`
+ * absoluteKeyOffset for `templateKey`
+ * ```
+ * contains three bindings:
+ * 1. ngFor -> null
+ * 2. item -> NgForOfContext.$implicit
+ * 3. ngForOf -> items
+ *
+ * This is apparent from the de-sugared template:
+ * ```html
+ *
+ * ```
+ *
+ * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor
+ * @param templateValue RHS of the microsyntax attribute
+ * @param templateUrl template filename if it's external, component filename if it's inline
+ * @param absoluteKeyOffset start of the `templateKey`
+ * @param absoluteValueOffset start of the `templateValue`
+ */
+ parseTemplateBindings(templateKey, templateValue, parseSourceSpan, absoluteKeyOffset, absoluteValueOffset) {
+ const tokens = this._lexer.tokenize(templateValue);
+ const errors = [];
+ const parser = new _ParseAST(templateValue, parseSourceSpan, absoluteValueOffset, tokens, 0, errors, 0, this._supportsDirectPipeReferences);
+ return parser.parseTemplateBindings({
+ source: templateKey,
+ span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length)
+ });
+ }
+ parseInterpolation(input, parseSourceSpan, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
+ const errors = [];
+ const { strings, expressions, offsets } = this.splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig);
+ if (expressions.length === 0)
+ return null;
+ const expressionNodes = [];
+ for (let i = 0; i < expressions.length; ++i) {
+ const expressionSpan = interpolatedTokens?.[i * 2 + 1]?.sourceSpan;
+ const expressionText = expressions[i].text;
+ const { stripped: sourceToLex, hasComments } = this._stripComments(expressionText);
+ const tokens = this._lexer.tokenize(sourceToLex);
+ if (hasComments && sourceToLex.trim().length === 0 && tokens.length === 0) {
+ errors.push(getParseError("Interpolation expression cannot only contain a comment", input, `at column ${expressions[i].start} in`, parseSourceSpan));
+ continue;
+ }
+ const ast = new _ParseAST(expressionSpan ? expressionText : input, expressionSpan || parseSourceSpan, absoluteOffset, tokens, 0, errors, offsets[i], this._supportsDirectPipeReferences).parseChain();
+ expressionNodes.push(ast);
+ }
+ return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input, getLocation(parseSourceSpan), absoluteOffset, errors);
+ }
+ /**
+ * Similar to `parseInterpolation`, but treats the provided string as a single expression
+ * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
+ * This is used for parsing the switch expression in ICUs.
+ */
+ parseInterpolationExpression(expression, parseSourceSpan, absoluteOffset) {
+ const { stripped: sourceToLex } = this._stripComments(expression);
+ const tokens = this._lexer.tokenize(sourceToLex);
+ const errors = [];
+ const ast = new _ParseAST(expression, parseSourceSpan, absoluteOffset, tokens, 0, errors, 0, this._supportsDirectPipeReferences).parseChain();
+ const strings = ["", ""];
+ return this.createInterpolationAst(strings, [ast], expression, getLocation(parseSourceSpan), absoluteOffset, errors);
+ }
+ createInterpolationAst(strings, expressions, input, location, absoluteOffset, errors) {
+ const span = new ParseSpan(0, input.length);
+ const interpolation = new Interpolation$1(span, span.toAbsolute(absoluteOffset), strings, expressions);
+ return new ASTWithSource(interpolation, input, location, absoluteOffset, errors);
+ }
+ /**
+ * Splits a string of text into "raw" text segments and expressions present in interpolations in
+ * the string.
+ * Returns `null` if there are no interpolations, otherwise a
+ * `SplitInterpolation` with splits that look like
+ * ...
+ */
+ splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
+ const strings = [];
+ const expressions = [];
+ const offsets = [];
+ const inputToTemplateIndexMap = interpolatedTokens ? getIndexMapForOriginalTemplate(interpolatedTokens) : null;
+ let i = 0;
+ let atInterpolation = false;
+ let extendLastString = false;
+ let { start: interpStart, end: interpEnd } = interpolationConfig;
+ while (i < input.length) {
+ if (!atInterpolation) {
+ const start = i;
+ i = input.indexOf(interpStart, i);
+ if (i === -1) {
+ i = input.length;
+ }
+ const text2 = input.substring(start, i);
+ strings.push({ text: text2, start, end: i });
+ atInterpolation = true;
+ } else {
+ const fullStart = i;
+ const exprStart = fullStart + interpStart.length;
+ const exprEnd = this._getInterpolationEndIndex(input, interpEnd, exprStart);
+ if (exprEnd === -1) {
+ atInterpolation = false;
+ extendLastString = true;
+ break;
+ }
+ const fullEnd = exprEnd + interpEnd.length;
+ const text2 = input.substring(exprStart, exprEnd);
+ if (text2.trim().length === 0) {
+ errors.push(getParseError("Blank expressions are not allowed in interpolated strings", input, `at column ${i} in`, parseSourceSpan));
+ }
+ expressions.push({ text: text2, start: fullStart, end: fullEnd });
+ const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;
+ const offset = startInOriginalTemplate + interpStart.length;
+ offsets.push(offset);
+ i = fullEnd;
+ atInterpolation = false;
+ }
+ }
+ if (!atInterpolation) {
+ if (extendLastString) {
+ const piece = strings[strings.length - 1];
+ piece.text += input.substring(i);
+ piece.end = input.length;
+ } else {
+ strings.push({ text: input.substring(i), start: i, end: input.length });
+ }
+ }
+ return new SplitInterpolation(strings, expressions, offsets);
+ }
+ wrapLiteralPrimitive(input, sourceSpanOrLocation, absoluteOffset) {
+ const span = new ParseSpan(0, input == null ? 0 : input.length);
+ return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, typeof sourceSpanOrLocation === "string" ? sourceSpanOrLocation : getLocation(sourceSpanOrLocation), absoluteOffset, []);
+ }
+ _stripComments(input) {
+ const i = this._commentStart(input);
+ return i != null ? { stripped: input.substring(0, i), hasComments: true } : { stripped: input, hasComments: false };
+ }
+ _commentStart(input) {
+ let outerQuote = null;
+ for (let i = 0; i < input.length - 1; i++) {
+ const char = input.charCodeAt(i);
+ const nextChar = input.charCodeAt(i + 1);
+ if (char === $SLASH && nextChar == $SLASH && outerQuote == null)
+ return i;
+ if (outerQuote === char) {
+ outerQuote = null;
+ } else if (outerQuote == null && isQuote(char)) {
+ outerQuote = char;
+ }
+ }
+ return null;
+ }
+ _checkNoInterpolation(errors, input, parseSourceSpan, { start, end }) {
+ let startIndex = -1;
+ let endIndex = -1;
+ for (const charIndex of this._forEachUnquotedChar(input, 0)) {
+ if (startIndex === -1) {
+ if (input.startsWith(start)) {
+ startIndex = charIndex;
+ }
+ } else {
+ endIndex = this._getInterpolationEndIndex(input, end, charIndex);
+ if (endIndex > -1) {
+ break;
+ }
+ }
+ }
+ if (startIndex > -1 && endIndex > -1) {
+ errors.push(getParseError(`Got interpolation (${start}${end}) where expression was expected`, input, `at column ${startIndex} in`, parseSourceSpan));
+ }
+ }
+ /**
+ * Finds the index of the end of an interpolation expression
+ * while ignoring comments and quoted content.
+ */
+ _getInterpolationEndIndex(input, expressionEnd, start) {
+ for (const charIndex of this._forEachUnquotedChar(input, start)) {
+ if (input.startsWith(expressionEnd, charIndex)) {
+ return charIndex;
+ }
+ if (input.startsWith("//", charIndex)) {
+ return input.indexOf(expressionEnd, charIndex);
+ }
+ }
+ return -1;
+ }
+ /**
+ * Generator used to iterate over the character indexes of a string that are outside of quotes.
+ * @param input String to loop through.
+ * @param start Index within the string at which to start.
+ */
+ *_forEachUnquotedChar(input, start) {
+ let currentQuote = null;
+ let escapeCount = 0;
+ for (let i = start; i < input.length; i++) {
+ const char = input[i];
+ if (isQuote(input.charCodeAt(i)) && (currentQuote === null || currentQuote === char) && escapeCount % 2 === 0) {
+ currentQuote = currentQuote === null ? char : null;
+ } else if (currentQuote === null) {
+ yield i;
+ }
+ escapeCount = char === "\\" ? escapeCount + 1 : 0;
+ }
+ }
+};
+var ParseContextFlags;
+(function(ParseContextFlags2) {
+ ParseContextFlags2[ParseContextFlags2["None"] = 0] = "None";
+ ParseContextFlags2[ParseContextFlags2["Writable"] = 1] = "Writable";
+})(ParseContextFlags || (ParseContextFlags = {}));
+var _ParseAST = class {
+ input;
+ parseSourceSpan;
+ absoluteOffset;
+ tokens;
+ parseFlags;
+ errors;
+ offset;
+ supportsDirectPipeReferences;
+ rparensExpected = 0;
+ rbracketsExpected = 0;
+ rbracesExpected = 0;
+ context = ParseContextFlags.None;
+ // Cache of expression start and input indeces to the absolute source span they map to, used to
+ // prevent creating superfluous source spans in `sourceSpan`.
+ // A serial of the expression start and input index is used for mapping because both are stateful
+ // and may change for subsequent expressions visited by the parser.
+ sourceSpanCache = /* @__PURE__ */ new Map();
+ index = 0;
+ constructor(input, parseSourceSpan, absoluteOffset, tokens, parseFlags, errors, offset, supportsDirectPipeReferences) {
+ this.input = input;
+ this.parseSourceSpan = parseSourceSpan;
+ this.absoluteOffset = absoluteOffset;
+ this.tokens = tokens;
+ this.parseFlags = parseFlags;
+ this.errors = errors;
+ this.offset = offset;
+ this.supportsDirectPipeReferences = supportsDirectPipeReferences;
+ }
+ peek(offset) {
+ const i = this.index + offset;
+ return i < this.tokens.length ? this.tokens[i] : EOF;
+ }
+ get next() {
+ return this.peek(0);
+ }
+ /** Whether all the parser input has been processed. */
+ get atEOF() {
+ return this.index >= this.tokens.length;
+ }
+ /**
+ * Index of the next token to be processed, or the end of the last token if all have been
+ * processed.
+ */
+ get inputIndex() {
+ return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;
+ }
+ /**
+ * End index of the last processed token, or the start of the first token if none have been
+ * processed.
+ */
+ get currentEndIndex() {
+ if (this.index > 0) {
+ const curToken = this.peek(-1);
+ return curToken.end + this.offset;
+ }
+ if (this.tokens.length === 0) {
+ return this.input.length + this.offset;
+ }
+ return this.next.index + this.offset;
+ }
+ /**
+ * Returns the absolute offset of the start of the current token.
+ */
+ get currentAbsoluteOffset() {
+ return this.absoluteOffset + this.inputIndex;
+ }
+ /**
+ * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if
+ * provided).
+ *
+ * @param start Position from which the `ParseSpan` will start.
+ * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the
+ * natural ending index)
+ */
+ span(start, artificialEndIndex) {
+ let endIndex = this.currentEndIndex;
+ if (artificialEndIndex !== void 0 && artificialEndIndex > this.currentEndIndex) {
+ endIndex = artificialEndIndex;
+ }
+ if (start > endIndex) {
+ const tmp = endIndex;
+ endIndex = start;
+ start = tmp;
+ }
+ return new ParseSpan(start, endIndex);
+ }
+ sourceSpan(start, artificialEndIndex) {
+ const serial = `${start}@${this.inputIndex}:${artificialEndIndex}`;
+ if (!this.sourceSpanCache.has(serial)) {
+ this.sourceSpanCache.set(serial, this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset));
+ }
+ return this.sourceSpanCache.get(serial);
+ }
+ advance() {
+ this.index++;
+ }
+ /**
+ * Executes a callback in the provided context.
+ */
+ withContext(context, cb) {
+ this.context |= context;
+ const ret = cb();
+ this.context ^= context;
+ return ret;
+ }
+ consumeOptionalCharacter(code) {
+ if (this.next.isCharacter(code)) {
+ this.advance();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ peekKeywordLet() {
+ return this.next.isKeywordLet();
+ }
+ peekKeywordAs() {
+ return this.next.isKeywordAs();
+ }
+ /**
+ * Consumes an expected character, otherwise emits an error about the missing expected character
+ * and skips over the token stream until reaching a recoverable point.
+ *
+ * See `this.error` and `this.skip` for more details.
+ */
+ expectCharacter(code) {
+ if (this.consumeOptionalCharacter(code))
+ return;
+ this.error(`Missing expected ${String.fromCharCode(code)}`);
+ }
+ consumeOptionalOperator(op) {
+ if (this.next.isOperator(op)) {
+ this.advance();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ isAssignmentOperator(token) {
+ return token.type === TokenType.Operator && Binary.isAssignmentOperation(token.strValue);
+ }
+ expectOperator(operator) {
+ if (this.consumeOptionalOperator(operator))
+ return;
+ this.error(`Missing expected operator ${operator}`);
+ }
+ prettyPrintToken(tok) {
+ return tok === EOF ? "end of input" : `token ${tok}`;
+ }
+ expectIdentifierOrKeyword() {
+ const n = this.next;
+ if (!n.isIdentifier() && !n.isKeyword()) {
+ if (n.isPrivateIdentifier()) {
+ this._reportErrorForPrivateIdentifier(n, "expected identifier or keyword");
+ } else {
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
+ }
+ return null;
+ }
+ this.advance();
+ return n.toString();
+ }
+ expectIdentifierOrKeywordOrString() {
+ const n = this.next;
+ if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
+ if (n.isPrivateIdentifier()) {
+ this._reportErrorForPrivateIdentifier(n, "expected identifier, keyword or string");
+ } else {
+ this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);
+ }
+ return "";
+ }
+ this.advance();
+ return n.toString();
+ }
+ parseChain() {
+ const exprs = [];
+ const start = this.inputIndex;
+ while (this.index < this.tokens.length) {
+ const expr = this.parsePipe();
+ exprs.push(expr);
+ if (this.consumeOptionalCharacter($SEMICOLON)) {
+ if (!(this.parseFlags & 1)) {
+ this.error("Binding expression cannot contain chained expression");
+ }
+ while (this.consumeOptionalCharacter($SEMICOLON)) {
+ }
+ } else if (this.index < this.tokens.length) {
+ const errorIndex = this.index;
+ this.error(`Unexpected token '${this.next}'`);
+ if (this.index === errorIndex) {
+ break;
+ }
+ }
+ }
+ if (exprs.length === 0) {
+ const artificialStart = this.offset;
+ const artificialEnd = this.offset + this.input.length;
+ return new EmptyExpr$1(this.span(artificialStart, artificialEnd), this.sourceSpan(artificialStart, artificialEnd));
+ }
+ if (exprs.length == 1)
+ return exprs[0];
+ return new Chain(this.span(start), this.sourceSpan(start), exprs);
+ }
+ parsePipe() {
+ const start = this.inputIndex;
+ let result = this.parseExpression();
+ if (this.consumeOptionalOperator("|")) {
+ if (this.parseFlags & 1) {
+ this.error(`Cannot have a pipe in an action expression`);
+ }
+ do {
+ const nameStart = this.inputIndex;
+ let nameId = this.expectIdentifierOrKeyword();
+ let nameSpan;
+ let fullSpanEnd = void 0;
+ if (nameId !== null) {
+ nameSpan = this.sourceSpan(nameStart);
+ } else {
+ nameId = "";
+ fullSpanEnd = this.next.index !== -1 ? this.next.index : this.input.length + this.offset;
+ nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset);
+ }
+ const args = [];
+ while (this.consumeOptionalCharacter($COLON)) {
+ args.push(this.parseExpression());
+ }
+ let type;
+ if (this.supportsDirectPipeReferences) {
+ const charCode = nameId.charCodeAt(0);
+ type = charCode === $_ || charCode >= $A && charCode <= $Z ? BindingPipeType.ReferencedDirectly : BindingPipeType.ReferencedByName;
+ } else {
+ type = BindingPipeType.ReferencedByName;
+ }
+ result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, type, nameSpan);
+ } while (this.consumeOptionalOperator("|"));
+ }
+ return result;
+ }
+ parseExpression() {
+ return this.parseConditional();
+ }
+ parseConditional() {
+ const start = this.inputIndex;
+ const result = this.parseLogicalOr();
+ if (this.consumeOptionalOperator("?")) {
+ const yes = this.parsePipe();
+ let no;
+ if (!this.consumeOptionalCharacter($COLON)) {
+ const end = this.inputIndex;
+ const expression = this.input.substring(start, end);
+ this.error(`Conditional expression ${expression} requires all 3 expressions`);
+ no = new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ } else {
+ no = this.parsePipe();
+ }
+ return new Conditional(this.span(start), this.sourceSpan(start), result, yes, no);
+ } else {
+ return result;
+ }
+ }
+ parseLogicalOr() {
+ const start = this.inputIndex;
+ let result = this.parseLogicalAnd();
+ while (this.consumeOptionalOperator("||")) {
+ const right = this.parseLogicalAnd();
+ result = new Binary(this.span(start), this.sourceSpan(start), "||", result, right);
+ }
+ return result;
+ }
+ parseLogicalAnd() {
+ const start = this.inputIndex;
+ let result = this.parseNullishCoalescing();
+ while (this.consumeOptionalOperator("&&")) {
+ const right = this.parseNullishCoalescing();
+ result = new Binary(this.span(start), this.sourceSpan(start), "&&", result, right);
+ }
+ return result;
+ }
+ parseNullishCoalescing() {
+ const start = this.inputIndex;
+ let result = this.parseEquality();
+ while (this.consumeOptionalOperator("??")) {
+ const right = this.parseEquality();
+ result = new Binary(this.span(start), this.sourceSpan(start), "??", result, right);
+ }
+ return result;
+ }
+ parseEquality() {
+ const start = this.inputIndex;
+ let result = this.parseRelational();
+ while (this.next.type == TokenType.Operator) {
+ const operator = this.next.strValue;
+ switch (operator) {
+ case "==":
+ case "===":
+ case "!=":
+ case "!==":
+ this.advance();
+ const right = this.parseRelational();
+ result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
+ continue;
+ }
+ break;
+ }
+ return result;
+ }
+ parseRelational() {
+ const start = this.inputIndex;
+ let result = this.parseAdditive();
+ while (this.next.type == TokenType.Operator || this.next.isKeywordIn) {
+ const operator = this.next.strValue;
+ switch (operator) {
+ case "<":
+ case ">":
+ case "<=":
+ case ">=":
+ case "in":
+ this.advance();
+ const right = this.parseAdditive();
+ result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
+ continue;
+ }
+ break;
+ }
+ return result;
+ }
+ parseAdditive() {
+ const start = this.inputIndex;
+ let result = this.parseMultiplicative();
+ while (this.next.type == TokenType.Operator) {
+ const operator = this.next.strValue;
+ switch (operator) {
+ case "+":
+ case "-":
+ this.advance();
+ let right = this.parseMultiplicative();
+ result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
+ continue;
+ }
+ break;
+ }
+ return result;
+ }
+ parseMultiplicative() {
+ const start = this.inputIndex;
+ let result = this.parseExponentiation();
+ while (this.next.type == TokenType.Operator) {
+ const operator = this.next.strValue;
+ switch (operator) {
+ case "*":
+ case "%":
+ case "/":
+ this.advance();
+ const right = this.parseExponentiation();
+ result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
+ continue;
+ }
+ break;
+ }
+ return result;
+ }
+ parseExponentiation() {
+ const start = this.inputIndex;
+ let result = this.parsePrefix();
+ while (this.next.type == TokenType.Operator && this.next.strValue === "**") {
+ if (result instanceof Unary || result instanceof PrefixNot || result instanceof TypeofExpression || result instanceof VoidExpression) {
+ this.error("Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence");
+ }
+ this.advance();
+ const right = this.parseExponentiation();
+ result = new Binary(this.span(start), this.sourceSpan(start), "**", result, right);
+ }
+ return result;
+ }
+ parsePrefix() {
+ if (this.next.type == TokenType.Operator) {
+ const start = this.inputIndex;
+ const operator = this.next.strValue;
+ let result;
+ switch (operator) {
+ case "+":
+ this.advance();
+ result = this.parsePrefix();
+ return Unary.createPlus(this.span(start), this.sourceSpan(start), result);
+ case "-":
+ this.advance();
+ result = this.parsePrefix();
+ return Unary.createMinus(this.span(start), this.sourceSpan(start), result);
+ case "!":
+ this.advance();
+ result = this.parsePrefix();
+ return new PrefixNot(this.span(start), this.sourceSpan(start), result);
+ }
+ } else if (this.next.isKeywordTypeof()) {
+ this.advance();
+ const start = this.inputIndex;
+ let result = this.parsePrefix();
+ return new TypeofExpression(this.span(start), this.sourceSpan(start), result);
+ } else if (this.next.isKeywordVoid()) {
+ this.advance();
+ const start = this.inputIndex;
+ let result = this.parsePrefix();
+ return new VoidExpression(this.span(start), this.sourceSpan(start), result);
+ }
+ return this.parseCallChain();
+ }
+ parseCallChain() {
+ const start = this.inputIndex;
+ let result = this.parsePrimary();
+ while (true) {
+ if (this.consumeOptionalCharacter($PERIOD)) {
+ result = this.parseAccessMember(result, start, false);
+ } else if (this.consumeOptionalOperator("?.")) {
+ if (this.consumeOptionalCharacter($LPAREN)) {
+ result = this.parseCall(result, start, true);
+ } else {
+ result = this.consumeOptionalCharacter($LBRACKET) ? this.parseKeyedReadOrWrite(result, start, true) : this.parseAccessMember(result, start, true);
+ }
+ } else if (this.consumeOptionalCharacter($LBRACKET)) {
+ result = this.parseKeyedReadOrWrite(result, start, false);
+ } else if (this.consumeOptionalCharacter($LPAREN)) {
+ result = this.parseCall(result, start, false);
+ } else if (this.consumeOptionalOperator("!")) {
+ result = new NonNullAssert(this.span(start), this.sourceSpan(start), result);
+ } else if (this.next.isTemplateLiteralEnd()) {
+ result = this.parseNoInterpolationTaggedTemplateLiteral(result, start);
+ } else if (this.next.isTemplateLiteralPart()) {
+ result = this.parseTaggedTemplateLiteral(result, start);
+ } else {
+ return result;
+ }
+ }
+ }
+ parsePrimary() {
+ const start = this.inputIndex;
+ if (this.consumeOptionalCharacter($LPAREN)) {
+ this.rparensExpected++;
+ const result = this.parsePipe();
+ if (!this.consumeOptionalCharacter($RPAREN)) {
+ this.error("Missing closing parentheses");
+ this.consumeOptionalCharacter($RPAREN);
+ }
+ this.rparensExpected--;
+ return new ParenthesizedExpression(this.span(start), this.sourceSpan(start), result);
+ } else if (this.next.isKeywordNull()) {
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);
+ } else if (this.next.isKeywordUndefined()) {
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0);
+ } else if (this.next.isKeywordTrue()) {
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);
+ } else if (this.next.isKeywordFalse()) {
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);
+ } else if (this.next.isKeywordIn()) {
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), "in");
+ } else if (this.next.isKeywordThis()) {
+ this.advance();
+ return new ThisReceiver(this.span(start), this.sourceSpan(start));
+ } else if (this.consumeOptionalCharacter($LBRACKET)) {
+ this.rbracketsExpected++;
+ const elements = this.parseExpressionList($RBRACKET);
+ this.rbracketsExpected--;
+ this.expectCharacter($RBRACKET);
+ return new LiteralArray(this.span(start), this.sourceSpan(start), elements);
+ } else if (this.next.isCharacter($LBRACE)) {
+ return this.parseLiteralMap();
+ } else if (this.next.isIdentifier()) {
+ return this.parseAccessMember(new ImplicitReceiver(this.span(start), this.sourceSpan(start)), start, false);
+ } else if (this.next.isNumber()) {
+ const value = this.next.toNumber();
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value);
+ } else if (this.next.isTemplateLiteralEnd()) {
+ return this.parseNoInterpolationTemplateLiteral();
+ } else if (this.next.isTemplateLiteralPart()) {
+ return this.parseTemplateLiteral();
+ } else if (this.next.isString() && this.next.kind === StringTokenKind.Plain) {
+ const literalValue = this.next.toString();
+ this.advance();
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);
+ } else if (this.next.isPrivateIdentifier()) {
+ this._reportErrorForPrivateIdentifier(this.next, null);
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ } else if (this.index >= this.tokens.length) {
+ this.error(`Unexpected end of expression: ${this.input}`);
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ } else {
+ this.error(`Unexpected token ${this.next}`);
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ }
+ }
+ parseExpressionList(terminator) {
+ const result = [];
+ do {
+ if (!this.next.isCharacter(terminator)) {
+ result.push(this.parsePipe());
+ } else {
+ break;
+ }
+ } while (this.consumeOptionalCharacter($COMMA));
+ return result;
+ }
+ parseLiteralMap() {
+ const keys = [];
+ const values = [];
+ const start = this.inputIndex;
+ this.expectCharacter($LBRACE);
+ if (!this.consumeOptionalCharacter($RBRACE)) {
+ this.rbracesExpected++;
+ do {
+ const keyStart = this.inputIndex;
+ const quoted = this.next.isString();
+ const key = this.expectIdentifierOrKeywordOrString();
+ const literalMapKey = { key, quoted };
+ keys.push(literalMapKey);
+ if (quoted) {
+ this.expectCharacter($COLON);
+ values.push(this.parsePipe());
+ } else if (this.consumeOptionalCharacter($COLON)) {
+ values.push(this.parsePipe());
+ } else {
+ literalMapKey.isShorthandInitialized = true;
+ const span = this.span(keyStart);
+ const sourceSpan = this.sourceSpan(keyStart);
+ values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
+ }
+ } while (this.consumeOptionalCharacter($COMMA) && !this.next.isCharacter($RBRACE));
+ this.rbracesExpected--;
+ this.expectCharacter($RBRACE);
+ }
+ return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values);
+ }
+ parseAccessMember(readReceiver, start, isSafe) {
+ const nameStart = this.inputIndex;
+ const id = this.withContext(ParseContextFlags.Writable, () => {
+ const id2 = this.expectIdentifierOrKeyword() ?? "";
+ if (id2.length === 0) {
+ this.error(`Expected identifier for property access`, readReceiver.span.end);
+ }
+ return id2;
+ });
+ const nameSpan = this.sourceSpan(nameStart);
+ if (isSafe) {
+ if (this.isAssignmentOperator(this.next)) {
+ this.advance();
+ this.error("The '?.' operator cannot be used in the assignment");
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ } else {
+ return new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
+ }
+ } else {
+ if (this.isAssignmentOperator(this.next)) {
+ const operation = this.next.strValue;
+ if (!(this.parseFlags & 1)) {
+ this.advance();
+ this.error("Bindings cannot contain assignments");
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ }
+ const receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
+ this.advance();
+ const value = this.parseConditional();
+ return new Binary(this.span(start), this.sourceSpan(start), operation, receiver, value);
+ } else {
+ return new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
+ }
+ }
+ }
+ parseCall(receiver, start, isSafe) {
+ const argumentStart = this.inputIndex;
+ this.rparensExpected++;
+ const args = this.parseCallArguments();
+ const argumentSpan = this.span(argumentStart, this.inputIndex).toAbsolute(this.absoluteOffset);
+ this.expectCharacter($RPAREN);
+ this.rparensExpected--;
+ const span = this.span(start);
+ const sourceSpan = this.sourceSpan(start);
+ return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) : new Call(span, sourceSpan, receiver, args, argumentSpan);
+ }
+ parseCallArguments() {
+ if (this.next.isCharacter($RPAREN))
+ return [];
+ const positionals = [];
+ do {
+ positionals.push(this.parsePipe());
+ } while (this.consumeOptionalCharacter($COMMA));
+ return positionals;
+ }
+ /**
+ * Parses an identifier, a keyword, a string with an optional `-` in between,
+ * and returns the string along with its absolute source span.
+ */
+ expectTemplateBindingKey() {
+ let result = "";
+ let operatorFound = false;
+ const start = this.currentAbsoluteOffset;
+ do {
+ result += this.expectIdentifierOrKeywordOrString();
+ operatorFound = this.consumeOptionalOperator("-");
+ if (operatorFound) {
+ result += "-";
+ }
+ } while (operatorFound);
+ return {
+ source: result,
+ span: new AbsoluteSourceSpan(start, start + result.length)
+ };
+ }
+ /**
+ * Parse microsyntax template expression and return a list of bindings or
+ * parsing errors in case the given expression is invalid.
+ *
+ * For example,
+ * ```html
+ *
+ * ```
+ * contains five bindings:
+ * 1. ngFor -> null
+ * 2. item -> NgForOfContext.$implicit
+ * 3. ngForOf -> items
+ * 4. i -> NgForOfContext.index
+ * 5. ngForTrackBy -> func
+ *
+ * For a full description of the microsyntax grammar, see
+ * https://gist.github.com/mhevery/d3530294cff2e4a1b3fe15ff75d08855
+ *
+ * @param templateKey name of the microsyntax directive, like ngIf, ngFor,
+ * without the *, along with its absolute span.
+ */
+ parseTemplateBindings(templateKey) {
+ const bindings = [];
+ bindings.push(...this.parseDirectiveKeywordBindings(templateKey));
+ while (this.index < this.tokens.length) {
+ const letBinding = this.parseLetBinding();
+ if (letBinding) {
+ bindings.push(letBinding);
+ } else {
+ const key = this.expectTemplateBindingKey();
+ const binding = this.parseAsBinding(key);
+ if (binding) {
+ bindings.push(binding);
+ } else {
+ key.source = templateKey.source + key.source.charAt(0).toUpperCase() + key.source.substring(1);
+ bindings.push(...this.parseDirectiveKeywordBindings(key));
+ }
+ }
+ this.consumeStatementTerminator();
+ }
+ return new TemplateBindingParseResult(bindings, [], this.errors);
+ }
+ parseKeyedReadOrWrite(receiver, start, isSafe) {
+ return this.withContext(ParseContextFlags.Writable, () => {
+ this.rbracketsExpected++;
+ const key = this.parsePipe();
+ if (key instanceof EmptyExpr$1) {
+ this.error(`Key access cannot be empty`);
+ }
+ this.rbracketsExpected--;
+ this.expectCharacter($RBRACKET);
+ if (this.isAssignmentOperator(this.next)) {
+ const operation = this.next.strValue;
+ if (isSafe) {
+ this.advance();
+ this.error("The '?.' operator cannot be used in the assignment");
+ } else {
+ const binaryReceiver = new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
+ this.advance();
+ const value = this.parseConditional();
+ return new Binary(this.span(start), this.sourceSpan(start), operation, binaryReceiver, value);
+ }
+ } else {
+ return isSafe ? new SafeKeyedRead(this.span(start), this.sourceSpan(start), receiver, key) : new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
+ }
+ return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
+ });
+ }
+ /**
+ * Parse a directive keyword, followed by a mandatory expression.
+ * For example, "of items", "trackBy: func".
+ * The bindings are: ngForOf -> items, ngForTrackBy -> func
+ * There could be an optional "as" binding that follows the expression.
+ * For example,
+ * ```
+ * *ngFor="let item of items | slice:0:1 as collection".
+ * ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
+ * keyword bound target optional 'as' binding
+ * ```
+ *
+ * @param key binding key, for example, ngFor, ngIf, ngForOf, along with its
+ * absolute span.
+ */
+ parseDirectiveKeywordBindings(key) {
+ const bindings = [];
+ this.consumeOptionalCharacter($COLON);
+ const value = this.getDirectiveBoundTarget();
+ let spanEnd = this.currentAbsoluteOffset;
+ const asBinding = this.parseAsBinding(key);
+ if (!asBinding) {
+ this.consumeStatementTerminator();
+ spanEnd = this.currentAbsoluteOffset;
+ }
+ const sourceSpan = new AbsoluteSourceSpan(key.span.start, spanEnd);
+ bindings.push(new ExpressionBinding(sourceSpan, key, value));
+ if (asBinding) {
+ bindings.push(asBinding);
+ }
+ return bindings;
+ }
+ /**
+ * Return the expression AST for the bound target of a directive keyword
+ * binding. For example,
+ * ```
+ * *ngIf="condition | pipe"
+ * ^^^^^^^^^^^^^^^^ bound target for "ngIf"
+ * *ngFor="let item of items"
+ * ^^^^^ bound target for "ngForOf"
+ * ```
+ */
+ getDirectiveBoundTarget() {
+ if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {
+ return null;
+ }
+ const ast = this.parsePipe();
+ const { start, end } = ast.span;
+ const value = this.input.substring(start, end);
+ return new ASTWithSource(ast, value, getLocation(this.parseSourceSpan), this.absoluteOffset + start, this.errors);
+ }
+ /**
+ * Return the binding for a variable declared using `as`. Note that the order
+ * of the key-value pair in this declaration is reversed. For example,
+ * ```
+ * *ngFor="let item of items; index as i"
+ * ^^^^^ ^
+ * value key
+ * ```
+ *
+ * @param value name of the value in the declaration, "ngIf" in the example
+ * above, along with its absolute span.
+ */
+ parseAsBinding(value) {
+ if (!this.peekKeywordAs()) {
+ return null;
+ }
+ this.advance();
+ const key = this.expectTemplateBindingKey();
+ this.consumeStatementTerminator();
+ const sourceSpan = new AbsoluteSourceSpan(value.span.start, this.currentAbsoluteOffset);
+ return new VariableBinding(sourceSpan, key, value);
+ }
+ /**
+ * Return the binding for a variable declared using `let`. For example,
+ * ```
+ * *ngFor="let item of items; let i=index;"
+ * ^^^^^^^^ ^^^^^^^^^^^
+ * ```
+ * In the first binding, `item` is bound to `NgForOfContext.$implicit`.
+ * In the second binding, `i` is bound to `NgForOfContext.index`.
+ */
+ parseLetBinding() {
+ if (!this.peekKeywordLet()) {
+ return null;
+ }
+ const spanStart = this.currentAbsoluteOffset;
+ this.advance();
+ const key = this.expectTemplateBindingKey();
+ let value = null;
+ if (this.consumeOptionalOperator("=")) {
+ value = this.expectTemplateBindingKey();
+ }
+ this.consumeStatementTerminator();
+ const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);
+ return new VariableBinding(sourceSpan, key, value);
+ }
+ parseNoInterpolationTaggedTemplateLiteral(tag, start) {
+ const template2 = this.parseNoInterpolationTemplateLiteral();
+ return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template2);
+ }
+ parseNoInterpolationTemplateLiteral() {
+ const text2 = this.next.strValue;
+ const start = this.inputIndex;
+ this.advance();
+ const span = this.span(start);
+ const sourceSpan = this.sourceSpan(start);
+ return new TemplateLiteral(span, sourceSpan, [new TemplateLiteralElement(span, sourceSpan, text2)], []);
+ }
+ parseTaggedTemplateLiteral(tag, start) {
+ const template2 = this.parseTemplateLiteral();
+ return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template2);
+ }
+ parseTemplateLiteral() {
+ const elements = [];
+ const expressions = [];
+ const start = this.inputIndex;
+ while (this.next !== EOF) {
+ const token = this.next;
+ if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) {
+ const partStart = this.inputIndex;
+ this.advance();
+ elements.push(new TemplateLiteralElement(this.span(partStart), this.sourceSpan(partStart), token.strValue));
+ if (token.isTemplateLiteralEnd()) {
+ break;
+ }
+ } else if (token.isTemplateLiteralInterpolationStart()) {
+ this.advance();
+ const expression = this.parsePipe();
+ if (expression instanceof EmptyExpr$1) {
+ this.error("Template literal interpolation cannot be empty");
+ } else {
+ expressions.push(expression);
+ }
+ } else {
+ this.advance();
+ }
+ }
+ return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions);
+ }
+ /**
+ * Consume the optional statement terminator: semicolon or comma.
+ */
+ consumeStatementTerminator() {
+ this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA);
+ }
+ /**
+ * Records an error and skips over the token stream until reaching a recoverable point. See
+ * `this.skip` for more details on token skipping.
+ */
+ error(message, index = this.index) {
+ this.errors.push(getParseError(message, this.input, this.getErrorLocationText(index), this.parseSourceSpan));
+ this.skip();
+ }
+ getErrorLocationText(index) {
+ return index < this.tokens.length ? `at column ${this.tokens[index].index + 1} in` : `at the end of the expression`;
+ }
+ /**
+ * Records an error for an unexpected private identifier being discovered.
+ * @param token Token representing a private identifier.
+ * @param extraMessage Optional additional message being appended to the error.
+ */
+ _reportErrorForPrivateIdentifier(token, extraMessage) {
+ let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`;
+ if (extraMessage !== null) {
+ errorMessage += `, ${extraMessage}`;
+ }
+ this.error(errorMessage);
+ }
+ /**
+ * Error recovery should skip tokens until it encounters a recovery point.
+ *
+ * The following are treated as unconditional recovery points:
+ * - end of input
+ * - ';' (parseChain() is always the root production, and it expects a ';')
+ * - '|' (since pipes may be chained and each pipe expression may be treated independently)
+ *
+ * The following are conditional recovery points:
+ * - ')', '}', ']' if one of calling productions is expecting one of these symbols
+ * - This allows skip() to recover from errors such as '(a.) + 1' allowing more of the AST to
+ * be retained (it doesn't skip any tokens as the ')' is retained because of the '(' begins
+ * an '('
')' production).
+ * The recovery points of grouping symbols must be conditional as they must be skipped if
+ * none of the calling productions are not expecting the closing token else we will never
+ * make progress in the case of an extraneous group closing symbol (such as a stray ')').
+ * That is, we skip a closing symbol if we are not in a grouping production.
+ * - Assignment in a `Writable` context
+ * - In this context, we are able to recover after seeing the `=` operator, which
+ * signals the presence of an independent rvalue expression following the `=` operator.
+ *
+ * If a production expects one of these token it increments the corresponding nesting count,
+ * and then decrements it just prior to checking if the token is in the input.
+ */
+ skip() {
+ let n = this.next;
+ while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) && !n.isOperator("|") && (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) && (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) && (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET)) && (!(this.context & ParseContextFlags.Writable) || !this.isAssignmentOperator(n))) {
+ if (this.next.isError()) {
+ this.errors.push(getParseError(this.next.toString(), this.input, this.getErrorLocationText(this.next.index), this.parseSourceSpan));
+ }
+ this.advance();
+ n = this.next;
+ }
+ }
+};
+function getParseError(message, input, locationText, parseSourceSpan) {
+ if (locationText.length > 0) {
+ locationText = ` ${locationText} `;
+ }
+ const location = getLocation(parseSourceSpan);
+ const error = `Parser Error: ${message}${locationText}[${input}] in ${location}`;
+ return new ParseError(parseSourceSpan, error);
+}
+var SimpleExpressionChecker = class extends RecursiveAstVisitor2 {
+ errors = [];
+ visitPipe() {
+ this.errors.push("pipes");
+ }
+};
+function getIndexMapForOriginalTemplate(interpolatedTokens) {
+ let offsetMap = /* @__PURE__ */ new Map();
+ let consumedInOriginalTemplate = 0;
+ let consumedInInput = 0;
+ let tokenIndex = 0;
+ while (tokenIndex < interpolatedTokens.length) {
+ const currentToken = interpolatedTokens[tokenIndex];
+ if (currentToken.type === 9) {
+ const [decoded, encoded] = currentToken.parts;
+ consumedInOriginalTemplate += encoded.length;
+ consumedInInput += decoded.length;
+ } else {
+ const lengthOfParts = currentToken.parts.reduce((sum, current) => sum + current.length, 0);
+ consumedInInput += lengthOfParts;
+ consumedInOriginalTemplate += lengthOfParts;
+ }
+ offsetMap.set(consumedInInput, consumedInOriginalTemplate);
+ tokenIndex++;
+ }
+ return offsetMap;
+}
+function serialize(expression) {
+ return expression.visit(new SerializeExpressionVisitor());
+}
+var SerializeExpressionVisitor = class {
+ visitUnary(ast, context) {
+ return `${ast.operator}${ast.expr.visit(this, context)}`;
+ }
+ visitBinary(ast, context) {
+ return `${ast.left.visit(this, context)} ${ast.operation} ${ast.right.visit(this, context)}`;
+ }
+ visitChain(ast, context) {
+ return ast.expressions.map((e) => e.visit(this, context)).join("; ");
+ }
+ visitConditional(ast, context) {
+ return `${ast.condition.visit(this, context)} ? ${ast.trueExp.visit(this, context)} : ${ast.falseExp.visit(this, context)}`;
+ }
+ visitThisReceiver() {
+ return "this";
+ }
+ visitImplicitReceiver() {
+ return "";
+ }
+ visitInterpolation(ast, context) {
+ return interleave(ast.strings, ast.expressions.map((e) => e.visit(this, context))).join("");
+ }
+ visitKeyedRead(ast, context) {
+ return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}]`;
+ }
+ visitLiteralArray(ast, context) {
+ return `[${ast.expressions.map((e) => e.visit(this, context)).join(", ")}]`;
+ }
+ visitLiteralMap(ast, context) {
+ return `{${zip(ast.keys.map((literal2) => literal2.quoted ? `'${literal2.key}'` : literal2.key), ast.values.map((value) => value.visit(this, context))).map(([key, value]) => `${key}: ${value}`).join(", ")}}`;
+ }
+ visitLiteralPrimitive(ast) {
+ if (ast.value === null)
+ return "null";
+ switch (typeof ast.value) {
+ case "number":
+ case "boolean":
+ return ast.value.toString();
+ case "undefined":
+ return "undefined";
+ case "string":
+ return `'${ast.value.replace(/'/g, `\\'`)}'`;
+ default:
+ throw new Error(`Unsupported primitive type: ${ast.value}`);
+ }
+ }
+ visitPipe(ast, context) {
+ return `${ast.exp.visit(this, context)} | ${ast.name}`;
+ }
+ visitPrefixNot(ast, context) {
+ return `!${ast.expression.visit(this, context)}`;
+ }
+ visitNonNullAssert(ast, context) {
+ return `${ast.expression.visit(this, context)}!`;
+ }
+ visitPropertyRead(ast, context) {
+ if (ast.receiver instanceof ImplicitReceiver) {
+ return ast.name;
+ } else {
+ return `${ast.receiver.visit(this, context)}.${ast.name}`;
+ }
+ }
+ visitSafePropertyRead(ast, context) {
+ return `${ast.receiver.visit(this, context)}?.${ast.name}`;
+ }
+ visitSafeKeyedRead(ast, context) {
+ return `${ast.receiver.visit(this, context)}?.[${ast.key.visit(this, context)}]`;
+ }
+ visitCall(ast, context) {
+ return `${ast.receiver.visit(this, context)}(${ast.args.map((e) => e.visit(this, context)).join(", ")})`;
+ }
+ visitSafeCall(ast, context) {
+ return `${ast.receiver.visit(this, context)}?.(${ast.args.map((e) => e.visit(this, context)).join(", ")})`;
+ }
+ visitTypeofExpression(ast, context) {
+ return `typeof ${ast.expression.visit(this, context)}`;
+ }
+ visitVoidExpression(ast, context) {
+ return `void ${ast.expression.visit(this, context)}`;
+ }
+ visitASTWithSource(ast, context) {
+ return ast.ast.visit(this, context);
+ }
+ visitTemplateLiteral(ast, context) {
+ let result = "";
+ for (let i = 0; i < ast.elements.length; i++) {
+ result += ast.elements[i].visit(this, context);
+ const expression = i < ast.expressions.length ? ast.expressions[i] : null;
+ if (expression !== null) {
+ result += "${" + expression.visit(this, context) + "}";
+ }
+ }
+ return "`" + result + "`";
+ }
+ visitTemplateLiteralElement(ast, context) {
+ return ast.text;
+ }
+ visitTaggedTemplateLiteral(ast, context) {
+ return ast.tag.visit(this, context) + ast.template.visit(this, context);
+ }
+ visitParenthesizedExpression(ast, context) {
+ return "(" + ast.expression.visit(this, context) + ")";
+ }
+};
+function zip(left, right) {
+ if (left.length !== right.length)
+ throw new Error("Array lengths must match");
+ return left.map((l, i) => [l, right[i]]);
+}
+function interleave(left, right) {
+ const result = [];
+ for (let index = 0; index < Math.max(left.length, right.length); index++) {
+ if (index < left.length)
+ result.push(left[index]);
+ if (index < right.length)
+ result.push(right[index]);
+ }
+ return result;
+}
+var _SECURITY_SCHEMA;
+function SECURITY_SCHEMA() {
+ if (!_SECURITY_SCHEMA) {
+ _SECURITY_SCHEMA = {};
+ registerContext(SecurityContext.HTML, ["iframe|srcdoc", "*|innerHTML", "*|outerHTML"]);
+ registerContext(SecurityContext.STYLE, ["*|style"]);
+ registerContext(SecurityContext.URL, [
+ "*|formAction",
+ "area|href",
+ "area|ping",
+ "audio|src",
+ "a|href",
+ "a|ping",
+ "blockquote|cite",
+ "body|background",
+ "del|cite",
+ "form|action",
+ "img|src",
+ "input|src",
+ "ins|cite",
+ "q|cite",
+ "source|src",
+ "track|src",
+ "video|poster",
+ "video|src"
+ ]);
+ registerContext(SecurityContext.RESOURCE_URL, [
+ "applet|code",
+ "applet|codebase",
+ "base|href",
+ "embed|src",
+ "frame|src",
+ "head|profile",
+ "html|manifest",
+ "iframe|src",
+ "link|href",
+ "media|src",
+ "object|codebase",
+ "object|data",
+ "script|src"
+ ]);
+ }
+ return _SECURITY_SCHEMA;
+}
+function registerContext(ctx, specs) {
+ for (const spec of specs)
+ _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
+}
+var IFRAME_SECURITY_SENSITIVE_ATTRS = /* @__PURE__ */ new Set([
+ "sandbox",
+ "allow",
+ "allowfullscreen",
+ "referrerpolicy",
+ "csp",
+ "fetchpriority"
+]);
+function isIframeSecuritySensitiveAttr(attrName) {
+ return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
+}
+var ElementSchemaRegistry = class {
+};
+var BOOLEAN = "boolean";
+var NUMBER = "number";
+var STRING = "string";
+var OBJECT = "object";
+var SCHEMA = [
+ "[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored",
+ "[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy",
+ "abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,search,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy",
+ "media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",
+ ":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",
+ ":svg:graphics^:svg:|",
+ ":svg:animation^:svg:|*begin,*end,*repeat",
+ ":svg:geometry^:svg:|",
+ ":svg:componentTransferFunction^:svg:|",
+ ":svg:gradient^:svg:|",
+ ":svg:textContent^:svg:graphics|",
+ ":svg:textPositioning^:svg:textContent|",
+ "a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username",
+ "area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username",
+ "audio^media|",
+ "br^[HTMLElement]|clear",
+ "base^[HTMLElement]|href,target",
+ "body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink",
+ "button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value",
+ "canvas^[HTMLElement]|#height,#width",
+ "content^[HTMLElement]|select",
+ "dl^[HTMLElement]|!compact",
+ "data^[HTMLElement]|value",
+ "datalist^[HTMLElement]|",
+ "details^[HTMLElement]|!open",
+ "dialog^[HTMLElement]|!open,returnValue",
+ "dir^[HTMLElement]|!compact",
+ "div^[HTMLElement]|align",
+ "embed^[HTMLElement]|align,height,name,src,type,width",
+ "fieldset^[HTMLElement]|!disabled,name",
+ "font^[HTMLElement]|color,face,size",
+ "form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target",
+ "frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src",
+ "frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows",
+ "hr^[HTMLElement]|align,color,!noShade,size,width",
+ "head^[HTMLElement]|",
+ "h1,h2,h3,h4,h5,h6^[HTMLElement]|align",
+ "html^[HTMLElement]|version",
+ "iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width",
+ "img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width",
+ "input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width",
+ "li^[HTMLElement]|type,#value",
+ "label^[HTMLElement]|htmlFor",
+ "legend^[HTMLElement]|align",
+ "link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type",
+ "map^[HTMLElement]|name",
+ "marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width",
+ "menu^[HTMLElement]|!compact",
+ "meta^[HTMLElement]|content,httpEquiv,media,name,scheme",
+ "meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value",
+ "ins,del^[HTMLElement]|cite,dateTime",
+ "ol^[HTMLElement]|!compact,!reversed,#start,type",
+ "object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width",
+ "optgroup^[HTMLElement]|!disabled,label",
+ "option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value",
+ "output^[HTMLElement]|defaultValue,%htmlFor,name,value",
+ "p^[HTMLElement]|align",
+ "param^[HTMLElement]|name,type,value,valueType",
+ "picture^[HTMLElement]|",
+ "pre^[HTMLElement]|#width",
+ "progress^[HTMLElement]|#max,#value",
+ "q,blockquote,cite^[HTMLElement]|",
+ "script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type",
+ "select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value",
+ "selectedcontent^[HTMLElement]|",
+ "slot^[HTMLElement]|name",
+ "source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width",
+ "span^[HTMLElement]|",
+ "style^[HTMLElement]|!disabled,media,type",
+ "search^[HTMLELement]|",
+ "caption^[HTMLElement]|align",
+ "th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width",
+ "col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width",
+ "table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width",
+ "tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign",
+ "tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign",
+ "template^[HTMLElement]|",
+ "textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap",
+ "time^[HTMLElement]|dateTime",
+ "title^[HTMLElement]|text",
+ "track^[HTMLElement]|!default,kind,label,src,srclang",
+ "ul^[HTMLElement]|!compact,type",
+ "unknown^[HTMLElement]|",
+ "video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",
+ ":svg:a^:svg:graphics|",
+ ":svg:animate^:svg:animation|",
+ ":svg:animateMotion^:svg:animation|",
+ ":svg:animateTransform^:svg:animation|",
+ ":svg:circle^:svg:geometry|",
+ ":svg:clipPath^:svg:graphics|",
+ ":svg:defs^:svg:graphics|",
+ ":svg:desc^:svg:|",
+ ":svg:discard^:svg:|",
+ ":svg:ellipse^:svg:geometry|",
+ ":svg:feBlend^:svg:|",
+ ":svg:feColorMatrix^:svg:|",
+ ":svg:feComponentTransfer^:svg:|",
+ ":svg:feComposite^:svg:|",
+ ":svg:feConvolveMatrix^:svg:|",
+ ":svg:feDiffuseLighting^:svg:|",
+ ":svg:feDisplacementMap^:svg:|",
+ ":svg:feDistantLight^:svg:|",
+ ":svg:feDropShadow^:svg:|",
+ ":svg:feFlood^:svg:|",
+ ":svg:feFuncA^:svg:componentTransferFunction|",
+ ":svg:feFuncB^:svg:componentTransferFunction|",
+ ":svg:feFuncG^:svg:componentTransferFunction|",
+ ":svg:feFuncR^:svg:componentTransferFunction|",
+ ":svg:feGaussianBlur^:svg:|",
+ ":svg:feImage^:svg:|",
+ ":svg:feMerge^:svg:|",
+ ":svg:feMergeNode^:svg:|",
+ ":svg:feMorphology^:svg:|",
+ ":svg:feOffset^:svg:|",
+ ":svg:fePointLight^:svg:|",
+ ":svg:feSpecularLighting^:svg:|",
+ ":svg:feSpotLight^:svg:|",
+ ":svg:feTile^:svg:|",
+ ":svg:feTurbulence^:svg:|",
+ ":svg:filter^:svg:|",
+ ":svg:foreignObject^:svg:graphics|",
+ ":svg:g^:svg:graphics|",
+ ":svg:image^:svg:graphics|decoding",
+ ":svg:line^:svg:geometry|",
+ ":svg:linearGradient^:svg:gradient|",
+ ":svg:mpath^:svg:|",
+ ":svg:marker^:svg:|",
+ ":svg:mask^:svg:|",
+ ":svg:metadata^:svg:|",
+ ":svg:path^:svg:geometry|",
+ ":svg:pattern^:svg:|",
+ ":svg:polygon^:svg:geometry|",
+ ":svg:polyline^:svg:geometry|",
+ ":svg:radialGradient^:svg:gradient|",
+ ":svg:rect^:svg:geometry|",
+ ":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",
+ ":svg:script^:svg:|type",
+ ":svg:set^:svg:animation|",
+ ":svg:stop^:svg:|",
+ ":svg:style^:svg:|!disabled,media,title,type",
+ ":svg:switch^:svg:graphics|",
+ ":svg:symbol^:svg:|",
+ ":svg:tspan^:svg:textPositioning|",
+ ":svg:text^:svg:textPositioning|",
+ ":svg:textPath^:svg:textContent|",
+ ":svg:title^:svg:|",
+ ":svg:use^:svg:graphics|",
+ ":svg:view^:svg:|#zoomAndPan",
+ "data^[HTMLElement]|value",
+ "keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name",
+ "menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default",
+ "summary^[HTMLElement]|",
+ "time^[HTMLElement]|dateTime",
+ ":svg:cursor^:svg:|",
+ ":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",
+ ":math:math^:math:|",
+ ":math:maction^:math:|",
+ ":math:menclose^:math:|",
+ ":math:merror^:math:|",
+ ":math:mfenced^:math:|",
+ ":math:mfrac^:math:|",
+ ":math:mi^:math:|",
+ ":math:mmultiscripts^:math:|",
+ ":math:mn^:math:|",
+ ":math:mo^:math:|",
+ ":math:mover^:math:|",
+ ":math:mpadded^:math:|",
+ ":math:mphantom^:math:|",
+ ":math:mroot^:math:|",
+ ":math:mrow^:math:|",
+ ":math:ms^:math:|",
+ ":math:mspace^:math:|",
+ ":math:msqrt^:math:|",
+ ":math:mstyle^:math:|",
+ ":math:msub^:math:|",
+ ":math:msubsup^:math:|",
+ ":math:msup^:math:|",
+ ":math:mtable^:math:|",
+ ":math:mtd^:math:|",
+ ":math:mtext^:math:|",
+ ":math:mtr^:math:|",
+ ":math:munder^:math:|",
+ ":math:munderover^:math:|",
+ ":math:semantics^:math:|"
+];
+var _ATTR_TO_PROP = new Map(Object.entries({
+ "class": "className",
+ "for": "htmlFor",
+ "formaction": "formAction",
+ "innerHtml": "innerHTML",
+ "readonly": "readOnly",
+ "tabindex": "tabIndex"
+}));
+var _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
+ inverted.set(propertyName, attributeName);
+ return inverted;
+}, /* @__PURE__ */ new Map());
+var DomElementSchemaRegistry = class extends ElementSchemaRegistry {
+ _schema = /* @__PURE__ */ new Map();
+ // We don't allow binding to events for security reasons. Allowing event bindings would almost
+ // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
+ _eventSchema = /* @__PURE__ */ new Map();
+ constructor() {
+ super();
+ SCHEMA.forEach((encodedType) => {
+ const type = /* @__PURE__ */ new Map();
+ const events = /* @__PURE__ */ new Set();
+ const [strType, strProperties] = encodedType.split("|");
+ const properties = strProperties.split(",");
+ const [typeNames, superName] = strType.split("^");
+ typeNames.split(",").forEach((tag) => {
+ this._schema.set(tag.toLowerCase(), type);
+ this._eventSchema.set(tag.toLowerCase(), events);
+ });
+ const superType = superName && this._schema.get(superName.toLowerCase());
+ if (superType) {
+ for (const [prop, value] of superType) {
+ type.set(prop, value);
+ }
+ for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
+ events.add(superEvent);
+ }
+ }
+ properties.forEach((property2) => {
+ if (property2.length > 0) {
+ switch (property2[0]) {
+ case "*":
+ events.add(property2.substring(1));
+ break;
+ case "!":
+ type.set(property2.substring(1), BOOLEAN);
+ break;
+ case "#":
+ type.set(property2.substring(1), NUMBER);
+ break;
+ case "%":
+ type.set(property2.substring(1), OBJECT);
+ break;
+ default:
+ type.set(property2, STRING);
+ }
+ }
+ });
+ });
+ }
+ hasProperty(tagName, propName, schemaMetas) {
+ if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
+ return true;
+ }
+ if (tagName.indexOf("-") > -1) {
+ if (isNgContainer(tagName) || isNgContent(tagName)) {
+ return false;
+ }
+ if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) {
+ return true;
+ }
+ }
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown");
+ return elementProperties.has(propName);
+ }
+ hasElement(tagName, schemaMetas) {
+ if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
+ return true;
+ }
+ if (tagName.indexOf("-") > -1) {
+ if (isNgContainer(tagName) || isNgContent(tagName)) {
+ return true;
+ }
+ if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) {
+ return true;
+ }
+ }
+ return this._schema.has(tagName.toLowerCase());
+ }
+ /**
+ * securityContext returns the security context for the given property on the given DOM tag.
+ *
+ * Tag and property name are statically known and cannot change at runtime, i.e. it is not
+ * possible to bind a value into a changing attribute or tag name.
+ *
+ * The filtering is based on a list of allowed tags|attributes. All attributes in the schema
+ * above are assumed to have the 'NONE' security context, i.e. that they are safe inert
+ * string values. Only specific well known attack vectors are assigned their appropriate context.
+ */
+ securityContext(tagName, propName, isAttribute) {
+ if (isAttribute) {
+ propName = this.getMappedPropName(propName);
+ }
+ tagName = tagName.toLowerCase();
+ propName = propName.toLowerCase();
+ let ctx = SECURITY_SCHEMA()[tagName + "|" + propName];
+ if (ctx) {
+ return ctx;
+ }
+ ctx = SECURITY_SCHEMA()["*|" + propName];
+ return ctx ? ctx : SecurityContext.NONE;
+ }
+ getMappedPropName(propName) {
+ return _ATTR_TO_PROP.get(propName) ?? propName;
+ }
+ getDefaultComponentElementName() {
+ return "ng-component";
+ }
+ validateProperty(name) {
+ if (name.toLowerCase().startsWith("on")) {
+ const msg = `Binding to event property '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...
+If '${name}' is a directive input, make sure the directive is imported by the current module.`;
+ return { error: true, msg };
+ } else {
+ return { error: false };
+ }
+ }
+ validateAttribute(name) {
+ if (name.toLowerCase().startsWith("on")) {
+ const msg = `Binding to event attribute '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...`;
+ return { error: true, msg };
+ } else {
+ return { error: false };
+ }
+ }
+ allKnownElementNames() {
+ return Array.from(this._schema.keys());
+ }
+ allKnownAttributesOfElement(tagName) {
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown");
+ return Array.from(elementProperties.keys()).map((prop) => _PROP_TO_ATTR.get(prop) ?? prop);
+ }
+ allKnownEventsOfElement(tagName) {
+ return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
+ }
+ normalizeAnimationStyleProperty(propName) {
+ return dashCaseToCamelCase(propName);
+ }
+ normalizeAnimationStyleValue(camelCaseProp, userProvidedProp, val) {
+ let unit = "";
+ const strVal = val.toString().trim();
+ let errorMsg = null;
+ if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== "0") {
+ if (typeof val === "number") {
+ unit = "px";
+ } else {
+ const valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/);
+ if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
+ errorMsg = `Please provide a CSS unit value for ${userProvidedProp}:${val}`;
+ }
+ }
+ }
+ return { error: errorMsg, value: strVal + unit };
+ }
+};
+function _isPixelDimensionStyle(prop) {
+ switch (prop) {
+ case "width":
+ case "height":
+ case "minWidth":
+ case "minHeight":
+ case "maxWidth":
+ case "maxHeight":
+ case "left":
+ case "top":
+ case "bottom":
+ case "right":
+ case "fontSize":
+ case "outlineWidth":
+ case "outlineOffset":
+ case "paddingTop":
+ case "paddingLeft":
+ case "paddingBottom":
+ case "paddingRight":
+ case "marginTop":
+ case "marginLeft":
+ case "marginBottom":
+ case "marginRight":
+ case "borderRadius":
+ case "borderWidth":
+ case "borderTopWidth":
+ case "borderLeftWidth":
+ case "borderRightWidth":
+ case "borderBottomWidth":
+ case "textIndent":
+ return true;
+ default:
+ return false;
+ }
+}
+var HtmlTagDefinition = class {
+ closedByChildren = {};
+ contentType;
+ closedByParent = false;
+ implicitNamespacePrefix;
+ isVoid;
+ ignoreFirstLf;
+ canSelfClose;
+ preventNamespaceInheritance;
+ constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
+ if (closedByChildren && closedByChildren.length > 0) {
+ closedByChildren.forEach((tagName) => this.closedByChildren[tagName] = true);
+ }
+ this.isVoid = isVoid;
+ this.closedByParent = closedByParent || isVoid;
+ this.implicitNamespacePrefix = implicitNamespacePrefix || null;
+ this.contentType = contentType;
+ this.ignoreFirstLf = ignoreFirstLf;
+ this.preventNamespaceInheritance = preventNamespaceInheritance;
+ this.canSelfClose = canSelfClose ?? isVoid;
+ }
+ isClosedByChild(name) {
+ return this.isVoid || name.toLowerCase() in this.closedByChildren;
+ }
+ getContentType(prefix) {
+ if (typeof this.contentType === "object") {
+ const overrideType = prefix === void 0 ? void 0 : this.contentType[prefix];
+ return overrideType ?? this.contentType.default;
+ }
+ return this.contentType;
+ }
+};
+var DEFAULT_TAG_DEFINITION;
+var TAG_DEFINITIONS;
+function getHtmlTagDefinition(tagName) {
+ if (!TAG_DEFINITIONS) {
+ DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({ canSelfClose: true });
+ TAG_DEFINITIONS = Object.assign(/* @__PURE__ */ Object.create(null), {
+ "base": new HtmlTagDefinition({ isVoid: true }),
+ "meta": new HtmlTagDefinition({ isVoid: true }),
+ "area": new HtmlTagDefinition({ isVoid: true }),
+ "embed": new HtmlTagDefinition({ isVoid: true }),
+ "link": new HtmlTagDefinition({ isVoid: true }),
+ "img": new HtmlTagDefinition({ isVoid: true }),
+ "input": new HtmlTagDefinition({ isVoid: true }),
+ "param": new HtmlTagDefinition({ isVoid: true }),
+ "hr": new HtmlTagDefinition({ isVoid: true }),
+ "br": new HtmlTagDefinition({ isVoid: true }),
+ "source": new HtmlTagDefinition({ isVoid: true }),
+ "track": new HtmlTagDefinition({ isVoid: true }),
+ "wbr": new HtmlTagDefinition({ isVoid: true }),
+ "p": new HtmlTagDefinition({
+ closedByChildren: [
+ "address",
+ "article",
+ "aside",
+ "blockquote",
+ "div",
+ "dl",
+ "fieldset",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "header",
+ "hgroup",
+ "hr",
+ "main",
+ "nav",
+ "ol",
+ "p",
+ "pre",
+ "section",
+ "table",
+ "ul"
+ ],
+ closedByParent: true
+ }),
+ "thead": new HtmlTagDefinition({ closedByChildren: ["tbody", "tfoot"] }),
+ "tbody": new HtmlTagDefinition({ closedByChildren: ["tbody", "tfoot"], closedByParent: true }),
+ "tfoot": new HtmlTagDefinition({ closedByChildren: ["tbody"], closedByParent: true }),
+ "tr": new HtmlTagDefinition({ closedByChildren: ["tr"], closedByParent: true }),
+ "td": new HtmlTagDefinition({ closedByChildren: ["td", "th"], closedByParent: true }),
+ "th": new HtmlTagDefinition({ closedByChildren: ["td", "th"], closedByParent: true }),
+ "col": new HtmlTagDefinition({ isVoid: true }),
+ "svg": new HtmlTagDefinition({ implicitNamespacePrefix: "svg" }),
+ "foreignObject": new HtmlTagDefinition({
+ // Usually the implicit namespace here would be redundant since it will be inherited from
+ // the parent `svg`, but we have to do it for `foreignObject`, because the way the parser
+ // works is that the parent node of an end tag is its own start tag which means that
+ // the `preventNamespaceInheritance` on `foreignObject` would have it default to the
+ // implicit namespace which is `html`, unless specified otherwise.
+ implicitNamespacePrefix: "svg",
+ // We want to prevent children of foreignObject from inheriting its namespace, because
+ // the point of the element is to allow nodes from other namespaces to be inserted.
+ preventNamespaceInheritance: true
+ }),
+ "math": new HtmlTagDefinition({ implicitNamespacePrefix: "math" }),
+ "li": new HtmlTagDefinition({ closedByChildren: ["li"], closedByParent: true }),
+ "dt": new HtmlTagDefinition({ closedByChildren: ["dt", "dd"] }),
+ "dd": new HtmlTagDefinition({ closedByChildren: ["dt", "dd"], closedByParent: true }),
+ "rb": new HtmlTagDefinition({
+ closedByChildren: ["rb", "rt", "rtc", "rp"],
+ closedByParent: true
+ }),
+ "rt": new HtmlTagDefinition({
+ closedByChildren: ["rb", "rt", "rtc", "rp"],
+ closedByParent: true
+ }),
+ "rtc": new HtmlTagDefinition({ closedByChildren: ["rb", "rtc", "rp"], closedByParent: true }),
+ "rp": new HtmlTagDefinition({
+ closedByChildren: ["rb", "rt", "rtc", "rp"],
+ closedByParent: true
+ }),
+ "optgroup": new HtmlTagDefinition({ closedByChildren: ["optgroup"], closedByParent: true }),
+ "option": new HtmlTagDefinition({
+ closedByChildren: ["option", "optgroup"],
+ closedByParent: true
+ }),
+ "pre": new HtmlTagDefinition({ ignoreFirstLf: true }),
+ "listing": new HtmlTagDefinition({ ignoreFirstLf: true }),
+ "style": new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
+ "script": new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),
+ "title": new HtmlTagDefinition({
+ // The browser supports two separate `title` tags which have to use
+ // a different content type: `HTMLTitleElement` and `SVGTitleElement`
+ contentType: {
+ default: TagContentType.ESCAPABLE_RAW_TEXT,
+ svg: TagContentType.PARSABLE_DATA
+ }
+ }),
+ "textarea": new HtmlTagDefinition({
+ contentType: TagContentType.ESCAPABLE_RAW_TEXT,
+ ignoreFirstLf: true
+ })
+ });
+ new DomElementSchemaRegistry().allKnownElementNames().forEach((knownTagName) => {
+ if (!TAG_DEFINITIONS[knownTagName] && getNsPrefix(knownTagName) === null) {
+ TAG_DEFINITIONS[knownTagName] = new HtmlTagDefinition({ canSelfClose: false });
+ }
+ });
+ }
+ return TAG_DEFINITIONS[tagName] ?? TAG_DEFINITIONS[tagName.toLowerCase()] ?? DEFAULT_TAG_DEFINITION;
+}
+var TAG_TO_PLACEHOLDER_NAMES = {
+ "A": "LINK",
+ "B": "BOLD_TEXT",
+ "BR": "LINE_BREAK",
+ "EM": "EMPHASISED_TEXT",
+ "H1": "HEADING_LEVEL1",
+ "H2": "HEADING_LEVEL2",
+ "H3": "HEADING_LEVEL3",
+ "H4": "HEADING_LEVEL4",
+ "H5": "HEADING_LEVEL5",
+ "H6": "HEADING_LEVEL6",
+ "HR": "HORIZONTAL_RULE",
+ "I": "ITALIC_TEXT",
+ "LI": "LIST_ITEM",
+ "LINK": "MEDIA_LINK",
+ "OL": "ORDERED_LIST",
+ "P": "PARAGRAPH",
+ "Q": "QUOTATION",
+ "S": "STRIKETHROUGH_TEXT",
+ "SMALL": "SMALL_TEXT",
+ "SUB": "SUBSTRIPT",
+ "SUP": "SUPERSCRIPT",
+ "TBODY": "TABLE_BODY",
+ "TD": "TABLE_CELL",
+ "TFOOT": "TABLE_FOOTER",
+ "TH": "TABLE_HEADER_CELL",
+ "THEAD": "TABLE_HEADER",
+ "TR": "TABLE_ROW",
+ "TT": "MONOSPACED_TEXT",
+ "U": "UNDERLINED_TEXT",
+ "UL": "UNORDERED_LIST"
+};
+var PlaceholderRegistry = class {
+ // Count the occurrence of the base name top generate a unique name
+ _placeHolderNameCounts = {};
+ // Maps signature to placeholder names
+ _signatureToName = {};
+ getStartTagPlaceholderName(tag, attrs, isVoid) {
+ const signature = this._hashTag(tag, attrs, isVoid);
+ if (this._signatureToName[signature]) {
+ return this._signatureToName[signature];
+ }
+ const upperTag = tag.toUpperCase();
+ const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;
+ const name = this._generateUniqueName(isVoid ? baseName : `START_${baseName}`);
+ this._signatureToName[signature] = name;
+ return name;
+ }
+ getCloseTagPlaceholderName(tag) {
+ const signature = this._hashClosingTag(tag);
+ if (this._signatureToName[signature]) {
+ return this._signatureToName[signature];
+ }
+ const upperTag = tag.toUpperCase();
+ const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;
+ const name = this._generateUniqueName(`CLOSE_${baseName}`);
+ this._signatureToName[signature] = name;
+ return name;
+ }
+ getPlaceholderName(name, content) {
+ const upperName = name.toUpperCase();
+ const signature = `PH: ${upperName}=${content}`;
+ if (this._signatureToName[signature]) {
+ return this._signatureToName[signature];
+ }
+ const uniqueName = this._generateUniqueName(upperName);
+ this._signatureToName[signature] = uniqueName;
+ return uniqueName;
+ }
+ getUniquePlaceholder(name) {
+ return this._generateUniqueName(name.toUpperCase());
+ }
+ getStartBlockPlaceholderName(name, parameters) {
+ const signature = this._hashBlock(name, parameters);
+ if (this._signatureToName[signature]) {
+ return this._signatureToName[signature];
+ }
+ const placeholder = this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);
+ this._signatureToName[signature] = placeholder;
+ return placeholder;
+ }
+ getCloseBlockPlaceholderName(name) {
+ const signature = this._hashClosingBlock(name);
+ if (this._signatureToName[signature]) {
+ return this._signatureToName[signature];
+ }
+ const placeholder = this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);
+ this._signatureToName[signature] = placeholder;
+ return placeholder;
+ }
+ // Generate a hash for a tag - does not take attribute order into account
+ _hashTag(tag, attrs, isVoid) {
+ const start = `<${tag}`;
+ const strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join("");
+ const end = isVoid ? "/>" : `>${tag}>`;
+ return start + strAttrs + end;
+ }
+ _hashClosingTag(tag) {
+ return this._hashTag(`/${tag}`, {}, false);
+ }
+ _hashBlock(name, parameters) {
+ const params = parameters.length === 0 ? "" : ` (${parameters.sort().join("; ")})`;
+ return `@${name}${params} {}`;
+ }
+ _hashClosingBlock(name) {
+ return this._hashBlock(`close_${name}`, []);
+ }
+ _toSnakeCase(name) {
+ return name.toUpperCase().replace(/[^A-Z0-9]/g, "_");
+ }
+ _generateUniqueName(base) {
+ const seen = this._placeHolderNameCounts.hasOwnProperty(base);
+ if (!seen) {
+ this._placeHolderNameCounts[base] = 1;
+ return base;
+ }
+ const id = this._placeHolderNameCounts[base];
+ this._placeHolderNameCounts[base] = id + 1;
+ return `${base}_${id}`;
+ }
+};
+var _expParser = new Parser2(new Lexer());
+function createI18nMessageFactory(interpolationConfig, containerBlocks, retainEmptyTokens, preserveExpressionWhitespace) {
+ const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks, retainEmptyTokens, preserveExpressionWhitespace);
+ return (nodes, meaning, description, customId, visitNodeFn) => visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn);
+}
+function noopVisitNodeFn(_html, i18n2) {
+ return i18n2;
+}
+var _I18nVisitor = class {
+ _expressionParser;
+ _interpolationConfig;
+ _containerBlocks;
+ _retainEmptyTokens;
+ _preserveExpressionWhitespace;
+ constructor(_expressionParser, _interpolationConfig, _containerBlocks, _retainEmptyTokens, _preserveExpressionWhitespace) {
+ this._expressionParser = _expressionParser;
+ this._interpolationConfig = _interpolationConfig;
+ this._containerBlocks = _containerBlocks;
+ this._retainEmptyTokens = _retainEmptyTokens;
+ this._preserveExpressionWhitespace = _preserveExpressionWhitespace;
+ }
+ toI18nMessage(nodes, meaning = "", description = "", customId = "", visitNodeFn) {
+ const context = {
+ isIcu: nodes.length == 1 && nodes[0] instanceof Expansion,
+ icuDepth: 0,
+ placeholderRegistry: new PlaceholderRegistry(),
+ placeholderToContent: {},
+ placeholderToMessage: {},
+ visitNodeFn: visitNodeFn || noopVisitNodeFn
+ };
+ const i18nodes = visitAll(this, nodes, context);
+ return new Message(i18nodes, context.placeholderToContent, context.placeholderToMessage, meaning, description, customId);
+ }
+ visitElement(el, context) {
+ return this._visitElementLike(el, context);
+ }
+ visitComponent(component, context) {
+ return this._visitElementLike(component, context);
+ }
+ visitDirective(directive, context) {
+ throw new Error("Unreachable code");
+ }
+ visitAttribute(attribute2, context) {
+ const node = attribute2.valueTokens === void 0 || attribute2.valueTokens.length === 1 ? new Text$2(attribute2.value, attribute2.valueSpan || attribute2.sourceSpan) : this._visitTextWithInterpolation(attribute2.valueTokens, attribute2.valueSpan || attribute2.sourceSpan, context, attribute2.i18n);
+ return context.visitNodeFn(attribute2, node);
+ }
+ visitText(text2, context) {
+ const node = text2.tokens.length === 1 ? new Text$2(text2.value, text2.sourceSpan) : this._visitTextWithInterpolation(text2.tokens, text2.sourceSpan, context, text2.i18n);
+ return context.visitNodeFn(text2, node);
+ }
+ visitComment(comment, context) {
+ return null;
+ }
+ visitExpansion(icu, context) {
+ context.icuDepth++;
+ const i18nIcuCases = {};
+ const i18nIcu = new Icu2(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);
+ icu.cases.forEach((caze) => {
+ i18nIcuCases[caze.value] = new Container(caze.expression.map((node2) => node2.visit(this, context)), caze.expSourceSpan);
+ });
+ context.icuDepth--;
+ if (context.isIcu || context.icuDepth > 0) {
+ const expPh = context.placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`);
+ i18nIcu.expressionPlaceholder = expPh;
+ context.placeholderToContent[expPh] = {
+ text: icu.switchValue,
+ sourceSpan: icu.switchValueSourceSpan
+ };
+ return context.visitNodeFn(icu, i18nIcu);
+ }
+ const phName = context.placeholderRegistry.getPlaceholderName("ICU", icu.sourceSpan.toString());
+ context.placeholderToMessage[phName] = this.toI18nMessage([icu], "", "", "", void 0);
+ const node = new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);
+ return context.visitNodeFn(icu, node);
+ }
+ visitExpansionCase(_icuCase, _context) {
+ throw new Error("Unreachable code");
+ }
+ visitBlock(block, context) {
+ const children = visitAll(this, block.children, context);
+ if (this._containerBlocks.has(block.name)) {
+ return new Container(children, block.sourceSpan);
+ }
+ const parameters = block.parameters.map((param) => param.expression);
+ const startPhName = context.placeholderRegistry.getStartBlockPlaceholderName(block.name, parameters);
+ const closePhName = context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);
+ context.placeholderToContent[startPhName] = {
+ text: block.startSourceSpan.toString(),
+ sourceSpan: block.startSourceSpan
+ };
+ context.placeholderToContent[closePhName] = {
+ text: block.endSourceSpan ? block.endSourceSpan.toString() : "}",
+ sourceSpan: block.endSourceSpan ?? block.sourceSpan
+ };
+ const node = new BlockPlaceholder(block.name, parameters, startPhName, closePhName, children, block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
+ return context.visitNodeFn(block, node);
+ }
+ visitBlockParameter(_parameter, _context) {
+ throw new Error("Unreachable code");
+ }
+ visitLetDeclaration(decl, context) {
+ return null;
+ }
+ _visitElementLike(node, context) {
+ const children = visitAll(this, node.children, context);
+ const attrs = {};
+ const visitAttribute = (attr) => {
+ attrs[attr.name] = attr.value;
+ };
+ let nodeName;
+ let isVoid;
+ if (node instanceof Element2) {
+ nodeName = node.name;
+ isVoid = getHtmlTagDefinition(node.name).isVoid;
+ } else {
+ nodeName = node.fullName;
+ isVoid = node.tagName ? getHtmlTagDefinition(node.tagName).isVoid : false;
+ }
+ node.attrs.forEach(visitAttribute);
+ node.directives.forEach((dir) => dir.attrs.forEach(visitAttribute));
+ const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(nodeName, attrs, isVoid);
+ context.placeholderToContent[startPhName] = {
+ text: node.startSourceSpan.toString(),
+ sourceSpan: node.startSourceSpan
+ };
+ let closePhName = "";
+ if (!isVoid) {
+ closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(nodeName);
+ context.placeholderToContent[closePhName] = {
+ text: `${nodeName}>`,
+ sourceSpan: node.endSourceSpan ?? node.sourceSpan
+ };
+ }
+ const i18nNode = new TagPlaceholder(nodeName, attrs, startPhName, closePhName, children, isVoid, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
+ return context.visitNodeFn(node, i18nNode);
+ }
+ /**
+ * Convert, text and interpolated tokens up into text and placeholder pieces.
+ *
+ * @param tokens The text and interpolated tokens.
+ * @param sourceSpan The span of the whole of the `text` string.
+ * @param context The current context of the visitor, used to compute and store placeholders.
+ * @param previousI18n Any i18n metadata associated with this `text` from a previous pass.
+ */
+ _visitTextWithInterpolation(tokens, sourceSpan, context, previousI18n) {
+ const nodes = [];
+ let hasInterpolation = false;
+ for (const token of tokens) {
+ switch (token.type) {
+ case 8:
+ case 17:
+ hasInterpolation = true;
+ const [startMarker, expression, endMarker] = token.parts;
+ const baseName = extractPlaceholderName(expression) || "INTERPOLATION";
+ const phName = context.placeholderRegistry.getPlaceholderName(baseName, expression);
+ if (this._preserveExpressionWhitespace) {
+ context.placeholderToContent[phName] = {
+ text: token.parts.join(""),
+ sourceSpan: token.sourceSpan
+ };
+ nodes.push(new Placeholder(expression, phName, token.sourceSpan));
+ } else {
+ const normalized = this.normalizeExpression(token);
+ context.placeholderToContent[phName] = {
+ text: `${startMarker}${normalized}${endMarker}`,
+ sourceSpan: token.sourceSpan
+ };
+ nodes.push(new Placeholder(normalized, phName, token.sourceSpan));
+ }
+ break;
+ default:
+ if (token.parts[0].length > 0 || this._retainEmptyTokens) {
+ const previous = nodes[nodes.length - 1];
+ if (previous instanceof Text$2) {
+ previous.value += token.parts[0];
+ previous.sourceSpan = new ParseSourceSpan(previous.sourceSpan.start, token.sourceSpan.end, previous.sourceSpan.fullStart, previous.sourceSpan.details);
+ } else {
+ nodes.push(new Text$2(token.parts[0], token.sourceSpan));
+ }
+ } else {
+ if (this._retainEmptyTokens) {
+ nodes.push(new Text$2(token.parts[0], token.sourceSpan));
+ }
+ }
+ break;
+ }
+ }
+ if (hasInterpolation) {
+ reusePreviousSourceSpans(nodes, previousI18n);
+ return new Container(nodes, sourceSpan);
+ } else {
+ return nodes[0];
+ }
+ }
+ // Normalize expression whitespace by parsing and re-serializing it. This makes
+ // message IDs more durable to insignificant whitespace changes.
+ normalizeExpression(token) {
+ const expression = token.parts[1];
+ const expr = this._expressionParser.parseBinding(
+ expression,
+ /* location */
+ token.sourceSpan,
+ /* absoluteOffset */
+ token.sourceSpan.start.offset,
+ this._interpolationConfig
+ );
+ return serialize(expr);
+ }
+};
+function reusePreviousSourceSpans(nodes, previousI18n) {
+ if (previousI18n instanceof Message) {
+ assertSingleContainerMessage(previousI18n);
+ previousI18n = previousI18n.nodes[0];
+ }
+ if (previousI18n instanceof Container) {
+ assertEquivalentNodes(previousI18n.children, nodes);
+ for (let i = 0; i < nodes.length; i++) {
+ nodes[i].sourceSpan = previousI18n.children[i].sourceSpan;
+ }
+ }
+}
+function assertSingleContainerMessage(message) {
+ const nodes = message.nodes;
+ if (nodes.length !== 1 || !(nodes[0] instanceof Container)) {
+ throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.");
+ }
+}
+function assertEquivalentNodes(previousNodes, nodes) {
+ if (previousNodes.length !== nodes.length) {
+ throw new Error(`
+The number of i18n message children changed between first and second pass.
+
+First pass (${previousNodes.length} tokens):
+${previousNodes.map((node) => `"${node.sourceSpan.toString()}"`).join("\n")}
+
+Second pass (${nodes.length} tokens):
+${nodes.map((node) => `"${node.sourceSpan.toString()}"`).join("\n")}
+ `.trim());
+ }
+ if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {
+ throw new Error("The types of the i18n message children changed between first and second pass.");
+ }
+}
+var _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
+function extractPlaceholderName(input) {
+ return input.split(_CUSTOM_PH_EXP)[2];
+}
+var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
+ // NOTE: All strings in this set *must* be lowercase!
+ // TrustedHTML
+ "iframe|srcdoc",
+ "*|innerhtml",
+ "*|outerhtml",
+ // NB: no TrustedScript here, as the corresponding tags are stripped by the compiler.
+ // TrustedScriptURL
+ "embed|src",
+ "object|codebase",
+ "object|data"
+]);
+function isTrustedTypesSink(tagName, propName) {
+ tagName = tagName.toLowerCase();
+ propName = propName.toLowerCase();
+ return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
+}
+var setI18nRefs = (originalNodeMap) => {
+ return (trimmedNode, i18nNode) => {
+ const originalNode = originalNodeMap.get(trimmedNode) ?? trimmedNode;
+ if (originalNode instanceof NodeWithI18n) {
+ if (i18nNode instanceof IcuPlaceholder && originalNode.i18n instanceof Message) {
+ i18nNode.previousMessage = originalNode.i18n;
+ }
+ originalNode.i18n = i18nNode;
+ }
+ return i18nNode;
+ };
+};
+var I18nMetaVisitor = class {
+ interpolationConfig;
+ keepI18nAttrs;
+ enableI18nLegacyMessageIdFormat;
+ containerBlocks;
+ preserveSignificantWhitespace;
+ retainEmptyTokens;
+ // whether visited nodes contain i18n information
+ hasI18nMeta = false;
+ _errors = [];
+ constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false, containerBlocks = DEFAULT_CONTAINER_BLOCKS, preserveSignificantWhitespace = true, retainEmptyTokens = !preserveSignificantWhitespace) {
+ this.interpolationConfig = interpolationConfig;
+ this.keepI18nAttrs = keepI18nAttrs;
+ this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat;
+ this.containerBlocks = containerBlocks;
+ this.preserveSignificantWhitespace = preserveSignificantWhitespace;
+ this.retainEmptyTokens = retainEmptyTokens;
+ }
+ _generateI18nMessage(nodes, meta = "", visitNodeFn) {
+ const { meaning, description, customId } = this._parseMetadata(meta);
+ const createI18nMessage2 = createI18nMessageFactory(
+ this.interpolationConfig,
+ this.containerBlocks,
+ this.retainEmptyTokens,
+ /* preserveExpressionWhitespace */
+ this.preserveSignificantWhitespace
+ );
+ const message = createI18nMessage2(nodes, meaning, description, customId, visitNodeFn);
+ this._setMessageId(message, meta);
+ this._setLegacyIds(message, meta);
+ return message;
+ }
+ visitAllWithErrors(nodes) {
+ const result = nodes.map((node) => node.visit(this, null));
+ return new ParseTreeResult(result, this._errors);
+ }
+ visitElement(element2) {
+ this._visitElementLike(element2);
+ return element2;
+ }
+ visitComponent(component, context) {
+ this._visitElementLike(component);
+ return component;
+ }
+ visitExpansion(expansion, currentMessage) {
+ let message;
+ const meta = expansion.i18n;
+ this.hasI18nMeta = true;
+ if (meta instanceof IcuPlaceholder) {
+ const name = meta.name;
+ message = this._generateI18nMessage([expansion], meta);
+ const icu = icuFromI18nMessage(message);
+ icu.name = name;
+ if (currentMessage !== null) {
+ currentMessage.placeholderToMessage[name] = message;
+ }
+ } else {
+ message = this._generateI18nMessage([expansion], currentMessage || meta);
+ }
+ expansion.i18n = message;
+ return expansion;
+ }
+ visitText(text2) {
+ return text2;
+ }
+ visitAttribute(attribute2) {
+ return attribute2;
+ }
+ visitComment(comment) {
+ return comment;
+ }
+ visitExpansionCase(expansionCase) {
+ return expansionCase;
+ }
+ visitBlock(block, context) {
+ visitAll(this, block.children, context);
+ return block;
+ }
+ visitBlockParameter(parameter, context) {
+ return parameter;
+ }
+ visitLetDeclaration(decl, context) {
+ return decl;
+ }
+ visitDirective(directive, context) {
+ return directive;
+ }
+ _visitElementLike(node) {
+ let message = void 0;
+ if (hasI18nAttrs(node)) {
+ this.hasI18nMeta = true;
+ const attrs = [];
+ const attrsMeta = {};
+ for (const attr of node.attrs) {
+ if (attr.name === I18N_ATTR) {
+ const i18n2 = node.i18n || attr.value;
+ const originalNodeMap = /* @__PURE__ */ new Map();
+ const trimmedNodes = this.preserveSignificantWhitespace ? node.children : visitAllWithSiblings(new WhitespaceVisitor(false, originalNodeMap), node.children);
+ message = this._generateI18nMessage(trimmedNodes, i18n2, setI18nRefs(originalNodeMap));
+ if (message.nodes.length === 0) {
+ message = void 0;
+ }
+ node.i18n = message;
+ } else if (attr.name.startsWith(I18N_ATTR_PREFIX)) {
+ const name = attr.name.slice(I18N_ATTR_PREFIX.length);
+ let isTrustedType;
+ if (node instanceof Component2) {
+ isTrustedType = node.tagName === null ? false : isTrustedTypesSink(node.tagName, name);
+ } else {
+ isTrustedType = isTrustedTypesSink(node.name, name);
+ }
+ if (isTrustedType) {
+ this._reportError(attr, `Translating attribute '${name}' is disallowed for security reasons.`);
+ } else {
+ attrsMeta[name] = attr.value;
+ }
+ } else {
+ attrs.push(attr);
+ }
+ }
+ if (Object.keys(attrsMeta).length) {
+ for (const attr of attrs) {
+ const meta = attrsMeta[attr.name];
+ if (meta !== void 0 && attr.value) {
+ attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);
+ }
+ }
+ }
+ if (!this.keepI18nAttrs) {
+ node.attrs = attrs;
+ }
+ }
+ visitAll(this, node.children, message);
+ }
+ /**
+ * Parse the general form `meta` passed into extract the explicit metadata needed to create a
+ * `Message`.
+ *
+ * There are three possibilities for the `meta` variable
+ * 1) a string from an `i18n` template attribute: parse it to extract the metadata values.
+ * 2) a `Message` from a previous processing pass: reuse the metadata values in the message.
+ * 4) other: ignore this and just process the message metadata as normal
+ *
+ * @param meta the bucket that holds information about the message
+ * @returns the parsed metadata.
+ */
+ _parseMetadata(meta) {
+ return typeof meta === "string" ? parseI18nMeta(meta) : meta instanceof Message ? meta : {};
+ }
+ /**
+ * Generate (or restore) message id if not specified already.
+ */
+ _setMessageId(message, meta) {
+ if (!message.id) {
+ message.id = meta instanceof Message && meta.id || decimalDigest(message);
+ }
+ }
+ /**
+ * Update the `message` with a `legacyId` if necessary.
+ *
+ * @param message the message whose legacy id should be set
+ * @param meta information about the message being processed
+ */
+ _setLegacyIds(message, meta) {
+ if (this.enableI18nLegacyMessageIdFormat) {
+ message.legacyIds = [computeDigest(message), computeDecimalDigest(message)];
+ } else if (typeof meta !== "string") {
+ const previousMessage = meta instanceof Message ? meta : meta instanceof IcuPlaceholder ? meta.previousMessage : void 0;
+ message.legacyIds = previousMessage ? previousMessage.legacyIds : [];
+ }
+ }
+ _reportError(node, msg) {
+ this._errors.push(new ParseError(node.sourceSpan, msg));
+ }
+};
+var I18N_MEANING_SEPARATOR = "|";
+var I18N_ID_SEPARATOR = "@@";
+function parseI18nMeta(meta = "") {
+ let customId;
+ let meaning;
+ let description;
+ meta = meta.trim();
+ if (meta) {
+ const idIndex = meta.indexOf(I18N_ID_SEPARATOR);
+ const descIndex = meta.indexOf(I18N_MEANING_SEPARATOR);
+ let meaningAndDesc;
+ [meaningAndDesc, customId] = idIndex > -1 ? [meta.slice(0, idIndex), meta.slice(idIndex + 2)] : [meta, ""];
+ [meaning, description] = descIndex > -1 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : ["", meaningAndDesc];
+ }
+ return { customId, meaning, description };
+}
+function i18nMetaToJSDoc(meta) {
+ const tags = [];
+ if (meta.description) {
+ tags.push({ tagName: "desc", text: meta.description });
+ } else {
+ tags.push({ tagName: "suppress", text: "{msgDescriptions}" });
+ }
+ if (meta.meaning) {
+ tags.push({ tagName: "meaning", text: meta.meaning });
+ }
+ return jsDocComment(tags);
+}
+var GOOG_GET_MSG = "goog.getMsg";
+function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) {
+ const messageString = serializeI18nMessageForGetMsg(message);
+ const args = [literal(messageString)];
+ if (Object.keys(placeholderValues).length) {
+ args.push(mapLiteral(
+ formatI18nPlaceholderNamesInMap(
+ placeholderValues,
+ true
+ /* useCamelCase */
+ ),
+ true
+ /* quoted */
+ ));
+ args.push(mapLiteral({
+ original_code: literalMap(Object.keys(placeholderValues).map((param) => ({
+ key: formatI18nPlaceholderName(param),
+ quoted: true,
+ value: message.placeholders[param] ? (
+ // Get source span for typical placeholder if it exists.
+ literal(message.placeholders[param].sourceSpan.toString())
+ ) : (
+ // Otherwise must be an ICU expression, get it's source span.
+ literal(message.placeholderToMessage[param].nodes.map((node) => node.sourceSpan.toString()).join(""))
+ )
+ })))
+ }));
+ }
+ const googGetMsgStmt = new DeclareVarStmt(closureVar.name, variable(GOOG_GET_MSG).callFn(args), INFERRED_TYPE, StmtModifier.Final);
+ googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
+ const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));
+ return [googGetMsgStmt, i18nAssignmentStmt];
+}
+var GetMsgSerializerVisitor = class {
+ formatPh(value) {
+ return `{$${formatI18nPlaceholderName(value)}}`;
+ }
+ visitText(text2) {
+ return text2.value;
+ }
+ visitContainer(container) {
+ return container.children.map((child) => child.visit(this)).join("");
+ }
+ visitIcu(icu) {
+ return serializeIcuNode(icu);
+ }
+ visitTagPlaceholder(ph) {
+ return ph.isVoid ? this.formatPh(ph.startName) : `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
+ }
+ visitPlaceholder(ph) {
+ return this.formatPh(ph.name);
+ }
+ visitBlockPlaceholder(ph) {
+ return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
+ }
+ visitIcuPlaceholder(ph, context) {
+ return this.formatPh(ph.name);
+ }
+};
+var serializerVisitor = new GetMsgSerializerVisitor();
+function serializeI18nMessageForGetMsg(message) {
+ return message.nodes.map((node) => node.visit(serializerVisitor, null)).join("");
+}
+function createLocalizeStatements(variable2, message, params) {
+ const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
+ const sourceSpan = getSourceSpan(message);
+ const expressions = placeHolders.map((ph) => params[ph.text]);
+ const localizedString$1 = localizedString(message, messageParts, placeHolders, expressions, sourceSpan);
+ const variableInitialization = variable2.set(localizedString$1);
+ return [new ExpressionStatement(variableInitialization)];
+}
+var LocalizeSerializerVisitor = class {
+ placeholderToMessage;
+ pieces;
+ constructor(placeholderToMessage, pieces) {
+ this.placeholderToMessage = placeholderToMessage;
+ this.pieces = pieces;
+ }
+ visitText(text2) {
+ if (this.pieces[this.pieces.length - 1] instanceof LiteralPiece) {
+ this.pieces[this.pieces.length - 1].text += text2.value;
+ } else {
+ const sourceSpan = new ParseSourceSpan(text2.sourceSpan.fullStart, text2.sourceSpan.end, text2.sourceSpan.fullStart, text2.sourceSpan.details);
+ this.pieces.push(new LiteralPiece(text2.value, sourceSpan));
+ }
+ }
+ visitContainer(container) {
+ container.children.forEach((child) => child.visit(this));
+ }
+ visitIcu(icu) {
+ this.pieces.push(new LiteralPiece(serializeIcuNode(icu), icu.sourceSpan));
+ }
+ visitTagPlaceholder(ph) {
+ this.pieces.push(this.createPlaceholderPiece(ph.startName, ph.startSourceSpan ?? ph.sourceSpan));
+ if (!ph.isVoid) {
+ ph.children.forEach((child) => child.visit(this));
+ this.pieces.push(this.createPlaceholderPiece(ph.closeName, ph.endSourceSpan ?? ph.sourceSpan));
+ }
+ }
+ visitPlaceholder(ph) {
+ this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));
+ }
+ visitBlockPlaceholder(ph) {
+ this.pieces.push(this.createPlaceholderPiece(ph.startName, ph.startSourceSpan ?? ph.sourceSpan));
+ ph.children.forEach((child) => child.visit(this));
+ this.pieces.push(this.createPlaceholderPiece(ph.closeName, ph.endSourceSpan ?? ph.sourceSpan));
+ }
+ visitIcuPlaceholder(ph) {
+ this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan, this.placeholderToMessage[ph.name]));
+ }
+ createPlaceholderPiece(name, sourceSpan, associatedMessage) {
+ return new PlaceholderPiece(formatI18nPlaceholderName(
+ name,
+ /* useCamelCase */
+ false
+ ), sourceSpan, associatedMessage);
+ }
+};
+function serializeI18nMessageForLocalize(message) {
+ const pieces = [];
+ const serializerVisitor2 = new LocalizeSerializerVisitor(message.placeholderToMessage, pieces);
+ message.nodes.forEach((node) => node.visit(serializerVisitor2));
+ return processMessagePieces(pieces);
+}
+function getSourceSpan(message) {
+ const startNode = message.nodes[0];
+ const endNode = message.nodes[message.nodes.length - 1];
+ return new ParseSourceSpan(startNode.sourceSpan.fullStart, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);
+}
+function processMessagePieces(pieces) {
+ const messageParts = [];
+ const placeHolders = [];
+ if (pieces[0] instanceof PlaceholderPiece) {
+ messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start));
+ }
+ for (let i = 0; i < pieces.length; i++) {
+ const part = pieces[i];
+ if (part instanceof LiteralPiece) {
+ messageParts.push(part);
+ } else {
+ placeHolders.push(part);
+ if (pieces[i - 1] instanceof PlaceholderPiece) {
+ messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));
+ }
+ }
+ }
+ if (pieces[pieces.length - 1] instanceof PlaceholderPiece) {
+ messageParts.push(createEmptyMessagePart(pieces[pieces.length - 1].sourceSpan.end));
+ }
+ return { messageParts, placeHolders };
+}
+function createEmptyMessagePart(location) {
+ return new LiteralPiece("", new ParseSourceSpan(location, location));
+}
+var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
+var TRANSLATION_VAR_PREFIX = "i18n_";
+var I18N_ICU_MAPPING_PREFIX = "I18N_EXP_";
+var ESCAPE = "�";
+var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
+function getTranslationConstPrefix(extra) {
+ return `${CLOSURE_TRANSLATION_VAR_PREFIX}${extra}`.toUpperCase();
+}
+function declareI18nVariable(variable2) {
+ return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
+}
+function collectI18nConsts(job) {
+ const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
+ const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
+ const i18nAttributesByElement = /* @__PURE__ */ new Map();
+ const i18nExpressionsByElement = /* @__PURE__ */ new Map();
+ const messages = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
+ const attributes = extractedAttributesByI18nContext.get(op.i18nContext) ?? [];
+ attributes.push(op);
+ extractedAttributesByI18nContext.set(op.i18nContext, attributes);
+ } else if (op.kind === OpKind.I18nAttributes) {
+ i18nAttributesByElement.set(op.target, op);
+ } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
+ const expressions = i18nExpressionsByElement.get(op.target) ?? [];
+ expressions.push(op);
+ i18nExpressionsByElement.set(op.target, expressions);
+ } else if (op.kind === OpKind.I18nMessage) {
+ messages.set(op.xref, op);
+ }
+ }
+ }
+ const i18nValuesByContext = /* @__PURE__ */ new Map();
+ const messageConstIndices = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.I18nMessage) {
+ if (op.messagePlaceholder === null) {
+ const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
+ if (op.i18nBlock !== null) {
+ const i18nConst = job.addConst(mainVar, statements);
+ messageConstIndices.set(op.i18nBlock, i18nConst);
+ } else {
+ job.constsInitializers.push(...statements);
+ i18nValuesByContext.set(op.i18nContext, mainVar);
+ const attributesForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
+ if (attributesForMessage !== void 0) {
+ for (const attr of attributesForMessage) {
+ attr.expression = mainVar.clone();
+ }
+ }
+ }
+ }
+ OpList.remove(op);
+ }
+ }
+ }
+ for (const unit of job.units) {
+ for (const elem of unit.create) {
+ if (isElementOrContainerOp(elem)) {
+ const i18nAttributes2 = i18nAttributesByElement.get(elem.xref);
+ if (i18nAttributes2 === void 0) {
+ continue;
+ }
+ let i18nExpressions = i18nExpressionsByElement.get(elem.xref);
+ if (i18nExpressions === void 0) {
+ throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");
+ }
+ const seenPropertyNames = /* @__PURE__ */ new Set();
+ i18nExpressions = i18nExpressions.filter((i18nExpr) => {
+ const seen = seenPropertyNames.has(i18nExpr.name);
+ seenPropertyNames.add(i18nExpr.name);
+ return !seen;
+ });
+ const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {
+ const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);
+ if (i18nExprValue === void 0) {
+ throw new Error("AssertionError: Could not find i18n expression's value");
+ }
+ return [literal(i18nExpr.name), i18nExprValue];
+ });
+ i18nAttributes2.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig));
+ }
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.I18nStart) {
+ const msgIndex = messageConstIndices.get(op.root);
+ if (msgIndex === void 0) {
+ throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");
+ }
+ op.messageIndex = msgIndex;
+ }
+ }
+ }
+}
+function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
+ const statements = [];
+ const subMessagePlaceholders = /* @__PURE__ */ new Map();
+ for (const subMessageId of messageOp.subMessages) {
+ const subMessage = messages.get(subMessageId);
+ const { mainVar: subMessageVar, statements: subMessageStatements } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage);
+ statements.push(...subMessageStatements);
+ const subMessages = subMessagePlaceholders.get(subMessage.messagePlaceholder) ?? [];
+ subMessages.push(subMessageVar);
+ subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages);
+ }
+ addSubMessageParams(messageOp, subMessagePlaceholders);
+ messageOp.params = new Map([...messageOp.params.entries()].sort());
+ const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));
+ const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
+ let transformFn = void 0;
+ if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) {
+ const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
+ const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(
+ postprocessingParams,
+ /* useCamelCase */
+ false
+ );
+ const extraTransformFnParams = [];
+ if (messageOp.postprocessingParams.size > 0) {
+ extraTransformFnParams.push(mapLiteral(
+ formattedPostprocessingParams,
+ /* quoted */
+ true
+ ));
+ }
+ transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
+ }
+ statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn));
+ return { mainVar, statements };
+}
+function addSubMessageParams(messageOp, subMessagePlaceholders) {
+ for (const [placeholder, subMessages] of subMessagePlaceholders) {
+ if (subMessages.length === 1) {
+ messageOp.params.set(placeholder, subMessages[0]);
+ } else {
+ messageOp.params.set(placeholder, literal(`${ESCAPE}${I18N_ICU_MAPPING_PREFIX}${placeholder}${ESCAPE}`));
+ messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
+ }
+ }
+}
+function getTranslationDeclStmts(message, variable2, closureVar, params, transformFn) {
+ const paramsObject = Object.fromEntries(params);
+ const statements = [
+ declareI18nVariable(variable2),
+ ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable2, message, closureVar, paramsObject), createLocalizeStatements(variable2, message, formatI18nPlaceholderNamesInMap(
+ paramsObject,
+ /* useCamelCase */
+ false
+ )))
+ ];
+ if (transformFn) {
+ statements.push(new ExpressionStatement(variable2.set(transformFn(variable2))));
+ }
+ return statements;
+}
+function createClosureModeGuard() {
+ return typeofExpr(variable(NG_I18N_CLOSURE_MODE)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE));
+}
+function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExternalIds) {
+ let name;
+ const suffix = fileBasedI18nSuffix;
+ if (useExternalIds) {
+ const prefix = getTranslationConstPrefix(`EXTERNAL_`);
+ const uniqueSuffix = pool.uniqueName(suffix);
+ name = `${prefix}${sanitizeIdentifier(messageId)}$$${uniqueSuffix}`;
+ } else {
+ const prefix = getTranslationConstPrefix(suffix);
+ name = pool.uniqueName(prefix);
+ }
+ return variable(name);
+}
+function convertI18nText(job) {
+ for (const unit of job.units) {
+ let currentI18n = null;
+ let currentIcu = null;
+ const textNodeI18nBlocks = /* @__PURE__ */ new Map();
+ const textNodeIcus = /* @__PURE__ */ new Map();
+ const icuPlaceholderByText = /* @__PURE__ */ new Map();
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ if (op.context === null) {
+ throw Error("I18n op should have its context set.");
+ }
+ currentI18n = op;
+ break;
+ case OpKind.I18nEnd:
+ currentI18n = null;
+ break;
+ case OpKind.IcuStart:
+ if (op.context === null) {
+ throw Error("Icu op should have its context set.");
+ }
+ currentIcu = op;
+ break;
+ case OpKind.IcuEnd:
+ currentIcu = null;
+ break;
+ case OpKind.Text:
+ if (currentI18n !== null) {
+ textNodeI18nBlocks.set(op.xref, currentI18n);
+ textNodeIcus.set(op.xref, currentIcu);
+ if (op.icuPlaceholder !== null) {
+ const icuPlaceholderOp = createIcuPlaceholderOp(job.allocateXrefId(), op.icuPlaceholder, [op.initialValue]);
+ OpList.replace(op, icuPlaceholderOp);
+ icuPlaceholderByText.set(op.xref, icuPlaceholderOp);
+ } else {
+ OpList.remove(op);
+ }
+ }
+ break;
+ }
+ }
+ for (const op of unit.update) {
+ switch (op.kind) {
+ case OpKind.InterpolateText:
+ if (!textNodeI18nBlocks.has(op.target)) {
+ continue;
+ }
+ const i18nOp = textNodeI18nBlocks.get(op.target);
+ const icuOp = textNodeIcus.get(op.target);
+ const icuPlaceholder = icuPlaceholderByText.get(op.target);
+ const contextId = icuOp ? icuOp.context : i18nOp.context;
+ const resolutionTime = icuOp ? I18nParamResolutionTime.Postproccessing : I18nParamResolutionTime.Creation;
+ const ops = [];
+ for (let i = 0; i < op.interpolation.expressions.length; i++) {
+ const expr = op.interpolation.expressions[i];
+ ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, icuPlaceholder?.xref ?? null, op.interpolation.i18nPlaceholders[i] ?? null, resolutionTime, I18nExpressionFor.I18nText, "", expr.sourceSpan ?? op.sourceSpan));
+ }
+ OpList.replaceWithMany(op, ops);
+ if (icuPlaceholder !== void 0) {
+ icuPlaceholder.strings = op.interpolation.strings;
+ }
+ break;
+ }
+ }
+ }
+}
+function liftLocalRefs(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.ElementStart:
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ if (!Array.isArray(op.localRefs)) {
+ throw new Error(`AssertionError: expected localRefs to be an array still`);
+ }
+ op.numSlotsUsed += op.localRefs.length;
+ if (op.localRefs.length > 0) {
+ const localRefs = serializeLocalRefs(op.localRefs);
+ op.localRefs = job.addConst(localRefs);
+ } else {
+ op.localRefs = null;
+ }
+ break;
+ }
+ }
+ }
+}
+function serializeLocalRefs(refs) {
+ const constRefs = [];
+ for (const ref of refs) {
+ constRefs.push(literal(ref.name), literal(ref.target));
+ }
+ return literalArr(constRefs);
+}
+function emitNamespaceChanges(job) {
+ for (const unit of job.units) {
+ let activeNamespace = Namespace.HTML;
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.ElementStart) {
+ continue;
+ }
+ if (op.namespace !== activeNamespace) {
+ OpList.insertBefore(createNamespaceOp(op.namespace), op);
+ activeNamespace = op.namespace;
+ }
+ }
+ }
+}
+function parse(value) {
+ const styles = [];
+ let i = 0;
+ let parenDepth = 0;
+ let quote = 0;
+ let valueStart = 0;
+ let propStart = 0;
+ let currentProp = null;
+ while (i < value.length) {
+ const token = value.charCodeAt(i++);
+ switch (token) {
+ case 40:
+ parenDepth++;
+ break;
+ case 41:
+ parenDepth--;
+ break;
+ case 39:
+ if (quote === 0) {
+ quote = 39;
+ } else if (quote === 39 && value.charCodeAt(i - 1) !== 92) {
+ quote = 0;
+ }
+ break;
+ case 34:
+ if (quote === 0) {
+ quote = 34;
+ } else if (quote === 34 && value.charCodeAt(i - 1) !== 92) {
+ quote = 0;
+ }
+ break;
+ case 58:
+ if (!currentProp && parenDepth === 0 && quote === 0) {
+ currentProp = hyphenate(value.substring(propStart, i - 1).trim());
+ valueStart = i;
+ }
+ break;
+ case 59:
+ if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0) {
+ const styleVal = value.substring(valueStart, i - 1).trim();
+ styles.push(currentProp, styleVal);
+ propStart = i;
+ valueStart = 0;
+ currentProp = null;
+ }
+ break;
+ }
+ }
+ if (currentProp && valueStart) {
+ const styleVal = value.slice(valueStart).trim();
+ styles.push(currentProp, styleVal);
+ }
+ return styles;
+}
+function hyphenate(value) {
+ return value.replace(/[a-z][A-Z]/g, (v) => {
+ return v.charAt(0) + "-" + v.charAt(1);
+ }).toLowerCase();
+}
+function parseExtractedStyles(job) {
+ const elements = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (isElementOrContainerOp(op)) {
+ elements.set(op.xref, op);
+ }
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) {
+ const target = elements.get(op.target);
+ if (target !== void 0 && (target.kind === OpKind.Template || target.kind === OpKind.ConditionalCreate || target.kind === OpKind.ConditionalBranchCreate) && target.templateKind === TemplateKind.Structural) {
+ continue;
+ }
+ if (op.name === "style") {
+ const parsedStyles = parse(op.expression.value);
+ for (let i = 0; i < parsedStyles.length - 1; i += 2) {
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, null, parsedStyles[i], literal(parsedStyles[i + 1]), null, null, SecurityContext.STYLE), op);
+ }
+ OpList.remove(op);
+ } else if (op.name === "class") {
+ const parsedClasses = op.expression.value.trim().split(/\s+/g);
+ for (const parsedClass of parsedClasses) {
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, null, parsedClass, null, null, null, SecurityContext.NONE), op);
+ }
+ OpList.remove(op);
+ }
+ }
+ }
+ }
+}
+function nameFunctionsAndVariables(job) {
+ addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
+}
+function addNamesToView(unit, baseName, state, compatibility) {
+ if (unit.fnName === null) {
+ unit.fnName = unit.job.pool.uniqueName(
+ sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`),
+ /* alwaysIncludeSuffix */
+ false
+ );
+ }
+ const varNames = /* @__PURE__ */ new Map();
+ for (const op of unit.ops()) {
+ switch (op.kind) {
+ case OpKind.Property:
+ case OpKind.DomProperty:
+ if (op.isLegacyAnimationTrigger) {
+ op.name = "@" + op.name;
+ }
+ break;
+ case OpKind.Listener:
+ if (op.handlerFnName !== null) {
+ break;
+ }
+ if (!op.hostListener && op.targetSlot.slot === null) {
+ throw new Error(`Expected a slot to be assigned`);
+ }
+ let animation = "";
+ if (op.isLegacyAnimationListener) {
+ op.name = `@${op.name}.${op.legacyAnimationPhase}`;
+ animation = "animation";
+ }
+ if (op.hostListener) {
+ op.handlerFnName = `${baseName}_${animation}${op.name}_HostBindingHandler`;
+ } else {
+ op.handlerFnName = `${unit.fnName}_${op.tag.replace("-", "_")}_${animation}${op.name}_${op.targetSlot.slot}_listener`;
+ }
+ op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
+ break;
+ case OpKind.TwoWayListener:
+ if (op.handlerFnName !== null) {
+ break;
+ }
+ if (op.targetSlot.slot === null) {
+ throw new Error(`Expected a slot to be assigned`);
+ }
+ op.handlerFnName = sanitizeIdentifier(`${unit.fnName}_${op.tag.replace("-", "_")}_${op.name}_${op.targetSlot.slot}_listener`);
+ break;
+ case OpKind.Variable:
+ varNames.set(op.xref, getVariableName(unit, op.variable, state));
+ break;
+ case OpKind.RepeaterCreate:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ if (op.handle.slot === null) {
+ throw new Error(`Expected slot to be assigned`);
+ }
+ if (op.emptyView !== null) {
+ const emptyView = unit.job.views.get(op.emptyView);
+ addNamesToView(emptyView, `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`, state, compatibility);
+ }
+ addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
+ break;
+ case OpKind.Projection:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ if (op.handle.slot === null) {
+ throw new Error(`Expected slot to be assigned`);
+ }
+ if (op.fallbackView !== null) {
+ const fallbackView = unit.job.views.get(op.fallbackView);
+ addNamesToView(fallbackView, `${baseName}_ProjectionFallback_${op.handle.slot}`, state, compatibility);
+ }
+ break;
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ const childView = unit.job.views.get(op.xref);
+ if (op.handle.slot === null) {
+ throw new Error(`Expected slot to be assigned`);
+ }
+ const suffix = op.functionNameSuffix.length === 0 ? "" : `_${op.functionNameSuffix}`;
+ addNamesToView(childView, `${baseName}${suffix}_${op.handle.slot}`, state, compatibility);
+ break;
+ case OpKind.StyleProp:
+ op.name = normalizeStylePropName(op.name);
+ if (compatibility) {
+ op.name = stripImportant(op.name);
+ }
+ break;
+ case OpKind.ClassProp:
+ if (compatibility) {
+ op.name = stripImportant(op.name);
+ }
+ break;
+ }
+ }
+ for (const op of unit.ops()) {
+ visitExpressionsInOp(op, (expr) => {
+ if (!(expr instanceof ReadVariableExpr) || expr.name !== null) {
+ return;
+ }
+ if (!varNames.has(expr.xref)) {
+ throw new Error(`Variable ${expr.xref} not yet named`);
+ }
+ expr.name = varNames.get(expr.xref);
+ });
+ }
+}
+function getVariableName(unit, variable2, state) {
+ if (variable2.name === null) {
+ switch (variable2.kind) {
+ case SemanticVariableKind.Context:
+ variable2.name = `ctx_r${state.index++}`;
+ break;
+ case SemanticVariableKind.Identifier:
+ if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
+ const compatPrefix = variable2.identifier === "ctx" ? "i" : "";
+ variable2.name = `${variable2.identifier}_${compatPrefix}r${++state.index}`;
+ } else {
+ variable2.name = `${variable2.identifier}_i${state.index++}`;
+ }
+ break;
+ default:
+ variable2.name = `_r${++state.index}`;
+ break;
+ }
+ }
+ return variable2.name;
+}
+function normalizeStylePropName(name) {
+ return name.startsWith("--") ? name : hyphenate(name);
+}
+function stripImportant(name) {
+ const importantIndex = name.indexOf("!important");
+ if (importantIndex > -1) {
+ return name.substring(0, importantIndex);
+ }
+ return name;
+}
+function mergeNextContextExpressions(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ mergeNextContextsInOps(op.handlerOps);
+ }
+ }
+ mergeNextContextsInOps(unit.update);
+ }
+}
+function mergeNextContextsInOps(ops) {
+ for (const op of ops) {
+ if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement) || !(op.statement.expr instanceof NextContextExpr)) {
+ continue;
+ }
+ const mergeSteps = op.statement.expr.steps;
+ let tryToMerge = true;
+ for (let candidate = op.next; candidate.kind !== OpKind.ListEnd && tryToMerge; candidate = candidate.next) {
+ visitExpressionsInOp(candidate, (expr, flags) => {
+ if (!isIrExpression(expr)) {
+ return expr;
+ }
+ if (!tryToMerge) {
+ return;
+ }
+ if (flags & VisitorContextFlag.InChildOperation) {
+ return;
+ }
+ switch (expr.kind) {
+ case ExpressionKind.NextContext:
+ expr.steps += mergeSteps;
+ OpList.remove(op);
+ tryToMerge = false;
+ break;
+ case ExpressionKind.GetCurrentView:
+ case ExpressionKind.Reference:
+ case ExpressionKind.ContextLetReference:
+ tryToMerge = false;
+ break;
+ }
+ return;
+ });
+ }
+ }
+}
+var CONTAINER_TAG = "ng-container";
+function generateNgContainerOps(job) {
+ for (const unit of job.units) {
+ const updatedElementXrefs = /* @__PURE__ */ new Set();
+ for (const op of unit.create) {
+ if (op.kind === OpKind.ElementStart && op.tag === CONTAINER_TAG) {
+ op.kind = OpKind.ContainerStart;
+ updatedElementXrefs.add(op.xref);
+ }
+ if (op.kind === OpKind.ElementEnd && updatedElementXrefs.has(op.xref)) {
+ op.kind = OpKind.ContainerEnd;
+ }
+ }
+ }
+}
+function lookupElement(elements, xref) {
+ const el = elements.get(xref);
+ if (el === void 0) {
+ throw new Error("All attributes should have an element-like target.");
+ }
+ return el;
+}
+function disableBindings$1(job) {
+ const elements = /* @__PURE__ */ new Map();
+ for (const view of job.units) {
+ for (const op of view.create) {
+ if (!isElementOrContainerOp(op)) {
+ continue;
+ }
+ elements.set(op.xref, op);
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if ((op.kind === OpKind.ElementStart || op.kind === OpKind.ContainerStart) && op.nonBindable) {
+ OpList.insertAfter(createDisableBindingsOp(op.xref), op);
+ }
+ if ((op.kind === OpKind.ElementEnd || op.kind === OpKind.ContainerEnd) && lookupElement(elements, op.xref).nonBindable) {
+ OpList.insertBefore(createEnableBindingsOp(op.xref), op);
+ }
+ }
+ }
+}
+function kindTest(kind) {
+ return (op) => op.kind === kind;
+}
+function kindWithInterpolationTest(kind, interpolation) {
+ return (op) => {
+ return op.kind === kind && interpolation === op.expression instanceof Interpolation2;
+ };
+}
+function basicListenerKindTest(op) {
+ return op.kind === OpKind.Listener && !(op.hostListener && op.isLegacyAnimationListener) || op.kind === OpKind.TwoWayListener;
+}
+function nonInterpolationPropertyKindTest(op) {
+ return (op.kind === OpKind.Property || op.kind === OpKind.TwoWayProperty) && !(op.expression instanceof Interpolation2);
+}
+var CREATE_ORDERING = [
+ { test: (op) => op.kind === OpKind.Listener && op.hostListener && op.isLegacyAnimationListener },
+ { test: basicListenerKindTest }
+];
+var UPDATE_ORDERING = [
+ { test: kindTest(OpKind.StyleMap), transform: keepLast },
+ { test: kindTest(OpKind.ClassMap), transform: keepLast },
+ { test: kindTest(OpKind.StyleProp) },
+ { test: kindTest(OpKind.ClassProp) },
+ { test: kindWithInterpolationTest(OpKind.Attribute, true) },
+ { test: kindWithInterpolationTest(OpKind.Property, true) },
+ { test: nonInterpolationPropertyKindTest },
+ { test: kindWithInterpolationTest(OpKind.Attribute, false) }
+];
+var UPDATE_HOST_ORDERING = [
+ { test: kindWithInterpolationTest(OpKind.DomProperty, true) },
+ { test: kindWithInterpolationTest(OpKind.DomProperty, false) },
+ { test: kindTest(OpKind.Attribute) },
+ { test: kindTest(OpKind.StyleMap), transform: keepLast },
+ { test: kindTest(OpKind.ClassMap), transform: keepLast },
+ { test: kindTest(OpKind.StyleProp) },
+ { test: kindTest(OpKind.ClassProp) }
+];
+var handledOpKinds = /* @__PURE__ */ new Set([
+ OpKind.Listener,
+ OpKind.TwoWayListener,
+ OpKind.StyleMap,
+ OpKind.ClassMap,
+ OpKind.StyleProp,
+ OpKind.ClassProp,
+ OpKind.Property,
+ OpKind.TwoWayProperty,
+ OpKind.DomProperty,
+ OpKind.Attribute
+]);
+function orderOps(job) {
+ for (const unit of job.units) {
+ orderWithin(unit.create, CREATE_ORDERING);
+ const ordering = unit.job.kind === CompilationJobKind.Host ? UPDATE_HOST_ORDERING : UPDATE_ORDERING;
+ orderWithin(unit.update, ordering);
+ }
+}
+function orderWithin(opList, ordering) {
+ let opsToOrder = [];
+ let firstTargetInGroup = null;
+ for (const op of opList) {
+ const currentTarget = hasDependsOnSlotContextTrait(op) ? op.target : null;
+ if (!handledOpKinds.has(op.kind) || currentTarget !== firstTargetInGroup && firstTargetInGroup !== null && currentTarget !== null) {
+ OpList.insertBefore(reorder(opsToOrder, ordering), op);
+ opsToOrder = [];
+ firstTargetInGroup = null;
+ }
+ if (handledOpKinds.has(op.kind)) {
+ opsToOrder.push(op);
+ OpList.remove(op);
+ firstTargetInGroup = currentTarget ?? firstTargetInGroup;
+ }
+ }
+ opList.push(reorder(opsToOrder, ordering));
+}
+function reorder(ops, ordering) {
+ const groups = Array.from(ordering, () => new Array());
+ for (const op of ops) {
+ const groupIndex = ordering.findIndex((o) => o.test(op));
+ groups[groupIndex].push(op);
+ }
+ return groups.flatMap((group, i) => {
+ const transform2 = ordering[i].transform;
+ return transform2 ? transform2(group) : group;
+ });
+}
+function keepLast(ops) {
+ return ops.slice(ops.length - 1);
+}
+function removeContentSelectors(job) {
+ for (const unit of job.units) {
+ const elements = createOpXrefMap(unit);
+ for (const op of unit.ops()) {
+ switch (op.kind) {
+ case OpKind.Binding:
+ const target = lookupInXrefMap(elements, op.target);
+ if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) {
+ OpList.remove(op);
+ }
+ break;
+ }
+ }
+ }
+}
+function isSelectAttribute(name) {
+ return name.toLowerCase() === "select";
+}
+function lookupInXrefMap(map, xref) {
+ const el = map.get(xref);
+ if (el === void 0) {
+ throw new Error("All attributes should have an slottable target.");
+ }
+ return el;
+}
+function createPipes(job) {
+ for (const unit of job.units) {
+ processPipeBindingsInView(unit);
+ }
+}
+function processPipeBindingsInView(unit) {
+ for (const updateOp of unit.update) {
+ visitExpressionsInOp(updateOp, (expr, flags) => {
+ if (!isIrExpression(expr)) {
+ return;
+ }
+ if (expr.kind !== ExpressionKind.PipeBinding) {
+ return;
+ }
+ if (flags & VisitorContextFlag.InChildOperation) {
+ throw new Error(`AssertionError: pipe bindings should not appear in child expressions`);
+ }
+ if (unit.job.compatibility) {
+ const slotHandle = updateOp.target;
+ if (slotHandle == void 0) {
+ throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`);
+ }
+ addPipeToCreationBlock(unit, updateOp.target, expr);
+ } else {
+ unit.create.push(createPipeOp(expr.target, expr.targetSlot, expr.name));
+ }
+ });
+ }
+}
+function addPipeToCreationBlock(unit, afterTargetXref, binding) {
+ for (let op = unit.create.head.next; op.kind !== OpKind.ListEnd; op = op.next) {
+ if (!hasConsumesSlotTrait(op)) {
+ continue;
+ }
+ if (op.xref !== afterTargetXref) {
+ continue;
+ }
+ while (op.next.kind === OpKind.Pipe) {
+ op = op.next;
+ }
+ const pipe2 = createPipeOp(binding.target, binding.targetSlot, binding.name);
+ OpList.insertBefore(pipe2, op.next);
+ return;
+ }
+ throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
+}
+function createVariadicPipes(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ transformExpressionsInOp(op, (expr) => {
+ if (!(expr instanceof PipeBindingExpr)) {
+ return expr;
+ }
+ if (expr.args.length <= 4) {
+ return expr;
+ }
+ return new PipeBindingVariadicExpr(expr.target, expr.targetSlot, expr.name, literalArr(expr.args), expr.args.length);
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+function propagateI18nBlocks(job) {
+ propagateI18nBlocksToTemplates(job.root, 0);
+}
+function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
+ let i18nBlock = null;
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ op.subTemplateIndex = subTemplateIndex === 0 ? null : subTemplateIndex;
+ i18nBlock = op;
+ break;
+ case OpKind.I18nEnd:
+ if (i18nBlock.subTemplateIndex === null) {
+ subTemplateIndex = 0;
+ }
+ i18nBlock = null;
+ break;
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
+ break;
+ case OpKind.RepeaterCreate:
+ const forView = unit.job.views.get(op.xref);
+ subTemplateIndex = propagateI18nBlocksForView(forView, i18nBlock, op.i18nPlaceholder, subTemplateIndex);
+ if (op.emptyView !== null) {
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
+ }
+ break;
+ }
+ }
+ return subTemplateIndex;
+}
+function propagateI18nBlocksForView(view, i18nBlock, i18nPlaceholder, subTemplateIndex) {
+ if (i18nPlaceholder !== void 0) {
+ if (i18nBlock === null) {
+ throw Error("Expected template with i18n placeholder to be in an i18n block.");
+ }
+ subTemplateIndex++;
+ wrapTemplateWithI18n(view, i18nBlock);
+ }
+ return propagateI18nBlocksToTemplates(view, subTemplateIndex);
+}
+function wrapTemplateWithI18n(unit, parentI18n) {
+ if (unit.create.head.next?.kind !== OpKind.I18nStart) {
+ const id = unit.job.allocateXrefId();
+ OpList.insertAfter(
+ // Nested ng-template i18n start/end ops should not receive source spans.
+ createI18nStartOp(id, parentI18n.message, parentI18n.root, null),
+ unit.create.head
+ );
+ OpList.insertBefore(createI18nEndOp(id, null), unit.create.tail);
+ }
+}
+function extractPureFunctions(job) {
+ for (const view of job.units) {
+ for (const op of view.ops()) {
+ visitExpressionsInOp(op, (expr) => {
+ if (!(expr instanceof PureFunctionExpr) || expr.body === null) {
+ return;
+ }
+ const constantDef = new PureFunctionConstant(expr.args.length);
+ expr.fn = job.pool.getSharedConstant(constantDef, expr.body);
+ expr.body = null;
+ });
+ }
+ }
+}
+var PureFunctionConstant = class extends GenericKeyFn {
+ numArgs;
+ constructor(numArgs) {
+ super();
+ this.numArgs = numArgs;
+ }
+ keyOf(expr) {
+ if (expr instanceof PureFunctionParameterExpr) {
+ return `param(${expr.index})`;
+ } else {
+ return super.keyOf(expr);
+ }
+ }
+ // TODO: Use the new pool method `getSharedFunctionReference`
+ toSharedConstantDeclaration(declName, keyExpr) {
+ const fnParams = [];
+ for (let idx = 0; idx < this.numArgs; idx++) {
+ fnParams.push(new FnParam("a" + idx));
+ }
+ const returnExpr = transformExpressionsInExpression(keyExpr, (expr) => {
+ if (!(expr instanceof PureFunctionParameterExpr)) {
+ return expr;
+ }
+ return variable("a" + expr.index);
+ }, VisitorContextFlag.None);
+ return new DeclareVarStmt(declName, new ArrowFunctionExpr(fnParams, returnExpr), void 0, StmtModifier.Final);
+ }
+};
+function generatePureLiteralStructures(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ transformExpressionsInOp(op, (expr, flags) => {
+ if (flags & VisitorContextFlag.InChildOperation) {
+ return expr;
+ }
+ if (expr instanceof LiteralArrayExpr) {
+ return transformLiteralArray(expr);
+ } else if (expr instanceof LiteralMapExpr) {
+ return transformLiteralMap(expr);
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+function transformLiteralArray(expr) {
+ const derivedEntries = [];
+ const nonConstantArgs = [];
+ for (const entry of expr.entries) {
+ if (entry.isConstant()) {
+ derivedEntries.push(entry);
+ } else {
+ const idx = nonConstantArgs.length;
+ nonConstantArgs.push(entry);
+ derivedEntries.push(new PureFunctionParameterExpr(idx));
+ }
+ }
+ return new PureFunctionExpr(literalArr(derivedEntries), nonConstantArgs);
+}
+function transformLiteralMap(expr) {
+ let derivedEntries = [];
+ const nonConstantArgs = [];
+ for (const entry of expr.entries) {
+ if (entry.value.isConstant()) {
+ derivedEntries.push(entry);
+ } else {
+ const idx = nonConstantArgs.length;
+ nonConstantArgs.push(entry.value);
+ derivedEntries.push(new LiteralMapEntry(entry.key, new PureFunctionParameterExpr(idx), entry.quoted));
+ }
+ }
+ return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
+}
+function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
+}
+function elementStart(slot, tag, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(Identifiers.elementStart, slot, tag, constIndex, localRefIndex, sourceSpan);
+}
+function elementOrContainerBase(instruction, slot, tag, constIndex, localRefIndex, sourceSpan) {
+ const args = [literal(slot)];
+ if (tag !== null) {
+ args.push(literal(tag));
+ }
+ if (localRefIndex !== null) {
+ args.push(
+ literal(constIndex),
+ // might be null, but that's okay.
+ literal(localRefIndex)
+ );
+ } else if (constIndex !== null) {
+ args.push(literal(constIndex));
+ }
+ return call(instruction, args, sourceSpan);
+}
+function templateBase(instruction, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
+ const args = [
+ literal(slot),
+ templateFnRef,
+ literal(decls),
+ literal(vars),
+ literal(tag),
+ literal(constIndex)
+ ];
+ if (localRefs !== null) {
+ args.push(literal(localRefs));
+ args.push(importExpr(Identifiers.templateRefExtractor));
+ }
+ while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
+ args.pop();
+ }
+ return call(instruction, args, sourceSpan);
+}
+function propertyBase(instruction, name, expression, sanitizer, sourceSpan) {
+ const args = [literal(name)];
+ if (expression instanceof Interpolation2) {
+ args.push(interpolationToExpression(expression, sourceSpan));
+ } else {
+ args.push(expression);
+ }
+ if (sanitizer !== null) {
+ args.push(sanitizer);
+ }
+ return call(instruction, args, sourceSpan);
+}
+function elementEnd(sourceSpan) {
+ return call(Identifiers.elementEnd, [], sourceSpan);
+}
+function elementContainerStart(slot, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(
+ Identifiers.elementContainerStart,
+ slot,
+ /* tag */
+ null,
+ constIndex,
+ localRefIndex,
+ sourceSpan
+ );
+}
+function elementContainer(slot, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(
+ Identifiers.elementContainer,
+ slot,
+ /* tag */
+ null,
+ constIndex,
+ localRefIndex,
+ sourceSpan
+ );
+}
+function elementContainerEnd() {
+ return call(Identifiers.elementContainerEnd, [], null);
+}
+function template(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
+ return templateBase(Identifiers.templateCreate, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan);
+}
+function disableBindings() {
+ return call(Identifiers.disableBindings, [], null);
+}
+function enableBindings() {
+ return call(Identifiers.enableBindings, [], null);
+}
+function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpan) {
+ const args = [literal(name), handlerFn];
+ if (eventTargetResolver !== null) {
+ args.push(importExpr(eventTargetResolver));
+ }
+ return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan);
+}
+function twoWayBindingSet(target, value) {
+ return importExpr(Identifiers.twoWayBindingSet).callFn([target, value]);
+}
+function twoWayListener(name, handlerFn, sourceSpan) {
+ return call(Identifiers.twoWayListener, [literal(name), handlerFn], sourceSpan);
+}
+function pipe(slot, name) {
+ return call(Identifiers.pipe, [literal(slot), literal(name)], null);
+}
+function namespaceHTML() {
+ return call(Identifiers.namespaceHTML, [], null);
+}
+function namespaceSVG() {
+ return call(Identifiers.namespaceSVG, [], null);
+}
+function namespaceMath() {
+ return call(Identifiers.namespaceMathML, [], null);
+}
+function advance(delta, sourceSpan) {
+ return call(Identifiers.advance, delta > 1 ? [literal(delta)] : [], sourceSpan);
+}
+function reference(slot) {
+ return importExpr(Identifiers.reference).callFn([literal(slot)]);
+}
+function nextContext(steps) {
+ return importExpr(Identifiers.nextContext).callFn(steps === 1 ? [] : [literal(steps)]);
+}
+function getCurrentView() {
+ return importExpr(Identifiers.getCurrentView).callFn([]);
+}
+function restoreView(savedView) {
+ return importExpr(Identifiers.restoreView).callFn([savedView]);
+}
+function resetView(returnValue) {
+ return importExpr(Identifiers.resetView).callFn([returnValue]);
+}
+function text(slot, initialValue, sourceSpan) {
+ const args = [literal(slot, null)];
+ if (initialValue !== "") {
+ args.push(literal(initialValue));
+ }
+ return call(Identifiers.text, args, sourceSpan);
+}
+function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeholderSlot, errorSlot, loadingConfig, placeholderConfig, enableTimerScheduling, sourceSpan, flags) {
+ const args = [
+ literal(selfSlot),
+ literal(primarySlot),
+ dependencyResolverFn ?? literal(null),
+ literal(loadingSlot),
+ literal(placeholderSlot),
+ literal(errorSlot),
+ loadingConfig ?? literal(null),
+ placeholderConfig ?? literal(null),
+ enableTimerScheduling ? importExpr(Identifiers.deferEnableTimerScheduling) : literal(null),
+ literal(flags)
+ ];
+ let expr;
+ while ((expr = args[args.length - 1]) !== null && expr instanceof LiteralExpr && expr.value === null) {
+ args.pop();
+ }
+ return call(Identifiers.defer, args, sourceSpan);
+}
+var deferTriggerToR3TriggerInstructionsMap = /* @__PURE__ */ new Map([
+ [
+ DeferTriggerKind.Idle,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnIdle,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnIdle,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnIdle
+ }
+ ],
+ [
+ DeferTriggerKind.Immediate,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnImmediate,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnImmediate,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnImmediate
+ }
+ ],
+ [
+ DeferTriggerKind.Timer,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnTimer,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnTimer,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnTimer
+ }
+ ],
+ [
+ DeferTriggerKind.Hover,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnHover,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnHover,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnHover
+ }
+ ],
+ [
+ DeferTriggerKind.Interaction,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnInteraction,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnInteraction,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnInteraction
+ }
+ ],
+ [
+ DeferTriggerKind.Viewport,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferOnViewport,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferPrefetchOnViewport,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateOnViewport
+ }
+ ],
+ [
+ DeferTriggerKind.Never,
+ {
+ [
+ "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ]: Identifiers.deferHydrateNever,
+ [
+ "prefetch"
+ /* ir.DeferOpModifierKind.PREFETCH */
+ ]: Identifiers.deferHydrateNever,
+ [
+ "hydrate"
+ /* ir.DeferOpModifierKind.HYDRATE */
+ ]: Identifiers.deferHydrateNever
+ }
+ ]
+]);
+function deferOn(trigger, args, modifier, sourceSpan) {
+ const instructionToCall = deferTriggerToR3TriggerInstructionsMap.get(trigger)?.[modifier];
+ if (instructionToCall === void 0) {
+ throw new Error(`Unable to determine instruction for trigger ${trigger}`);
+ }
+ return call(instructionToCall, args.map((a) => literal(a)), sourceSpan);
+}
+function projectionDef(def) {
+ return call(Identifiers.projectionDef, def ? [def] : [], null);
+}
+function projection(slot, projectionSlotIndex, attributes, fallbackFnName, fallbackDecls, fallbackVars, sourceSpan) {
+ const args = [literal(slot)];
+ if (projectionSlotIndex !== 0 || attributes !== null || fallbackFnName !== null) {
+ args.push(literal(projectionSlotIndex));
+ if (attributes !== null) {
+ args.push(attributes);
+ }
+ if (fallbackFnName !== null) {
+ if (attributes === null) {
+ args.push(literal(null));
+ }
+ args.push(variable(fallbackFnName), literal(fallbackDecls), literal(fallbackVars));
+ }
+ }
+ return call(Identifiers.projection, args, sourceSpan);
+}
+function i18nStart(slot, constIndex, subTemplateIndex, sourceSpan) {
+ const args = [literal(slot), literal(constIndex)];
+ if (subTemplateIndex !== null) {
+ args.push(literal(subTemplateIndex));
+ }
+ return call(Identifiers.i18nStart, args, sourceSpan);
+}
+function conditionalCreate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
+ const args = [
+ literal(slot),
+ templateFnRef,
+ literal(decls),
+ literal(vars),
+ literal(tag),
+ literal(constIndex)
+ ];
+ if (localRefs !== null) {
+ args.push(literal(localRefs));
+ args.push(importExpr(Identifiers.templateRefExtractor));
+ }
+ while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
+ args.pop();
+ }
+ return call(Identifiers.conditionalCreate, args, sourceSpan);
+}
+function conditionalBranchCreate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
+ const args = [
+ literal(slot),
+ templateFnRef,
+ literal(decls),
+ literal(vars),
+ literal(tag),
+ literal(constIndex)
+ ];
+ if (localRefs !== null) {
+ args.push(literal(localRefs));
+ args.push(importExpr(Identifiers.templateRefExtractor));
+ }
+ while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
+ args.pop();
+ }
+ return call(Identifiers.conditionalBranchCreate, args, sourceSpan);
+}
+function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, emptyTag, emptyConstIndex, sourceSpan) {
+ const args = [
+ literal(slot),
+ variable(viewFnName),
+ literal(decls),
+ literal(vars),
+ literal(tag),
+ literal(constIndex),
+ trackByFn
+ ];
+ if (trackByUsesComponentInstance || emptyViewFnName !== null) {
+ args.push(literal(trackByUsesComponentInstance));
+ if (emptyViewFnName !== null) {
+ args.push(variable(emptyViewFnName), literal(emptyDecls), literal(emptyVars));
+ if (emptyTag !== null || emptyConstIndex !== null) {
+ args.push(literal(emptyTag));
+ }
+ if (emptyConstIndex !== null) {
+ args.push(literal(emptyConstIndex));
+ }
+ }
+ }
+ return call(Identifiers.repeaterCreate, args, sourceSpan);
+}
+function repeater(collection, sourceSpan) {
+ return call(Identifiers.repeater, [collection], sourceSpan);
+}
+function deferWhen(modifier, expr, sourceSpan) {
+ if (modifier === "prefetch") {
+ return call(Identifiers.deferPrefetchWhen, [expr], sourceSpan);
+ } else if (modifier === "hydrate") {
+ return call(Identifiers.deferHydrateWhen, [expr], sourceSpan);
+ }
+ return call(Identifiers.deferWhen, [expr], sourceSpan);
+}
+function declareLet(slot, sourceSpan) {
+ return call(Identifiers.declareLet, [literal(slot)], sourceSpan);
+}
+function storeLet(value, sourceSpan) {
+ return importExpr(Identifiers.storeLet).callFn([value], sourceSpan);
+}
+function readContextLet(slot) {
+ return importExpr(Identifiers.readContextLet).callFn([literal(slot)]);
+}
+function i18n(slot, constIndex, subTemplateIndex, sourceSpan) {
+ const args = [literal(slot), literal(constIndex)];
+ if (subTemplateIndex) {
+ args.push(literal(subTemplateIndex));
+ }
+ return call(Identifiers.i18n, args, sourceSpan);
+}
+function i18nEnd(endSourceSpan) {
+ return call(Identifiers.i18nEnd, [], endSourceSpan);
+}
+function i18nAttributes(slot, i18nAttributesConfig) {
+ const args = [literal(slot), literal(i18nAttributesConfig)];
+ return call(Identifiers.i18nAttributes, args, null);
+}
+function property(name, expression, sanitizer, sourceSpan) {
+ return propertyBase(Identifiers.property, name, expression, sanitizer, sourceSpan);
+}
+function twoWayProperty(name, expression, sanitizer, sourceSpan) {
+ const args = [literal(name), expression];
+ if (sanitizer !== null) {
+ args.push(sanitizer);
+ }
+ return call(Identifiers.twoWayProperty, args, sourceSpan);
+}
+function attribute(name, expression, sanitizer, namespace, sourceSpan) {
+ const args = [literal(name)];
+ if (expression instanceof Interpolation2) {
+ args.push(interpolationToExpression(expression, sourceSpan));
+ } else {
+ args.push(expression);
+ }
+ if (sanitizer !== null || namespace !== null) {
+ args.push(sanitizer ?? literal(null));
+ }
+ if (namespace !== null) {
+ args.push(literal(namespace));
+ }
+ return call(Identifiers.attribute, args, null);
+}
+function styleProp(name, expression, unit, sourceSpan) {
+ const args = [literal(name)];
+ if (expression instanceof Interpolation2) {
+ args.push(interpolationToExpression(expression, sourceSpan));
+ } else {
+ args.push(expression);
+ }
+ if (unit !== null) {
+ args.push(literal(unit));
+ }
+ return call(Identifiers.styleProp, args, sourceSpan);
+}
+function classProp(name, expression, sourceSpan) {
+ return call(Identifiers.classProp, [literal(name), expression], sourceSpan);
+}
+function styleMap(expression, sourceSpan) {
+ const value = expression instanceof Interpolation2 ? interpolationToExpression(expression, sourceSpan) : expression;
+ return call(Identifiers.styleMap, [value], sourceSpan);
+}
+function classMap(expression, sourceSpan) {
+ const value = expression instanceof Interpolation2 ? interpolationToExpression(expression, sourceSpan) : expression;
+ return call(Identifiers.classMap, [value], sourceSpan);
+}
+function domElement(slot, tag, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(Identifiers.domElement, slot, tag, constIndex, localRefIndex, sourceSpan);
+}
+function domElementStart(slot, tag, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(Identifiers.domElementStart, slot, tag, constIndex, localRefIndex, sourceSpan);
+}
+function domElementEnd(sourceSpan) {
+ return call(Identifiers.domElementEnd, [], sourceSpan);
+}
+function domElementContainerStart(slot, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(
+ Identifiers.domElementContainerStart,
+ slot,
+ /* tag */
+ null,
+ constIndex,
+ localRefIndex,
+ sourceSpan
+ );
+}
+function domElementContainer(slot, constIndex, localRefIndex, sourceSpan) {
+ return elementOrContainerBase(
+ Identifiers.domElementContainer,
+ slot,
+ /* tag */
+ null,
+ constIndex,
+ localRefIndex,
+ sourceSpan
+ );
+}
+function domElementContainerEnd() {
+ return call(Identifiers.domElementContainerEnd, [], null);
+}
+function domListener(name, handlerFn, eventTargetResolver, sourceSpan) {
+ const args = [literal(name), handlerFn];
+ if (eventTargetResolver !== null) {
+ args.push(importExpr(eventTargetResolver));
+ }
+ return call(Identifiers.domListener, args, sourceSpan);
+}
+function domTemplate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
+ return templateBase(Identifiers.domTemplate, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan);
+}
+var PIPE_BINDINGS = [
+ Identifiers.pipeBind1,
+ Identifiers.pipeBind2,
+ Identifiers.pipeBind3,
+ Identifiers.pipeBind4
+];
+function pipeBind(slot, varOffset, args) {
+ if (args.length < 1 || args.length > PIPE_BINDINGS.length) {
+ throw new Error(`pipeBind() argument count out of bounds`);
+ }
+ const instruction = PIPE_BINDINGS[args.length - 1];
+ return importExpr(instruction).callFn([literal(slot), literal(varOffset), ...args]);
+}
+function pipeBindV(slot, varOffset, args) {
+ return importExpr(Identifiers.pipeBindV).callFn([literal(slot), literal(varOffset), args]);
+}
+function textInterpolate(strings, expressions, sourceSpan) {
+ const interpolationArgs = collateInterpolationArgs(strings, expressions);
+ return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
+}
+function i18nExp(expr, sourceSpan) {
+ return call(Identifiers.i18nExp, [expr], sourceSpan);
+}
+function i18nApply(slot, sourceSpan) {
+ return call(Identifiers.i18nApply, [literal(slot)], sourceSpan);
+}
+function domProperty(name, expression, sanitizer, sourceSpan) {
+ return propertyBase(Identifiers.domProperty, name, expression, sanitizer, sourceSpan);
+}
+function syntheticHostProperty(name, expression, sourceSpan) {
+ return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan);
+}
+function pureFunction(varOffset, fn2, args) {
+ return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args, [], null);
+}
+function attachSourceLocation(templatePath, locations) {
+ return call(Identifiers.attachSourceLocations, [literal(templatePath), locations], null);
+}
+function collateInterpolationArgs(strings, expressions) {
+ if (strings.length < 1 || expressions.length !== strings.length - 1) {
+ throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
+ }
+ const interpolationArgs = [];
+ if (expressions.length === 1 && strings[0] === "" && strings[1] === "") {
+ interpolationArgs.push(expressions[0]);
+ } else {
+ let idx;
+ for (idx = 0; idx < expressions.length; idx++) {
+ interpolationArgs.push(literal(strings[idx]), expressions[idx]);
+ }
+ interpolationArgs.push(literal(strings[idx]));
+ }
+ return interpolationArgs;
+}
+function interpolationToExpression(interpolation, sourceSpan) {
+ const interpolationArgs = collateInterpolationArgs(interpolation.strings, interpolation.expressions);
+ return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
+}
+function call(instruction, args, sourceSpan) {
+ const expr = importExpr(instruction).callFn(args, sourceSpan);
+ return createStatementOp(new ExpressionStatement(expr, sourceSpan));
+}
+function conditional(condition, contextValue, sourceSpan) {
+ const args = [condition];
+ if (contextValue !== null) {
+ args.push(contextValue);
+ }
+ return call(Identifiers.conditional, args, sourceSpan);
+}
+var TEXT_INTERPOLATE_CONFIG = {
+ constant: [
+ Identifiers.textInterpolate,
+ Identifiers.textInterpolate1,
+ Identifiers.textInterpolate2,
+ Identifiers.textInterpolate3,
+ Identifiers.textInterpolate4,
+ Identifiers.textInterpolate5,
+ Identifiers.textInterpolate6,
+ Identifiers.textInterpolate7,
+ Identifiers.textInterpolate8
+ ],
+ variable: Identifiers.textInterpolateV,
+ mapping: (n) => {
+ if (n % 2 === 0) {
+ throw new Error(`Expected odd number of arguments`);
+ }
+ return (n - 1) / 2;
+ }
+};
+var VALUE_INTERPOLATE_CONFIG = {
+ constant: [
+ Identifiers.interpolate,
+ Identifiers.interpolate1,
+ Identifiers.interpolate2,
+ Identifiers.interpolate3,
+ Identifiers.interpolate4,
+ Identifiers.interpolate5,
+ Identifiers.interpolate6,
+ Identifiers.interpolate7,
+ Identifiers.interpolate8
+ ],
+ variable: Identifiers.interpolateV,
+ mapping: (n) => {
+ if (n % 2 === 0) {
+ throw new Error(`Expected odd number of arguments`);
+ }
+ return (n - 1) / 2;
+ }
+};
+var PURE_FUNCTION_CONFIG = {
+ constant: [
+ Identifiers.pureFunction0,
+ Identifiers.pureFunction1,
+ Identifiers.pureFunction2,
+ Identifiers.pureFunction3,
+ Identifiers.pureFunction4,
+ Identifiers.pureFunction5,
+ Identifiers.pureFunction6,
+ Identifiers.pureFunction7,
+ Identifiers.pureFunction8
+ ],
+ variable: Identifiers.pureFunctionV,
+ mapping: (n) => n
+};
+function callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan) {
+ const n = config.mapping(interpolationArgs.length);
+ const lastInterpolationArg = interpolationArgs.at(-1);
+ if (extraArgs.length === 0 && interpolationArgs.length > 1 && lastInterpolationArg instanceof LiteralExpr && lastInterpolationArg.value === "") {
+ interpolationArgs.pop();
+ }
+ if (n < config.constant.length) {
+ return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs, ...extraArgs], sourceSpan);
+ } else if (config.variable !== null) {
+ return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs), ...extraArgs], sourceSpan);
+ } else {
+ throw new Error(`AssertionError: unable to call variadic function`);
+ }
+}
+function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs, sourceSpan) {
+ return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
+}
+var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([
+ ["window", Identifiers.resolveWindow],
+ ["document", Identifiers.resolveDocument],
+ ["body", Identifiers.resolveBody]
+]);
+var DOM_PROPERTY_REMAPPING = /* @__PURE__ */ new Map([
+ ["class", "className"],
+ ["for", "htmlFor"],
+ ["formaction", "formAction"],
+ ["innerHtml", "innerHTML"],
+ ["readonly", "readOnly"],
+ ["tabindex", "tabIndex"]
+]);
+function reify(job) {
+ for (const unit of job.units) {
+ reifyCreateOperations(unit, unit.create);
+ reifyUpdateOperations(unit, unit.update);
+ }
+}
+function reifyCreateOperations(unit, ops) {
+ for (const op of ops) {
+ transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
+ switch (op.kind) {
+ case OpKind.Text:
+ OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
+ break;
+ case OpKind.ElementStart:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan) : elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
+ break;
+ case OpKind.Element:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElement(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan) : element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan));
+ break;
+ case OpKind.ElementEnd:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElementEnd(op.sourceSpan) : elementEnd(op.sourceSpan));
+ break;
+ case OpKind.ContainerStart:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan) : elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan));
+ break;
+ case OpKind.Container:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan) : elementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan));
+ break;
+ case OpKind.ContainerEnd:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly ? domElementContainerEnd() : elementContainerEnd());
+ break;
+ case OpKind.I18nStart:
+ OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
+ break;
+ case OpKind.I18nEnd:
+ OpList.replace(op, i18nEnd(op.sourceSpan));
+ break;
+ case OpKind.I18n:
+ OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
+ break;
+ case OpKind.I18nAttributes:
+ if (op.i18nAttributesConfig === null) {
+ throw new Error(`AssertionError: i18nAttributesConfig was not set`);
+ }
+ OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig));
+ break;
+ case OpKind.Template:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ if (Array.isArray(op.localRefs)) {
+ throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
+ }
+ const childView = unit.job.views.get(op.xref);
+ OpList.replace(
+ op,
+ // Block templates can't have directives so we can always generate them as DOM-only.
+ op.templateKind === TemplateKind.Block || unit.job.mode === TemplateCompilationMode.DomOnly ? domTemplate(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan) : template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan)
+ );
+ break;
+ case OpKind.DisableBindings:
+ OpList.replace(op, disableBindings());
+ break;
+ case OpKind.EnableBindings:
+ OpList.replace(op, enableBindings());
+ break;
+ case OpKind.Pipe:
+ OpList.replace(op, pipe(op.handle.slot, op.name));
+ break;
+ case OpKind.DeclareLet:
+ OpList.replace(op, declareLet(op.handle.slot, op.sourceSpan));
+ break;
+ case OpKind.Listener:
+ const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
+ const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
+ if (eventTargetResolver === void 0) {
+ throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`);
+ }
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly && !op.hostListener && !op.isLegacyAnimationListener ? domListener(op.name, listenerFn, eventTargetResolver, op.sourceSpan) : listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isLegacyAnimationListener, op.sourceSpan));
+ break;
+ case OpKind.TwoWayListener:
+ OpList.replace(op, twoWayListener(op.name, reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, true), op.sourceSpan));
+ break;
+ case OpKind.Variable:
+ if (op.variable.name === null) {
+ throw new Error(`AssertionError: unnamed variable ${op.xref}`);
+ }
+ OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, void 0, StmtModifier.Final)));
+ break;
+ case OpKind.Namespace:
+ switch (op.active) {
+ case Namespace.HTML:
+ OpList.replace(op, namespaceHTML());
+ break;
+ case Namespace.SVG:
+ OpList.replace(op, namespaceSVG());
+ break;
+ case Namespace.Math:
+ OpList.replace(op, namespaceMath());
+ break;
+ }
+ break;
+ case OpKind.Defer:
+ const timerScheduling = !!op.loadingMinimumTime || !!op.loadingAfterTime || !!op.placeholderMinimumTime;
+ OpList.replace(op, defer(op.handle.slot, op.mainSlot.slot, op.resolverFn, op.loadingSlot?.slot ?? null, op.placeholderSlot?.slot ?? null, op.errorSlot?.slot ?? null, op.loadingConfig, op.placeholderConfig, timerScheduling, op.sourceSpan, op.flags));
+ break;
+ case OpKind.DeferOn:
+ let args = [];
+ switch (op.trigger.kind) {
+ case DeferTriggerKind.Never:
+ case DeferTriggerKind.Idle:
+ case DeferTriggerKind.Immediate:
+ break;
+ case DeferTriggerKind.Timer:
+ args = [op.trigger.delay];
+ break;
+ case DeferTriggerKind.Interaction:
+ case DeferTriggerKind.Hover:
+ case DeferTriggerKind.Viewport:
+ if (op.modifier === "hydrate") {
+ args = [];
+ } else {
+ args = [op.trigger.targetSlot?.slot ?? null];
+ if (op.trigger.targetSlotViewSteps !== 0) {
+ args.push(op.trigger.targetSlotViewSteps);
+ }
+ }
+ break;
+ default:
+ throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${op.trigger.kind}`);
+ }
+ OpList.replace(op, deferOn(op.trigger.kind, args, op.modifier, op.sourceSpan));
+ break;
+ case OpKind.ProjectionDef:
+ OpList.replace(op, projectionDef(op.def));
+ break;
+ case OpKind.Projection:
+ if (op.handle.slot === null) {
+ throw new Error("No slot was assigned for project instruction");
+ }
+ let fallbackViewFnName = null;
+ let fallbackDecls = null;
+ let fallbackVars = null;
+ if (op.fallbackView !== null) {
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ const fallbackView = unit.job.views.get(op.fallbackView);
+ if (fallbackView === void 0) {
+ throw new Error("AssertionError: projection had fallback view xref, but fallback view was not found");
+ }
+ if (fallbackView.fnName === null || fallbackView.decls === null || fallbackView.vars === null) {
+ throw new Error(`AssertionError: expected projection fallback view to have been named and counted`);
+ }
+ fallbackViewFnName = fallbackView.fnName;
+ fallbackDecls = fallbackView.decls;
+ fallbackVars = fallbackView.vars;
+ }
+ OpList.replace(op, projection(op.handle.slot, op.projectionSlotIndex, op.attributes, fallbackViewFnName, fallbackDecls, fallbackVars, op.sourceSpan));
+ break;
+ case OpKind.ConditionalCreate:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ if (Array.isArray(op.localRefs)) {
+ throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
+ }
+ const conditionalCreateChildView = unit.job.views.get(op.xref);
+ OpList.replace(op, conditionalCreate(op.handle.slot, variable(conditionalCreateChildView.fnName), conditionalCreateChildView.decls, conditionalCreateChildView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
+ break;
+ case OpKind.ConditionalBranchCreate:
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ if (Array.isArray(op.localRefs)) {
+ throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
+ }
+ const conditionalBranchCreateChildView = unit.job.views.get(op.xref);
+ OpList.replace(op, conditionalBranchCreate(op.handle.slot, variable(conditionalBranchCreateChildView.fnName), conditionalBranchCreateChildView.decls, conditionalBranchCreateChildView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
+ break;
+ case OpKind.RepeaterCreate:
+ if (op.handle.slot === null) {
+ throw new Error("No slot was assigned for repeater instruction");
+ }
+ if (!(unit instanceof ViewCompilationUnit)) {
+ throw new Error(`AssertionError: must be compiling a component`);
+ }
+ const repeaterView = unit.job.views.get(op.xref);
+ if (repeaterView.fnName === null) {
+ throw new Error(`AssertionError: expected repeater primary view to have been named`);
+ }
+ let emptyViewFnName = null;
+ let emptyDecls = null;
+ let emptyVars = null;
+ if (op.emptyView !== null) {
+ const emptyView = unit.job.views.get(op.emptyView);
+ if (emptyView === void 0) {
+ throw new Error("AssertionError: repeater had empty view xref, but empty view was not found");
+ }
+ if (emptyView.fnName === null || emptyView.decls === null || emptyView.vars === null) {
+ throw new Error(`AssertionError: expected repeater empty view to have been named and counted`);
+ }
+ emptyViewFnName = emptyView.fnName;
+ emptyDecls = emptyView.decls;
+ emptyVars = emptyView.vars;
+ }
+ OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, reifyTrackBy(unit, op), op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
+ break;
+ case OpKind.SourceLocation:
+ const locationsLiteral = literalArr(op.locations.map(({ targetSlot, offset, line, column }) => {
+ if (targetSlot.slot === null) {
+ throw new Error("No slot was assigned for source location");
+ }
+ return literalArr([
+ literal(targetSlot.slot),
+ literal(offset),
+ literal(line),
+ literal(column)
+ ]);
+ }));
+ OpList.replace(op, attachSourceLocation(op.templatePath, locationsLiteral));
+ break;
+ case OpKind.Statement:
+ break;
+ default:
+ throw new Error(`AssertionError: Unsupported reification of create op ${OpKind[op.kind]}`);
+ }
+ }
+}
+function reifyUpdateOperations(unit, ops) {
+ for (const op of ops) {
+ transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
+ switch (op.kind) {
+ case OpKind.Advance:
+ OpList.replace(op, advance(op.delta, op.sourceSpan));
+ break;
+ case OpKind.Property:
+ OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly && !op.isLegacyAnimationTrigger ? domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan) : property(op.name, op.expression, op.sanitizer, op.sourceSpan));
+ break;
+ case OpKind.TwoWayProperty:
+ OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
+ break;
+ case OpKind.StyleProp:
+ OpList.replace(op, styleProp(op.name, op.expression, op.unit, op.sourceSpan));
+ break;
+ case OpKind.ClassProp:
+ OpList.replace(op, classProp(op.name, op.expression, op.sourceSpan));
+ break;
+ case OpKind.StyleMap:
+ OpList.replace(op, styleMap(op.expression, op.sourceSpan));
+ break;
+ case OpKind.ClassMap:
+ OpList.replace(op, classMap(op.expression, op.sourceSpan));
+ break;
+ case OpKind.I18nExpression:
+ OpList.replace(op, i18nExp(op.expression, op.sourceSpan));
+ break;
+ case OpKind.I18nApply:
+ OpList.replace(op, i18nApply(op.handle.slot, op.sourceSpan));
+ break;
+ case OpKind.InterpolateText:
+ OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan));
+ break;
+ case OpKind.Attribute:
+ OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace, op.sourceSpan));
+ break;
+ case OpKind.DomProperty:
+ if (op.expression instanceof Interpolation2) {
+ throw new Error("not yet handled");
+ } else {
+ if (op.isLegacyAnimationTrigger) {
+ OpList.replace(op, syntheticHostProperty(op.name, op.expression, op.sourceSpan));
+ } else {
+ OpList.replace(op, domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan));
+ }
+ }
+ break;
+ case OpKind.Variable:
+ if (op.variable.name === null) {
+ throw new Error(`AssertionError: unnamed variable ${op.xref}`);
+ }
+ OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, void 0, StmtModifier.Final)));
+ break;
+ case OpKind.Conditional:
+ if (op.processed === null) {
+ throw new Error(`Conditional test was not set.`);
+ }
+ OpList.replace(op, conditional(op.processed, op.contextValue, op.sourceSpan));
+ break;
+ case OpKind.Repeater:
+ OpList.replace(op, repeater(op.collection, op.sourceSpan));
+ break;
+ case OpKind.DeferWhen:
+ OpList.replace(op, deferWhen(op.modifier, op.expr, op.sourceSpan));
+ break;
+ case OpKind.StoreLet:
+ throw new Error(`AssertionError: unexpected storeLet ${op.declaredName}`);
+ case OpKind.Statement:
+ break;
+ default:
+ throw new Error(`AssertionError: Unsupported reification of update op ${OpKind[op.kind]}`);
+ }
+ }
+}
+function reifyIrExpression(expr) {
+ if (!isIrExpression(expr)) {
+ return expr;
+ }
+ switch (expr.kind) {
+ case ExpressionKind.NextContext:
+ return nextContext(expr.steps);
+ case ExpressionKind.Reference:
+ return reference(expr.targetSlot.slot + 1 + expr.offset);
+ case ExpressionKind.LexicalRead:
+ throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);
+ case ExpressionKind.TwoWayBindingSet:
+ throw new Error(`AssertionError: unresolved TwoWayBindingSet`);
+ case ExpressionKind.RestoreView:
+ if (typeof expr.view === "number") {
+ throw new Error(`AssertionError: unresolved RestoreView`);
+ }
+ return restoreView(expr.view);
+ case ExpressionKind.ResetView:
+ return resetView(expr.expr);
+ case ExpressionKind.GetCurrentView:
+ return getCurrentView();
+ case ExpressionKind.ReadVariable:
+ if (expr.name === null) {
+ throw new Error(`Read of unnamed variable ${expr.xref}`);
+ }
+ return variable(expr.name);
+ case ExpressionKind.ReadTemporaryExpr:
+ if (expr.name === null) {
+ throw new Error(`Read of unnamed temporary ${expr.xref}`);
+ }
+ return variable(expr.name);
+ case ExpressionKind.AssignTemporaryExpr:
+ if (expr.name === null) {
+ throw new Error(`Assign of unnamed temporary ${expr.xref}`);
+ }
+ return variable(expr.name).set(expr.expr);
+ case ExpressionKind.PureFunctionExpr:
+ if (expr.fn === null) {
+ throw new Error(`AssertionError: expected PureFunctions to have been extracted`);
+ }
+ return pureFunction(expr.varOffset, expr.fn, expr.args);
+ case ExpressionKind.PureFunctionParameterExpr:
+ throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);
+ case ExpressionKind.PipeBinding:
+ return pipeBind(expr.targetSlot.slot, expr.varOffset, expr.args);
+ case ExpressionKind.PipeBindingVariadic:
+ return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
+ case ExpressionKind.SlotLiteralExpr:
+ return literal(expr.slot.slot);
+ case ExpressionKind.ContextLetReference:
+ return readContextLet(expr.targetSlot.slot);
+ case ExpressionKind.StoreLet:
+ return storeLet(expr.value, expr.sourceSpan);
+ case ExpressionKind.TrackContext:
+ return variable("this");
+ default:
+ throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
+ }
+}
+function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
+ reifyUpdateOperations(unit, handlerOps);
+ const handlerStmts = [];
+ for (const op of handlerOps) {
+ if (op.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[op.kind]}`);
+ }
+ handlerStmts.push(op.statement);
+ }
+ const params = [];
+ if (consumesDollarEvent) {
+ params.push(new FnParam("$event"));
+ }
+ return fn(params, handlerStmts, void 0, void 0, name);
+}
+function reifyTrackBy(unit, op) {
+ if (op.trackByFn !== null) {
+ return op.trackByFn;
+ }
+ const params = [new FnParam("$index"), new FnParam("$item")];
+ let fn$1;
+ if (op.trackByOps === null) {
+ fn$1 = op.usesComponentInstance ? fn(params, [new ReturnStatement(op.track)]) : arrowFn(params, op.track);
+ } else {
+ reifyUpdateOperations(unit, op.trackByOps);
+ const statements = [];
+ for (const trackOp of op.trackByOps) {
+ if (trackOp.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[trackOp.kind]}`);
+ }
+ statements.push(trackOp.statement);
+ }
+ fn$1 = op.usesComponentInstance || statements.length !== 1 || !(statements[0] instanceof ReturnStatement) ? fn(params, statements) : arrowFn(params, statements[0].value);
+ }
+ op.trackByFn = unit.job.pool.getSharedFunctionReference(fn$1, "_forTrack");
+ return op.trackByFn;
+}
+function removeEmptyBindings(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ switch (op.kind) {
+ case OpKind.Attribute:
+ case OpKind.Binding:
+ case OpKind.ClassProp:
+ case OpKind.ClassMap:
+ case OpKind.Property:
+ case OpKind.StyleProp:
+ case OpKind.StyleMap:
+ if (op.expression instanceof EmptyExpr2) {
+ OpList.remove(op);
+ }
+ break;
+ }
+ }
+ }
+}
+function removeI18nContexts(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nContext:
+ OpList.remove(op);
+ break;
+ case OpKind.I18nStart:
+ op.context = null;
+ break;
+ }
+ }
+ }
+}
+function removeIllegalLetReferences(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) {
+ continue;
+ }
+ const name = op.variable.identifier;
+ let current = op;
+ while (current && current.kind !== OpKind.ListEnd) {
+ transformExpressionsInOp(current, (expr) => expr instanceof LexicalReadExpr && expr.name === name ? literal(void 0) : expr, VisitorContextFlag.None);
+ current = current.prev;
+ }
+ }
+ }
+}
+function removeUnusedI18nAttributesOps(job) {
+ for (const unit of job.units) {
+ const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
+ for (const op of unit.update) {
+ switch (op.kind) {
+ case OpKind.I18nExpression:
+ ownersWithI18nExpressions.add(op.i18nOwner);
+ }
+ }
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nAttributes:
+ if (ownersWithI18nExpressions.has(op.xref)) {
+ continue;
+ }
+ OpList.remove(op);
+ }
+ }
+ }
+}
+function resolveContexts(job) {
+ for (const unit of job.units) {
+ processLexicalScope$1(unit, unit.create);
+ processLexicalScope$1(unit, unit.update);
+ }
+}
+function processLexicalScope$1(view, ops) {
+ const scope = /* @__PURE__ */ new Map();
+ scope.set(view.xref, variable("ctx"));
+ for (const op of ops) {
+ switch (op.kind) {
+ case OpKind.Variable:
+ switch (op.variable.kind) {
+ case SemanticVariableKind.Context:
+ scope.set(op.variable.view, new ReadVariableExpr(op.xref));
+ break;
+ }
+ break;
+ case OpKind.Listener:
+ case OpKind.TwoWayListener:
+ processLexicalScope$1(view, op.handlerOps);
+ break;
+ case OpKind.RepeaterCreate:
+ if (op.trackByOps !== null) {
+ processLexicalScope$1(view, op.trackByOps);
+ }
+ break;
+ }
+ }
+ if (view === view.job.root) {
+ scope.set(view.xref, variable("ctx"));
+ }
+ for (const op of ops) {
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof ContextExpr) {
+ if (!scope.has(expr.view)) {
+ throw new Error(`No context found for reference to view ${expr.view} from view ${view.xref}`);
+ }
+ return scope.get(expr.view);
+ } else {
+ return expr;
+ }
+ }, VisitorContextFlag.None);
+ }
+}
+function resolveDeferDepsFns(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.Defer) {
+ if (op.resolverFn !== null) {
+ continue;
+ }
+ if (op.ownResolverFn !== null) {
+ if (op.handle.slot === null) {
+ throw new Error("AssertionError: slot must be assigned before extracting defer deps functions");
+ }
+ const fullPathName = unit.fnName?.replace("_Template", "");
+ op.resolverFn = job.pool.getSharedFunctionReference(
+ op.ownResolverFn,
+ `${fullPathName}_Defer_${op.handle.slot}_DepsFn`,
+ /* Don't use unique names for TDB compatibility */
+ false
+ );
+ }
+ }
+ }
+ }
+}
+function resolveDollarEvent(job) {
+ for (const unit of job.units) {
+ transformDollarEvent(unit.create);
+ transformDollarEvent(unit.update);
+ }
+}
+function transformDollarEvent(ops) {
+ for (const op of ops) {
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof LexicalReadExpr && expr.name === "$event") {
+ if (op.kind === OpKind.Listener) {
+ op.consumesDollarEvent = true;
+ }
+ return new ReadVarExpr(expr.name);
+ }
+ return expr;
+ }, VisitorContextFlag.InChildOperation);
+ }
+ }
+}
+function resolveI18nElementPlaceholders(job) {
+ const i18nContexts = /* @__PURE__ */ new Map();
+ const elements = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nContext:
+ i18nContexts.set(op.xref, op);
+ break;
+ case OpKind.ElementStart:
+ elements.set(op.xref, op);
+ break;
+ }
+ }
+ }
+ resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
+}
+function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) {
+ let currentOps = null;
+ let pendingStructuralDirectiveCloses = /* @__PURE__ */ new Map();
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ if (!op.context) {
+ throw Error("Could not find i18n context for i18n op");
+ }
+ currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
+ break;
+ case OpKind.I18nEnd:
+ currentOps = null;
+ break;
+ case OpKind.ElementStart:
+ if (op.i18nPlaceholder !== void 0) {
+ if (currentOps === null) {
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
+ }
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {
+ pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);
+ }
+ pendingStructuralDirective = void 0;
+ }
+ break;
+ case OpKind.ElementEnd:
+ const startOp = elements.get(op.xref);
+ if (startOp && startOp.i18nPlaceholder !== void 0) {
+ if (currentOps === null) {
+ throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");
+ }
+ recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref));
+ pendingStructuralDirectiveCloses.delete(op.xref);
+ }
+ break;
+ case OpKind.Projection:
+ if (op.i18nPlaceholder !== void 0) {
+ if (currentOps === null) {
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
+ }
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ pendingStructuralDirective = void 0;
+ }
+ break;
+ case OpKind.ConditionalCreate:
+ case OpKind.ConditionalBranchCreate:
+ case OpKind.Template:
+ const view = job.views.get(op.xref);
+ if (op.i18nPlaceholder === void 0) {
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
+ } else {
+ if (currentOps === null) {
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
+ }
+ if (op.templateKind === TemplateKind.Structural) {
+ resolvePlaceholdersForView(job, view, i18nContexts, elements, op);
+ } else {
+ recordTemplateStart(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
+ recordTemplateClose(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ pendingStructuralDirective = void 0;
+ }
+ }
+ break;
+ case OpKind.RepeaterCreate:
+ if (pendingStructuralDirective !== void 0) {
+ throw Error("AssertionError: Unexpected structural directive associated with @for block");
+ }
+ const forSlot = op.handle.slot + 1;
+ const forView = job.views.get(op.xref);
+ if (op.i18nPlaceholder === void 0) {
+ resolvePlaceholdersForView(job, forView, i18nContexts, elements);
+ } else {
+ if (currentOps === null) {
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
+ }
+ recordTemplateStart(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ resolvePlaceholdersForView(job, forView, i18nContexts, elements);
+ recordTemplateClose(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ pendingStructuralDirective = void 0;
+ }
+ if (op.emptyView !== null) {
+ const emptySlot = op.handle.slot + 2;
+ const emptyView = job.views.get(op.emptyView);
+ if (op.emptyI18nPlaceholder === void 0) {
+ resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
+ } else {
+ if (currentOps === null) {
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
+ }
+ recordTemplateStart(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
+ recordTemplateClose(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
+ pendingStructuralDirective = void 0;
+ }
+ }
+ break;
+ }
+ }
+}
+function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) {
+ const { startName, closeName } = op.i18nPlaceholder;
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
+ let value = op.handle.slot;
+ if (structuralDirective !== void 0) {
+ flags |= I18nParamValueFlags.TemplateTag;
+ value = { element: value, template: structuralDirective.handle.slot };
+ }
+ if (!closeName) {
+ flags |= I18nParamValueFlags.CloseTag;
+ }
+ addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);
+}
+function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
+ const { closeName } = op.i18nPlaceholder;
+ if (closeName) {
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag;
+ let value = op.handle.slot;
+ if (structuralDirective !== void 0) {
+ flags |= I18nParamValueFlags.TemplateTag;
+ value = { element: value, template: structuralDirective.handle.slot };
+ }
+ addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
+ }
+}
+function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
+ let { startName, closeName } = i18nPlaceholder;
+ let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
+ if (!closeName) {
+ flags |= I18nParamValueFlags.CloseTag;
+ }
+ if (structuralDirective !== void 0) {
+ addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
+ }
+ addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
+}
+function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
+ const { closeName } = i18nPlaceholder;
+ const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
+ if (closeName) {
+ addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
+ if (structuralDirective !== void 0) {
+ addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
+ }
+ }
+}
+function getSubTemplateIndexForTemplateTag(job, i18nOp, view) {
+ for (const childOp of view.create) {
+ if (childOp.kind === OpKind.I18nStart) {
+ return childOp.subTemplateIndex;
+ }
+ }
+ return i18nOp.subTemplateIndex;
+}
+function addParam(params, placeholder, value, subTemplateIndex, flags) {
+ const values = params.get(placeholder) ?? [];
+ values.push({ value, subTemplateIndex, flags });
+ params.set(placeholder, values);
+}
+function resolveI18nExpressionPlaceholders(job) {
+ const subTemplateIndices = /* @__PURE__ */ new Map();
+ const i18nContexts = /* @__PURE__ */ new Map();
+ const icuPlaceholders = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ subTemplateIndices.set(op.xref, op.subTemplateIndex);
+ break;
+ case OpKind.I18nContext:
+ i18nContexts.set(op.xref, op);
+ break;
+ case OpKind.IcuPlaceholder:
+ icuPlaceholders.set(op.xref, op);
+ break;
+ }
+ }
+ }
+ const expressionIndices = /* @__PURE__ */ new Map();
+ const referenceIndex = (op) => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context;
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ if (op.kind === OpKind.I18nExpression) {
+ const index = expressionIndices.get(referenceIndex(op)) || 0;
+ const subTemplateIndex = subTemplateIndices.get(op.i18nOwner) ?? null;
+ const value = {
+ value: index,
+ subTemplateIndex,
+ flags: I18nParamValueFlags.ExpressionIndex
+ };
+ updatePlaceholder(op, value, i18nContexts, icuPlaceholders);
+ expressionIndices.set(referenceIndex(op), index + 1);
+ }
+ }
+ }
+}
+function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) {
+ if (op.i18nPlaceholder !== null) {
+ const i18nContext = i18nContexts.get(op.context);
+ const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
+ const values = params.get(op.i18nPlaceholder) || [];
+ values.push(value);
+ params.set(op.i18nPlaceholder, values);
+ }
+ if (op.icuPlaceholder !== null) {
+ const icuPlaceholderOp = icuPlaceholders.get(op.icuPlaceholder);
+ icuPlaceholderOp?.expressionPlaceholders.push(value);
+ }
+}
+function resolveNames(job) {
+ for (const unit of job.units) {
+ processLexicalScope(unit, unit.create, null);
+ processLexicalScope(unit, unit.update, null);
+ }
+}
+function processLexicalScope(unit, ops, savedView) {
+ const scope = /* @__PURE__ */ new Map();
+ const localDefinitions = /* @__PURE__ */ new Map();
+ for (const op of ops) {
+ switch (op.kind) {
+ case OpKind.Variable:
+ switch (op.variable.kind) {
+ case SemanticVariableKind.Identifier:
+ if (op.variable.local) {
+ if (localDefinitions.has(op.variable.identifier)) {
+ continue;
+ }
+ localDefinitions.set(op.variable.identifier, op.xref);
+ } else if (scope.has(op.variable.identifier)) {
+ continue;
+ }
+ scope.set(op.variable.identifier, op.xref);
+ break;
+ case SemanticVariableKind.Alias:
+ if (scope.has(op.variable.identifier)) {
+ continue;
+ }
+ scope.set(op.variable.identifier, op.xref);
+ break;
+ case SemanticVariableKind.SavedView:
+ savedView = {
+ view: op.variable.view,
+ variable: op.xref
+ };
+ break;
+ }
+ break;
+ case OpKind.Listener:
+ case OpKind.TwoWayListener:
+ processLexicalScope(unit, op.handlerOps, savedView);
+ break;
+ case OpKind.RepeaterCreate:
+ if (op.trackByOps !== null) {
+ processLexicalScope(unit, op.trackByOps, savedView);
+ }
+ break;
+ }
+ }
+ for (const op of ops) {
+ if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ continue;
+ }
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof LexicalReadExpr) {
+ if (localDefinitions.has(expr.name)) {
+ return new ReadVariableExpr(localDefinitions.get(expr.name));
+ } else if (scope.has(expr.name)) {
+ return new ReadVariableExpr(scope.get(expr.name));
+ } else {
+ return new ReadPropExpr(new ContextExpr(unit.job.root.xref), expr.name);
+ }
+ } else if (expr instanceof RestoreViewExpr && typeof expr.view === "number") {
+ if (savedView === null || savedView.view !== expr.view) {
+ throw new Error(`AssertionError: no saved view ${expr.view} from view ${unit.xref}`);
+ }
+ expr.view = new ReadVariableExpr(savedView.variable);
+ return expr;
+ } else {
+ return expr;
+ }
+ }, VisitorContextFlag.None);
+ }
+ for (const op of ops) {
+ visitExpressionsInOp(op, (expr) => {
+ if (expr instanceof LexicalReadExpr) {
+ throw new Error(`AssertionError: no lexical reads should remain, but found read of ${expr.name}`);
+ }
+ });
+ }
+}
+var sanitizerFns = /* @__PURE__ */ new Map([
+ [SecurityContext.HTML, Identifiers.sanitizeHtml],
+ [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl],
+ [SecurityContext.SCRIPT, Identifiers.sanitizeScript],
+ [SecurityContext.STYLE, Identifiers.sanitizeStyle],
+ [SecurityContext.URL, Identifiers.sanitizeUrl]
+]);
+var trustedValueFns = /* @__PURE__ */ new Map([
+ [SecurityContext.HTML, Identifiers.trustConstantHtml],
+ [SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl]
+]);
+function resolveSanitizers(job) {
+ for (const unit of job.units) {
+ const elements = createOpXrefMap(unit);
+ if (job.kind !== CompilationJobKind.Host) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.ExtractedAttribute) {
+ const trustedValueFn = trustedValueFns.get(getOnlySecurityContext(op.securityContext)) ?? null;
+ op.trustedValueFn = trustedValueFn !== null ? importExpr(trustedValueFn) : null;
+ }
+ }
+ }
+ for (const op of unit.update) {
+ switch (op.kind) {
+ case OpKind.Property:
+ case OpKind.Attribute:
+ case OpKind.DomProperty:
+ let sanitizerFn = null;
+ if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.indexOf(SecurityContext.URL) > -1 && op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) {
+ sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;
+ } else {
+ sanitizerFn = sanitizerFns.get(getOnlySecurityContext(op.securityContext)) ?? null;
+ }
+ op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
+ if (op.sanitizer === null) {
+ let isIframe = false;
+ if (job.kind === CompilationJobKind.Host || op.kind === OpKind.DomProperty) {
+ isIframe = true;
+ } else {
+ const ownerOp = elements.get(op.target);
+ if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
+ throw Error("Property should have an element-like owner");
+ }
+ isIframe = isIframeElement(ownerOp);
+ }
+ if (isIframe && isIframeSecuritySensitiveAttr(op.name)) {
+ op.sanitizer = importExpr(Identifiers.validateIframeAttribute);
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+function isIframeElement(op) {
+ return op.kind === OpKind.ElementStart && op.tag?.toLowerCase() === "iframe";
+}
+function getOnlySecurityContext(securityContext) {
+ if (Array.isArray(securityContext)) {
+ if (securityContext.length > 1) {
+ throw Error(`AssertionError: Ambiguous security context`);
+ }
+ return securityContext[0] || SecurityContext.NONE;
+ }
+ return securityContext;
+}
+function saveAndRestoreView(job) {
+ for (const unit of job.units) {
+ unit.create.prepend([
+ createVariableOp(unit.job.allocateXrefId(), {
+ kind: SemanticVariableKind.SavedView,
+ name: null,
+ view: unit.xref
+ }, new GetCurrentViewExpr(), VariableFlags.None)
+ ]);
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.Listener && op.kind !== OpKind.TwoWayListener) {
+ continue;
+ }
+ let needsRestoreView = unit !== job.root;
+ if (!needsRestoreView) {
+ for (const handlerOp of op.handlerOps) {
+ visitExpressionsInOp(handlerOp, (expr) => {
+ if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
+ needsRestoreView = true;
+ }
+ });
+ }
+ }
+ if (needsRestoreView) {
+ addSaveRestoreViewOperationToListener(unit, op);
+ }
+ }
+ }
+}
+function addSaveRestoreViewOperationToListener(unit, op) {
+ op.handlerOps.prepend([
+ createVariableOp(unit.job.allocateXrefId(), {
+ kind: SemanticVariableKind.Context,
+ name: null,
+ view: unit.xref
+ }, new RestoreViewExpr(unit.xref), VariableFlags.None)
+ ]);
+ for (const handlerOp of op.handlerOps) {
+ if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) {
+ handlerOp.statement.value = new ResetViewExpr(handlerOp.statement.value);
+ }
+ }
+}
+function allocateSlots(job) {
+ const slotMap = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ let slotCount = 0;
+ for (const op of unit.create) {
+ if (!hasConsumesSlotTrait(op)) {
+ continue;
+ }
+ op.handle.slot = slotCount;
+ slotMap.set(op.xref, op.handle.slot);
+ slotCount += op.numSlotsUsed;
+ }
+ unit.decls = slotCount;
+ }
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ if (op.kind === OpKind.Template || op.kind === OpKind.ConditionalCreate || op.kind === OpKind.ConditionalBranchCreate || op.kind === OpKind.RepeaterCreate) {
+ const childView = job.views.get(op.xref);
+ op.decls = childView.decls;
+ }
+ }
+ }
+}
+function optimizeStoreLet(job) {
+ const letUsedExternally = /* @__PURE__ */ new Set();
+ const declareLetOps = /* @__PURE__ */ new Map();
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ if (op.kind === OpKind.DeclareLet) {
+ declareLetOps.set(op.xref, op);
+ }
+ visitExpressionsInOp(op, (expr) => {
+ if (expr instanceof ContextLetReferenceExpr) {
+ letUsedExternally.add(expr.target);
+ }
+ });
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof StoreLetExpr && !letUsedExternally.has(expr.target)) {
+ if (!hasPipe(expr)) {
+ OpList.remove(declareLetOps.get(expr.target));
+ }
+ return expr.value;
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+function hasPipe(root) {
+ let result = false;
+ transformExpressionsInExpression(root, (expr) => {
+ if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
+ result = true;
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ return result;
+}
+function stripNonrequiredParentheses(job) {
+ const requiredParens = /* @__PURE__ */ new Set();
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ visitExpressionsInOp(op, (expr) => {
+ if (expr instanceof BinaryOperatorExpr) {
+ switch (expr.operator) {
+ case BinaryOperator.Exponentiation:
+ checkExponentiationParens(expr, requiredParens);
+ break;
+ case BinaryOperator.NullishCoalesce:
+ checkNullishCoalescingParens(expr, requiredParens);
+ break;
+ }
+ }
+ });
+ }
+ }
+ for (const unit of job.units) {
+ for (const op of unit.ops()) {
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof ParenthesizedExpr) {
+ return requiredParens.has(expr) ? expr : expr.expr;
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+function checkExponentiationParens(expr, requiredParens) {
+ if (expr.lhs instanceof ParenthesizedExpr && expr.lhs.expr instanceof UnaryOperatorExpr) {
+ requiredParens.add(expr.lhs);
+ }
+}
+function checkNullishCoalescingParens(expr, requiredParens) {
+ if (expr.lhs instanceof ParenthesizedExpr && (isLogicalAndOr(expr.lhs.expr) || expr.lhs.expr instanceof ConditionalExpr)) {
+ requiredParens.add(expr.lhs);
+ }
+ if (expr.rhs instanceof ParenthesizedExpr && (isLogicalAndOr(expr.rhs.expr) || expr.rhs.expr instanceof ConditionalExpr)) {
+ requiredParens.add(expr.rhs);
+ }
+}
+function isLogicalAndOr(expr) {
+ return expr instanceof BinaryOperatorExpr && (expr.operator === BinaryOperator.And || expr.operator === BinaryOperator.Or);
+}
+function specializeStyleBindings(job) {
+ for (const unit of job.units) {
+ for (const op of unit.update) {
+ if (op.kind !== OpKind.Binding) {
+ continue;
+ }
+ switch (op.bindingKind) {
+ case BindingKind.ClassName:
+ if (op.expression instanceof Interpolation2) {
+ throw new Error(`Unexpected interpolation in ClassName binding`);
+ }
+ OpList.replace(op, createClassPropOp(op.target, op.name, op.expression, op.sourceSpan));
+ break;
+ case BindingKind.StyleProperty:
+ OpList.replace(op, createStylePropOp(op.target, op.name, op.expression, op.unit, op.sourceSpan));
+ break;
+ case BindingKind.Property:
+ case BindingKind.Template:
+ if (op.name === "style") {
+ OpList.replace(op, createStyleMapOp(op.target, op.expression, op.sourceSpan));
+ } else if (op.name === "class") {
+ OpList.replace(op, createClassMapOp(op.target, op.expression, op.sourceSpan));
+ }
+ break;
+ }
+ }
+ }
+}
+function generateTemporaryVariables(job) {
+ for (const unit of job.units) {
+ unit.create.prepend(generateTemporaries(unit.create));
+ unit.update.prepend(generateTemporaries(unit.update));
+ }
+}
+function generateTemporaries(ops) {
+ let opCount = 0;
+ let generatedStatements = [];
+ for (const op of ops) {
+ const finalReads = /* @__PURE__ */ new Map();
+ visitExpressionsInOp(op, (expr, flag) => {
+ if (flag & VisitorContextFlag.InChildOperation) {
+ return;
+ }
+ if (expr instanceof ReadTemporaryExpr) {
+ finalReads.set(expr.xref, expr);
+ }
+ });
+ let count = 0;
+ const assigned = /* @__PURE__ */ new Set();
+ const released = /* @__PURE__ */ new Set();
+ const defs = /* @__PURE__ */ new Map();
+ visitExpressionsInOp(op, (expr, flag) => {
+ if (flag & VisitorContextFlag.InChildOperation) {
+ return;
+ }
+ if (expr instanceof AssignTemporaryExpr) {
+ if (!assigned.has(expr.xref)) {
+ assigned.add(expr.xref);
+ defs.set(expr.xref, `tmp_${opCount}_${count++}`);
+ }
+ assignName(defs, expr);
+ } else if (expr instanceof ReadTemporaryExpr) {
+ if (finalReads.get(expr.xref) === expr) {
+ released.add(expr.xref);
+ count--;
+ }
+ assignName(defs, expr);
+ }
+ });
+ generatedStatements.push(...Array.from(new Set(defs.values())).map((name) => createStatementOp(new DeclareVarStmt(name))));
+ opCount++;
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ op.handlerOps.prepend(generateTemporaries(op.handlerOps));
+ } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
+ op.trackByOps.prepend(generateTemporaries(op.trackByOps));
+ }
+ }
+ return generatedStatements;
+}
+function assignName(names, expr) {
+ const name = names.get(expr.xref);
+ if (name === void 0) {
+ throw new Error(`Found xref with unassigned name: ${expr.xref}`);
+ }
+ expr.name = name;
+}
+function optimizeTrackFns(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.RepeaterCreate) {
+ continue;
+ }
+ if (op.track instanceof ReadVarExpr && op.track.name === "$index") {
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex);
+ } else if (op.track instanceof ReadVarExpr && op.track.name === "$item") {
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
+ } else if (isTrackByFunctionCall(job.root.xref, op.track)) {
+ op.usesComponentInstance = true;
+ if (op.track.receiver.receiver.view === unit.xref) {
+ op.trackByFn = op.track.receiver;
+ } else {
+ op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);
+ op.track = op.trackByFn;
+ }
+ } else {
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
+ if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
+ throw new Error(`Illegal State: Pipes are not allowed in this context`);
+ } else if (expr instanceof ContextExpr) {
+ op.usesComponentInstance = true;
+ return new TrackContextExpr(expr.view);
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ const trackOpList = new OpList();
+ trackOpList.push(createStatementOp(new ReturnStatement(op.track, op.track.sourceSpan)));
+ op.trackByOps = trackOpList;
+ }
+ }
+ }
+}
+function isTrackByFunctionCall(rootView, expr) {
+ if (!(expr instanceof InvokeFunctionExpr) || expr.args.length === 0 || expr.args.length > 2) {
+ return false;
+ }
+ if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) {
+ return false;
+ }
+ const [arg0, arg1] = expr.args;
+ if (!(arg0 instanceof ReadVarExpr) || arg0.name !== "$index") {
+ return false;
+ } else if (expr.args.length === 1) {
+ return true;
+ }
+ if (!(arg1 instanceof ReadVarExpr) || arg1.name !== "$item") {
+ return false;
+ }
+ return true;
+}
+function generateTrackVariables(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.RepeaterCreate) {
+ continue;
+ }
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
+ if (expr instanceof LexicalReadExpr) {
+ if (op.varNames.$index.has(expr.name)) {
+ return variable("$index");
+ } else if (expr.name === op.varNames.$implicit) {
+ return variable("$item");
+ }
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ }
+ }
+}
+function transformTwoWayBindingSet(job) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind === OpKind.TwoWayListener) {
+ transformExpressionsInOp(op, (expr) => {
+ if (!(expr instanceof TwoWayBindingSetExpr)) {
+ return expr;
+ }
+ const { target, value } = expr;
+ if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) {
+ return twoWayBindingSet(target, value).or(target.set(value));
+ }
+ if (target instanceof ReadVariableExpr) {
+ return twoWayBindingSet(target, value);
+ }
+ throw new Error(`Unsupported expression in two-way action binding.`);
+ }, VisitorContextFlag.InChildOperation);
+ }
+ }
+ }
+}
+function countVariables(job) {
+ for (const unit of job.units) {
+ let varCount = 0;
+ for (const op of unit.ops()) {
+ if (hasConsumesVarsTrait(op)) {
+ varCount += varsUsedByOp(op);
+ }
+ }
+ for (const op of unit.ops()) {
+ visitExpressionsInOp(op, (expr) => {
+ if (!isIrExpression(expr)) {
+ return;
+ }
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) {
+ return;
+ }
+ if (hasUsesVarOffsetTrait(expr)) {
+ expr.varOffset = varCount;
+ }
+ if (hasConsumesVarsTrait(expr)) {
+ varCount += varsUsedByIrExpression(expr);
+ }
+ });
+ }
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
+ for (const op of unit.ops()) {
+ visitExpressionsInOp(op, (expr) => {
+ if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) {
+ return;
+ }
+ if (hasUsesVarOffsetTrait(expr)) {
+ expr.varOffset = varCount;
+ }
+ if (hasConsumesVarsTrait(expr)) {
+ varCount += varsUsedByIrExpression(expr);
+ }
+ });
+ }
+ }
+ unit.vars = varCount;
+ }
+ if (job instanceof ComponentCompilationJob) {
+ for (const unit of job.units) {
+ for (const op of unit.create) {
+ if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate && op.kind !== OpKind.ConditionalCreate && op.kind !== OpKind.ConditionalBranchCreate) {
+ continue;
+ }
+ const childView = job.views.get(op.xref);
+ op.vars = childView.vars;
+ }
+ }
+ }
+}
+function varsUsedByOp(op) {
+ let slots;
+ switch (op.kind) {
+ case OpKind.Attribute:
+ slots = 1;
+ if (op.expression instanceof Interpolation2 && !isSingletonInterpolation(op.expression)) {
+ slots += op.expression.expressions.length;
+ }
+ return slots;
+ case OpKind.Property:
+ case OpKind.DomProperty:
+ slots = 1;
+ if (op.expression instanceof Interpolation2) {
+ slots += op.expression.expressions.length;
+ }
+ return slots;
+ case OpKind.TwoWayProperty:
+ return 1;
+ case OpKind.StyleProp:
+ case OpKind.ClassProp:
+ case OpKind.StyleMap:
+ case OpKind.ClassMap:
+ slots = 2;
+ if (op.expression instanceof Interpolation2) {
+ slots += op.expression.expressions.length;
+ }
+ return slots;
+ case OpKind.InterpolateText:
+ return op.interpolation.expressions.length;
+ case OpKind.I18nExpression:
+ case OpKind.Conditional:
+ case OpKind.DeferWhen:
+ case OpKind.StoreLet:
+ return 1;
+ case OpKind.RepeaterCreate:
+ return op.emptyView ? 1 : 0;
+ default:
+ throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
+ }
+}
+function varsUsedByIrExpression(expr) {
+ switch (expr.kind) {
+ case ExpressionKind.PureFunctionExpr:
+ return 1 + expr.args.length;
+ case ExpressionKind.PipeBinding:
+ return 1 + expr.args.length;
+ case ExpressionKind.PipeBindingVariadic:
+ return 1 + expr.numArgs;
+ case ExpressionKind.StoreLet:
+ return 1;
+ default:
+ throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
+ }
+}
+function isSingletonInterpolation(expr) {
+ if (expr.expressions.length !== 1 || expr.strings.length !== 2) {
+ return false;
+ }
+ if (expr.strings[0] !== "" || expr.strings[1] !== "") {
+ return false;
+ }
+ return true;
+}
+function optimizeVariables(job) {
+ for (const unit of job.units) {
+ inlineAlwaysInlineVariables(unit.create);
+ inlineAlwaysInlineVariables(unit.update);
+ for (const op of unit.create) {
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ inlineAlwaysInlineVariables(op.handlerOps);
+ } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
+ inlineAlwaysInlineVariables(op.trackByOps);
+ }
+ }
+ optimizeVariablesInOpList(unit.create, job.compatibility);
+ optimizeVariablesInOpList(unit.update, job.compatibility);
+ for (const op of unit.create) {
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
+ optimizeVariablesInOpList(op.handlerOps, job.compatibility);
+ } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
+ optimizeVariablesInOpList(op.trackByOps, job.compatibility);
+ }
+ }
+ }
+}
+var Fence;
+(function(Fence2) {
+ Fence2[Fence2["None"] = 0] = "None";
+ Fence2[Fence2["ViewContextRead"] = 1] = "ViewContextRead";
+ Fence2[Fence2["ViewContextWrite"] = 2] = "ViewContextWrite";
+ Fence2[Fence2["SideEffectful"] = 4] = "SideEffectful";
+})(Fence || (Fence = {}));
+function inlineAlwaysInlineVariables(ops) {
+ const vars = /* @__PURE__ */ new Map();
+ for (const op of ops) {
+ if (op.kind === OpKind.Variable && op.flags & VariableFlags.AlwaysInline) {
+ visitExpressionsInOp(op, (expr) => {
+ if (isIrExpression(expr) && fencesForIrExpression(expr) !== Fence.None) {
+ throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`);
+ }
+ });
+ vars.set(op.xref, op);
+ }
+ transformExpressionsInOp(op, (expr) => {
+ if (expr instanceof ReadVariableExpr && vars.has(expr.xref)) {
+ const varOp = vars.get(expr.xref);
+ return varOp.initializer.clone();
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ }
+ for (const op of vars.values()) {
+ OpList.remove(op);
+ }
+}
+function optimizeVariablesInOpList(ops, compatibility) {
+ const varDecls = /* @__PURE__ */ new Map();
+ const varUsages = /* @__PURE__ */ new Map();
+ const varRemoteUsages = /* @__PURE__ */ new Set();
+ const opMap = /* @__PURE__ */ new Map();
+ for (const op of ops) {
+ if (op.kind === OpKind.Variable) {
+ if (varDecls.has(op.xref) || varUsages.has(op.xref)) {
+ throw new Error(`Should not see two declarations of the same variable: ${op.xref}`);
+ }
+ varDecls.set(op.xref, op);
+ varUsages.set(op.xref, 0);
+ }
+ opMap.set(op, collectOpInfo(op));
+ countVariableUsages(op, varUsages, varRemoteUsages);
+ }
+ let contextIsUsed = false;
+ for (const op of ops.reversed()) {
+ const opInfo = opMap.get(op);
+ if (op.kind === OpKind.Variable && varUsages.get(op.xref) === 0) {
+ if (contextIsUsed && opInfo.fences & Fence.ViewContextWrite || opInfo.fences & Fence.SideEffectful) {
+ const stmtOp = createStatementOp(op.initializer.toStmt());
+ opMap.set(stmtOp, opInfo);
+ OpList.replace(op, stmtOp);
+ } else {
+ uncountVariableUsages(op, varUsages);
+ OpList.remove(op);
+ }
+ opMap.delete(op);
+ varDecls.delete(op.xref);
+ varUsages.delete(op.xref);
+ continue;
+ }
+ if (opInfo.fences & Fence.ViewContextRead) {
+ contextIsUsed = true;
+ }
+ }
+ const toInline = [];
+ for (const [id, count] of varUsages) {
+ const decl = varDecls.get(id);
+ const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
+ if (count !== 1 || isAlwaysInline) {
+ continue;
+ }
+ if (varRemoteUsages.has(id)) {
+ continue;
+ }
+ toInline.push(id);
+ }
+ let candidate;
+ while (candidate = toInline.pop()) {
+ const decl = varDecls.get(candidate);
+ const varInfo = opMap.get(decl);
+ const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
+ if (isAlwaysInline) {
+ throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`);
+ }
+ for (let targetOp = decl.next; targetOp.kind !== OpKind.ListEnd; targetOp = targetOp.next) {
+ const opInfo = opMap.get(targetOp);
+ if (opInfo.variablesUsed.has(candidate)) {
+ if (compatibility === CompatibilityMode.TemplateDefinitionBuilder && !allowConservativeInlining(decl, targetOp)) {
+ break;
+ }
+ if (tryInlineVariableInitializer(candidate, decl.initializer, targetOp, varInfo.fences)) {
+ opInfo.variablesUsed.delete(candidate);
+ for (const id of varInfo.variablesUsed) {
+ opInfo.variablesUsed.add(id);
+ }
+ opInfo.fences |= varInfo.fences;
+ varDecls.delete(candidate);
+ varUsages.delete(candidate);
+ opMap.delete(decl);
+ OpList.remove(decl);
+ }
+ break;
+ }
+ if (!safeToInlinePastFences(opInfo.fences, varInfo.fences)) {
+ break;
+ }
+ }
+ }
+}
+function fencesForIrExpression(expr) {
+ switch (expr.kind) {
+ case ExpressionKind.NextContext:
+ return Fence.ViewContextRead | Fence.ViewContextWrite;
+ case ExpressionKind.RestoreView:
+ return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful;
+ case ExpressionKind.StoreLet:
+ return Fence.SideEffectful;
+ case ExpressionKind.Reference:
+ case ExpressionKind.ContextLetReference:
+ return Fence.ViewContextRead;
+ default:
+ return Fence.None;
+ }
+}
+function collectOpInfo(op) {
+ let fences = Fence.None;
+ const variablesUsed = /* @__PURE__ */ new Set();
+ visitExpressionsInOp(op, (expr) => {
+ if (!isIrExpression(expr)) {
+ return;
+ }
+ switch (expr.kind) {
+ case ExpressionKind.ReadVariable:
+ variablesUsed.add(expr.xref);
+ break;
+ default:
+ fences |= fencesForIrExpression(expr);
+ }
+ });
+ return { fences, variablesUsed };
+}
+function countVariableUsages(op, varUsages, varRemoteUsage) {
+ visitExpressionsInOp(op, (expr, flags) => {
+ if (!isIrExpression(expr)) {
+ return;
+ }
+ if (expr.kind !== ExpressionKind.ReadVariable) {
+ return;
+ }
+ const count = varUsages.get(expr.xref);
+ if (count === void 0) {
+ return;
+ }
+ varUsages.set(expr.xref, count + 1);
+ if (flags & VisitorContextFlag.InChildOperation) {
+ varRemoteUsage.add(expr.xref);
+ }
+ });
+}
+function uncountVariableUsages(op, varUsages) {
+ visitExpressionsInOp(op, (expr) => {
+ if (!isIrExpression(expr)) {
+ return;
+ }
+ if (expr.kind !== ExpressionKind.ReadVariable) {
+ return;
+ }
+ const count = varUsages.get(expr.xref);
+ if (count === void 0) {
+ return;
+ } else if (count === 0) {
+ throw new Error(`Inaccurate variable count: ${expr.xref} - found another read but count is already 0`);
+ }
+ varUsages.set(expr.xref, count - 1);
+ });
+}
+function safeToInlinePastFences(fences, declFences) {
+ if (fences & Fence.ViewContextWrite) {
+ if (declFences & Fence.ViewContextRead) {
+ return false;
+ }
+ } else if (fences & Fence.ViewContextRead) {
+ if (declFences & Fence.ViewContextWrite) {
+ return false;
+ }
+ }
+ return true;
+}
+function tryInlineVariableInitializer(id, initializer, target, declFences) {
+ let inlined = false;
+ let inliningAllowed = true;
+ transformExpressionsInOp(target, (expr, flags) => {
+ if (!isIrExpression(expr)) {
+ return expr;
+ }
+ if (inlined || !inliningAllowed) {
+ return expr;
+ } else if (flags & VisitorContextFlag.InChildOperation && declFences & Fence.ViewContextRead) {
+ return expr;
+ }
+ switch (expr.kind) {
+ case ExpressionKind.ReadVariable:
+ if (expr.xref === id) {
+ inlined = true;
+ return initializer;
+ }
+ break;
+ default:
+ const exprFences = fencesForIrExpression(expr);
+ inliningAllowed = inliningAllowed && safeToInlinePastFences(exprFences, declFences);
+ break;
+ }
+ return expr;
+ }, VisitorContextFlag.None);
+ return inlined;
+}
+function allowConservativeInlining(decl, target) {
+ switch (decl.variable.kind) {
+ case SemanticVariableKind.Identifier:
+ if (decl.initializer instanceof ReadVarExpr && decl.initializer.name === "ctx") {
+ return true;
+ }
+ return false;
+ case SemanticVariableKind.Context:
+ return target.kind === OpKind.Variable;
+ default:
+ return true;
+ }
+}
+function wrapI18nIcus(job) {
+ for (const unit of job.units) {
+ let currentI18nOp = null;
+ let addedI18nId = null;
+ for (const op of unit.create) {
+ switch (op.kind) {
+ case OpKind.I18nStart:
+ currentI18nOp = op;
+ break;
+ case OpKind.I18nEnd:
+ currentI18nOp = null;
+ break;
+ case OpKind.IcuStart:
+ if (currentI18nOp === null) {
+ addedI18nId = job.allocateXrefId();
+ OpList.insertBefore(createI18nStartOp(addedI18nId, op.message, void 0, null), op);
+ }
+ break;
+ case OpKind.IcuEnd:
+ if (addedI18nId !== null) {
+ OpList.insertAfter(createI18nEndOp(addedI18nId, null), op);
+ addedI18nId = null;
+ }
+ break;
+ }
+ }
+ }
+}
+var phases = [
+ { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
+ { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
+ { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
+ { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
+ { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
+ { kind: CompilationJobKind.Both, fn: deduplicateTextBindings },
+ { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
+ { kind: CompilationJobKind.Both, fn: specializeBindings },
+ { kind: CompilationJobKind.Both, fn: extractAttributes },
+ { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
+ { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
+ { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
+ { kind: CompilationJobKind.Both, fn: collapseSingletonInterpolations },
+ { kind: CompilationJobKind.Both, fn: orderOps },
+ { kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
+ { kind: CompilationJobKind.Tmpl, fn: createPipes },
+ { kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
+ { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
+ { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
+ { kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
+ { kind: CompilationJobKind.Tmpl, fn: generateLocalLetReferences },
+ { kind: CompilationJobKind.Tmpl, fn: generateVariables },
+ { kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
+ { kind: CompilationJobKind.Both, fn: deleteAnyCasts },
+ { kind: CompilationJobKind.Both, fn: resolveDollarEvent },
+ { kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
+ { kind: CompilationJobKind.Tmpl, fn: removeIllegalLetReferences },
+ { kind: CompilationJobKind.Both, fn: resolveNames },
+ { kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
+ { kind: CompilationJobKind.Tmpl, fn: transformTwoWayBindingSet },
+ { kind: CompilationJobKind.Tmpl, fn: optimizeTrackFns },
+ { kind: CompilationJobKind.Both, fn: resolveContexts },
+ { kind: CompilationJobKind.Both, fn: resolveSanitizers },
+ { kind: CompilationJobKind.Tmpl, fn: liftLocalRefs },
+ { kind: CompilationJobKind.Both, fn: expandSafeReads },
+ { kind: CompilationJobKind.Both, fn: stripNonrequiredParentheses },
+ { kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
+ { kind: CompilationJobKind.Both, fn: optimizeVariables },
+ { kind: CompilationJobKind.Both, fn: optimizeStoreLet },
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nText },
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
+ { kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
+ { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
+ { kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
+ { kind: CompilationJobKind.Tmpl, fn: allocateSlots },
+ { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
+ { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
+ { kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
+ { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
+ { kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
+ { kind: CompilationJobKind.Both, fn: collectElementConsts },
+ { kind: CompilationJobKind.Tmpl, fn: removeI18nContexts },
+ { kind: CompilationJobKind.Both, fn: countVariables },
+ { kind: CompilationJobKind.Tmpl, fn: generateAdvance },
+ { kind: CompilationJobKind.Both, fn: nameFunctionsAndVariables },
+ { kind: CompilationJobKind.Tmpl, fn: resolveDeferDepsFns },
+ { kind: CompilationJobKind.Tmpl, fn: mergeNextContextExpressions },
+ { kind: CompilationJobKind.Tmpl, fn: generateNgContainerOps },
+ { kind: CompilationJobKind.Tmpl, fn: collapseEmptyInstructions },
+ { kind: CompilationJobKind.Tmpl, fn: attachSourceLocations },
+ { kind: CompilationJobKind.Tmpl, fn: disableBindings$1 },
+ { kind: CompilationJobKind.Both, fn: extractPureFunctions },
+ { kind: CompilationJobKind.Both, fn: reify },
+ { kind: CompilationJobKind.Both, fn: chain }
+];
+function transform(job, kind) {
+ for (const phase of phases) {
+ if (phase.kind === kind || phase.kind === CompilationJobKind.Both) {
+ phase.fn(job);
+ }
+ }
+}
+function emitTemplateFn(tpl, pool) {
+ const rootFn = emitView(tpl.root);
+ emitChildViews(tpl.root, pool);
+ return rootFn;
+}
+function emitChildViews(parent, pool) {
+ for (const unit of parent.job.units) {
+ if (unit.parent !== parent.xref) {
+ continue;
+ }
+ emitChildViews(unit, pool);
+ const viewFn = emitView(unit);
+ pool.statements.push(viewFn.toDeclStmt(viewFn.name));
+ }
+}
+function emitView(view) {
+ if (view.fnName === null) {
+ throw new Error(`AssertionError: view ${view.xref} is unnamed`);
+ }
+ const createStatements = [];
+ for (const op of view.create) {
+ if (op.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${OpKind[op.kind]}`);
+ }
+ createStatements.push(op.statement);
+ }
+ const updateStatements = [];
+ for (const op of view.update) {
+ if (op.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${OpKind[op.kind]}`);
+ }
+ updateStatements.push(op.statement);
+ }
+ const createCond = maybeGenerateRfBlock(1, createStatements);
+ const updateCond = maybeGenerateRfBlock(2, updateStatements);
+ return fn(
+ [new FnParam("rf"), new FnParam("ctx")],
+ [...createCond, ...updateCond],
+ /* type */
+ void 0,
+ /* sourceSpan */
+ void 0,
+ view.fnName
+ );
+}
+function maybeGenerateRfBlock(flag, statements) {
+ if (statements.length === 0) {
+ return [];
+ }
+ return [
+ ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable("rf"), literal(flag)), statements)
+ ];
+}
+function emitHostBindingFunction(job) {
+ if (job.root.fnName === null) {
+ throw new Error(`AssertionError: host binding function is unnamed`);
+ }
+ const createStatements = [];
+ for (const op of job.root.create) {
+ if (op.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${OpKind[op.kind]}`);
+ }
+ createStatements.push(op.statement);
+ }
+ const updateStatements = [];
+ for (const op of job.root.update) {
+ if (op.kind !== OpKind.Statement) {
+ throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${OpKind[op.kind]}`);
+ }
+ updateStatements.push(op.statement);
+ }
+ if (createStatements.length === 0 && updateStatements.length === 0) {
+ return null;
+ }
+ const createCond = maybeGenerateRfBlock(1, createStatements);
+ const updateCond = maybeGenerateRfBlock(2, updateStatements);
+ return fn(
+ [new FnParam("rf"), new FnParam("ctx")],
+ [...createCond, ...updateCond],
+ /* type */
+ void 0,
+ /* sourceSpan */
+ void 0,
+ job.root.fnName
+ );
+}
+var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
+var domSchema = new DomElementSchemaRegistry();
+var NG_TEMPLATE_TAG_NAME = "ng-template";
+function isI18nRootNode(meta) {
+ return meta instanceof Message;
+}
+function isSingleI18nIcu(meta) {
+ return isI18nRootNode(meta) && meta.nodes.length === 1 && meta.nodes[0] instanceof Icu2;
+}
+function ingestComponent(componentName, template2, constantPool, compilationMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
+ const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, compilationMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations);
+ ingestNodes(job.root, template2);
+ return job;
+}
+function ingestHostBinding(input, bindingParser, constantPool) {
+ const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode, TemplateCompilationMode.DomOnly);
+ for (const property2 of input.properties ?? []) {
+ let bindingKind = BindingKind.Property;
+ if (property2.name.startsWith("attr.")) {
+ property2.name = property2.name.substring("attr.".length);
+ bindingKind = BindingKind.Attribute;
+ }
+ if (property2.isLegacyAnimation) {
+ bindingKind = BindingKind.LegacyAnimation;
+ }
+ const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property2.name, bindingKind === BindingKind.Attribute).filter((context) => context !== SecurityContext.NONE);
+ ingestDomProperty(job, property2, bindingKind, securityContexts);
+ }
+ for (const [name, expr] of Object.entries(input.attributes) ?? []) {
+ const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter((context) => context !== SecurityContext.NONE);
+ ingestHostAttribute(job, name, expr, securityContexts);
+ }
+ for (const event of input.events ?? []) {
+ ingestHostEvent(job, event);
+ }
+ return job;
+}
+function ingestDomProperty(job, property2, bindingKind, securityContexts) {
+ let expression;
+ const ast = property2.expression.ast;
+ if (ast instanceof Interpolation$1) {
+ expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)), []);
+ } else {
+ expression = convertAst(ast, job, property2.sourceSpan);
+ }
+ job.root.update.push(createBindingOp(
+ job.root.xref,
+ bindingKind,
+ property2.name,
+ expression,
+ null,
+ securityContexts,
+ false,
+ false,
+ null,
+ /* TODO: How do Host bindings handle i18n attrs? */
+ null,
+ property2.sourceSpan
+ ));
+}
+function ingestHostAttribute(job, name, value, securityContexts) {
+ const attrBinding = createBindingOp(
+ job.root.xref,
+ BindingKind.Attribute,
+ name,
+ value,
+ null,
+ securityContexts,
+ /* Host attributes should always be extracted to const hostAttrs, even if they are not
+ *strictly* text literals */
+ true,
+ false,
+ null,
+ /* TODO */
+ null,
+ /** TODO: May be null? */
+ value.sourceSpan
+ );
+ job.root.update.push(attrBinding);
+}
+function ingestHostEvent(job, event) {
+ const [phase, target] = event.type !== ParsedEventType.LegacyAnimation ? [null, event.targetOrPhase] : [event.targetOrPhase, null];
+ const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
+ job.root.create.push(eventBinding);
+}
+function ingestNodes(unit, template2) {
+ for (const node of template2) {
+ if (node instanceof Element$1) {
+ ingestElement(unit, node);
+ } else if (node instanceof Template) {
+ ingestTemplate(unit, node);
+ } else if (node instanceof Content) {
+ ingestContent(unit, node);
+ } else if (node instanceof Text$3) {
+ ingestText(unit, node, null);
+ } else if (node instanceof BoundText) {
+ ingestBoundText(unit, node, null);
+ } else if (node instanceof IfBlock) {
+ ingestIfBlock(unit, node);
+ } else if (node instanceof SwitchBlock) {
+ ingestSwitchBlock(unit, node);
+ } else if (node instanceof DeferredBlock) {
+ ingestDeferBlock(unit, node);
+ } else if (node instanceof Icu$1) {
+ ingestIcu(unit, node);
+ } else if (node instanceof ForLoopBlock) {
+ ingestForBlock(unit, node);
+ } else if (node instanceof LetDeclaration$1) {
+ ingestLetDeclaration(unit, node);
+ } else if (node instanceof Component$1) ;
+ else {
+ throw new Error(`Unsupported template node: ${node.constructor.name}`);
+ }
+ }
+}
+function ingestElement(unit, element2) {
+ if (element2.i18n !== void 0 && !(element2.i18n instanceof Message || element2.i18n instanceof TagPlaceholder)) {
+ throw Error(`Unhandled i18n metadata type for element: ${element2.i18n.constructor.name}`);
+ }
+ const id = unit.job.allocateXrefId();
+ const [namespaceKey, elementName] = splitNsName(element2.name);
+ const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan, element2.sourceSpan);
+ unit.create.push(startOp);
+ ingestElementBindings(unit, startOp, element2);
+ ingestReferences(startOp, element2);
+ let i18nBlockId = null;
+ if (element2.i18n instanceof Message) {
+ i18nBlockId = unit.job.allocateXrefId();
+ unit.create.push(createI18nStartOp(i18nBlockId, element2.i18n, void 0, element2.startSourceSpan));
+ }
+ ingestNodes(unit, element2.children);
+ const endOp = createElementEndOp(id, element2.endSourceSpan ?? element2.startSourceSpan);
+ unit.create.push(endOp);
+ if (i18nBlockId !== null) {
+ OpList.insertBefore(createI18nEndOp(i18nBlockId, element2.endSourceSpan ?? element2.startSourceSpan), endOp);
+ }
+}
+function ingestTemplate(unit, tmpl) {
+ if (tmpl.i18n !== void 0 && !(tmpl.i18n instanceof Message || tmpl.i18n instanceof TagPlaceholder)) {
+ throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`);
+ }
+ const childView = unit.job.allocateView(unit.xref);
+ let tagNameWithoutNamespace = tmpl.tagName;
+ let namespacePrefix = "";
+ if (tmpl.tagName) {
+ [namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName);
+ }
+ const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
+ const namespace = namespaceForKey(namespacePrefix);
+ const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
+ const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
+ const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan, tmpl.sourceSpan);
+ unit.create.push(templateOp);
+ ingestTemplateBindings(unit, templateOp, tmpl, templateKind);
+ ingestReferences(templateOp, tmpl);
+ ingestNodes(childView, tmpl.children);
+ for (const { name, value } of tmpl.variables) {
+ childView.contextVariables.set(name, value !== "" ? value : "$implicit");
+ }
+ if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
+ const id = unit.job.allocateXrefId();
+ OpList.insertAfter(createI18nStartOp(id, tmpl.i18n, void 0, tmpl.startSourceSpan), childView.create.head);
+ OpList.insertBefore(createI18nEndOp(id, tmpl.endSourceSpan ?? tmpl.startSourceSpan), childView.create.tail);
+ }
+}
+function ingestContent(unit, content) {
+ if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
+ throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
+ }
+ let fallbackView = null;
+ if (content.children.some((child) => !(child instanceof Comment$1) && (!(child instanceof Text$3) || child.value.trim().length > 0))) {
+ fallbackView = unit.job.allocateView(unit.xref);
+ ingestNodes(fallbackView, content.children);
+ }
+ const id = unit.job.allocateXrefId();
+ const op = createProjectionOp(id, content.selector, content.i18n, fallbackView?.xref ?? null, content.sourceSpan);
+ for (const attr of content.attributes) {
+ const securityContext = domSchema.securityContext(content.name, attr.name, true);
+ unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
+ }
+ unit.create.push(op);
+}
+function ingestText(unit, text2, icuPlaceholder) {
+ unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, icuPlaceholder, text2.sourceSpan));
+}
+function ingestBoundText(unit, text2, icuPlaceholder) {
+ let value = text2.value;
+ if (value instanceof ASTWithSource) {
+ value = value.ast;
+ }
+ if (!(value instanceof Interpolation$1)) {
+ throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${value.constructor.name}`);
+ }
+ if (text2.i18n !== void 0 && !(text2.i18n instanceof Container)) {
+ throw Error(`Unhandled i18n metadata type for text interpolation: ${text2.i18n?.constructor.name}`);
+ }
+ const i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
+ if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) {
+ throw Error(`Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`);
+ }
+ const textXref = unit.job.allocateXrefId();
+ unit.create.push(createTextOp(textXref, "", icuPlaceholder, text2.sourceSpan));
+ const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
+ unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
+}
+function ingestIfBlock(unit, ifBlock) {
+ let firstXref = null;
+ let conditions = [];
+ for (let i = 0; i < ifBlock.branches.length; i++) {
+ const ifCase = ifBlock.branches[i];
+ const cView = unit.job.allocateView(unit.xref);
+ const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase);
+ if (ifCase.expressionAlias !== null) {
+ cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
+ }
+ let ifCaseI18nMeta = void 0;
+ if (ifCase.i18n !== void 0) {
+ if (!(ifCase.i18n instanceof BlockPlaceholder)) {
+ throw Error(`Unhandled i18n metadata type for if block: ${ifCase.i18n?.constructor.name}`);
+ }
+ ifCaseI18nMeta = ifCase.i18n;
+ }
+ const createOp = i === 0 ? createConditionalCreateOp : createConditionalBranchCreateOp;
+ const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.startSourceSpan, ifCase.sourceSpan);
+ unit.create.push(conditionalCreateOp);
+ if (firstXref === null) {
+ firstXref = cView.xref;
+ }
+ const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, conditionalCreateOp.xref, conditionalCreateOp.handle, ifCase.expressionAlias);
+ conditions.push(conditionalCaseExpr);
+ ingestNodes(cView, ifCase.children);
+ }
+ unit.update.push(createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan));
+}
+function ingestSwitchBlock(unit, switchBlock) {
+ if (switchBlock.cases.length === 0) {
+ return;
+ }
+ let firstXref = null;
+ let conditions = [];
+ for (let i = 0; i < switchBlock.cases.length; i++) {
+ const switchCase = switchBlock.cases[i];
+ const cView = unit.job.allocateView(unit.xref);
+ const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCase);
+ let switchCaseI18nMeta = void 0;
+ if (switchCase.i18n !== void 0) {
+ if (!(switchCase.i18n instanceof BlockPlaceholder)) {
+ throw Error(`Unhandled i18n metadata type for switch block: ${switchCase.i18n?.constructor.name}`);
+ }
+ switchCaseI18nMeta = switchCase.i18n;
+ }
+ const createOp = i === 0 ? createConditionalCreateOp : createConditionalBranchCreateOp;
+ const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan);
+ unit.create.push(conditionalCreateOp);
+ if (firstXref === null) {
+ firstXref = cView.xref;
+ }
+ const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, conditionalCreateOp.xref, conditionalCreateOp.handle);
+ conditions.push(conditionalCaseExpr);
+ ingestNodes(cView, switchCase.children);
+ }
+ unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan));
+}
+function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
+ if (i18nMeta !== void 0 && !(i18nMeta instanceof BlockPlaceholder)) {
+ throw Error("Unhandled i18n metadata type for defer block");
+ }
+ if (children === void 0) {
+ return null;
+ }
+ const secondaryView = unit.job.allocateView(unit.xref);
+ ingestNodes(secondaryView, children);
+ const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan, sourceSpan);
+ unit.create.push(templateOp);
+ return templateOp;
+}
+function ingestDeferBlock(unit, deferBlock) {
+ let ownResolverFn = null;
+ if (unit.job.deferMeta.mode === 0) {
+ if (!unit.job.deferMeta.blocks.has(deferBlock)) {
+ throw new Error(`AssertionError: unable to find a dependency function for this deferred block`);
+ }
+ ownResolverFn = unit.job.deferMeta.blocks.get(deferBlock) ?? null;
+ }
+ const main = ingestDeferView(unit, "", deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan);
+ const loading = ingestDeferView(unit, "Loading", deferBlock.loading?.i18n, deferBlock.loading?.children, deferBlock.loading?.sourceSpan);
+ const placeholder = ingestDeferView(unit, "Placeholder", deferBlock.placeholder?.i18n, deferBlock.placeholder?.children, deferBlock.placeholder?.sourceSpan);
+ const error = ingestDeferView(unit, "Error", deferBlock.error?.i18n, deferBlock.error?.children, deferBlock.error?.sourceSpan);
+ const deferXref = unit.job.allocateXrefId();
+ const deferOp = createDeferOp(deferXref, main.xref, main.handle, ownResolverFn, unit.job.allDeferrableDepsFn, deferBlock.sourceSpan);
+ deferOp.placeholderView = placeholder?.xref ?? null;
+ deferOp.placeholderSlot = placeholder?.handle ?? null;
+ deferOp.loadingSlot = loading?.handle ?? null;
+ deferOp.errorSlot = error?.handle ?? null;
+ deferOp.placeholderMinimumTime = deferBlock.placeholder?.minimumTime ?? null;
+ deferOp.loadingMinimumTime = deferBlock.loading?.minimumTime ?? null;
+ deferOp.loadingAfterTime = deferBlock.loading?.afterTime ?? null;
+ deferOp.flags = calcDeferBlockFlags(deferBlock);
+ unit.create.push(deferOp);
+ const deferOnOps = [];
+ const deferWhenOps = [];
+ ingestDeferTriggers("hydrate", deferBlock.hydrateTriggers, deferOnOps, deferWhenOps, unit, deferXref);
+ ingestDeferTriggers("none", deferBlock.triggers, deferOnOps, deferWhenOps, unit, deferXref);
+ ingestDeferTriggers("prefetch", deferBlock.prefetchTriggers, deferOnOps, deferWhenOps, unit, deferXref);
+ const hasConcreteTrigger = deferOnOps.some(
+ (op) => op.modifier === "none"
+ /* ir.DeferOpModifierKind.NONE */
+ ) || deferWhenOps.some(
+ (op) => op.modifier === "none"
+ /* ir.DeferOpModifierKind.NONE */
+ );
+ if (!hasConcreteTrigger) {
+ deferOnOps.push(createDeferOnOp(deferXref, { kind: DeferTriggerKind.Idle }, "none", null));
+ }
+ unit.create.push(deferOnOps);
+ unit.update.push(deferWhenOps);
+}
+function calcDeferBlockFlags(deferBlockDetails) {
+ if (Object.keys(deferBlockDetails.hydrateTriggers).length > 0) {
+ return 1;
+ }
+ return null;
+}
+function ingestDeferTriggers(modifier, triggers, onOps, whenOps, unit, deferXref) {
+ if (triggers.idle !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Idle }, modifier, triggers.idle.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.immediate !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Immediate }, modifier, triggers.immediate.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.timer !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Timer, delay: triggers.timer.delay }, modifier, triggers.timer.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.hover !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, {
+ kind: DeferTriggerKind.Hover,
+ targetName: triggers.hover.reference,
+ targetXref: null,
+ targetSlot: null,
+ targetView: null,
+ targetSlotViewSteps: null
+ }, modifier, triggers.hover.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.interaction !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, {
+ kind: DeferTriggerKind.Interaction,
+ targetName: triggers.interaction.reference,
+ targetXref: null,
+ targetSlot: null,
+ targetView: null,
+ targetSlotViewSteps: null
+ }, modifier, triggers.interaction.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.viewport !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, {
+ kind: DeferTriggerKind.Viewport,
+ targetName: triggers.viewport.reference,
+ targetXref: null,
+ targetSlot: null,
+ targetView: null,
+ targetSlotViewSteps: null
+ }, modifier, triggers.viewport.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.never !== void 0) {
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Never }, modifier, triggers.never.sourceSpan);
+ onOps.push(deferOnOp);
+ }
+ if (triggers.when !== void 0) {
+ if (triggers.when.value instanceof Interpolation$1) {
+ throw new Error(`Unexpected interpolation in defer block when trigger`);
+ }
+ const deferOnOp = createDeferWhenOp(deferXref, convertAst(triggers.when.value, unit.job, triggers.when.sourceSpan), modifier, triggers.when.sourceSpan);
+ whenOps.push(deferOnOp);
+ }
+}
+function ingestIcu(unit, icu) {
+ if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
+ const xref = unit.job.allocateXrefId();
+ unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
+ for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
+ if (text2 instanceof BoundText) {
+ ingestBoundText(unit, text2, placeholder);
+ } else {
+ ingestText(unit, text2, placeholder);
+ }
+ }
+ unit.create.push(createIcuEndOp(xref));
+ } else {
+ throw Error(`Unhandled i18n metadata type for ICU: ${icu.i18n?.constructor.name}`);
+ }
+}
+function ingestForBlock(unit, forBlock) {
+ const repeaterView = unit.job.allocateView(unit.xref);
+ const indexName = `ɵ$index_${repeaterView.xref}`;
+ const countName = `ɵ$count_${repeaterView.xref}`;
+ const indexVarNames = /* @__PURE__ */ new Set();
+ repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value);
+ for (const variable2 of forBlock.contextVariables) {
+ if (variable2.value === "$index") {
+ indexVarNames.add(variable2.name);
+ }
+ if (variable2.name === "$index") {
+ repeaterView.contextVariables.set("$index", variable2.value).set(indexName, variable2.value);
+ } else if (variable2.name === "$count") {
+ repeaterView.contextVariables.set("$count", variable2.value).set(countName, variable2.value);
+ } else {
+ repeaterView.aliases.add({
+ kind: SemanticVariableKind.Alias,
+ name: null,
+ identifier: variable2.name,
+ expression: getComputedForLoopVariableExpression(variable2, indexName, countName)
+ });
+ }
+ }
+ const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan);
+ const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
+ ingestNodes(repeaterView, forBlock.children);
+ let emptyView = null;
+ let emptyTagName = null;
+ if (forBlock.empty !== null) {
+ emptyView = unit.job.allocateView(unit.xref);
+ ingestNodes(emptyView, forBlock.empty.children);
+ emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty);
+ }
+ const varNames = {
+ $index: indexVarNames,
+ $implicit: forBlock.item.name
+ };
+ if (forBlock.i18n !== void 0 && !(forBlock.i18n instanceof BlockPlaceholder)) {
+ throw Error("AssertionError: Unhandled i18n metadata type or @for");
+ }
+ if (forBlock.empty?.i18n !== void 0 && !(forBlock.empty.i18n instanceof BlockPlaceholder)) {
+ throw Error("AssertionError: Unhandled i18n metadata type or @empty");
+ }
+ const i18nPlaceholder = forBlock.i18n;
+ const emptyI18nPlaceholder = forBlock.empty?.i18n;
+ const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);
+ const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, emptyView?.xref ?? null, tagName, track, varNames, emptyTagName, i18nPlaceholder, emptyI18nPlaceholder, forBlock.startSourceSpan, forBlock.sourceSpan);
+ unit.create.push(repeaterCreate2);
+ const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
+ const repeater2 = createRepeaterOp(repeaterCreate2.xref, repeaterCreate2.handle, expression, forBlock.sourceSpan);
+ unit.update.push(repeater2);
+}
+function getComputedForLoopVariableExpression(variable2, indexName, countName) {
+ switch (variable2.value) {
+ case "$index":
+ return new LexicalReadExpr(indexName);
+ case "$count":
+ return new LexicalReadExpr(countName);
+ case "$first":
+ return new LexicalReadExpr(indexName).identical(literal(0));
+ case "$last":
+ return new LexicalReadExpr(indexName).identical(new LexicalReadExpr(countName).minus(literal(1)));
+ case "$even":
+ return new LexicalReadExpr(indexName).modulo(literal(2)).identical(literal(0));
+ case "$odd":
+ return new LexicalReadExpr(indexName).modulo(literal(2)).notIdentical(literal(0));
+ default:
+ throw new Error(`AssertionError: unknown @for loop variable ${variable2.value}`);
+ }
+}
+function ingestLetDeclaration(unit, node) {
+ const target = unit.job.allocateXrefId();
+ unit.create.push(createDeclareLetOp(target, node.name, node.sourceSpan));
+ unit.update.push(createStoreLetOp(target, node.name, convertAst(node.value, unit.job, node.valueSpan), node.sourceSpan));
+}
+function convertAst(ast, job, baseSourceSpan) {
+ if (ast instanceof ASTWithSource) {
+ return convertAst(ast.ast, job, baseSourceSpan);
+ } else if (ast instanceof PropertyRead) {
+ const isImplicitReceiver = ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver);
+ if (isImplicitReceiver) {
+ return new LexicalReadExpr(ast.name);
+ } else {
+ return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
+ }
+ } else if (ast instanceof Call) {
+ if (ast.receiver instanceof ImplicitReceiver) {
+ throw new Error(`Unexpected ImplicitReceiver`);
+ } else {
+ return new InvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((arg) => convertAst(arg, job, baseSourceSpan)), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ }
+ } else if (ast instanceof LiteralPrimitive) {
+ return literal(ast.value, void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof Unary) {
+ switch (ast.operator) {
+ case "+":
+ return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ case "-":
+ return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ default:
+ throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);
+ }
+ } else if (ast instanceof Binary) {
+ const operator = BINARY_OPERATORS.get(ast.operation);
+ if (operator === void 0) {
+ throw new Error(`AssertionError: unknown binary operator ${ast.operation}`);
+ }
+ return new BinaryOperatorExpr(operator, convertAst(ast.left, job, baseSourceSpan), convertAst(ast.right, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof ThisReceiver) {
+ return new ContextExpr(job.root.xref);
+ } else if (ast instanceof KeyedRead) {
+ return new ReadKeyExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof Chain) {
+ throw new Error(`AssertionError: Chain in unknown context`);
+ } else if (ast instanceof LiteralMap) {
+ const entries = ast.keys.map((key, idx) => {
+ const value = ast.values[idx];
+ return new LiteralMapEntry(key.key, convertAst(value, job, baseSourceSpan), key.quoted);
+ });
+ return new LiteralMapExpr(entries, void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof LiteralArray) {
+ return new LiteralArrayExpr(ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)));
+ } else if (ast instanceof Conditional) {
+ return new ConditionalExpr(convertAst(ast.condition, job, baseSourceSpan), convertAst(ast.trueExp, job, baseSourceSpan), convertAst(ast.falseExp, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof NonNullAssert) {
+ return convertAst(ast.expression, job, baseSourceSpan);
+ } else if (ast instanceof BindingPipe) {
+ return new PipeBindingExpr(job.allocateXrefId(), new SlotHandle(), ast.name, [
+ convertAst(ast.exp, job, baseSourceSpan),
+ ...ast.args.map((arg) => convertAst(arg, job, baseSourceSpan))
+ ]);
+ } else if (ast instanceof SafeKeyedRead) {
+ return new SafeKeyedReadExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof SafePropertyRead) {
+ return new SafePropertyReadExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name);
+ } else if (ast instanceof SafeCall) {
+ return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((a) => convertAst(a, job, baseSourceSpan)));
+ } else if (ast instanceof EmptyExpr$1) {
+ return new EmptyExpr2(convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof PrefixNot) {
+ return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof TypeofExpression) {
+ return typeofExpr(convertAst(ast.expression, job, baseSourceSpan));
+ } else if (ast instanceof VoidExpression) {
+ return new VoidExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof TemplateLiteral) {
+ return convertTemplateLiteral(ast, job, baseSourceSpan);
+ } else if (ast instanceof TaggedTemplateLiteral) {
+ return new TaggedTemplateLiteralExpr(convertAst(ast.tag, job, baseSourceSpan), convertTemplateLiteral(ast.template, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else if (ast instanceof ParenthesizedExpression) {
+ return new ParenthesizedExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
+ } else {
+ throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
+ }
+}
+function convertTemplateLiteral(ast, job, baseSourceSpan) {
+ return new TemplateLiteralExpr(ast.elements.map((el) => {
+ return new TemplateLiteralElementExpr(el.text, convertSourceSpan(el.span, baseSourceSpan));
+ }), ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)), convertSourceSpan(ast.span, baseSourceSpan));
+}
+function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) {
+ let expression;
+ if (value instanceof Interpolation$1) {
+ expression = new Interpolation2(value.strings, value.expressions.map((e) => convertAst(e, job, null)), Object.keys(asMessage(i18nMeta)?.placeholders ?? {}));
+ } else if (value instanceof AST) {
+ expression = convertAst(value, job, null);
+ } else {
+ expression = literal(value);
+ }
+ return expression;
+}
+var BINDING_KINDS = /* @__PURE__ */ new Map([
+ [BindingType.Property, BindingKind.Property],
+ [BindingType.TwoWay, BindingKind.TwoWayProperty],
+ [BindingType.Attribute, BindingKind.Attribute],
+ [BindingType.Class, BindingKind.ClassName],
+ [BindingType.Style, BindingKind.StyleProperty],
+ [BindingType.LegacyAnimation, BindingKind.LegacyAnimation]
+]);
+function isPlainTemplate(tmpl) {
+ return splitNsName(tmpl.tagName ?? "")[1] === NG_TEMPLATE_TAG_NAME;
+}
+function asMessage(i18nMeta) {
+ if (i18nMeta == null) {
+ return null;
+ }
+ if (!(i18nMeta instanceof Message)) {
+ throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`);
+ }
+ return i18nMeta;
+}
+function ingestElementBindings(unit, op, element2) {
+ let bindings = new Array();
+ let i18nAttributeBindingNames = /* @__PURE__ */ new Set();
+ for (const attr of element2.attributes) {
+ const securityContext = domSchema.securityContext(element2.name, attr.name, true);
+ bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
+ if (attr.i18n) {
+ i18nAttributeBindingNames.add(attr.name);
+ }
+ }
+ for (const input of element2.inputs) {
+ if (i18nAttributeBindingNames.has(input.name)) {
+ console.error(`On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`);
+ }
+ bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, asMessage(input.i18n) ?? null, input.sourceSpan));
+ }
+ unit.create.push(bindings.filter((b) => b?.kind === OpKind.ExtractedAttribute));
+ unit.update.push(bindings.filter((b) => b?.kind === OpKind.Binding));
+ for (const output of element2.outputs) {
+ if (output.type === ParsedEventType.LegacyAnimation && output.phase === null) {
+ throw Error("Animation listener should have a phase");
+ }
+ if (output.type === ParsedEventType.TwoWay) {
+ unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan));
+ } else {
+ unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
+ }
+ }
+ if (bindings.some((b) => b?.i18nMessage) !== null) {
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
+ }
+}
+function ingestTemplateBindings(unit, op, template2, templateKind) {
+ let bindings = new Array();
+ for (const attr of template2.templateAttrs) {
+ if (attr instanceof TextAttribute) {
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
+ bindings.push(createTemplateBinding(unit, op.xref, BindingType.Attribute, attr.name, attr.value, null, securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
+ } else {
+ bindings.push(createTemplateBinding(unit, op.xref, attr.type, attr.name, astOf(attr.value), attr.unit, attr.securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
+ }
+ }
+ for (const attr of template2.attributes) {
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
+ bindings.push(createTemplateBinding(unit, op.xref, BindingType.Attribute, attr.name, attr.value, null, securityContext, false, templateKind, asMessage(attr.i18n), attr.sourceSpan));
+ }
+ for (const input of template2.inputs) {
+ bindings.push(createTemplateBinding(unit, op.xref, input.type, input.name, astOf(input.value), input.unit, input.securityContext, false, templateKind, asMessage(input.i18n), input.sourceSpan));
+ }
+ unit.create.push(bindings.filter((b) => b?.kind === OpKind.ExtractedAttribute));
+ unit.update.push(bindings.filter((b) => b?.kind === OpKind.Binding));
+ for (const output of template2.outputs) {
+ if (output.type === ParsedEventType.LegacyAnimation && output.phase === null) {
+ throw Error("Animation listener should have a phase");
+ }
+ if (templateKind === TemplateKind.NgTemplate) {
+ if (output.type === ParsedEventType.TwoWay) {
+ unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan));
+ } else {
+ unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
+ }
+ }
+ if (templateKind === TemplateKind.Structural && output.type !== ParsedEventType.LegacyAnimation) {
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, output.name, false);
+ unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, null, output.name, null, null, null, securityContext));
+ }
+ }
+ if (bindings.some((b) => b?.i18nMessage) !== null) {
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
+ }
+}
+function createTemplateBinding(view, xref, type, name, value, unit, securityContext, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
+ const isTextBinding = typeof value === "string";
+ if (templateKind === TemplateKind.Structural) {
+ if (!isStructuralTemplateAttribute) {
+ switch (type) {
+ case BindingType.Property:
+ case BindingType.Class:
+ case BindingType.Style:
+ return createExtractedAttributeOp(xref, BindingKind.Property, null, name, null, null, i18nMessage, securityContext);
+ case BindingType.TwoWay:
+ return createExtractedAttributeOp(xref, BindingKind.TwoWayProperty, null, name, null, null, i18nMessage, securityContext);
+ }
+ }
+ if (!isTextBinding && (type === BindingType.Attribute || type === BindingType.LegacyAnimation)) {
+ return null;
+ }
+ }
+ let bindingType = BINDING_KINDS.get(type);
+ if (templateKind === TemplateKind.NgTemplate) {
+ if (type === BindingType.Class || type === BindingType.Style || type === BindingType.Attribute && !isTextBinding) {
+ bindingType = BindingKind.Property;
+ }
+ }
+ return createBindingOp(xref, bindingType, name, convertAstWithInterpolation(view.job, value, i18nMessage), unit, securityContext, isTextBinding, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan);
+}
+function makeListenerHandlerOps(unit, handler, handlerSpan) {
+ handler = astOf(handler);
+ const handlerOps = new Array();
+ let handlerExprs = handler instanceof Chain ? handler.expressions : [handler];
+ if (handlerExprs.length === 0) {
+ throw new Error("Expected listener to have non-empty expression list.");
+ }
+ const expressions = handlerExprs.map((expr) => convertAst(expr, unit.job, handlerSpan));
+ const returnExpr = expressions.pop();
+ handlerOps.push(...expressions.map((e) => createStatementOp(new ExpressionStatement(e, e.sourceSpan))));
+ handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
+ return handlerOps;
+}
+function makeTwoWayListenerHandlerOps(unit, handler, handlerSpan) {
+ handler = astOf(handler);
+ const handlerOps = new Array();
+ if (handler instanceof Chain) {
+ if (handler.expressions.length === 1) {
+ handler = handler.expressions[0];
+ } else {
+ throw new Error("Expected two-way listener to have a single expression.");
+ }
+ }
+ const handlerExpr = convertAst(handler, unit.job, handlerSpan);
+ const eventReference = new LexicalReadExpr("$event");
+ const twoWaySetExpr = new TwoWayBindingSetExpr(handlerExpr, eventReference);
+ handlerOps.push(createStatementOp(new ExpressionStatement(twoWaySetExpr)));
+ handlerOps.push(createStatementOp(new ReturnStatement(eventReference)));
+ return handlerOps;
+}
+function astOf(ast) {
+ return ast instanceof ASTWithSource ? ast.ast : ast;
+}
+function ingestReferences(op, element2) {
+ assertIsArray(op.localRefs);
+ for (const { name, value } of element2.references) {
+ op.localRefs.push({
+ name,
+ target: value
+ });
+ }
+}
+function assertIsArray(value) {
+ if (!Array.isArray(value)) {
+ throw new Error(`AssertionError: expected an array`);
+ }
+}
+function convertSourceSpan(span, baseSourceSpan) {
+ if (baseSourceSpan === null) {
+ return null;
+ }
+ const start = baseSourceSpan.start.moveBy(span.start);
+ const end = baseSourceSpan.start.moveBy(span.end);
+ const fullStart = baseSourceSpan.fullStart.moveBy(span.start);
+ return new ParseSourceSpan(start, end, fullStart);
+}
+function ingestControlFlowInsertionPoint(unit, xref, node) {
+ let root = null;
+ for (const child of node.children) {
+ if (child instanceof Comment$1 || child instanceof LetDeclaration$1) {
+ continue;
+ }
+ if (root !== null) {
+ return null;
+ }
+ if (child instanceof Element$1 || child instanceof Template && child.tagName !== null) {
+ root = child;
+ } else {
+ return null;
+ }
+ }
+ if (root !== null) {
+ for (const attr of root.attributes) {
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
+ unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
+ }
+ for (const attr of root.inputs) {
+ if (attr.type !== BindingType.LegacyAnimation && attr.type !== BindingType.Attribute) {
+ const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
+ unit.create.push(createExtractedAttributeOp(xref, BindingKind.Property, null, attr.name, null, null, null, securityContext));
+ }
+ }
+ const tagName = root instanceof Element$1 ? root.name : root.tagName;
+ return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;
+ }
+ return null;
+}
+var ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
+function setEnableTemplateSourceLocations(value) {
+ ENABLE_TEMPLATE_SOURCE_LOCATIONS = value;
+}
+function getTemplateSourceLocationsEnabled() {
+ return ENABLE_TEMPLATE_SOURCE_LOCATIONS;
+}
+function renderFlagCheckIfStmt(flags, statements) {
+ return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null), statements);
+}
+function toQueryFlags(query) {
+ return (query.descendants ? 1 : 0) | (query.static ? 2 : 0) | (query.emitDistinctChangesOnly ? 4 : 0);
+}
+function getQueryPredicate(query, constantPool) {
+ if (Array.isArray(query.predicate)) {
+ let predicate = [];
+ query.predicate.forEach((selector) => {
+ const selectors = selector.split(",").map((token) => literal(token.trim()));
+ predicate.push(...selectors);
+ });
+ return constantPool.getConstLiteral(literalArr(predicate), true);
+ } else {
+ switch (query.predicate.forwardRef) {
+ case 0:
+ case 2:
+ return query.predicate.expression;
+ case 1:
+ return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
+ }
+ }
+}
+function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) {
+ const parameters = [];
+ if (prependParams !== void 0) {
+ parameters.push(...prependParams);
+ }
+ if (query.isSignal) {
+ parameters.push(new ReadPropExpr(variable(CONTEXT_NAME), query.propertyName));
+ }
+ parameters.push(getQueryPredicate(query, constantPool), literal(toQueryFlags(query)));
+ if (query.read) {
+ parameters.push(query.read);
+ }
+ const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;
+ return importExpr(queryCreateFn).callFn(parameters);
+}
+var queryAdvancePlaceholder = Symbol("queryAdvancePlaceholder");
+function collapseAdvanceStatements(statements) {
+ const result = [];
+ let advanceCollapseCount = 0;
+ const flushAdvanceCount = () => {
+ if (advanceCollapseCount > 0) {
+ result.unshift(importExpr(Identifiers.queryAdvance).callFn(advanceCollapseCount === 1 ? [] : [literal(advanceCollapseCount)]).toStmt());
+ advanceCollapseCount = 0;
+ }
+ };
+ for (let i = statements.length - 1; i >= 0; i--) {
+ const st = statements[i];
+ if (st === queryAdvancePlaceholder) {
+ advanceCollapseCount++;
+ } else {
+ flushAdvanceCount();
+ result.unshift(st);
+ }
+ }
+ flushAdvanceCount();
+ return result;
+}
+function createViewQueriesFunction(viewQueries, constantPool, name) {
+ const createStatements = [];
+ const updateStatements = [];
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
+ viewQueries.forEach((query) => {
+ const queryDefinitionCall = createQueryCreateCall(query, constantPool, {
+ signalBased: Identifiers.viewQuerySignal,
+ nonSignal: Identifiers.viewQuery
+ });
+ createStatements.push(queryDefinitionCall.toStmt());
+ if (query.isSignal) {
+ updateStatements.push(queryAdvancePlaceholder);
+ return;
+ }
+ const temporary = tempAllocator();
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
+ updateStatements.push(refresh.and(updateDirective).toStmt());
+ });
+ const viewQueryFnName = name ? `${name}_Query` : null;
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
+ renderFlagCheckIfStmt(1, createStatements),
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
+ ], INFERRED_TYPE, null, viewQueryFnName);
+}
+function createContentQueriesFunction(queries, constantPool, name) {
+ const createStatements = [];
+ const updateStatements = [];
+ const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);
+ for (const query of queries) {
+ createStatements.push(createQueryCreateCall(
+ query,
+ constantPool,
+ { nonSignal: Identifiers.contentQuery, signalBased: Identifiers.contentQuerySignal },
+ /* prependParams */
+ [variable("dirIndex")]
+ ).toStmt());
+ if (query.isSignal) {
+ updateStatements.push(queryAdvancePlaceholder);
+ continue;
+ }
+ const temporary = tempAllocator();
+ const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
+ const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
+ const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop("first") : temporary);
+ updateStatements.push(refresh.and(updateDirective).toStmt());
+ }
+ const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
+ return fn([
+ new FnParam(RENDER_FLAGS, NUMBER_TYPE),
+ new FnParam(CONTEXT_NAME, null),
+ new FnParam("dirIndex", null)
+ ], [
+ renderFlagCheckIfStmt(1, createStatements),
+ renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))
+ ], INFERRED_TYPE, null, contentQueriesFnName);
+}
+var HtmlParser = class extends Parser$1 {
+ constructor() {
+ super(getHtmlTagDefinition);
+ }
+ parse(source, url, options) {
+ return super.parse(source, url, options);
+ }
+};
+var PROPERTY_PARTS_SEPARATOR = ".";
+var ATTRIBUTE_PREFIX = "attr";
+var CLASS_PREFIX = "class";
+var STYLE_PREFIX = "style";
+var TEMPLATE_ATTR_PREFIX$1 = "*";
+var LEGACY_ANIMATE_PROP_PREFIX = "animate-";
+var BindingParser = class {
+ _exprParser;
+ _interpolationConfig;
+ _schemaRegistry;
+ errors;
+ constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) {
+ this._exprParser = _exprParser;
+ this._interpolationConfig = _interpolationConfig;
+ this._schemaRegistry = _schemaRegistry;
+ this.errors = errors;
+ }
+ get interpolationConfig() {
+ return this._interpolationConfig;
+ }
+ createBoundHostProperties(properties, sourceSpan) {
+ const boundProps = [];
+ for (const propName of Object.keys(properties)) {
+ const expression = properties[propName];
+ if (typeof expression === "string") {
+ this.parsePropertyBinding(
+ propName,
+ expression,
+ true,
+ false,
+ sourceSpan,
+ sourceSpan.start.offset,
+ void 0,
+ [],
+ // Use the `sourceSpan` for `keySpan`. This isn't really accurate, but neither is the
+ // sourceSpan, as it represents the sourceSpan of the host itself rather than the
+ // source of the host binding (which doesn't exist in the template). Regardless,
+ // neither of these values are used in Ivy but are only here to satisfy the function
+ // signature. This should likely be refactored in the future so that `sourceSpan`
+ // isn't being used inaccurately.
+ boundProps,
+ sourceSpan
+ );
+ } else {
+ this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
+ }
+ }
+ return boundProps;
+ }
+ createDirectiveHostEventAsts(hostListeners, sourceSpan) {
+ const targetEvents = [];
+ for (const propName of Object.keys(hostListeners)) {
+ const expression = hostListeners[propName];
+ if (typeof expression === "string") {
+ this.parseEvent(
+ propName,
+ expression,
+ /* isAssignmentEvent */
+ false,
+ sourceSpan,
+ sourceSpan,
+ [],
+ targetEvents,
+ sourceSpan
+ );
+ } else {
+ this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
+ }
+ }
+ return targetEvents;
+ }
+ parseInterpolation(value, sourceSpan, interpolatedTokens) {
+ const absoluteOffset = sourceSpan.fullStart.offset;
+ try {
+ const ast = this._exprParser.parseInterpolation(value, sourceSpan, absoluteOffset, interpolatedTokens, this._interpolationConfig);
+ if (ast) {
+ this.errors.push(...ast.errors);
+ }
+ return ast;
+ } catch (e) {
+ this._reportError(`${e}`, sourceSpan);
+ return this._exprParser.wrapLiteralPrimitive("ERROR", sourceSpan, absoluteOffset);
+ }
+ }
+ /**
+ * Similar to `parseInterpolation`, but treats the provided string as a single expression
+ * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
+ * This is used for parsing the switch expression in ICUs.
+ */
+ parseInterpolationExpression(expression, sourceSpan) {
+ const absoluteOffset = sourceSpan.start.offset;
+ try {
+ const ast = this._exprParser.parseInterpolationExpression(expression, sourceSpan, absoluteOffset);
+ if (ast) {
+ this.errors.push(...ast.errors);
+ }
+ return ast;
+ } catch (e) {
+ this._reportError(`${e}`, sourceSpan);
+ return this._exprParser.wrapLiteralPrimitive("ERROR", sourceSpan, absoluteOffset);
+ }
+ }
+ /**
+ * Parses the bindings in a microsyntax expression, and converts them to
+ * `ParsedProperty` or `ParsedVariable`.
+ *
+ * @param tplKey template binding name
+ * @param tplValue template binding value
+ * @param sourceSpan span of template binding relative to entire the template
+ * @param absoluteValueOffset start of the tplValue relative to the entire template
+ * @param targetMatchableAttrs potential attributes to match in the template
+ * @param targetProps target property bindings in the template
+ * @param targetVars target variables in the template
+ */
+ parseInlineTemplateBinding(tplKey, tplValue, sourceSpan, absoluteValueOffset, targetMatchableAttrs, targetProps, targetVars, isIvyAst) {
+ const absoluteKeyOffset = sourceSpan.start.offset + TEMPLATE_ATTR_PREFIX$1.length;
+ const bindings = this._parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset);
+ for (const binding of bindings) {
+ const bindingSpan = moveParseSourceSpan(sourceSpan, binding.sourceSpan);
+ const key = binding.key.source;
+ const keySpan = moveParseSourceSpan(sourceSpan, binding.key.span);
+ if (binding instanceof VariableBinding) {
+ const value = binding.value ? binding.value.source : "$implicit";
+ const valueSpan = binding.value ? moveParseSourceSpan(sourceSpan, binding.value.span) : void 0;
+ targetVars.push(new ParsedVariable(key, value, bindingSpan, keySpan, valueSpan));
+ } else if (binding.value) {
+ const srcSpan = isIvyAst ? bindingSpan : sourceSpan;
+ const valueSpan = moveParseSourceSpan(sourceSpan, binding.value.ast.sourceSpan);
+ this._parsePropertyAst(key, binding.value, false, srcSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
+ } else {
+ targetMatchableAttrs.push([
+ key,
+ ""
+ /* value */
+ ]);
+ this.parseLiteralAttr(key, null, keySpan, absoluteValueOffset, void 0, targetMatchableAttrs, targetProps, keySpan);
+ }
+ }
+ }
+ /**
+ * Parses the bindings in a microsyntax expression, e.g.
+ * ```html
+ *
+ * ```
+ *
+ * @param tplKey template binding name
+ * @param tplValue template binding value
+ * @param sourceSpan span of template binding relative to entire the template
+ * @param absoluteKeyOffset start of the `tplKey`
+ * @param absoluteValueOffset start of the `tplValue`
+ */
+ _parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset) {
+ try {
+ const bindingsResult = this._exprParser.parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset);
+ bindingsResult.errors.forEach((e) => this.errors.push(e));
+ bindingsResult.warnings.forEach((warning) => {
+ this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING);
+ });
+ return bindingsResult.templateBindings;
+ } catch (e) {
+ this._reportError(`${e}`, sourceSpan);
+ return [];
+ }
+ }
+ parseLiteralAttr(name, value, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) {
+ if (isLegacyAnimationLabel(name)) {
+ name = name.substring(1);
+ if (keySpan !== void 0) {
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
+ }
+ if (value) {
+ this._reportError(`Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.`, sourceSpan, ParseErrorLevel.ERROR);
+ }
+ this._parseLegacyAnimation(name, value, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);
+ } else {
+ targetProps.push(new ParsedProperty(name, this._exprParser.wrapLiteralPrimitive(value, "", absoluteOffset), ParsedPropertyType.LITERAL_ATTR, sourceSpan, keySpan, valueSpan));
+ }
+ }
+ parsePropertyBinding(name, expression, isHost, isPartOfAssignmentBinding, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) {
+ if (name.length === 0) {
+ this._reportError(`Property name is missing in binding`, sourceSpan);
+ }
+ let isLegacyAnimationProp = false;
+ if (name.startsWith(LEGACY_ANIMATE_PROP_PREFIX)) {
+ isLegacyAnimationProp = true;
+ name = name.substring(LEGACY_ANIMATE_PROP_PREFIX.length);
+ if (keySpan !== void 0) {
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + LEGACY_ANIMATE_PROP_PREFIX.length, keySpan.end.offset));
+ }
+ } else if (isLegacyAnimationLabel(name)) {
+ isLegacyAnimationProp = true;
+ name = name.substring(1);
+ if (keySpan !== void 0) {
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
+ }
+ }
+ if (isLegacyAnimationProp) {
+ this._parseLegacyAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps);
+ } else {
+ this._parsePropertyAst(name, this.parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
+ }
+ }
+ parsePropertyInterpolation(name, value, sourceSpan, valueSpan, targetMatchableAttrs, targetProps, keySpan, interpolatedTokens) {
+ const expr = this.parseInterpolation(value, valueSpan || sourceSpan, interpolatedTokens);
+ if (expr) {
+ this._parsePropertyAst(name, expr, false, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
+ return true;
+ }
+ return false;
+ }
+ _parsePropertyAst(name, ast, isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps) {
+ targetMatchableAttrs.push([name, ast.source]);
+ targetProps.push(new ParsedProperty(name, ast, isPartOfAssignmentBinding ? ParsedPropertyType.TWO_WAY : ParsedPropertyType.DEFAULT, sourceSpan, keySpan, valueSpan));
+ }
+ _parseLegacyAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps) {
+ if (name.length === 0) {
+ this._reportError("Animation trigger is missing", sourceSpan);
+ }
+ const ast = this.parseBinding(expression || "undefined", false, valueSpan || sourceSpan, absoluteOffset);
+ targetMatchableAttrs.push([name, ast.source]);
+ targetProps.push(new ParsedProperty(name, ast, ParsedPropertyType.LEGACY_ANIMATION, sourceSpan, keySpan, valueSpan));
+ }
+ parseBinding(value, isHostBinding2, sourceSpan, absoluteOffset) {
+ try {
+ const ast = isHostBinding2 ? this._exprParser.parseSimpleBinding(value, sourceSpan, absoluteOffset, this._interpolationConfig) : this._exprParser.parseBinding(value, sourceSpan, absoluteOffset, this._interpolationConfig);
+ if (ast) {
+ this.errors.push(...ast.errors);
+ }
+ return ast;
+ } catch (e) {
+ this._reportError(`${e}`, sourceSpan);
+ return this._exprParser.wrapLiteralPrimitive("ERROR", sourceSpan, absoluteOffset);
+ }
+ }
+ createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) {
+ if (boundProp.isLegacyAnimation) {
+ return new BoundElementProperty(boundProp.name, BindingType.LegacyAnimation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
+ }
+ let unit = null;
+ let bindingType = void 0;
+ let boundPropertyName = null;
+ const parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);
+ let securityContexts = void 0;
+ if (parts.length > 1) {
+ if (parts[0] == ATTRIBUTE_PREFIX) {
+ boundPropertyName = parts.slice(1).join(PROPERTY_PARTS_SEPARATOR);
+ if (!skipValidation) {
+ this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);
+ }
+ securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);
+ const nsSeparatorIdx = boundPropertyName.indexOf(":");
+ if (nsSeparatorIdx > -1) {
+ const ns = boundPropertyName.substring(0, nsSeparatorIdx);
+ const name = boundPropertyName.substring(nsSeparatorIdx + 1);
+ boundPropertyName = mergeNsAndName(ns, name);
+ }
+ bindingType = BindingType.Attribute;
+ } else if (parts[0] == CLASS_PREFIX) {
+ boundPropertyName = parts[1];
+ bindingType = BindingType.Class;
+ securityContexts = [SecurityContext.NONE];
+ } else if (parts[0] == STYLE_PREFIX) {
+ unit = parts.length > 2 ? parts[2] : null;
+ boundPropertyName = parts[1];
+ bindingType = BindingType.Style;
+ securityContexts = [SecurityContext.STYLE];
+ }
+ }
+ if (boundPropertyName === null) {
+ const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);
+ boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;
+ securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);
+ bindingType = boundProp.type === ParsedPropertyType.TWO_WAY ? BindingType.TwoWay : BindingType.Property;
+ if (!skipValidation) {
+ this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);
+ }
+ }
+ return new BoundElementProperty(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
+ }
+ // TODO: keySpan should be required but was made optional to avoid changing VE parser.
+ parseEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
+ if (name.length === 0) {
+ this._reportError(`Event name is missing in binding`, sourceSpan);
+ }
+ if (isLegacyAnimationLabel(name)) {
+ name = name.slice(1);
+ if (keySpan !== void 0) {
+ keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
+ }
+ this._parseLegacyAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);
+ } else {
+ this._parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
+ }
+ }
+ calcPossibleSecurityContexts(selector, propName, isAttribute) {
+ const prop = this._schemaRegistry.getMappedPropName(propName);
+ return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);
+ }
+ parseEventListenerName(rawName) {
+ const [target, eventName] = splitAtColon(rawName, [null, rawName]);
+ return { eventName, target };
+ }
+ parseLegacyAnimationEventName(rawName) {
+ const matches = splitAtPeriod(rawName, [rawName, null]);
+ return { eventName: matches[0], phase: matches[1] === null ? null : matches[1].toLowerCase() };
+ }
+ _parseLegacyAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {
+ const { eventName, phase } = this.parseLegacyAnimationEventName(name);
+ const ast = this._parseAction(expression, handlerSpan);
+ targetEvents.push(new ParsedEvent(eventName, phase, ParsedEventType.LegacyAnimation, ast, sourceSpan, handlerSpan, keySpan));
+ if (eventName.length === 0) {
+ this._reportError(`Animation event name is missing in binding`, sourceSpan);
+ }
+ if (phase) {
+ if (phase !== "start" && phase !== "done") {
+ this._reportError(`The provided animation output phase value "${phase}" for "@${eventName}" is not supported (use start or done)`, sourceSpan);
+ }
+ } else {
+ this._reportError(`The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`, sourceSpan);
+ }
+ }
+ _parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
+ const { eventName, target } = this.parseEventListenerName(name);
+ const prevErrorCount = this.errors.length;
+ const ast = this._parseAction(expression, handlerSpan);
+ const isValid = this.errors.length === prevErrorCount;
+ targetMatchableAttrs.push([name, ast.source]);
+ if (isAssignmentEvent && isValid && !this._isAllowedAssignmentEvent(ast)) {
+ this._reportError("Unsupported expression in a two-way binding", sourceSpan);
+ }
+ targetEvents.push(new ParsedEvent(eventName, target, isAssignmentEvent ? ParsedEventType.TwoWay : ParsedEventType.Regular, ast, sourceSpan, handlerSpan, keySpan));
+ }
+ _parseAction(value, sourceSpan) {
+ const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0;
+ try {
+ const ast = this._exprParser.parseAction(value, sourceSpan, absoluteOffset, this._interpolationConfig);
+ if (ast) {
+ this.errors.push(...ast.errors);
+ }
+ if (!ast || ast.ast instanceof EmptyExpr$1) {
+ this._reportError(`Empty expressions are not allowed`, sourceSpan);
+ return this._exprParser.wrapLiteralPrimitive("ERROR", sourceSpan, absoluteOffset);
+ }
+ return ast;
+ } catch (e) {
+ this._reportError(`${e}`, sourceSpan);
+ return this._exprParser.wrapLiteralPrimitive("ERROR", sourceSpan, absoluteOffset);
+ }
+ }
+ _reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
+ this.errors.push(new ParseError(sourceSpan, message, level));
+ }
+ /**
+ * @param propName the name of the property / attribute
+ * @param sourceSpan
+ * @param isAttr true when binding to an attribute
+ */
+ _validatePropertyOrAttributeName(propName, sourceSpan, isAttr) {
+ const report = isAttr ? this._schemaRegistry.validateAttribute(propName) : this._schemaRegistry.validateProperty(propName);
+ if (report.error) {
+ this._reportError(report.msg, sourceSpan, ParseErrorLevel.ERROR);
+ }
+ }
+ /**
+ * Returns whether a parsed AST is allowed to be used within the event side of a two-way binding.
+ * @param ast Parsed AST to be checked.
+ */
+ _isAllowedAssignmentEvent(ast) {
+ if (ast instanceof ASTWithSource) {
+ return this._isAllowedAssignmentEvent(ast.ast);
+ }
+ if (ast instanceof NonNullAssert) {
+ return this._isAllowedAssignmentEvent(ast.expression);
+ }
+ if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver && !(ast.receiver.receiver instanceof ThisReceiver)) {
+ return this._isAllowedAssignmentEvent(ast.args[0]);
+ }
+ if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
+ if (!hasRecursiveSafeReceiver(ast)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+function hasRecursiveSafeReceiver(ast) {
+ if (ast instanceof SafePropertyRead || ast instanceof SafeKeyedRead) {
+ return true;
+ }
+ if (ast instanceof ParenthesizedExpression) {
+ return hasRecursiveSafeReceiver(ast.expression);
+ }
+ if (ast instanceof PropertyRead || ast instanceof KeyedRead || ast instanceof Call) {
+ return hasRecursiveSafeReceiver(ast.receiver);
+ }
+ return false;
+}
+function isLegacyAnimationLabel(name) {
+ return name[0] == "@";
+}
+function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {
+ let ctxs;
+ const nameToContext = (elName) => registry.securityContext(elName, propName, isAttribute);
+ if (selector === null) {
+ ctxs = registry.allKnownElementNames().map(nameToContext);
+ } else {
+ ctxs = [];
+ CssSelector.parse(selector).forEach((selector2) => {
+ const elementNames = selector2.element ? [selector2.element] : registry.allKnownElementNames();
+ const notElementNames = new Set(selector2.notSelectors.filter((selector3) => selector3.isElementSelector()).map((selector3) => selector3.element));
+ const possibleElementNames = elementNames.filter((elName) => !notElementNames.has(elName));
+ ctxs.push(...possibleElementNames.map(nameToContext));
+ });
+ }
+ return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();
+}
+function moveParseSourceSpan(sourceSpan, absoluteSpan) {
+ const startDiff = absoluteSpan.start - sourceSpan.start.offset;
+ const endDiff = absoluteSpan.end - sourceSpan.end.offset;
+ return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
+}
+function isStyleUrlResolvable(url) {
+ if (url == null || url.length === 0 || url[0] == "/")
+ return false;
+ const schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);
+ return schemeMatch === null || schemeMatch[1] == "package" || schemeMatch[1] == "asset";
+}
+var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
+var NG_CONTENT_SELECT_ATTR = "select";
+var LINK_ELEMENT = "link";
+var LINK_STYLE_REL_ATTR = "rel";
+var LINK_STYLE_HREF_ATTR = "href";
+var LINK_STYLE_REL_VALUE = "stylesheet";
+var STYLE_ELEMENT = "style";
+var SCRIPT_ELEMENT = "script";
+var NG_NON_BINDABLE_ATTR = "ngNonBindable";
+var NG_PROJECT_AS = "ngProjectAs";
+function preparseElement(ast) {
+ let selectAttr = null;
+ let hrefAttr = null;
+ let relAttr = null;
+ let nonBindable = false;
+ let projectAs = "";
+ ast.attrs.forEach((attr) => {
+ const lcAttrName = attr.name.toLowerCase();
+ if (lcAttrName == NG_CONTENT_SELECT_ATTR) {
+ selectAttr = attr.value;
+ } else if (lcAttrName == LINK_STYLE_HREF_ATTR) {
+ hrefAttr = attr.value;
+ } else if (lcAttrName == LINK_STYLE_REL_ATTR) {
+ relAttr = attr.value;
+ } else if (attr.name == NG_NON_BINDABLE_ATTR) {
+ nonBindable = true;
+ } else if (attr.name == NG_PROJECT_AS) {
+ if (attr.value.length > 0) {
+ projectAs = attr.value;
+ }
+ }
+ });
+ selectAttr = normalizeNgContentSelect(selectAttr);
+ const nodeName = ast.name.toLowerCase();
+ let type = PreparsedElementType.OTHER;
+ if (isNgContent(nodeName)) {
+ type = PreparsedElementType.NG_CONTENT;
+ } else if (nodeName == STYLE_ELEMENT) {
+ type = PreparsedElementType.STYLE;
+ } else if (nodeName == SCRIPT_ELEMENT) {
+ type = PreparsedElementType.SCRIPT;
+ } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {
+ type = PreparsedElementType.STYLESHEET;
+ }
+ return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);
+}
+var PreparsedElementType;
+(function(PreparsedElementType2) {
+ PreparsedElementType2[PreparsedElementType2["NG_CONTENT"] = 0] = "NG_CONTENT";
+ PreparsedElementType2[PreparsedElementType2["STYLE"] = 1] = "STYLE";
+ PreparsedElementType2[PreparsedElementType2["STYLESHEET"] = 2] = "STYLESHEET";
+ PreparsedElementType2[PreparsedElementType2["SCRIPT"] = 3] = "SCRIPT";
+ PreparsedElementType2[PreparsedElementType2["OTHER"] = 4] = "OTHER";
+})(PreparsedElementType || (PreparsedElementType = {}));
+var PreparsedElement = class {
+ type;
+ selectAttr;
+ hrefAttr;
+ nonBindable;
+ projectAs;
+ constructor(type, selectAttr, hrefAttr, nonBindable, projectAs) {
+ this.type = type;
+ this.selectAttr = selectAttr;
+ this.hrefAttr = hrefAttr;
+ this.nonBindable = nonBindable;
+ this.projectAs = projectAs;
+ }
+};
+function normalizeNgContentSelect(selectAttr) {
+ if (selectAttr === null || selectAttr.length === 0) {
+ return "*";
+ }
+ return selectAttr;
+}
+var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
+var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
+var CONDITIONAL_ALIAS_PATTERN = /^(as\s+)(.*)/;
+var ELSE_IF_PATTERN = /^else[^\S\r\n]+if/;
+var FOR_LOOP_LET_PATTERN = /^let\s+([\S\s]*)/;
+var IDENTIFIER_PATTERN = /^[$A-Z_][0-9A-Z_$]*$/i;
+var CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN = /(\s*)(\S+)(\s*)/;
+var ALLOWED_FOR_LOOP_LET_VARIABLES = /* @__PURE__ */ new Set([
+ "$index",
+ "$first",
+ "$last",
+ "$even",
+ "$odd",
+ "$count"
+]);
+function isConnectedForLoopBlock(name) {
+ return name === "empty";
+}
+function isConnectedIfLoopBlock(name) {
+ return name === "else" || ELSE_IF_PATTERN.test(name);
+}
+function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
+ const errors = validateIfConnectedBlocks(connectedBlocks);
+ const branches = [];
+ const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);
+ if (mainBlockParams !== null) {
+ branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan, ast.i18n));
+ }
+ for (const block of connectedBlocks) {
+ if (ELSE_IF_PATTERN.test(block.name)) {
+ const params = parseConditionalBlockParameters(block, errors, bindingParser);
+ if (params !== null) {
+ const children = visitAll(visitor, block.children, block.children);
+ branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
+ }
+ } else if (block.name === "else") {
+ const children = visitAll(visitor, block.children, block.children);
+ branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
+ }
+ }
+ const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;
+ const ifBlockEndSourceSpan = branches.length > 0 ? branches[branches.length - 1].endSourceSpan : ast.endSourceSpan;
+ let wholeSourceSpan = ast.sourceSpan;
+ const lastBranch = branches[branches.length - 1];
+ if (lastBranch !== void 0) {
+ wholeSourceSpan = new ParseSourceSpan(ifBlockStartSourceSpan.start, lastBranch.sourceSpan.end);
+ }
+ return {
+ node: new IfBlock(branches, wholeSourceSpan, ast.startSourceSpan, ifBlockEndSourceSpan, ast.nameSpan),
+ errors
+ };
+}
+function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
+ const errors = [];
+ const params = parseForLoopParameters(ast, errors, bindingParser);
+ let node = null;
+ let empty = null;
+ for (const block of connectedBlocks) {
+ if (block.name === "empty") {
+ if (empty !== null) {
+ errors.push(new ParseError(block.sourceSpan, "@for loop can only have one @empty block"));
+ } else if (block.parameters.length > 0) {
+ errors.push(new ParseError(block.sourceSpan, "@empty block cannot have parameters"));
+ } else {
+ empty = new ForLoopBlockEmpty(visitAll(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n);
+ }
+ } else {
+ errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`));
+ }
+ }
+ if (params !== null) {
+ if (params.trackBy === null) {
+ errors.push(new ParseError(ast.startSourceSpan, '@for loop must have a "track" expression'));
+ } else {
+ const endSpan = empty?.endSourceSpan ?? ast.endSourceSpan;
+ const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, endSpan?.end ?? ast.sourceSpan.end);
+ node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n);
+ }
+ }
+ return { node, errors };
+}
+function createSwitchBlock(ast, visitor, bindingParser) {
+ const errors = validateSwitchBlock(ast);
+ const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding("", false, ast.sourceSpan, 0);
+ const cases = [];
+ const unknownBlocks = [];
+ let defaultCase = null;
+ for (const node of ast.children) {
+ if (!(node instanceof Block)) {
+ continue;
+ }
+ if ((node.name !== "case" || node.parameters.length === 0) && node.name !== "default") {
+ unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan, node.nameSpan));
+ continue;
+ }
+ const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
+ const ast2 = new SwitchBlockCase(expression, visitAll(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan, node.i18n);
+ if (expression === null) {
+ defaultCase = ast2;
+ } else {
+ cases.push(ast2);
+ }
+ }
+ if (defaultCase !== null) {
+ cases.push(defaultCase);
+ }
+ return {
+ node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan),
+ errors
+ };
+}
+function parseForLoopParameters(block, errors, bindingParser) {
+ if (block.parameters.length === 0) {
+ errors.push(new ParseError(block.startSourceSpan, "@for loop does not have an expression"));
+ return null;
+ }
+ const [expressionParam, ...secondaryParams] = block.parameters;
+ const match = stripOptionalParentheses(expressionParam, errors)?.match(FOR_LOOP_EXPRESSION_PATTERN);
+ if (!match || match[2].trim().length === 0) {
+ errors.push(new ParseError(expressionParam.sourceSpan, 'Cannot parse expression. @for loop expression must match the pattern " of "'));
+ return null;
+ }
+ const [, itemName, rawExpression] = match;
+ if (ALLOWED_FOR_LOOP_LET_VARIABLES.has(itemName)) {
+ errors.push(new ParseError(expressionParam.sourceSpan, `@for loop item name cannot be one of ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(", ")}.`));
+ }
+ const variableName = expressionParam.expression.split(" ")[0];
+ const variableSpan = new ParseSourceSpan(expressionParam.sourceSpan.start, expressionParam.sourceSpan.start.moveBy(variableName.length));
+ const result = {
+ itemName: new Variable(itemName, "$implicit", variableSpan, variableSpan),
+ trackBy: null,
+ expression: parseBlockParameterToBinding(expressionParam, bindingParser, rawExpression),
+ context: Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES, (variableName2) => {
+ const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end);
+ return new Variable(variableName2, variableName2, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart);
+ })
+ };
+ for (const param of secondaryParams) {
+ const letMatch = param.expression.match(FOR_LOOP_LET_PATTERN);
+ if (letMatch !== null) {
+ const variablesSpan = new ParseSourceSpan(param.sourceSpan.start.moveBy(letMatch[0].length - letMatch[1].length), param.sourceSpan.end);
+ parseLetParameter(param.sourceSpan, letMatch[1], variablesSpan, itemName, result.context, errors);
+ continue;
+ }
+ const trackMatch = param.expression.match(FOR_LOOP_TRACK_PATTERN);
+ if (trackMatch !== null) {
+ if (result.trackBy !== null) {
+ errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
+ } else {
+ const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
+ if (expression.ast instanceof EmptyExpr$1) {
+ errors.push(new ParseError(block.startSourceSpan, '@for loop must have a "track" expression'));
+ }
+ const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
+ result.trackBy = { expression, keywordSpan };
+ }
+ continue;
+ }
+ errors.push(new ParseError(param.sourceSpan, `Unrecognized @for loop parameter "${param.expression}"`));
+ }
+ return result;
+}
+function parseLetParameter(sourceSpan, expression, span, loopItemName, context, errors) {
+ const parts = expression.split(",");
+ let startSpan = span.start;
+ for (const part of parts) {
+ const expressionParts = part.split("=");
+ const name = expressionParts.length === 2 ? expressionParts[0].trim() : "";
+ const variableName = expressionParts.length === 2 ? expressionParts[1].trim() : "";
+ if (name.length === 0 || variableName.length === 0) {
+ errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Parameter should match the pattern " = "`));
+ } else if (!ALLOWED_FOR_LOOP_LET_VARIABLES.has(variableName)) {
+ errors.push(new ParseError(sourceSpan, `Unknown "let" parameter variable "${variableName}". The allowed variables are: ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(", ")}`));
+ } else if (name === loopItemName) {
+ errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Variable cannot be called "${loopItemName}"`));
+ } else if (context.some((v) => v.name === name)) {
+ errors.push(new ParseError(sourceSpan, `Duplicate "let" parameter variable "${variableName}"`));
+ } else {
+ const [, keyLeadingWhitespace, keyName] = expressionParts[0].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN) ?? [];
+ const keySpan = keyLeadingWhitespace !== void 0 && expressionParts.length === 2 ? new ParseSourceSpan(
+ /* strip leading spaces */
+ startSpan.moveBy(keyLeadingWhitespace.length),
+ /* advance to end of the variable name */
+ startSpan.moveBy(keyLeadingWhitespace.length + keyName.length)
+ ) : span;
+ let valueSpan = void 0;
+ if (expressionParts.length === 2) {
+ const [, valueLeadingWhitespace, implicit] = expressionParts[1].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN) ?? [];
+ valueSpan = valueLeadingWhitespace !== void 0 ? new ParseSourceSpan(startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length), startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length + implicit.length)) : void 0;
+ }
+ const sourceSpan2 = new ParseSourceSpan(keySpan.start, valueSpan?.end ?? keySpan.end);
+ context.push(new Variable(name, variableName, sourceSpan2, keySpan, valueSpan));
+ }
+ startSpan = startSpan.moveBy(
+ part.length + 1
+ /* add 1 to move past the comma */
+ );
+ }
+}
+function validateIfConnectedBlocks(connectedBlocks) {
+ const errors = [];
+ let hasElse = false;
+ for (let i = 0; i < connectedBlocks.length; i++) {
+ const block = connectedBlocks[i];
+ if (block.name === "else") {
+ if (hasElse) {
+ errors.push(new ParseError(block.startSourceSpan, "Conditional can only have one @else block"));
+ } else if (connectedBlocks.length > 1 && i < connectedBlocks.length - 1) {
+ errors.push(new ParseError(block.startSourceSpan, "@else block must be last inside the conditional"));
+ } else if (block.parameters.length > 0) {
+ errors.push(new ParseError(block.startSourceSpan, "@else block cannot have parameters"));
+ }
+ hasElse = true;
+ } else if (!ELSE_IF_PATTERN.test(block.name)) {
+ errors.push(new ParseError(block.startSourceSpan, `Unrecognized conditional block @${block.name}`));
+ }
+ }
+ return errors;
+}
+function validateSwitchBlock(ast) {
+ const errors = [];
+ let hasDefault = false;
+ if (ast.parameters.length !== 1) {
+ errors.push(new ParseError(ast.startSourceSpan, "@switch block must have exactly one parameter"));
+ return errors;
+ }
+ for (const node of ast.children) {
+ if (node instanceof Comment2 || node instanceof Text4 && node.value.trim().length === 0) {
+ continue;
+ }
+ if (!(node instanceof Block) || node.name !== "case" && node.name !== "default") {
+ errors.push(new ParseError(node.sourceSpan, "@switch block can only contain @case and @default blocks"));
+ continue;
+ }
+ if (node.name === "default") {
+ if (hasDefault) {
+ errors.push(new ParseError(node.startSourceSpan, "@switch block can only have one @default block"));
+ } else if (node.parameters.length > 0) {
+ errors.push(new ParseError(node.startSourceSpan, "@default block cannot have parameters"));
+ }
+ hasDefault = true;
+ } else if (node.name === "case" && node.parameters.length !== 1) {
+ errors.push(new ParseError(node.startSourceSpan, "@case block must have exactly one parameter"));
+ }
+ }
+ return errors;
+}
+function parseBlockParameterToBinding(ast, bindingParser, part) {
+ let start;
+ let end;
+ if (typeof part === "string") {
+ start = Math.max(0, ast.expression.lastIndexOf(part));
+ end = start + part.length;
+ } else {
+ start = 0;
+ end = ast.expression.length;
+ }
+ return bindingParser.parseBinding(ast.expression.slice(start, end), false, ast.sourceSpan, ast.sourceSpan.start.offset + start);
+}
+function parseConditionalBlockParameters(block, errors, bindingParser) {
+ if (block.parameters.length === 0) {
+ errors.push(new ParseError(block.startSourceSpan, "Conditional block does not have an expression"));
+ return null;
+ }
+ const expression = parseBlockParameterToBinding(block.parameters[0], bindingParser);
+ let expressionAlias = null;
+ for (let i = 1; i < block.parameters.length; i++) {
+ const param = block.parameters[i];
+ const aliasMatch = param.expression.match(CONDITIONAL_ALIAS_PATTERN);
+ if (aliasMatch === null) {
+ errors.push(new ParseError(param.sourceSpan, `Unrecognized conditional parameter "${param.expression}"`));
+ } else if (block.name !== "if") {
+ errors.push(new ParseError(param.sourceSpan, '"as" expression is only allowed on the primary @if block'));
+ } else if (expressionAlias !== null) {
+ errors.push(new ParseError(param.sourceSpan, 'Conditional can only have one "as" expression'));
+ } else {
+ const name = aliasMatch[2].trim();
+ if (IDENTIFIER_PATTERN.test(name)) {
+ const variableStart = param.sourceSpan.start.moveBy(aliasMatch[1].length);
+ const variableSpan = new ParseSourceSpan(variableStart, variableStart.moveBy(name.length));
+ expressionAlias = new Variable(name, name, variableSpan, variableSpan);
+ } else {
+ errors.push(new ParseError(param.sourceSpan, '"as" expression must be a valid JavaScript identifier'));
+ }
+ }
+ }
+ return { expression, expressionAlias };
+}
+function stripOptionalParentheses(param, errors) {
+ const expression = param.expression;
+ const spaceRegex = /^\s$/;
+ let openParens = 0;
+ let start = 0;
+ let end = expression.length - 1;
+ for (let i = 0; i < expression.length; i++) {
+ const char = expression[i];
+ if (char === "(") {
+ start = i + 1;
+ openParens++;
+ } else if (spaceRegex.test(char)) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ if (openParens === 0) {
+ return expression;
+ }
+ for (let i = expression.length - 1; i > -1; i--) {
+ const char = expression[i];
+ if (char === ")") {
+ end = i;
+ openParens--;
+ if (openParens === 0) {
+ break;
+ }
+ } else if (spaceRegex.test(char)) {
+ continue;
+ } else {
+ break;
+ }
+ }
+ if (openParens !== 0) {
+ errors.push(new ParseError(param.sourceSpan, "Unclosed parentheses in expression"));
+ return null;
+ }
+ return expression.slice(start, end);
+}
+var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
+var SEPARATOR_PATTERN = /^\s$/;
+var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
+ [$LBRACE, $RBRACE],
+ // Object literals
+ [$LBRACKET, $RBRACKET],
+ // Array literals
+ [$LPAREN, $RPAREN]
+ // Function calls
+]);
+var OnTriggerType;
+(function(OnTriggerType2) {
+ OnTriggerType2["IDLE"] = "idle";
+ OnTriggerType2["TIMER"] = "timer";
+ OnTriggerType2["INTERACTION"] = "interaction";
+ OnTriggerType2["IMMEDIATE"] = "immediate";
+ OnTriggerType2["HOVER"] = "hover";
+ OnTriggerType2["VIEWPORT"] = "viewport";
+ OnTriggerType2["NEVER"] = "never";
+})(OnTriggerType || (OnTriggerType = {}));
+function parseNeverTrigger({ expression, sourceSpan }, triggers, errors) {
+ const neverIndex = expression.indexOf("never");
+ const neverSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(neverIndex), sourceSpan.start.moveBy(neverIndex + "never".length));
+ const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
+ const hydrateSpan = getHydrateSpan(expression, sourceSpan);
+ if (neverIndex === -1) {
+ errors.push(new ParseError(sourceSpan, `Could not find "never" keyword in expression`));
+ } else {
+ trackTrigger("never", triggers, errors, new NeverDeferredTrigger(neverSourceSpan, sourceSpan, prefetchSpan, null, hydrateSpan));
+ }
+}
+function parseWhenTrigger({ expression, sourceSpan }, bindingParser, triggers, errors) {
+ const whenIndex = expression.indexOf("when");
+ const whenSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(whenIndex), sourceSpan.start.moveBy(whenIndex + "when".length));
+ const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
+ const hydrateSpan = getHydrateSpan(expression, sourceSpan);
+ if (whenIndex === -1) {
+ errors.push(new ParseError(sourceSpan, `Could not find "when" keyword in expression`));
+ } else {
+ const start = getTriggerParametersStart(expression, whenIndex + 1);
+ const parsed = bindingParser.parseBinding(expression.slice(start), false, sourceSpan, sourceSpan.start.offset + start);
+ trackTrigger("when", triggers, errors, new BoundDeferredTrigger(parsed, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan));
+ }
+}
+function parseOnTrigger({ expression, sourceSpan }, triggers, errors, placeholder) {
+ const onIndex = expression.indexOf("on");
+ const onSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(onIndex), sourceSpan.start.moveBy(onIndex + "on".length));
+ const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
+ const hydrateSpan = getHydrateSpan(expression, sourceSpan);
+ if (onIndex === -1) {
+ errors.push(new ParseError(sourceSpan, `Could not find "on" keyword in expression`));
+ } else {
+ const start = getTriggerParametersStart(expression, onIndex + 1);
+ const parser = new OnTriggerParser(expression, start, sourceSpan, triggers, errors, expression.startsWith("hydrate") ? validateHydrateReferenceBasedTrigger : validatePlainReferenceBasedTrigger, placeholder, prefetchSpan, onSourceSpan, hydrateSpan);
+ parser.parse();
+ }
+}
+function getPrefetchSpan(expression, sourceSpan) {
+ if (!expression.startsWith("prefetch")) {
+ return null;
+ }
+ return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy("prefetch".length));
+}
+function getHydrateSpan(expression, sourceSpan) {
+ if (!expression.startsWith("hydrate")) {
+ return null;
+ }
+ return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy("hydrate".length));
+}
+var OnTriggerParser = class {
+ expression;
+ start;
+ span;
+ triggers;
+ errors;
+ validator;
+ placeholder;
+ prefetchSpan;
+ onSourceSpan;
+ hydrateSpan;
+ index = 0;
+ tokens;
+ constructor(expression, start, span, triggers, errors, validator, placeholder, prefetchSpan, onSourceSpan, hydrateSpan) {
+ this.expression = expression;
+ this.start = start;
+ this.span = span;
+ this.triggers = triggers;
+ this.errors = errors;
+ this.validator = validator;
+ this.placeholder = placeholder;
+ this.prefetchSpan = prefetchSpan;
+ this.onSourceSpan = onSourceSpan;
+ this.hydrateSpan = hydrateSpan;
+ this.tokens = new Lexer().tokenize(expression.slice(start));
+ }
+ parse() {
+ while (this.tokens.length > 0 && this.index < this.tokens.length) {
+ const token = this.token();
+ if (!token.isIdentifier()) {
+ this.unexpectedToken(token);
+ break;
+ }
+ if (this.isFollowedByOrLast($COMMA)) {
+ this.consumeTrigger(token, []);
+ this.advance();
+ } else if (this.isFollowedByOrLast($LPAREN)) {
+ this.advance();
+ const prevErrors = this.errors.length;
+ const parameters = this.consumeParameters();
+ if (this.errors.length !== prevErrors) {
+ break;
+ }
+ this.consumeTrigger(token, parameters);
+ this.advance();
+ } else if (this.index < this.tokens.length - 1) {
+ this.unexpectedToken(this.tokens[this.index + 1]);
+ }
+ this.advance();
+ }
+ }
+ advance() {
+ this.index++;
+ }
+ isFollowedByOrLast(char) {
+ if (this.index === this.tokens.length - 1) {
+ return true;
+ }
+ return this.tokens[this.index + 1].isCharacter(char);
+ }
+ token() {
+ return this.tokens[Math.min(this.index, this.tokens.length - 1)];
+ }
+ consumeTrigger(identifier, parameters) {
+ const triggerNameStartSpan = this.span.start.moveBy(this.start + identifier.index - this.tokens[0].index);
+ const nameSpan = new ParseSourceSpan(triggerNameStartSpan, triggerNameStartSpan.moveBy(identifier.strValue.length));
+ const endSpan = triggerNameStartSpan.moveBy(this.token().end - identifier.index);
+ const isFirstTrigger = identifier.index === 0;
+ const onSourceSpan = isFirstTrigger ? this.onSourceSpan : null;
+ const prefetchSourceSpan = isFirstTrigger ? this.prefetchSpan : null;
+ const hydrateSourceSpan = isFirstTrigger ? this.hydrateSpan : null;
+ const sourceSpan = new ParseSourceSpan(isFirstTrigger ? this.span.start : triggerNameStartSpan, endSpan);
+ try {
+ switch (identifier.toString()) {
+ case OnTriggerType.IDLE:
+ this.trackTrigger("idle", createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSourceSpan, onSourceSpan, hydrateSourceSpan));
+ break;
+ case OnTriggerType.TIMER:
+ this.trackTrigger("timer", createTimerTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan));
+ break;
+ case OnTriggerType.INTERACTION:
+ this.trackTrigger("interaction", createInteractionTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.validator));
+ break;
+ case OnTriggerType.IMMEDIATE:
+ this.trackTrigger("immediate", createImmediateTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan));
+ break;
+ case OnTriggerType.HOVER:
+ this.trackTrigger("hover", createHoverTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.placeholder, this.validator));
+ break;
+ case OnTriggerType.VIEWPORT:
+ this.trackTrigger("viewport", createViewportTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.validator));
+ break;
+ default:
+ throw new Error(`Unrecognized trigger type "${identifier}"`);
+ }
+ } catch (e) {
+ this.error(identifier, e.message);
+ }
+ }
+ consumeParameters() {
+ const parameters = [];
+ if (!this.token().isCharacter($LPAREN)) {
+ this.unexpectedToken(this.token());
+ return parameters;
+ }
+ this.advance();
+ const commaDelimStack = [];
+ let current = "";
+ while (this.index < this.tokens.length) {
+ const token = this.token();
+ if (token.isCharacter($RPAREN) && commaDelimStack.length === 0) {
+ if (current.length) {
+ parameters.push(current);
+ }
+ break;
+ }
+ if (token.type === TokenType.Character && COMMA_DELIMITED_SYNTAX.has(token.numValue)) {
+ commaDelimStack.push(COMMA_DELIMITED_SYNTAX.get(token.numValue));
+ }
+ if (commaDelimStack.length > 0 && token.isCharacter(commaDelimStack[commaDelimStack.length - 1])) {
+ commaDelimStack.pop();
+ }
+ if (commaDelimStack.length === 0 && token.isCharacter($COMMA) && current.length > 0) {
+ parameters.push(current);
+ current = "";
+ this.advance();
+ continue;
+ }
+ current += this.tokenText();
+ this.advance();
+ }
+ if (!this.token().isCharacter($RPAREN) || commaDelimStack.length > 0) {
+ this.error(this.token(), "Unexpected end of expression");
+ }
+ if (this.index < this.tokens.length - 1 && !this.tokens[this.index + 1].isCharacter($COMMA)) {
+ this.unexpectedToken(this.tokens[this.index + 1]);
+ }
+ return parameters;
+ }
+ tokenText() {
+ return this.expression.slice(this.start + this.token().index, this.start + this.token().end);
+ }
+ trackTrigger(name, trigger) {
+ trackTrigger(name, this.triggers, this.errors, trigger);
+ }
+ error(token, message) {
+ const newStart = this.span.start.moveBy(this.start + token.index);
+ const newEnd = newStart.moveBy(token.end - token.index);
+ this.errors.push(new ParseError(new ParseSourceSpan(newStart, newEnd), message));
+ }
+ unexpectedToken(token) {
+ this.error(token, `Unexpected token "${token}"`);
+ }
+};
+function trackTrigger(name, allTriggers, errors, trigger) {
+ if (allTriggers[name]) {
+ errors.push(new ParseError(trigger.sourceSpan, `Duplicate "${name}" trigger is not allowed`));
+ } else {
+ allTriggers[name] = trigger;
+ }
+}
+function createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ if (parameters.length > 0) {
+ throw new Error(`"${OnTriggerType.IDLE}" trigger cannot have parameters`);
+ }
+ return new IdleDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function createTimerTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ if (parameters.length !== 1) {
+ throw new Error(`"${OnTriggerType.TIMER}" trigger must have exactly one parameter`);
+ }
+ const delay = parseDeferredTime(parameters[0]);
+ if (delay === null) {
+ throw new Error(`Could not parse time value of trigger "${OnTriggerType.TIMER}"`);
+ }
+ return new TimerDeferredTrigger(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function createImmediateTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
+ if (parameters.length > 0) {
+ throw new Error(`"${OnTriggerType.IMMEDIATE}" trigger cannot have parameters`);
+ }
+ return new ImmediateDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function createHoverTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, placeholder, validator) {
+ validator(OnTriggerType.HOVER, parameters);
+ return new HoverDeferredTrigger(parameters[0] ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function createInteractionTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
+ validator(OnTriggerType.INTERACTION, parameters);
+ return new InteractionDeferredTrigger(parameters[0] ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function createViewportTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
+ validator(OnTriggerType.VIEWPORT, parameters);
+ return new ViewportDeferredTrigger(parameters[0] ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
+}
+function validatePlainReferenceBasedTrigger(type, parameters) {
+ if (parameters.length > 1) {
+ throw new Error(`"${type}" trigger can only have zero or one parameters`);
+ }
+}
+function validateHydrateReferenceBasedTrigger(type, parameters) {
+ if (parameters.length > 0) {
+ throw new Error(`Hydration trigger "${type}" cannot have parameters`);
+ }
+}
+function getTriggerParametersStart(value, startPosition = 0) {
+ let hasFoundSeparator = false;
+ for (let i = startPosition; i < value.length; i++) {
+ if (SEPARATOR_PATTERN.test(value[i])) {
+ hasFoundSeparator = true;
+ } else if (hasFoundSeparator) {
+ return i;
+ }
+ }
+ return -1;
+}
+function parseDeferredTime(value) {
+ const match = value.match(TIME_PATTERN);
+ if (!match) {
+ return null;
+ }
+ const [time, units] = match;
+ return parseFloat(time) * (units === "s" ? 1e3 : 1);
+}
+var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
+var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
+var HYDRATE_WHEN_PATTERN = /^hydrate\s+when\s/;
+var HYDRATE_ON_PATTERN = /^hydrate\s+on\s/;
+var HYDRATE_NEVER_PATTERN = /^hydrate\s+never(\s*)$/;
+var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
+var AFTER_PARAMETER_PATTERN = /^after\s/;
+var WHEN_PARAMETER_PATTERN = /^when\s/;
+var ON_PARAMETER_PATTERN = /^on\s/;
+function isConnectedDeferLoopBlock(name) {
+ return name === "placeholder" || name === "loading" || name === "error";
+}
+function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
+ const errors = [];
+ const { placeholder, loading, error } = parseConnectedBlocks(connectedBlocks, errors, visitor);
+ const { triggers, prefetchTriggers, hydrateTriggers } = parsePrimaryTriggers(ast, bindingParser, errors, placeholder);
+ let lastEndSourceSpan = ast.endSourceSpan;
+ let endOfLastSourceSpan = ast.sourceSpan.end;
+ if (connectedBlocks.length > 0) {
+ const lastConnectedBlock = connectedBlocks[connectedBlocks.length - 1];
+ lastEndSourceSpan = lastConnectedBlock.endSourceSpan;
+ endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;
+ }
+ const sourceSpanWithConnectedBlocks = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
+ const node = new DeferredBlock(visitAll(visitor, ast.children, ast.children), triggers, prefetchTriggers, hydrateTriggers, placeholder, loading, error, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan, ast.i18n);
+ return { node, errors };
+}
+function parseConnectedBlocks(connectedBlocks, errors, visitor) {
+ let placeholder = null;
+ let loading = null;
+ let error = null;
+ for (const block of connectedBlocks) {
+ try {
+ if (!isConnectedDeferLoopBlock(block.name)) {
+ errors.push(new ParseError(block.startSourceSpan, `Unrecognized block "@${block.name}"`));
+ break;
+ }
+ switch (block.name) {
+ case "placeholder":
+ if (placeholder !== null) {
+ errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @placeholder block`));
+ } else {
+ placeholder = parsePlaceholderBlock(block, visitor);
+ }
+ break;
+ case "loading":
+ if (loading !== null) {
+ errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @loading block`));
+ } else {
+ loading = parseLoadingBlock(block, visitor);
+ }
+ break;
+ case "error":
+ if (error !== null) {
+ errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @error block`));
+ } else {
+ error = parseErrorBlock(block, visitor);
+ }
+ break;
+ }
+ } catch (e) {
+ errors.push(new ParseError(block.startSourceSpan, e.message));
+ }
+ }
+ return { placeholder, loading, error };
+}
+function parsePlaceholderBlock(ast, visitor) {
+ let minimumTime = null;
+ for (const param of ast.parameters) {
+ if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) {
+ if (minimumTime != null) {
+ throw new Error(`@placeholder block can only have one "minimum" parameter`);
+ }
+ const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression)));
+ if (parsedTime === null) {
+ throw new Error(`Could not parse time value of parameter "minimum"`);
+ }
+ minimumTime = parsedTime;
+ } else {
+ throw new Error(`Unrecognized parameter in @placeholder block: "${param.expression}"`);
+ }
+ }
+ return new DeferredBlockPlaceholder(visitAll(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
+}
+function parseLoadingBlock(ast, visitor) {
+ let afterTime = null;
+ let minimumTime = null;
+ for (const param of ast.parameters) {
+ if (AFTER_PARAMETER_PATTERN.test(param.expression)) {
+ if (afterTime != null) {
+ throw new Error(`@loading block can only have one "after" parameter`);
+ }
+ const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression)));
+ if (parsedTime === null) {
+ throw new Error(`Could not parse time value of parameter "after"`);
+ }
+ afterTime = parsedTime;
+ } else if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) {
+ if (minimumTime != null) {
+ throw new Error(`@loading block can only have one "minimum" parameter`);
+ }
+ const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression)));
+ if (parsedTime === null) {
+ throw new Error(`Could not parse time value of parameter "minimum"`);
+ }
+ minimumTime = parsedTime;
+ } else {
+ throw new Error(`Unrecognized parameter in @loading block: "${param.expression}"`);
+ }
+ }
+ return new DeferredBlockLoading(visitAll(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
+}
+function parseErrorBlock(ast, visitor) {
+ if (ast.parameters.length > 0) {
+ throw new Error(`@error block cannot have parameters`);
+ }
+ return new DeferredBlockError(visitAll(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
+}
+function parsePrimaryTriggers(ast, bindingParser, errors, placeholder) {
+ const triggers = {};
+ const prefetchTriggers = {};
+ const hydrateTriggers = {};
+ for (const param of ast.parameters) {
+ if (WHEN_PARAMETER_PATTERN.test(param.expression)) {
+ parseWhenTrigger(param, bindingParser, triggers, errors);
+ } else if (ON_PARAMETER_PATTERN.test(param.expression)) {
+ parseOnTrigger(param, triggers, errors, placeholder);
+ } else if (PREFETCH_WHEN_PATTERN.test(param.expression)) {
+ parseWhenTrigger(param, bindingParser, prefetchTriggers, errors);
+ } else if (PREFETCH_ON_PATTERN.test(param.expression)) {
+ parseOnTrigger(param, prefetchTriggers, errors, placeholder);
+ } else if (HYDRATE_WHEN_PATTERN.test(param.expression)) {
+ parseWhenTrigger(param, bindingParser, hydrateTriggers, errors);
+ } else if (HYDRATE_ON_PATTERN.test(param.expression)) {
+ parseOnTrigger(param, hydrateTriggers, errors, placeholder);
+ } else if (HYDRATE_NEVER_PATTERN.test(param.expression)) {
+ parseNeverTrigger(param, hydrateTriggers, errors);
+ } else {
+ errors.push(new ParseError(param.sourceSpan, "Unrecognized trigger"));
+ }
+ }
+ if (hydrateTriggers.never && Object.keys(hydrateTriggers).length > 1) {
+ errors.push(new ParseError(ast.startSourceSpan, "Cannot specify additional `hydrate` triggers if `hydrate never` is present"));
+ }
+ return { triggers, prefetchTriggers, hydrateTriggers };
+}
+var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
+var KW_BIND_IDX = 1;
+var KW_LET_IDX = 2;
+var KW_REF_IDX = 3;
+var KW_ON_IDX = 4;
+var KW_BINDON_IDX = 5;
+var KW_AT_IDX = 6;
+var IDENT_KW_IDX = 7;
+var BINDING_DELIMS = {
+ BANANA_BOX: { start: "[(", end: ")]" },
+ PROPERTY: { start: "[", end: "]" },
+ EVENT: { start: "(", end: ")" }
+};
+var TEMPLATE_ATTR_PREFIX = "*";
+var UNSUPPORTED_SELECTORLESS_TAGS = /* @__PURE__ */ new Set([
+ "link",
+ "style",
+ "script",
+ "ng-template",
+ "ng-container",
+ "ng-content"
+]);
+var UNSUPPORTED_SELECTORLESS_DIRECTIVE_ATTRS = /* @__PURE__ */ new Set(["ngProjectAs", "ngNonBindable"]);
+function htmlAstToRender3Ast(htmlNodes, bindingParser, options) {
+ const transformer = new HtmlAstToIvyAst(bindingParser, options);
+ const ivyNodes = visitAll(transformer, htmlNodes, htmlNodes);
+ const allErrors = bindingParser.errors.concat(transformer.errors);
+ const result = {
+ nodes: ivyNodes,
+ errors: allErrors,
+ styleUrls: transformer.styleUrls,
+ styles: transformer.styles,
+ ngContentSelectors: transformer.ngContentSelectors
+ };
+ if (options.collectCommentNodes) {
+ result.commentNodes = transformer.commentNodes;
+ }
+ return result;
+}
+var HtmlAstToIvyAst = class {
+ bindingParser;
+ options;
+ errors = [];
+ styles = [];
+ styleUrls = [];
+ ngContentSelectors = [];
+ // This array will be populated if `Render3ParseOptions['collectCommentNodes']` is true
+ commentNodes = [];
+ inI18nBlock = false;
+ /**
+ * Keeps track of the nodes that have been processed already when previous nodes were visited.
+ * These are typically blocks connected to other blocks or text nodes between connected blocks.
+ */
+ processedNodes = /* @__PURE__ */ new Set();
+ constructor(bindingParser, options) {
+ this.bindingParser = bindingParser;
+ this.options = options;
+ }
+ // HTML visitor
+ visitElement(element2) {
+ const isI18nRootElement = isI18nRootNode(element2.i18n);
+ if (isI18nRootElement) {
+ if (this.inI18nBlock) {
+ this.reportError("Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.", element2.sourceSpan);
+ }
+ this.inI18nBlock = true;
+ }
+ const preparsedElement = preparseElement(element2);
+ if (preparsedElement.type === PreparsedElementType.SCRIPT) {
+ return null;
+ } else if (preparsedElement.type === PreparsedElementType.STYLE) {
+ const contents = textContents(element2);
+ if (contents !== null) {
+ this.styles.push(contents);
+ }
+ return null;
+ } else if (preparsedElement.type === PreparsedElementType.STYLESHEET && isStyleUrlResolvable(preparsedElement.hrefAttr)) {
+ this.styleUrls.push(preparsedElement.hrefAttr);
+ return null;
+ }
+ const isTemplateElement = isNgTemplate(element2.name);
+ const { attributes, boundEvents, references, variables, templateVariables, elementHasInlineTemplate, parsedProperties, templateParsedProperties, i18nAttrsMeta } = this.prepareAttributes(element2.attrs, isTemplateElement);
+ const directives = this.extractDirectives(element2);
+ let children;
+ if (preparsedElement.nonBindable) {
+ children = visitAll(NON_BINDABLE_VISITOR, element2.children).flat(Infinity);
+ } else {
+ children = visitAll(this, element2.children, element2.children);
+ }
+ let parsedElement;
+ if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
+ const selector = preparsedElement.selectAttr;
+ const attrs = element2.attrs.map((attr) => this.visitAttribute(attr));
+ parsedElement = new Content(selector, attrs, children, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
+ this.ngContentSelectors.push(selector);
+ } else if (isTemplateElement) {
+ const attrs = this.categorizePropertyAttributes(element2.name, parsedProperties, i18nAttrsMeta);
+ parsedElement = new Template(element2.name, attributes, attrs.bound, boundEvents, directives, [
+ /* no template attributes */
+ ], children, references, variables, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
+ } else {
+ const attrs = this.categorizePropertyAttributes(element2.name, parsedProperties, i18nAttrsMeta);
+ parsedElement = new Element$1(element2.name, attributes, attrs.bound, boundEvents, directives, children, references, element2.isSelfClosing, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.isVoid, element2.i18n);
+ }
+ if (elementHasInlineTemplate) {
+ parsedElement = this.wrapInTemplate(parsedElement, templateParsedProperties, templateVariables, i18nAttrsMeta, isTemplateElement, isI18nRootElement);
+ }
+ if (isI18nRootElement) {
+ this.inI18nBlock = false;
+ }
+ return parsedElement;
+ }
+ visitAttribute(attribute2) {
+ return new TextAttribute(attribute2.name, attribute2.value, attribute2.sourceSpan, attribute2.keySpan, attribute2.valueSpan, attribute2.i18n);
+ }
+ visitText(text2) {
+ return this.processedNodes.has(text2) ? null : this._visitTextWithInterpolation(text2.value, text2.sourceSpan, text2.tokens, text2.i18n);
+ }
+ visitExpansion(expansion) {
+ if (!expansion.i18n) {
+ return null;
+ }
+ if (!isI18nRootNode(expansion.i18n)) {
+ throw new Error(`Invalid type "${expansion.i18n.constructor}" for "i18n" property of ${expansion.sourceSpan.toString()}. Expected a "Message"`);
+ }
+ const message = expansion.i18n;
+ const vars = {};
+ const placeholders = {};
+ Object.keys(message.placeholders).forEach((key) => {
+ const value = message.placeholders[key];
+ if (key.startsWith(I18N_ICU_VAR_PREFIX)) {
+ const formattedKey = key.trim();
+ const ast = this.bindingParser.parseInterpolationExpression(value.text, value.sourceSpan);
+ vars[formattedKey] = new BoundText(ast, value.sourceSpan);
+ } else {
+ placeholders[key] = this._visitTextWithInterpolation(value.text, value.sourceSpan, null);
+ }
+ });
+ return new Icu$1(vars, placeholders, expansion.sourceSpan, message);
+ }
+ visitExpansionCase(expansionCase) {
+ return null;
+ }
+ visitComment(comment) {
+ if (this.options.collectCommentNodes) {
+ this.commentNodes.push(new Comment$1(comment.value || "", comment.sourceSpan));
+ }
+ return null;
+ }
+ visitLetDeclaration(decl, context) {
+ const value = this.bindingParser.parseBinding(decl.value, false, decl.valueSpan, decl.valueSpan.start.offset);
+ if (value.errors.length === 0 && value.ast instanceof EmptyExpr$1) {
+ this.reportError("@let declaration value cannot be empty", decl.valueSpan);
+ }
+ return new LetDeclaration$1(decl.name, value, decl.sourceSpan, decl.nameSpan, decl.valueSpan);
+ }
+ visitComponent(component) {
+ const isI18nRootElement = isI18nRootNode(component.i18n);
+ if (isI18nRootElement) {
+ if (this.inI18nBlock) {
+ this.reportError("Cannot mark a component as translatable inside of a translatable section. Please remove the nested i18n marker.", component.sourceSpan);
+ }
+ this.inI18nBlock = true;
+ }
+ if (component.tagName !== null && UNSUPPORTED_SELECTORLESS_TAGS.has(component.tagName)) {
+ this.reportError(`Tag name "${component.tagName}" cannot be used as a component tag`, component.startSourceSpan);
+ return null;
+ }
+ const { attributes, boundEvents, references, templateVariables, elementHasInlineTemplate, parsedProperties, templateParsedProperties, i18nAttrsMeta } = this.prepareAttributes(component.attrs, false);
+ this.validateSelectorlessReferences(references);
+ const directives = this.extractDirectives(component);
+ let children;
+ if (component.attrs.find((attr) => attr.name === "ngNonBindable")) {
+ children = visitAll(NON_BINDABLE_VISITOR, component.children).flat(Infinity);
+ } else {
+ children = visitAll(this, component.children, component.children);
+ }
+ const attrs = this.categorizePropertyAttributes(component.tagName, parsedProperties, i18nAttrsMeta);
+ let node = new Component$1(component.componentName, component.tagName, component.fullName, attributes, attrs.bound, boundEvents, directives, children, references, component.isSelfClosing, component.sourceSpan, component.startSourceSpan, component.endSourceSpan, component.i18n);
+ if (elementHasInlineTemplate) {
+ node = this.wrapInTemplate(node, templateParsedProperties, templateVariables, i18nAttrsMeta, false, isI18nRootElement);
+ }
+ if (isI18nRootElement) {
+ this.inI18nBlock = false;
+ }
+ return node;
+ }
+ visitDirective() {
+ return null;
+ }
+ visitBlockParameter() {
+ return null;
+ }
+ visitBlock(block, context) {
+ const index = Array.isArray(context) ? context.indexOf(block) : -1;
+ if (index === -1) {
+ throw new Error("Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context");
+ }
+ if (this.processedNodes.has(block)) {
+ return null;
+ }
+ let result = null;
+ switch (block.name) {
+ case "defer":
+ result = createDeferredBlock(block, this.findConnectedBlocks(index, context, isConnectedDeferLoopBlock), this, this.bindingParser);
+ break;
+ case "switch":
+ result = createSwitchBlock(block, this, this.bindingParser);
+ break;
+ case "for":
+ result = createForLoop(block, this.findConnectedBlocks(index, context, isConnectedForLoopBlock), this, this.bindingParser);
+ break;
+ case "if":
+ result = createIfBlock(block, this.findConnectedBlocks(index, context, isConnectedIfLoopBlock), this, this.bindingParser);
+ break;
+ default:
+ let errorMessage;
+ if (isConnectedDeferLoopBlock(block.name)) {
+ errorMessage = `@${block.name} block can only be used after an @defer block.`;
+ this.processedNodes.add(block);
+ } else if (isConnectedForLoopBlock(block.name)) {
+ errorMessage = `@${block.name} block can only be used after an @for block.`;
+ this.processedNodes.add(block);
+ } else if (isConnectedIfLoopBlock(block.name)) {
+ errorMessage = `@${block.name} block can only be used after an @if or @else if block.`;
+ this.processedNodes.add(block);
+ } else {
+ errorMessage = `Unrecognized block @${block.name}.`;
+ }
+ result = {
+ node: new UnknownBlock(block.name, block.sourceSpan, block.nameSpan),
+ errors: [new ParseError(block.sourceSpan, errorMessage)]
+ };
+ break;
+ }
+ this.errors.push(...result.errors);
+ return result.node;
+ }
+ findConnectedBlocks(primaryBlockIndex, siblings, predicate) {
+ const relatedBlocks = [];
+ for (let i = primaryBlockIndex + 1; i < siblings.length; i++) {
+ const node = siblings[i];
+ if (node instanceof Comment2) {
+ continue;
+ }
+ if (node instanceof Text4 && node.value.trim().length === 0) {
+ this.processedNodes.add(node);
+ continue;
+ }
+ if (!(node instanceof Block) || !predicate(node.name)) {
+ break;
+ }
+ relatedBlocks.push(node);
+ this.processedNodes.add(node);
+ }
+ return relatedBlocks;
+ }
+ /** Splits up the property attributes depending on whether they're static or bound. */
+ categorizePropertyAttributes(elementName, properties, i18nPropsMeta) {
+ const bound = [];
+ const literal2 = [];
+ properties.forEach((prop) => {
+ const i18n2 = i18nPropsMeta[prop.name];
+ if (prop.isLiteral) {
+ literal2.push(new TextAttribute(prop.name, prop.expression.source || "", prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n2));
+ } else {
+ const bep = this.bindingParser.createBoundElementProperty(
+ elementName,
+ prop,
+ /* skipValidation */
+ true,
+ /* mapPropertyName */
+ false
+ );
+ bound.push(BoundAttribute.fromBoundElementProperty(bep, i18n2));
+ }
+ });
+ return { bound, literal: literal2 };
+ }
+ prepareAttributes(attrs, isTemplateElement) {
+ const parsedProperties = [];
+ const boundEvents = [];
+ const variables = [];
+ const references = [];
+ const attributes = [];
+ const i18nAttrsMeta = {};
+ const templateParsedProperties = [];
+ const templateVariables = [];
+ let elementHasInlineTemplate = false;
+ for (const attribute2 of attrs) {
+ let hasBinding = false;
+ const normalizedName = normalizeAttributeName(attribute2.name);
+ let isTemplateBinding = false;
+ if (attribute2.i18n) {
+ i18nAttrsMeta[attribute2.name] = attribute2.i18n;
+ }
+ if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {
+ if (elementHasInlineTemplate) {
+ this.reportError(`Can't have multiple template bindings on one element. Use only one attribute prefixed with *`, attribute2.sourceSpan);
+ }
+ isTemplateBinding = true;
+ elementHasInlineTemplate = true;
+ const templateValue = attribute2.value;
+ const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);
+ const parsedVariables = [];
+ const absoluteValueOffset = attribute2.valueSpan ? attribute2.valueSpan.start.offset : (
+ // If there is no value span the attribute does not have a value, like `attr` in
+ //``. In this case, point to one character beyond the last character of
+ // the attribute name.
+ attribute2.sourceSpan.start.offset + attribute2.name.length
+ );
+ this.bindingParser.parseInlineTemplateBinding(
+ templateKey,
+ templateValue,
+ attribute2.sourceSpan,
+ absoluteValueOffset,
+ [],
+ templateParsedProperties,
+ parsedVariables,
+ true
+ /* isIvyAst */
+ );
+ templateVariables.push(...parsedVariables.map((v) => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan)));
+ } else {
+ hasBinding = this.parseAttribute(isTemplateElement, attribute2, [], parsedProperties, boundEvents, variables, references);
+ }
+ if (!hasBinding && !isTemplateBinding) {
+ attributes.push(this.visitAttribute(attribute2));
+ }
+ }
+ return {
+ attributes,
+ boundEvents,
+ references,
+ variables,
+ templateVariables,
+ elementHasInlineTemplate,
+ parsedProperties,
+ templateParsedProperties,
+ i18nAttrsMeta
+ };
+ }
+ parseAttribute(isTemplateElement, attribute2, matchableAttributes, parsedProperties, boundEvents, variables, references) {
+ const name = normalizeAttributeName(attribute2.name);
+ const value = attribute2.value;
+ const srcSpan = attribute2.sourceSpan;
+ const absoluteOffset = attribute2.valueSpan ? attribute2.valueSpan.fullStart.offset : srcSpan.fullStart.offset;
+ function createKeySpan(srcSpan2, prefix, identifier) {
+ const normalizationAdjustment = attribute2.name.length - name.length;
+ const keySpanStart = srcSpan2.start.moveBy(prefix.length + normalizationAdjustment);
+ const keySpanEnd = keySpanStart.moveBy(identifier.length);
+ return new ParseSourceSpan(keySpanStart, keySpanEnd, keySpanStart, identifier);
+ }
+ const bindParts = name.match(BIND_NAME_REGEXP);
+ if (bindParts) {
+ if (bindParts[KW_BIND_IDX] != null) {
+ const identifier = bindParts[IDENT_KW_IDX];
+ const keySpan2 = createKeySpan(srcSpan, bindParts[KW_BIND_IDX], identifier);
+ this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
+ } else if (bindParts[KW_LET_IDX]) {
+ if (isTemplateElement) {
+ const identifier = bindParts[IDENT_KW_IDX];
+ const keySpan2 = createKeySpan(srcSpan, bindParts[KW_LET_IDX], identifier);
+ this.parseVariable(identifier, value, srcSpan, keySpan2, attribute2.valueSpan, variables);
+ } else {
+ this.reportError(`"let-" is only supported on ng-template elements.`, srcSpan);
+ }
+ } else if (bindParts[KW_REF_IDX]) {
+ const identifier = bindParts[IDENT_KW_IDX];
+ const keySpan2 = createKeySpan(srcSpan, bindParts[KW_REF_IDX], identifier);
+ this.parseReference(identifier, value, srcSpan, keySpan2, attribute2.valueSpan, references);
+ } else if (bindParts[KW_ON_IDX]) {
+ const events = [];
+ const identifier = bindParts[IDENT_KW_IDX];
+ const keySpan2 = createKeySpan(srcSpan, bindParts[KW_ON_IDX], identifier);
+ this.bindingParser.parseEvent(
+ identifier,
+ value,
+ /* isAssignmentEvent */
+ false,
+ srcSpan,
+ attribute2.valueSpan || srcSpan,
+ matchableAttributes,
+ events,
+ keySpan2
+ );
+ addEvents(events, boundEvents);
+ } else if (bindParts[KW_BINDON_IDX]) {
+ const identifier = bindParts[IDENT_KW_IDX];
+ const keySpan2 = createKeySpan(srcSpan, bindParts[KW_BINDON_IDX], identifier);
+ this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
+ this.parseAssignmentEvent(identifier, value, srcSpan, attribute2.valueSpan, matchableAttributes, boundEvents, keySpan2);
+ } else if (bindParts[KW_AT_IDX]) {
+ const keySpan2 = createKeySpan(srcSpan, "", name);
+ this.bindingParser.parseLiteralAttr(name, value, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
+ }
+ return true;
+ }
+ let delims = null;
+ if (name.startsWith(BINDING_DELIMS.BANANA_BOX.start)) {
+ delims = BINDING_DELIMS.BANANA_BOX;
+ } else if (name.startsWith(BINDING_DELIMS.PROPERTY.start)) {
+ delims = BINDING_DELIMS.PROPERTY;
+ } else if (name.startsWith(BINDING_DELIMS.EVENT.start)) {
+ delims = BINDING_DELIMS.EVENT;
+ }
+ if (delims !== null && // NOTE: older versions of the parser would match a start/end delimited
+ // binding iff the property name was terminated by the ending delimiter
+ // and the identifier in the binding was non-empty.
+ // TODO(ayazhafiz): update this to handle malformed bindings.
+ name.endsWith(delims.end) && name.length > delims.start.length + delims.end.length) {
+ const identifier = name.substring(delims.start.length, name.length - delims.end.length);
+ const keySpan2 = createKeySpan(srcSpan, delims.start, identifier);
+ if (delims.start === BINDING_DELIMS.BANANA_BOX.start) {
+ this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
+ this.parseAssignmentEvent(identifier, value, srcSpan, attribute2.valueSpan, matchableAttributes, boundEvents, keySpan2);
+ } else if (delims.start === BINDING_DELIMS.PROPERTY.start) {
+ this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan2);
+ } else {
+ const events = [];
+ this.bindingParser.parseEvent(
+ identifier,
+ value,
+ /* isAssignmentEvent */
+ false,
+ srcSpan,
+ attribute2.valueSpan || srcSpan,
+ matchableAttributes,
+ events,
+ keySpan2
+ );
+ addEvents(events, boundEvents);
+ }
+ return true;
+ }
+ const keySpan = createKeySpan(srcSpan, "", name);
+ const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan, attribute2.valueTokens ?? null);
+ return hasBinding;
+ }
+ extractDirectives(node) {
+ const elementName = node instanceof Component2 ? node.tagName : node.name;
+ const directives = [];
+ const seenDirectives = /* @__PURE__ */ new Set();
+ for (const directive of node.directives) {
+ let invalid = false;
+ for (const attr of directive.attrs) {
+ if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) {
+ invalid = true;
+ this.reportError(`Shorthand template syntax "${attr.name}" is not supported inside a directive context`, attr.sourceSpan);
+ } else if (UNSUPPORTED_SELECTORLESS_DIRECTIVE_ATTRS.has(attr.name)) {
+ invalid = true;
+ this.reportError(`Attribute "${attr.name}" is not supported in a directive context`, attr.sourceSpan);
+ }
+ }
+ if (!invalid && seenDirectives.has(directive.name)) {
+ invalid = true;
+ this.reportError(`Cannot apply directive "${directive.name}" multiple times on the same element`, directive.sourceSpan);
+ }
+ if (invalid) {
+ continue;
+ }
+ const { attributes, parsedProperties, boundEvents, references, i18nAttrsMeta } = this.prepareAttributes(directive.attrs, false);
+ this.validateSelectorlessReferences(references);
+ const { bound: inputs } = this.categorizePropertyAttributes(elementName, parsedProperties, i18nAttrsMeta);
+ for (const input of inputs) {
+ if (input.type !== BindingType.Property && input.type !== BindingType.TwoWay) {
+ invalid = true;
+ this.reportError("Binding is not supported in a directive context", input.sourceSpan);
+ }
+ }
+ if (invalid) {
+ continue;
+ }
+ seenDirectives.add(directive.name);
+ directives.push(new Directive$1(directive.name, attributes, inputs, boundEvents, references, directive.sourceSpan, directive.startSourceSpan, directive.endSourceSpan, void 0));
+ }
+ return directives;
+ }
+ wrapInTemplate(node, templateProperties, templateVariables, i18nAttrsMeta, isTemplateElement, isI18nRootElement) {
+ const attrs = this.categorizePropertyAttributes("ng-template", templateProperties, i18nAttrsMeta);
+ const templateAttrs = [];
+ attrs.literal.forEach((attr) => templateAttrs.push(attr));
+ attrs.bound.forEach((attr) => templateAttrs.push(attr));
+ const hoistedAttrs = {
+ attributes: [],
+ inputs: [],
+ outputs: []
+ };
+ if (node instanceof Element$1 || node instanceof Component$1) {
+ hoistedAttrs.attributes.push(...node.attributes);
+ hoistedAttrs.inputs.push(...node.inputs);
+ hoistedAttrs.outputs.push(...node.outputs);
+ }
+ const i18n2 = isTemplateElement && isI18nRootElement ? void 0 : node.i18n;
+ let name;
+ if (node instanceof Component$1) {
+ name = node.tagName;
+ } else if (node instanceof Template) {
+ name = null;
+ } else {
+ name = node.name;
+ }
+ return new Template(name, hoistedAttrs.attributes, hoistedAttrs.inputs, hoistedAttrs.outputs, [
+ // Do not copy over the directives.
+ ], templateAttrs, [node], [
+ // Do not copy over the references.
+ ], templateVariables, false, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, i18n2);
+ }
+ _visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n2) {
+ const valueNoNgsp = replaceNgsp(value);
+ const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan, interpolatedTokens);
+ return expr ? new BoundText(expr, sourceSpan, i18n2) : new Text$3(valueNoNgsp, sourceSpan);
+ }
+ parseVariable(identifier, value, sourceSpan, keySpan, valueSpan, variables) {
+ if (identifier.indexOf("-") > -1) {
+ this.reportError(`"-" is not allowed in variable names`, sourceSpan);
+ } else if (identifier.length === 0) {
+ this.reportError(`Variable does not have a name`, sourceSpan);
+ }
+ variables.push(new Variable(identifier, value, sourceSpan, keySpan, valueSpan));
+ }
+ parseReference(identifier, value, sourceSpan, keySpan, valueSpan, references) {
+ if (identifier.indexOf("-") > -1) {
+ this.reportError(`"-" is not allowed in reference names`, sourceSpan);
+ } else if (identifier.length === 0) {
+ this.reportError(`Reference does not have a name`, sourceSpan);
+ } else if (references.some((reference2) => reference2.name === identifier)) {
+ this.reportError(`Reference "#${identifier}" is defined more than once`, sourceSpan);
+ }
+ references.push(new Reference(identifier, value, sourceSpan, keySpan, valueSpan));
+ }
+ parseAssignmentEvent(name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) {
+ const events = [];
+ this.bindingParser.parseEvent(
+ `${name}Change`,
+ expression,
+ /* isAssignmentEvent */
+ true,
+ sourceSpan,
+ valueSpan || sourceSpan,
+ targetMatchableAttrs,
+ events,
+ keySpan
+ );
+ addEvents(events, boundEvents);
+ }
+ validateSelectorlessReferences(references) {
+ if (references.length === 0) {
+ return;
+ }
+ const seenNames = /* @__PURE__ */ new Set();
+ for (const ref of references) {
+ if (ref.value.length > 0) {
+ this.reportError("Cannot specify a value for a local reference in this context", ref.valueSpan || ref.sourceSpan);
+ } else if (seenNames.has(ref.name)) {
+ this.reportError("Duplicate reference names are not allowed", ref.sourceSpan);
+ } else {
+ seenNames.add(ref.name);
+ }
+ }
+ }
+ reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
+ this.errors.push(new ParseError(sourceSpan, message, level));
+ }
+};
+var NonBindableVisitor = class {
+ visitElement(ast) {
+ const preparsedElement = preparseElement(ast);
+ if (preparsedElement.type === PreparsedElementType.SCRIPT || preparsedElement.type === PreparsedElementType.STYLE || preparsedElement.type === PreparsedElementType.STYLESHEET) {
+ return null;
+ }
+ const children = visitAll(this, ast.children, null);
+ return new Element$1(
+ ast.name,
+ visitAll(this, ast.attrs),
+ /* inputs */
+ [],
+ /* outputs */
+ [],
+ /* directives */
+ [],
+ children,
+ /* references */
+ [],
+ ast.isSelfClosing,
+ ast.sourceSpan,
+ ast.startSourceSpan,
+ ast.endSourceSpan,
+ ast.isVoid
+ );
+ }
+ visitComment(comment) {
+ return null;
+ }
+ visitAttribute(attribute2) {
+ return new TextAttribute(attribute2.name, attribute2.value, attribute2.sourceSpan, attribute2.keySpan, attribute2.valueSpan, attribute2.i18n);
+ }
+ visitText(text2) {
+ return new Text$3(text2.value, text2.sourceSpan);
+ }
+ visitExpansion(expansion) {
+ return null;
+ }
+ visitExpansionCase(expansionCase) {
+ return null;
+ }
+ visitBlock(block, context) {
+ const nodes = [
+ // In an ngNonBindable context we treat the opening/closing tags of block as plain text.
+ // This is the as if the `tokenizeBlocks` option was disabled.
+ new Text$3(block.startSourceSpan.toString(), block.startSourceSpan),
+ ...visitAll(this, block.children)
+ ];
+ if (block.endSourceSpan !== null) {
+ nodes.push(new Text$3(block.endSourceSpan.toString(), block.endSourceSpan));
+ }
+ return nodes;
+ }
+ visitBlockParameter(parameter, context) {
+ return null;
+ }
+ visitLetDeclaration(decl, context) {
+ return new Text$3(`@let ${decl.name} = ${decl.value};`, decl.sourceSpan);
+ }
+ visitComponent(ast, context) {
+ const children = visitAll(this, ast.children, null);
+ return new Element$1(
+ ast.fullName,
+ visitAll(this, ast.attrs),
+ /* inputs */
+ [],
+ /* outputs */
+ [],
+ /* directives */
+ [],
+ children,
+ /* references */
+ [],
+ ast.isSelfClosing,
+ ast.sourceSpan,
+ ast.startSourceSpan,
+ ast.endSourceSpan,
+ false
+ );
+ }
+ visitDirective(directive, context) {
+ return null;
+ }
+};
+var NON_BINDABLE_VISITOR = new NonBindableVisitor();
+function normalizeAttributeName(attrName) {
+ return /^data-/i.test(attrName) ? attrName.substring(5) : attrName;
+}
+function addEvents(events, boundEvents) {
+ boundEvents.push(...events.map((e) => BoundEvent.fromParsedEvent(e)));
+}
+function textContents(node) {
+ if (node.children.length !== 1 || !(node.children[0] instanceof Text4)) {
+ return null;
+ } else {
+ return node.children[0].value;
+ }
+}
+var LEADING_TRIVIA_CHARS = [" ", "\n", "\r", " "];
+function parseTemplate(template2, templateUrl, options = {}) {
+ const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
+ const selectorlessEnabled = options.enableSelectorless ?? false;
+ const bindingParser = makeBindingParser(interpolationConfig, selectorlessEnabled);
+ const htmlParser = new HtmlParser();
+ const parseResult = htmlParser.parse(template2, templateUrl, __spreadProps(__spreadValues({
+ leadingTriviaChars: LEADING_TRIVIA_CHARS
+ }, options), {
+ tokenizeExpansionForms: true,
+ tokenizeBlocks: options.enableBlockSyntax ?? true,
+ tokenizeLet: options.enableLetSyntax ?? true,
+ selectorlessEnabled
+ }));
+ if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors && parseResult.errors.length > 0) {
+ const parsedTemplate2 = {
+ interpolationConfig,
+ preserveWhitespaces,
+ errors: parseResult.errors,
+ nodes: [],
+ styleUrls: [],
+ styles: [],
+ ngContentSelectors: []
+ };
+ if (options.collectCommentNodes) {
+ parsedTemplate2.commentNodes = [];
+ }
+ return parsedTemplate2;
+ }
+ let rootNodes = parseResult.rootNodes;
+ const retainEmptyTokens = !(options.preserveSignificantWhitespace ?? true);
+ const i18nMetaVisitor = new I18nMetaVisitor(
+ interpolationConfig,
+ /* keepI18nAttrs */
+ !preserveWhitespaces,
+ enableI18nLegacyMessageIdFormat,
+ /* containerBlocks */
+ void 0,
+ options.preserveSignificantWhitespace,
+ retainEmptyTokens
+ );
+ const i18nMetaResult = i18nMetaVisitor.visitAllWithErrors(rootNodes);
+ if (!options.alwaysAttemptHtmlToR3AstConversion && i18nMetaResult.errors && i18nMetaResult.errors.length > 0) {
+ const parsedTemplate2 = {
+ interpolationConfig,
+ preserveWhitespaces,
+ errors: i18nMetaResult.errors,
+ nodes: [],
+ styleUrls: [],
+ styles: [],
+ ngContentSelectors: []
+ };
+ if (options.collectCommentNodes) {
+ parsedTemplate2.commentNodes = [];
+ }
+ return parsedTemplate2;
+ }
+ rootNodes = i18nMetaResult.rootNodes;
+ if (!preserveWhitespaces) {
+ rootNodes = visitAll(new WhitespaceVisitor(
+ /* preserveSignificantWhitespace */
+ true,
+ /* originalNodeMap */
+ void 0,
+ /* requireContext */
+ false
+ ), rootNodes);
+ if (i18nMetaVisitor.hasI18nMeta) {
+ rootNodes = visitAll(new I18nMetaVisitor(
+ interpolationConfig,
+ /* keepI18nAttrs */
+ false,
+ /* enableI18nLegacyMessageIdFormat */
+ void 0,
+ /* containerBlocks */
+ void 0,
+ /* preserveSignificantWhitespace */
+ true,
+ retainEmptyTokens
+ ), rootNodes);
+ }
+ }
+ const { nodes, errors, styleUrls, styles, ngContentSelectors, commentNodes } = htmlAstToRender3Ast(rootNodes, bindingParser, { collectCommentNodes: !!options.collectCommentNodes });
+ errors.push(...parseResult.errors, ...i18nMetaResult.errors);
+ const parsedTemplate = {
+ interpolationConfig,
+ preserveWhitespaces,
+ errors: errors.length > 0 ? errors : null,
+ nodes,
+ styleUrls,
+ styles,
+ ngContentSelectors
+ };
+ if (options.collectCommentNodes) {
+ parsedTemplate.commentNodes = commentNodes;
+ }
+ return parsedTemplate;
+}
+var elementRegistry = new DomElementSchemaRegistry();
+function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, selectorlessEnabled = false) {
+ return new BindingParser(new Parser2(new Lexer(), selectorlessEnabled), interpolationConfig, elementRegistry, []);
+}
+var COMPONENT_VARIABLE = "%COMP%";
+var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
+var CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
+function baseDirectiveFields(meta, constantPool, bindingParser) {
+ const definitionMap = new DefinitionMap();
+ const selectors = parseSelectorToR3Selector(meta.selector);
+ definitionMap.set("type", meta.type.value);
+ if (selectors.length > 0) {
+ definitionMap.set("selectors", asLiteral(selectors));
+ }
+ if (meta.queries.length > 0) {
+ definitionMap.set("contentQueries", createContentQueriesFunction(meta.queries, constantPool, meta.name));
+ }
+ if (meta.viewQueries.length) {
+ definitionMap.set("viewQuery", createViewQueriesFunction(meta.viewQueries, constantPool, meta.name));
+ }
+ definitionMap.set("hostBindings", createHostBindingsFunction(meta.host, meta.typeSourceSpan, bindingParser, constantPool, meta.selector || "", meta.name, definitionMap));
+ definitionMap.set("inputs", conditionallyCreateDirectiveBindingLiteral(meta.inputs, true));
+ definitionMap.set("outputs", conditionallyCreateDirectiveBindingLiteral(meta.outputs));
+ if (meta.exportAs !== null) {
+ definitionMap.set("exportAs", literalArr(meta.exportAs.map((e) => literal(e))));
+ }
+ if (meta.isStandalone === false) {
+ definitionMap.set("standalone", literal(false));
+ }
+ if (meta.isSignal) {
+ definitionMap.set("signals", literal(true));
+ }
+ return definitionMap;
+}
+function addFeatures(definitionMap, meta) {
+ const features = [];
+ const providers = meta.providers;
+ const viewProviders = meta.viewProviders;
+ if (providers || viewProviders) {
+ const args = [providers || new LiteralArrayExpr([])];
+ if (viewProviders) {
+ args.push(viewProviders);
+ }
+ features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
+ }
+ if (meta.hostDirectives?.length) {
+ features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
+ }
+ if (meta.usesInheritance) {
+ features.push(importExpr(Identifiers.InheritDefinitionFeature));
+ }
+ if (meta.fullInheritance) {
+ features.push(importExpr(Identifiers.CopyDefinitionFeature));
+ }
+ if (meta.lifecycle.usesOnChanges) {
+ features.push(importExpr(Identifiers.NgOnChangesFeature));
+ }
+ if ("externalStyles" in meta && meta.externalStyles?.length) {
+ const externalStyleNodes = meta.externalStyles.map((externalStyle) => literal(externalStyle));
+ features.push(importExpr(Identifiers.ExternalStylesFeature).callFn([literalArr(externalStyleNodes)]));
+ }
+ if (features.length) {
+ definitionMap.set("features", literalArr(features));
+ }
+}
+function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
+ const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
+ addFeatures(definitionMap, meta);
+ const expression = importExpr(Identifiers.defineDirective).callFn([definitionMap.toLiteralMap()], void 0, true);
+ const type = createDirectiveType(meta);
+ return { expression, type, statements: [] };
+}
+function compileComponentFromMetadata(meta, constantPool, bindingParser) {
+ const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
+ addFeatures(definitionMap, meta);
+ const selector = meta.selector && CssSelector.parse(meta.selector);
+ const firstSelector = selector && selector[0];
+ if (firstSelector) {
+ const selectorAttributes = firstSelector.getAttrs();
+ if (selectorAttributes.length) {
+ definitionMap.set("attrs", constantPool.getConstLiteral(
+ literalArr(selectorAttributes.map((value) => value != null ? literal(value) : literal(void 0))),
+ /* forceShared */
+ true
+ ));
+ }
+ }
+ const templateTypeName = meta.name;
+ let allDeferrableDepsFn = null;
+ if (meta.defer.mode === 1 && meta.defer.dependenciesFn !== null) {
+ const fnName = `${templateTypeName}_DeferFn`;
+ constantPool.statements.push(new DeclareVarStmt(fnName, meta.defer.dependenciesFn, void 0, StmtModifier.Final));
+ allDeferrableDepsFn = variable(fnName);
+ }
+ const compilationMode = meta.isStandalone && !meta.hasDirectiveDependencies ? TemplateCompilationMode.DomOnly : TemplateCompilationMode.Full;
+ const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, compilationMode, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled());
+ transform(tpl, CompilationJobKind.Tmpl);
+ const templateFn = emitTemplateFn(tpl, constantPool);
+ if (tpl.contentSelectors !== null) {
+ definitionMap.set("ngContentSelectors", tpl.contentSelectors);
+ }
+ definitionMap.set("decls", literal(tpl.root.decls));
+ definitionMap.set("vars", literal(tpl.root.vars));
+ if (tpl.consts.length > 0) {
+ if (tpl.constsInitializers.length > 0) {
+ definitionMap.set("consts", arrowFn([], [...tpl.constsInitializers, new ReturnStatement(literalArr(tpl.consts))]));
+ } else {
+ definitionMap.set("consts", literalArr(tpl.consts));
+ }
+ }
+ definitionMap.set("template", templateFn);
+ if (meta.declarationListEmitMode !== 3 && meta.declarations.length > 0) {
+ definitionMap.set("dependencies", compileDeclarationList(literalArr(meta.declarations.map((decl) => decl.type)), meta.declarationListEmitMode));
+ } else if (meta.declarationListEmitMode === 3) {
+ const args = [meta.type.value];
+ if (meta.rawImports) {
+ args.push(meta.rawImports);
+ }
+ definitionMap.set("dependencies", importExpr(Identifiers.getComponentDepsFactory).callFn(args));
+ }
+ if (meta.encapsulation === null) {
+ meta.encapsulation = ViewEncapsulation$1.Emulated;
+ }
+ let hasStyles = !!meta.externalStyles?.length;
+ if (meta.styles && meta.styles.length) {
+ const styleValues = meta.encapsulation == ViewEncapsulation$1.Emulated ? compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) : meta.styles;
+ const styleNodes = styleValues.reduce((result, style) => {
+ if (style.trim().length > 0) {
+ result.push(constantPool.getConstLiteral(literal(style)));
+ }
+ return result;
+ }, []);
+ if (styleNodes.length > 0) {
+ hasStyles = true;
+ definitionMap.set("styles", literalArr(styleNodes));
+ }
+ }
+ if (!hasStyles && meta.encapsulation === ViewEncapsulation$1.Emulated) {
+ meta.encapsulation = ViewEncapsulation$1.None;
+ }
+ if (meta.encapsulation !== ViewEncapsulation$1.Emulated) {
+ definitionMap.set("encapsulation", literal(meta.encapsulation));
+ }
+ if (meta.animations !== null) {
+ definitionMap.set("data", literalMap([{ key: "animation", value: meta.animations, quoted: false }]));
+ }
+ if (meta.changeDetection !== null) {
+ if (typeof meta.changeDetection === "number" && meta.changeDetection !== ChangeDetectionStrategy.Default) {
+ definitionMap.set("changeDetection", literal(meta.changeDetection));
+ } else if (typeof meta.changeDetection === "object") {
+ definitionMap.set("changeDetection", meta.changeDetection);
+ }
+ }
+ const expression = importExpr(Identifiers.defineComponent).callFn([definitionMap.toLiteralMap()], void 0, true);
+ const type = createComponentType(meta);
+ return { expression, type, statements: [] };
+}
+function createComponentType(meta) {
+ const typeParams = createBaseDirectiveTypeParams(meta);
+ typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
+ typeParams.push(expressionType(literal(meta.isStandalone)));
+ typeParams.push(createHostDirectivesType(meta));
+ if (meta.isSignal) {
+ typeParams.push(expressionType(literal(meta.isSignal)));
+ }
+ return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
+}
+function compileDeclarationList(list, mode) {
+ switch (mode) {
+ case 0:
+ return list;
+ case 1:
+ return arrowFn([], list);
+ case 2:
+ const resolvedList = list.prop("map").callFn([importExpr(Identifiers.resolveForwardRef)]);
+ return arrowFn([], resolvedList);
+ case 3:
+ throw new Error(`Unsupported with an array of pre-resolved dependencies`);
+ }
+}
+function stringAsType(str) {
+ return expressionType(literal(str));
+}
+function stringMapAsLiteralExpression(map) {
+ const mapValues = Object.keys(map).map((key) => {
+ const value = Array.isArray(map[key]) ? map[key][0] : map[key];
+ return {
+ key,
+ value: literal(value),
+ quoted: true
+ };
+ });
+ return literalMap(mapValues);
+}
+function stringArrayAsType(arr) {
+ return arr.length > 0 ? expressionType(literalArr(arr.map((value) => literal(value)))) : NONE_TYPE;
+}
+function createBaseDirectiveTypeParams(meta) {
+ const selectorForType = meta.selector !== null ? meta.selector.replace(/\n/g, "") : null;
+ return [
+ typeWithParameters(meta.type.type, meta.typeArgumentCount),
+ selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE,
+ meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE,
+ expressionType(getInputsTypeExpression(meta)),
+ expressionType(stringMapAsLiteralExpression(meta.outputs)),
+ stringArrayAsType(meta.queries.map((q) => q.propertyName))
+ ];
+}
+function getInputsTypeExpression(meta) {
+ return literalMap(Object.keys(meta.inputs).map((key) => {
+ const value = meta.inputs[key];
+ const values = [
+ { key: "alias", value: literal(value.bindingPropertyName), quoted: true },
+ { key: "required", value: literal(value.required), quoted: true }
+ ];
+ if (value.isSignal) {
+ values.push({ key: "isSignal", value: literal(value.isSignal), quoted: true });
+ }
+ return { key, value: literalMap(values), quoted: true };
+ }));
+}
+function createDirectiveType(meta) {
+ const typeParams = createBaseDirectiveTypeParams(meta);
+ typeParams.push(NONE_TYPE);
+ typeParams.push(expressionType(literal(meta.isStandalone)));
+ typeParams.push(createHostDirectivesType(meta));
+ if (meta.isSignal) {
+ typeParams.push(expressionType(literal(meta.isSignal)));
+ }
+ return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
+}
+function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) {
+ const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, typeSourceSpan);
+ const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, typeSourceSpan);
+ if (hostBindingsMetadata.specialAttributes.styleAttr) {
+ hostBindingsMetadata.attributes["style"] = literal(hostBindingsMetadata.specialAttributes.styleAttr);
+ }
+ if (hostBindingsMetadata.specialAttributes.classAttr) {
+ hostBindingsMetadata.attributes["class"] = literal(hostBindingsMetadata.specialAttributes.classAttr);
+ }
+ const hostJob = ingestHostBinding({
+ componentName: name,
+ componentSelector: selector,
+ properties: bindings,
+ events: eventBindings,
+ attributes: hostBindingsMetadata.attributes
+ }, bindingParser, constantPool);
+ transform(hostJob, CompilationJobKind.Host);
+ definitionMap.set("hostAttrs", hostJob.root.attributes);
+ const varCount = hostJob.root.vars;
+ if (varCount !== null && varCount > 0) {
+ definitionMap.set("hostVars", literal(varCount));
+ }
+ return emitHostBindingFunction(hostJob);
+}
+var HOST_REG_EXP = /^(?:\[([^\]]+)\])|(?:\(([^\)]+)\))$/;
+function parseHostBindings(host) {
+ const attributes = {};
+ const listeners = {};
+ const properties = {};
+ const specialAttributes = {};
+ for (const key of Object.keys(host)) {
+ const value = host[key];
+ const matches = key.match(HOST_REG_EXP);
+ if (matches === null) {
+ switch (key) {
+ case "class":
+ if (typeof value !== "string") {
+ throw new Error(`Class binding must be string`);
+ }
+ specialAttributes.classAttr = value;
+ break;
+ case "style":
+ if (typeof value !== "string") {
+ throw new Error(`Style binding must be string`);
+ }
+ specialAttributes.styleAttr = value;
+ break;
+ default:
+ if (typeof value === "string") {
+ attributes[key] = literal(value);
+ } else {
+ attributes[key] = value;
+ }
+ }
+ } else if (matches[
+ 1
+ /* HostBindingGroup.Binding */
+ ] != null) {
+ if (typeof value !== "string") {
+ throw new Error(`Property binding must be string`);
+ }
+ properties[matches[
+ 1
+ /* HostBindingGroup.Binding */
+ ]] = value;
+ } else if (matches[
+ 2
+ /* HostBindingGroup.Event */
+ ] != null) {
+ if (typeof value !== "string") {
+ throw new Error(`Event binding must be string`);
+ }
+ listeners[matches[
+ 2
+ /* HostBindingGroup.Event */
+ ]] = value;
+ }
+ }
+ return { attributes, listeners, properties, specialAttributes };
+}
+function verifyHostBindings(bindings, sourceSpan) {
+ const bindingParser = makeBindingParser();
+ bindingParser.createDirectiveHostEventAsts(bindings.listeners, sourceSpan);
+ bindingParser.createBoundHostProperties(bindings.properties, sourceSpan);
+ return bindingParser.errors;
+}
+function compileStyles(styles, selector, hostSelector) {
+ const shadowCss = new ShadowCss();
+ return styles.map((style) => {
+ return shadowCss.shimCssText(style, selector, hostSelector);
+ });
+}
+function encapsulateStyle(style, componentIdentifier) {
+ const shadowCss = new ShadowCss();
+ const selector = componentIdentifier ? CONTENT_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier) : CONTENT_ATTR;
+ const hostSelector = componentIdentifier ? HOST_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier) : HOST_ATTR;
+ return shadowCss.shimCssText(style, selector, hostSelector);
+}
+function createHostDirectivesType(meta) {
+ if (!meta.hostDirectives?.length) {
+ return NONE_TYPE;
+ }
+ return expressionType(literalArr(meta.hostDirectives.map((hostMeta) => literalMap([
+ { key: "directive", value: typeofExpr(hostMeta.directive.type), quoted: false },
+ {
+ key: "inputs",
+ value: stringMapAsLiteralExpression(hostMeta.inputs || {}),
+ quoted: false
+ },
+ {
+ key: "outputs",
+ value: stringMapAsLiteralExpression(hostMeta.outputs || {}),
+ quoted: false
+ }
+ ]))));
+}
+function createHostDirectivesFeatureArg(hostDirectives) {
+ const expressions = [];
+ let hasForwardRef = false;
+ for (const current of hostDirectives) {
+ if (!current.inputs && !current.outputs) {
+ expressions.push(current.directive.type);
+ } else {
+ const keys = [{ key: "directive", value: current.directive.type, quoted: false }];
+ if (current.inputs) {
+ const inputsLiteral = createHostDirectivesMappingArray(current.inputs);
+ if (inputsLiteral) {
+ keys.push({ key: "inputs", value: inputsLiteral, quoted: false });
+ }
+ }
+ if (current.outputs) {
+ const outputsLiteral = createHostDirectivesMappingArray(current.outputs);
+ if (outputsLiteral) {
+ keys.push({ key: "outputs", value: outputsLiteral, quoted: false });
+ }
+ }
+ expressions.push(literalMap(keys));
+ }
+ if (current.isForwardReference) {
+ hasForwardRef = true;
+ }
+ }
+ return hasForwardRef ? new FunctionExpr([], [new ReturnStatement(literalArr(expressions))]) : literalArr(expressions);
+}
+function createHostDirectivesMappingArray(mapping) {
+ const elements = [];
+ for (const publicName in mapping) {
+ if (mapping.hasOwnProperty(publicName)) {
+ elements.push(literal(publicName), literal(mapping[publicName]));
+ }
+ }
+ return elements.length > 0 ? literalArr(elements) : null;
+}
+function compileDeferResolverFunction(meta) {
+ const depExpressions = [];
+ if (meta.mode === 0) {
+ for (const dep of meta.dependencies) {
+ if (dep.isDeferrable) {
+ const innerFn = arrowFn(
+ // Default imports are always accessed through the `default` property.
+ [new FnParam("m", DYNAMIC_TYPE)],
+ variable("m").prop(dep.isDefaultImport ? "default" : dep.symbolName)
+ );
+ const importExpr2 = new DynamicImportExpr(dep.importPath).prop("then").callFn([innerFn]);
+ depExpressions.push(importExpr2);
+ } else {
+ depExpressions.push(dep.typeReference);
+ }
+ }
+ } else {
+ for (const { symbolName, importPath, isDefaultImport } of meta.dependencies) {
+ const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(isDefaultImport ? "default" : symbolName));
+ const importExpr2 = new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
+ depExpressions.push(importExpr2);
+ }
+ }
+ return arrowFn([], literalArr(depExpressions));
+}
+var CombinedRecursiveAstVisitor = class extends RecursiveAstVisitor2 {
+ visit(node) {
+ if (node instanceof ASTWithSource) {
+ this.visit(node.ast);
+ } else {
+ node.visit(this);
+ }
+ }
+ visitElement(element2) {
+ this.visitAllTemplateNodes(element2.attributes);
+ this.visitAllTemplateNodes(element2.inputs);
+ this.visitAllTemplateNodes(element2.outputs);
+ this.visitAllTemplateNodes(element2.directives);
+ this.visitAllTemplateNodes(element2.references);
+ this.visitAllTemplateNodes(element2.children);
+ }
+ visitTemplate(template2) {
+ this.visitAllTemplateNodes(template2.attributes);
+ this.visitAllTemplateNodes(template2.inputs);
+ this.visitAllTemplateNodes(template2.outputs);
+ this.visitAllTemplateNodes(template2.directives);
+ this.visitAllTemplateNodes(template2.templateAttrs);
+ this.visitAllTemplateNodes(template2.variables);
+ this.visitAllTemplateNodes(template2.references);
+ this.visitAllTemplateNodes(template2.children);
+ }
+ visitContent(content) {
+ this.visitAllTemplateNodes(content.children);
+ }
+ visitBoundAttribute(attribute2) {
+ this.visit(attribute2.value);
+ }
+ visitBoundEvent(attribute2) {
+ this.visit(attribute2.handler);
+ }
+ visitBoundText(text2) {
+ this.visit(text2.value);
+ }
+ visitIcu(icu) {
+ Object.keys(icu.vars).forEach((key) => this.visit(icu.vars[key]));
+ Object.keys(icu.placeholders).forEach((key) => this.visit(icu.placeholders[key]));
+ }
+ visitDeferredBlock(deferred) {
+ deferred.visitAll(this);
+ }
+ visitDeferredTrigger(trigger) {
+ if (trigger instanceof BoundDeferredTrigger) {
+ this.visit(trigger.value);
+ }
+ }
+ visitDeferredBlockPlaceholder(block) {
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitDeferredBlockError(block) {
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitDeferredBlockLoading(block) {
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitSwitchBlock(block) {
+ this.visit(block.expression);
+ this.visitAllTemplateNodes(block.cases);
+ }
+ visitSwitchBlockCase(block) {
+ block.expression && this.visit(block.expression);
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitForLoopBlock(block) {
+ block.item.visit(this);
+ this.visitAllTemplateNodes(block.contextVariables);
+ this.visit(block.expression);
+ this.visitAllTemplateNodes(block.children);
+ block.empty?.visit(this);
+ }
+ visitForLoopBlockEmpty(block) {
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitIfBlock(block) {
+ this.visitAllTemplateNodes(block.branches);
+ }
+ visitIfBlockBranch(block) {
+ block.expression && this.visit(block.expression);
+ block.expressionAlias?.visit(this);
+ this.visitAllTemplateNodes(block.children);
+ }
+ visitLetDeclaration(decl) {
+ this.visit(decl.value);
+ }
+ visitComponent(component) {
+ this.visitAllTemplateNodes(component.attributes);
+ this.visitAllTemplateNodes(component.inputs);
+ this.visitAllTemplateNodes(component.outputs);
+ this.visitAllTemplateNodes(component.directives);
+ this.visitAllTemplateNodes(component.references);
+ this.visitAllTemplateNodes(component.children);
+ }
+ visitDirective(directive) {
+ this.visitAllTemplateNodes(directive.attributes);
+ this.visitAllTemplateNodes(directive.inputs);
+ this.visitAllTemplateNodes(directive.outputs);
+ this.visitAllTemplateNodes(directive.references);
+ }
+ visitVariable(variable2) {
+ }
+ visitReference(reference2) {
+ }
+ visitTextAttribute(attribute2) {
+ }
+ visitText(text2) {
+ }
+ visitUnknownBlock(block) {
+ }
+ visitAllTemplateNodes(nodes) {
+ for (const node of nodes) {
+ this.visit(node);
+ }
+ }
+};
+function diff(fullList, itemsToExclude) {
+ const exclude = new Set(itemsToExclude);
+ return fullList.filter((item) => !exclude.has(item));
+}
+function findMatchingDirectivesAndPipes(template2, directiveSelectors) {
+ const matcher = new SelectorMatcher();
+ for (const selector of directiveSelectors) {
+ const fakeDirective = {
+ selector,
+ exportAs: null,
+ inputs: {
+ hasBindingPropertyName() {
+ return false;
+ }
+ },
+ outputs: {
+ hasBindingPropertyName() {
+ return false;
+ }
+ }
+ };
+ matcher.addSelectables(CssSelector.parse(selector), [fakeDirective]);
+ }
+ const parsedTemplate = parseTemplate(
+ template2,
+ ""
+ /* templateUrl */
+ );
+ const binder = new R3TargetBinder(matcher);
+ const bound = binder.bind({ template: parsedTemplate.nodes });
+ const eagerDirectiveSelectors = bound.getEagerlyUsedDirectives().map((dir) => dir.selector);
+ const allMatchedDirectiveSelectors = bound.getUsedDirectives().map((dir) => dir.selector);
+ const eagerPipes = bound.getEagerlyUsedPipes();
+ return {
+ directives: {
+ regular: eagerDirectiveSelectors,
+ deferCandidates: diff(allMatchedDirectiveSelectors, eagerDirectiveSelectors)
+ },
+ pipes: {
+ regular: eagerPipes,
+ deferCandidates: diff(bound.getUsedPipes(), eagerPipes)
+ }
+ };
+}
+var R3TargetBinder = class {
+ directiveMatcher;
+ constructor(directiveMatcher) {
+ this.directiveMatcher = directiveMatcher;
+ }
+ /**
+ * Perform a binding operation on the given `Target` and return a `BoundTarget` which contains
+ * metadata about the types referenced in the template.
+ */
+ bind(target) {
+ if (!target.template && !target.host) {
+ throw new Error("Empty bound targets are not supported");
+ }
+ const directives = /* @__PURE__ */ new Map();
+ const eagerDirectives = [];
+ const missingDirectives = /* @__PURE__ */ new Set();
+ const bindings = /* @__PURE__ */ new Map();
+ const references = /* @__PURE__ */ new Map();
+ const scopedNodeEntities = /* @__PURE__ */ new Map();
+ const expressions = /* @__PURE__ */ new Map();
+ const symbols = /* @__PURE__ */ new Map();
+ const nestingLevel = /* @__PURE__ */ new Map();
+ const usedPipes = /* @__PURE__ */ new Set();
+ const eagerPipes = /* @__PURE__ */ new Set();
+ const deferBlocks = [];
+ if (target.template) {
+ const scope = Scope2.apply(target.template);
+ extractScopedNodeEntities(scope, scopedNodeEntities);
+ DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
+ TemplateBinder.applyWithScope(target.template, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
+ }
+ if (target.host) {
+ directives.set(target.host.node, target.host.directives);
+ TemplateBinder.applyWithScope(target.host.node, Scope2.apply(target.host.node), expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
+ }
+ return new R3BoundTarget(target, directives, eagerDirectives, missingDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
+ }
+};
+var Scope2 = class _Scope {
+ parentScope;
+ rootNode;
+ /**
+ * Named members of the `Scope`, such as `Reference`s or `Variable`s.
+ */
+ namedEntities = /* @__PURE__ */ new Map();
+ /**
+ * Set of element-like nodes that belong to this scope.
+ */
+ elementLikeInScope = /* @__PURE__ */ new Set();
+ /**
+ * Child `Scope`s for immediately nested `ScopedNode`s.
+ */
+ childScopes = /* @__PURE__ */ new Map();
+ /** Whether this scope is deferred or if any of its ancestors are deferred. */
+ isDeferred;
+ constructor(parentScope, rootNode) {
+ this.parentScope = parentScope;
+ this.rootNode = rootNode;
+ this.isDeferred = parentScope !== null && parentScope.isDeferred ? true : rootNode instanceof DeferredBlock;
+ }
+ static newRootScope() {
+ return new _Scope(null, null);
+ }
+ /**
+ * Process a template (either as a `Template` sub-template with variables, or a plain array of
+ * template `Node`s) and construct its `Scope`.
+ */
+ static apply(template2) {
+ const scope = _Scope.newRootScope();
+ scope.ingest(template2);
+ return scope;
+ }
+ /**
+ * Internal method to process the scoped node and populate the `Scope`.
+ */
+ ingest(nodeOrNodes) {
+ if (nodeOrNodes instanceof Template) {
+ nodeOrNodes.variables.forEach((node) => this.visitVariable(node));
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ } else if (nodeOrNodes instanceof IfBlockBranch) {
+ if (nodeOrNodes.expressionAlias !== null) {
+ this.visitVariable(nodeOrNodes.expressionAlias);
+ }
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ } else if (nodeOrNodes instanceof ForLoopBlock) {
+ this.visitVariable(nodeOrNodes.item);
+ nodeOrNodes.contextVariables.forEach((v) => this.visitVariable(v));
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ } else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ } else if (!(nodeOrNodes instanceof HostElement)) {
+ nodeOrNodes.forEach((node) => node.visit(this));
+ }
+ }
+ visitElement(element2) {
+ this.visitElementLike(element2);
+ }
+ visitTemplate(template2) {
+ template2.directives.forEach((node) => node.visit(this));
+ template2.references.forEach((node) => this.visitReference(node));
+ this.ingestScopedNode(template2);
+ }
+ visitVariable(variable2) {
+ this.maybeDeclare(variable2);
+ }
+ visitReference(reference2) {
+ this.maybeDeclare(reference2);
+ }
+ visitDeferredBlock(deferred) {
+ this.ingestScopedNode(deferred);
+ deferred.placeholder?.visit(this);
+ deferred.loading?.visit(this);
+ deferred.error?.visit(this);
+ }
+ visitDeferredBlockPlaceholder(block) {
+ this.ingestScopedNode(block);
+ }
+ visitDeferredBlockError(block) {
+ this.ingestScopedNode(block);
+ }
+ visitDeferredBlockLoading(block) {
+ this.ingestScopedNode(block);
+ }
+ visitSwitchBlock(block) {
+ block.cases.forEach((node) => node.visit(this));
+ }
+ visitSwitchBlockCase(block) {
+ this.ingestScopedNode(block);
+ }
+ visitForLoopBlock(block) {
+ this.ingestScopedNode(block);
+ block.empty?.visit(this);
+ }
+ visitForLoopBlockEmpty(block) {
+ this.ingestScopedNode(block);
+ }
+ visitIfBlock(block) {
+ block.branches.forEach((node) => node.visit(this));
+ }
+ visitIfBlockBranch(block) {
+ this.ingestScopedNode(block);
+ }
+ visitContent(content) {
+ this.ingestScopedNode(content);
+ }
+ visitLetDeclaration(decl) {
+ this.maybeDeclare(decl);
+ }
+ visitComponent(component) {
+ this.visitElementLike(component);
+ }
+ visitDirective(directive) {
+ directive.references.forEach((current) => this.visitReference(current));
+ }
+ // Unused visitors.
+ visitBoundAttribute(attr) {
+ }
+ visitBoundEvent(event) {
+ }
+ visitBoundText(text2) {
+ }
+ visitText(text2) {
+ }
+ visitTextAttribute(attr) {
+ }
+ visitIcu(icu) {
+ }
+ visitDeferredTrigger(trigger) {
+ }
+ visitUnknownBlock(block) {
+ }
+ visitElementLike(node) {
+ node.directives.forEach((current) => current.visit(this));
+ node.references.forEach((current) => this.visitReference(current));
+ node.children.forEach((current) => current.visit(this));
+ this.elementLikeInScope.add(node);
+ }
+ maybeDeclare(thing) {
+ if (!this.namedEntities.has(thing.name)) {
+ this.namedEntities.set(thing.name, thing);
+ }
+ }
+ /**
+ * Look up a variable within this `Scope`.
+ *
+ * This can recurse into a parent `Scope` if it's available.
+ */
+ lookup(name) {
+ if (this.namedEntities.has(name)) {
+ return this.namedEntities.get(name);
+ } else if (this.parentScope !== null) {
+ return this.parentScope.lookup(name);
+ } else {
+ return null;
+ }
+ }
+ /**
+ * Get the child scope for a `ScopedNode`.
+ *
+ * This should always be defined.
+ */
+ getChildScope(node) {
+ const res = this.childScopes.get(node);
+ if (res === void 0) {
+ throw new Error(`Assertion error: child scope for ${node} not found`);
+ }
+ return res;
+ }
+ ingestScopedNode(node) {
+ const scope = new _Scope(this, node);
+ scope.ingest(node);
+ this.childScopes.set(node, scope);
+ }
+};
+var DirectiveBinder = class _DirectiveBinder {
+ directiveMatcher;
+ directives;
+ eagerDirectives;
+ missingDirectives;
+ bindings;
+ references;
+ // Indicates whether we are visiting elements within a `defer` block
+ isInDeferBlock = false;
+ constructor(directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references) {
+ this.directiveMatcher = directiveMatcher;
+ this.directives = directives;
+ this.eagerDirectives = eagerDirectives;
+ this.missingDirectives = missingDirectives;
+ this.bindings = bindings;
+ this.references = references;
+ }
+ /**
+ * Process a template (list of `Node`s) and perform directive matching against each node.
+ *
+ * @param template the list of template `Node`s to match (recursively).
+ * @param selectorMatcher a `SelectorMatcher` containing the directives that are in scope for
+ * this template.
+ * @returns three maps which contain information about directives in the template: the
+ * `directives` map which lists directives matched on each node, the `bindings` map which
+ * indicates which directives claimed which bindings (inputs, outputs, etc), and the `references`
+ * map which resolves #references (`Reference`s) within the template to the named directive or
+ * template node.
+ */
+ static apply(template2, directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references) {
+ const matcher = new _DirectiveBinder(directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
+ matcher.ingest(template2);
+ }
+ ingest(template2) {
+ template2.forEach((node) => node.visit(this));
+ }
+ visitElement(element2) {
+ this.visitElementOrTemplate(element2);
+ }
+ visitTemplate(template2) {
+ this.visitElementOrTemplate(template2);
+ }
+ visitDeferredBlock(deferred) {
+ const wasInDeferBlock = this.isInDeferBlock;
+ this.isInDeferBlock = true;
+ deferred.children.forEach((child) => child.visit(this));
+ this.isInDeferBlock = wasInDeferBlock;
+ deferred.placeholder?.visit(this);
+ deferred.loading?.visit(this);
+ deferred.error?.visit(this);
+ }
+ visitDeferredBlockPlaceholder(block) {
+ block.children.forEach((child) => child.visit(this));
+ }
+ visitDeferredBlockError(block) {
+ block.children.forEach((child) => child.visit(this));
+ }
+ visitDeferredBlockLoading(block) {
+ block.children.forEach((child) => child.visit(this));
+ }
+ visitSwitchBlock(block) {
+ block.cases.forEach((node) => node.visit(this));
+ }
+ visitSwitchBlockCase(block) {
+ block.children.forEach((node) => node.visit(this));
+ }
+ visitForLoopBlock(block) {
+ block.item.visit(this);
+ block.contextVariables.forEach((v) => v.visit(this));
+ block.children.forEach((node) => node.visit(this));
+ block.empty?.visit(this);
+ }
+ visitForLoopBlockEmpty(block) {
+ block.children.forEach((node) => node.visit(this));
+ }
+ visitIfBlock(block) {
+ block.branches.forEach((node) => node.visit(this));
+ }
+ visitIfBlockBranch(block) {
+ block.expressionAlias?.visit(this);
+ block.children.forEach((node) => node.visit(this));
+ }
+ visitContent(content) {
+ content.children.forEach((child) => child.visit(this));
+ }
+ visitComponent(node) {
+ if (this.directiveMatcher instanceof SelectorlessMatcher) {
+ const componentMatches = this.directiveMatcher.match(node.componentName);
+ if (componentMatches.length > 0) {
+ this.trackSelectorlessMatchesAndDirectives(node, componentMatches);
+ } else {
+ this.missingDirectives.add(node.componentName);
+ }
+ }
+ node.directives.forEach((directive) => directive.visit(this));
+ node.children.forEach((child) => child.visit(this));
+ }
+ visitDirective(node) {
+ if (this.directiveMatcher instanceof SelectorlessMatcher) {
+ const directives = this.directiveMatcher.match(node.name);
+ if (directives.length > 0) {
+ this.trackSelectorlessMatchesAndDirectives(node, directives);
+ } else {
+ this.missingDirectives.add(node.name);
+ }
+ }
+ }
+ visitElementOrTemplate(node) {
+ if (this.directiveMatcher instanceof SelectorMatcher) {
+ const directives = [];
+ const cssSelector = createCssSelectorFromNode(node);
+ this.directiveMatcher.match(cssSelector, (_, results) => directives.push(...results));
+ this.trackSelectorBasedBindingsAndDirectives(node, directives);
+ } else {
+ node.references.forEach((ref) => {
+ if (ref.value.trim() === "") {
+ this.references.set(ref, node);
+ }
+ });
+ }
+ node.directives.forEach((directive) => directive.visit(this));
+ node.children.forEach((child) => child.visit(this));
+ }
+ trackMatchedDirectives(node, directives) {
+ if (directives.length > 0) {
+ this.directives.set(node, directives);
+ if (!this.isInDeferBlock) {
+ this.eagerDirectives.push(...directives);
+ }
+ }
+ }
+ trackSelectorlessMatchesAndDirectives(node, directives) {
+ if (directives.length === 0) {
+ return;
+ }
+ this.trackMatchedDirectives(node, directives);
+ const setBinding = (meta, attribute2, ioType) => {
+ if (meta[ioType].hasBindingPropertyName(attribute2.name)) {
+ this.bindings.set(attribute2, meta);
+ }
+ };
+ for (const directive of directives) {
+ node.inputs.forEach((input) => setBinding(directive, input, "inputs"));
+ node.attributes.forEach((attr) => setBinding(directive, attr, "inputs"));
+ node.outputs.forEach((output) => setBinding(directive, output, "outputs"));
+ }
+ node.references.forEach((ref) => this.references.set(ref, { directive: directives[0], node }));
+ }
+ trackSelectorBasedBindingsAndDirectives(node, directives) {
+ this.trackMatchedDirectives(node, directives);
+ node.references.forEach((ref) => {
+ let dirTarget = null;
+ if (ref.value.trim() === "") {
+ dirTarget = directives.find((dir) => dir.isComponent) || null;
+ } else {
+ dirTarget = directives.find((dir) => dir.exportAs !== null && dir.exportAs.some((value) => value === ref.value)) || null;
+ if (dirTarget === null) {
+ return;
+ }
+ }
+ if (dirTarget !== null) {
+ this.references.set(ref, { directive: dirTarget, node });
+ } else {
+ this.references.set(ref, node);
+ }
+ });
+ const setAttributeBinding = (attribute2, ioType) => {
+ const dir = directives.find((dir2) => dir2[ioType].hasBindingPropertyName(attribute2.name));
+ const binding = dir !== void 0 ? dir : node;
+ this.bindings.set(attribute2, binding);
+ };
+ node.inputs.forEach((input) => setAttributeBinding(input, "inputs"));
+ node.attributes.forEach((attr) => setAttributeBinding(attr, "inputs"));
+ if (node instanceof Template) {
+ node.templateAttrs.forEach((attr) => setAttributeBinding(attr, "inputs"));
+ }
+ node.outputs.forEach((output) => setAttributeBinding(output, "outputs"));
+ }
+ // Unused visitors.
+ visitVariable(variable2) {
+ }
+ visitReference(reference2) {
+ }
+ visitTextAttribute(attribute2) {
+ }
+ visitBoundAttribute(attribute2) {
+ }
+ visitBoundEvent(attribute2) {
+ }
+ visitBoundAttributeOrEvent(node) {
+ }
+ visitText(text2) {
+ }
+ visitBoundText(text2) {
+ }
+ visitIcu(icu) {
+ }
+ visitDeferredTrigger(trigger) {
+ }
+ visitUnknownBlock(block) {
+ }
+ visitLetDeclaration(decl) {
+ }
+};
+var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
+ bindings;
+ symbols;
+ usedPipes;
+ eagerPipes;
+ deferBlocks;
+ nestingLevel;
+ scope;
+ rootNode;
+ level;
+ visitNode = (node) => node.visit(this);
+ constructor(bindings, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, rootNode, level) {
+ super();
+ this.bindings = bindings;
+ this.symbols = symbols;
+ this.usedPipes = usedPipes;
+ this.eagerPipes = eagerPipes;
+ this.deferBlocks = deferBlocks;
+ this.nestingLevel = nestingLevel;
+ this.scope = scope;
+ this.rootNode = rootNode;
+ this.level = level;
+ }
+ /**
+ * Process a template and extract metadata about expressions and symbols within.
+ *
+ * @param nodeOrNodes the nodes of the template to process
+ * @param scope the `Scope` of the template being processed.
+ * @returns three maps which contain metadata about the template: `expressions` which interprets
+ * special `AST` nodes in expressions as pointing to references or variables declared within the
+ * template, `symbols` which maps those variables and references to the nested `Template` which
+ * declares them, if any, and `nestingLevel` which associates each `Template` with a integer
+ * nesting level (how many levels deep within the template structure the `Template` is), starting
+ * at 1.
+ */
+ static applyWithScope(nodeOrNodes, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks) {
+ const template2 = nodeOrNodes instanceof Template ? nodeOrNodes : null;
+ const binder = new _TemplateBinder(expressions, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, template2, 0);
+ binder.ingest(nodeOrNodes);
+ }
+ ingest(nodeOrNodes) {
+ if (nodeOrNodes instanceof Template) {
+ nodeOrNodes.variables.forEach(this.visitNode);
+ nodeOrNodes.children.forEach(this.visitNode);
+ this.nestingLevel.set(nodeOrNodes, this.level);
+ } else if (nodeOrNodes instanceof IfBlockBranch) {
+ if (nodeOrNodes.expressionAlias !== null) {
+ this.visitNode(nodeOrNodes.expressionAlias);
+ }
+ nodeOrNodes.children.forEach(this.visitNode);
+ this.nestingLevel.set(nodeOrNodes, this.level);
+ } else if (nodeOrNodes instanceof ForLoopBlock) {
+ this.visitNode(nodeOrNodes.item);
+ nodeOrNodes.contextVariables.forEach((v) => this.visitNode(v));
+ nodeOrNodes.trackBy.visit(this);
+ nodeOrNodes.children.forEach(this.visitNode);
+ this.nestingLevel.set(nodeOrNodes, this.level);
+ } else if (nodeOrNodes instanceof DeferredBlock) {
+ if (this.scope.rootNode !== nodeOrNodes) {
+ throw new Error(`Assertion error: resolved incorrect scope for deferred block ${nodeOrNodes}`);
+ }
+ this.deferBlocks.push([nodeOrNodes, this.scope]);
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ this.nestingLevel.set(nodeOrNodes, this.level);
+ } else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
+ nodeOrNodes.children.forEach((node) => node.visit(this));
+ this.nestingLevel.set(nodeOrNodes, this.level);
+ } else if (nodeOrNodes instanceof HostElement) {
+ this.nestingLevel.set(nodeOrNodes, 0);
+ } else {
+ nodeOrNodes.forEach(this.visitNode);
+ }
+ }
+ visitTemplate(template2) {
+ template2.inputs.forEach(this.visitNode);
+ template2.outputs.forEach(this.visitNode);
+ template2.directives.forEach(this.visitNode);
+ template2.templateAttrs.forEach(this.visitNode);
+ template2.references.forEach(this.visitNode);
+ this.ingestScopedNode(template2);
+ }
+ visitVariable(variable2) {
+ if (this.rootNode !== null) {
+ this.symbols.set(variable2, this.rootNode);
+ }
+ }
+ visitReference(reference2) {
+ if (this.rootNode !== null) {
+ this.symbols.set(reference2, this.rootNode);
+ }
+ }
+ visitDeferredBlock(deferred) {
+ this.ingestScopedNode(deferred);
+ deferred.triggers.when?.value.visit(this);
+ deferred.prefetchTriggers.when?.value.visit(this);
+ deferred.hydrateTriggers.when?.value.visit(this);
+ deferred.hydrateTriggers.never?.visit(this);
+ deferred.placeholder && this.visitNode(deferred.placeholder);
+ deferred.loading && this.visitNode(deferred.loading);
+ deferred.error && this.visitNode(deferred.error);
+ }
+ visitDeferredBlockPlaceholder(block) {
+ this.ingestScopedNode(block);
+ }
+ visitDeferredBlockError(block) {
+ this.ingestScopedNode(block);
+ }
+ visitDeferredBlockLoading(block) {
+ this.ingestScopedNode(block);
+ }
+ visitSwitchBlockCase(block) {
+ block.expression?.visit(this);
+ this.ingestScopedNode(block);
+ }
+ visitForLoopBlock(block) {
+ block.expression.visit(this);
+ this.ingestScopedNode(block);
+ block.empty?.visit(this);
+ }
+ visitForLoopBlockEmpty(block) {
+ this.ingestScopedNode(block);
+ }
+ visitIfBlockBranch(block) {
+ block.expression?.visit(this);
+ this.ingestScopedNode(block);
+ }
+ visitContent(content) {
+ this.ingestScopedNode(content);
+ }
+ visitLetDeclaration(decl) {
+ super.visitLetDeclaration(decl);
+ if (this.rootNode !== null) {
+ this.symbols.set(decl, this.rootNode);
+ }
+ }
+ visitPipe(ast, context) {
+ this.usedPipes.add(ast.name);
+ if (!this.scope.isDeferred) {
+ this.eagerPipes.add(ast.name);
+ }
+ return super.visitPipe(ast, context);
+ }
+ // These five types of AST expressions can refer to expression roots, which could be variables
+ // or references in the current scope.
+ visitPropertyRead(ast, context) {
+ this.maybeMap(ast, ast.name);
+ return super.visitPropertyRead(ast, context);
+ }
+ visitSafePropertyRead(ast, context) {
+ this.maybeMap(ast, ast.name);
+ return super.visitSafePropertyRead(ast, context);
+ }
+ ingestScopedNode(node) {
+ const childScope = this.scope.getChildScope(node);
+ const binder = new _TemplateBinder(this.bindings, this.symbols, this.usedPipes, this.eagerPipes, this.deferBlocks, this.nestingLevel, childScope, node, this.level + 1);
+ binder.ingest(node);
+ }
+ maybeMap(ast, name) {
+ if (!(ast.receiver instanceof ImplicitReceiver) || ast.receiver instanceof ThisReceiver) {
+ return;
+ }
+ const target = this.scope.lookup(name);
+ if (target !== null) {
+ this.bindings.set(ast, target);
+ }
+ }
+};
+var R3BoundTarget = class {
+ target;
+ directives;
+ eagerDirectives;
+ missingDirectives;
+ bindings;
+ references;
+ exprTargets;
+ symbols;
+ nestingLevel;
+ scopedNodeEntities;
+ usedPipes;
+ eagerPipes;
+ /** Deferred blocks, ordered as they appear in the template. */
+ deferredBlocks;
+ /** Map of deferred blocks to their scope. */
+ deferredScopes;
+ constructor(target, directives, eagerDirectives, missingDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) {
+ this.target = target;
+ this.directives = directives;
+ this.eagerDirectives = eagerDirectives;
+ this.missingDirectives = missingDirectives;
+ this.bindings = bindings;
+ this.references = references;
+ this.exprTargets = exprTargets;
+ this.symbols = symbols;
+ this.nestingLevel = nestingLevel;
+ this.scopedNodeEntities = scopedNodeEntities;
+ this.usedPipes = usedPipes;
+ this.eagerPipes = eagerPipes;
+ this.deferredBlocks = rawDeferred.map((current) => current[0]);
+ this.deferredScopes = new Map(rawDeferred);
+ }
+ getEntitiesInScope(node) {
+ return this.scopedNodeEntities.get(node) ?? /* @__PURE__ */ new Set();
+ }
+ getDirectivesOfNode(node) {
+ return this.directives.get(node) || null;
+ }
+ getReferenceTarget(ref) {
+ return this.references.get(ref) || null;
+ }
+ getConsumerOfBinding(binding) {
+ return this.bindings.get(binding) || null;
+ }
+ getExpressionTarget(expr) {
+ return this.exprTargets.get(expr) || null;
+ }
+ getDefinitionNodeOfSymbol(symbol) {
+ return this.symbols.get(symbol) || null;
+ }
+ getNestingLevel(node) {
+ return this.nestingLevel.get(node) || 0;
+ }
+ getUsedDirectives() {
+ const set = /* @__PURE__ */ new Set();
+ this.directives.forEach((dirs) => dirs.forEach((dir) => set.add(dir)));
+ return Array.from(set.values());
+ }
+ getEagerlyUsedDirectives() {
+ const set = new Set(this.eagerDirectives);
+ return Array.from(set.values());
+ }
+ getUsedPipes() {
+ return Array.from(this.usedPipes);
+ }
+ getEagerlyUsedPipes() {
+ return Array.from(this.eagerPipes);
+ }
+ getDeferBlocks() {
+ return this.deferredBlocks;
+ }
+ getDeferredTriggerTarget(block, trigger) {
+ if (!(trigger instanceof InteractionDeferredTrigger) && !(trigger instanceof ViewportDeferredTrigger) && !(trigger instanceof HoverDeferredTrigger)) {
+ return null;
+ }
+ const name = trigger.reference;
+ if (name === null) {
+ let target = null;
+ if (block.placeholder !== null) {
+ for (const child of block.placeholder.children) {
+ if (child instanceof Comment$1) {
+ continue;
+ }
+ if (target !== null) {
+ return null;
+ }
+ if (child instanceof Element$1) {
+ target = child;
+ }
+ }
+ }
+ return target;
+ }
+ const outsideRef = this.findEntityInScope(block, name);
+ if (outsideRef instanceof Reference && this.getDefinitionNodeOfSymbol(outsideRef) !== block) {
+ const target = this.getReferenceTarget(outsideRef);
+ if (target !== null) {
+ return this.referenceTargetToElement(target);
+ }
+ }
+ if (block.placeholder !== null) {
+ const refInPlaceholder = this.findEntityInScope(block.placeholder, name);
+ const targetInPlaceholder = refInPlaceholder instanceof Reference ? this.getReferenceTarget(refInPlaceholder) : null;
+ if (targetInPlaceholder !== null) {
+ return this.referenceTargetToElement(targetInPlaceholder);
+ }
+ }
+ return null;
+ }
+ isDeferred(element2) {
+ for (const block of this.deferredBlocks) {
+ if (!this.deferredScopes.has(block)) {
+ continue;
+ }
+ const stack = [this.deferredScopes.get(block)];
+ while (stack.length > 0) {
+ const current = stack.pop();
+ if (current.elementLikeInScope.has(element2)) {
+ return true;
+ }
+ stack.push(...current.childScopes.values());
+ }
+ }
+ return false;
+ }
+ referencedDirectiveExists(name) {
+ return !this.missingDirectives.has(name);
+ }
+ /**
+ * Finds an entity with a specific name in a scope.
+ * @param rootNode Root node of the scope.
+ * @param name Name of the entity.
+ */
+ findEntityInScope(rootNode, name) {
+ const entities = this.getEntitiesInScope(rootNode);
+ for (const entity of entities) {
+ if (entity.name === name) {
+ return entity;
+ }
+ }
+ return null;
+ }
+ /** Coerces a `ReferenceTarget` to an `Element`, if possible. */
+ referenceTargetToElement(target) {
+ if (target instanceof Element$1) {
+ return target;
+ }
+ if (target instanceof Template || target.node instanceof Component$1 || target.node instanceof Directive$1 || target.node instanceof HostElement) {
+ return null;
+ }
+ return this.referenceTargetToElement(target.node);
+ }
+};
+function extractScopedNodeEntities(rootScope, templateEntities) {
+ const entityMap = /* @__PURE__ */ new Map();
+ function extractScopeEntities(scope) {
+ if (entityMap.has(scope.rootNode)) {
+ return entityMap.get(scope.rootNode);
+ }
+ const currentEntities = scope.namedEntities;
+ let entities;
+ if (scope.parentScope !== null) {
+ entities = new Map([...extractScopeEntities(scope.parentScope), ...currentEntities]);
+ } else {
+ entities = new Map(currentEntities);
+ }
+ entityMap.set(scope.rootNode, entities);
+ return entities;
+ }
+ const scopesToProcess = [rootScope];
+ while (scopesToProcess.length > 0) {
+ const scope = scopesToProcess.pop();
+ for (const childScope of scope.childScopes.values()) {
+ scopesToProcess.push(childScope);
+ }
+ extractScopeEntities(scope);
+ }
+ for (const [template2, entities] of entityMap) {
+ templateEntities.set(template2, new Set(entities.values()));
+ }
+}
+var ResourceLoader = class {
+};
+var CompilerFacadeImpl = class {
+ jitEvaluator;
+ FactoryTarget = FactoryTarget;
+ ResourceLoader = ResourceLoader;
+ elementSchemaRegistry = new DomElementSchemaRegistry();
+ constructor(jitEvaluator = new JitEvaluator()) {
+ this.jitEvaluator = jitEvaluator;
+ }
+ compilePipe(angularCoreEnv, sourceMapUrl, facade) {
+ const metadata = {
+ name: facade.name,
+ type: wrapReference(facade.type),
+ typeArgumentCount: 0,
+ deps: null,
+ pipeName: facade.pipeName,
+ pure: facade.pure,
+ isStandalone: facade.isStandalone
+ };
+ const res = compilePipeFromMetadata(metadata);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compilePipeDeclaration(angularCoreEnv, sourceMapUrl, declaration) {
+ const meta = convertDeclarePipeFacadeToMetadata(declaration);
+ const res = compilePipeFromMetadata(meta);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compileInjectable(angularCoreEnv, sourceMapUrl, facade) {
+ const { expression, statements } = compileInjectable(
+ {
+ name: facade.name,
+ type: wrapReference(facade.type),
+ typeArgumentCount: facade.typeArgumentCount,
+ providedIn: computeProvidedIn(facade.providedIn),
+ useClass: convertToProviderExpression(facade, "useClass"),
+ useFactory: wrapExpression(facade, "useFactory"),
+ useValue: convertToProviderExpression(facade, "useValue"),
+ useExisting: convertToProviderExpression(facade, "useExisting"),
+ deps: facade.deps?.map(convertR3DependencyMetadata)
+ },
+ /* resolveForwardRefs */
+ true
+ );
+ return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);
+ }
+ compileInjectableDeclaration(angularCoreEnv, sourceMapUrl, facade) {
+ const { expression, statements } = compileInjectable(
+ {
+ name: facade.type.name,
+ type: wrapReference(facade.type),
+ typeArgumentCount: 0,
+ providedIn: computeProvidedIn(facade.providedIn),
+ useClass: convertToProviderExpression(facade, "useClass"),
+ useFactory: wrapExpression(facade, "useFactory"),
+ useValue: convertToProviderExpression(facade, "useValue"),
+ useExisting: convertToProviderExpression(facade, "useExisting"),
+ deps: facade.deps?.map(convertR3DeclareDependencyMetadata)
+ },
+ /* resolveForwardRefs */
+ true
+ );
+ return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);
+ }
+ compileInjector(angularCoreEnv, sourceMapUrl, facade) {
+ const meta = {
+ name: facade.name,
+ type: wrapReference(facade.type),
+ providers: facade.providers && facade.providers.length > 0 ? new WrappedNodeExpr(facade.providers) : null,
+ imports: facade.imports.map((i) => new WrappedNodeExpr(i))
+ };
+ const res = compileInjector(meta);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compileInjectorDeclaration(angularCoreEnv, sourceMapUrl, declaration) {
+ const meta = convertDeclareInjectorFacadeToMetadata(declaration);
+ const res = compileInjector(meta);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compileNgModule(angularCoreEnv, sourceMapUrl, facade) {
+ const meta = {
+ kind: R3NgModuleMetadataKind.Global,
+ type: wrapReference(facade.type),
+ bootstrap: facade.bootstrap.map(wrapReference),
+ declarations: facade.declarations.map(wrapReference),
+ publicDeclarationTypes: null,
+ // only needed for types in AOT
+ imports: facade.imports.map(wrapReference),
+ includeImportTypes: true,
+ exports: facade.exports.map(wrapReference),
+ selectorScopeMode: R3SelectorScopeMode.Inline,
+ containsForwardDecls: false,
+ schemas: facade.schemas ? facade.schemas.map(wrapReference) : null,
+ id: facade.id ? new WrappedNodeExpr(facade.id) : null
+ };
+ const res = compileNgModule(meta);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compileNgModuleDeclaration(angularCoreEnv, sourceMapUrl, declaration) {
+ const expression = compileNgModuleDeclarationExpression(declaration);
+ return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, []);
+ }
+ compileDirective(angularCoreEnv, sourceMapUrl, facade) {
+ const meta = convertDirectiveFacadeToMetadata(facade);
+ return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta);
+ }
+ compileDirectiveDeclaration(angularCoreEnv, sourceMapUrl, declaration) {
+ const typeSourceSpan = this.createParseSourceSpan("Directive", declaration.type.name, sourceMapUrl);
+ const meta = convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan);
+ return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta);
+ }
+ compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta) {
+ const constantPool = new ConstantPool();
+ const bindingParser = makeBindingParser();
+ const res = compileDirectiveFromMetadata(meta, constantPool, bindingParser);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements);
+ }
+ compileComponent(angularCoreEnv, sourceMapUrl, facade) {
+ const { template: template2, interpolation, defer: defer2 } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation, void 0);
+ const meta = __spreadProps(__spreadValues(__spreadValues({}, facade), convertDirectiveFacadeToMetadata(facade)), {
+ selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(),
+ template: template2,
+ declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
+ declarationListEmitMode: 0,
+ defer: defer2,
+ styles: [...facade.styles, ...template2.styles],
+ encapsulation: facade.encapsulation,
+ interpolation,
+ changeDetection: facade.changeDetection ?? null,
+ animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
+ viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
+ relativeContextFilePath: "",
+ i18nUseExternalIds: true,
+ relativeTemplatePath: null
+ });
+ const jitExpressionSourceMap = `ng:///${facade.name}.js`;
+ return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
+ }
+ compileComponentDeclaration(angularCoreEnv, sourceMapUrl, declaration) {
+ const typeSourceSpan = this.createParseSourceSpan("Component", declaration.type.name, sourceMapUrl);
+ const meta = convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl);
+ return this.compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta);
+ }
+ compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta) {
+ const constantPool = new ConstantPool();
+ const bindingParser = makeBindingParser(meta.interpolation);
+ const res = compileComponentFromMetadata(meta, constantPool, bindingParser);
+ return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements);
+ }
+ compileFactory(angularCoreEnv, sourceMapUrl, meta) {
+ const factoryRes = compileFactoryFunction({
+ name: meta.name,
+ type: wrapReference(meta.type),
+ typeArgumentCount: meta.typeArgumentCount,
+ deps: convertR3DependencyMetadataArray(meta.deps),
+ target: meta.target
+ });
+ return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements);
+ }
+ compileFactoryDeclaration(angularCoreEnv, sourceMapUrl, meta) {
+ const factoryRes = compileFactoryFunction({
+ name: meta.type.name,
+ type: wrapReference(meta.type),
+ typeArgumentCount: 0,
+ deps: Array.isArray(meta.deps) ? meta.deps.map(convertR3DeclareDependencyMetadata) : meta.deps,
+ target: meta.target
+ });
+ return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements);
+ }
+ createParseSourceSpan(kind, typeName, sourceUrl) {
+ return r3JitTypeSourceSpan(kind, typeName, sourceUrl);
+ }
+ /**
+ * JIT compiles an expression and returns the result of executing that expression.
+ *
+ * @param def the definition which will be compiled and executed to get the value to patch
+ * @param context an object map of @angular/core symbol names to symbols which will be available
+ * in the context of the compiled expression
+ * @param sourceUrl a URL to use for the source map of the compiled expression
+ * @param preStatements a collection of statements that should be evaluated before the expression.
+ */
+ jitExpression(def, context, sourceUrl, preStatements) {
+ const statements = [
+ ...preStatements,
+ new DeclareVarStmt("$def", def, void 0, StmtModifier.Exported)
+ ];
+ const res = this.jitEvaluator.evaluateStatements(
+ sourceUrl,
+ statements,
+ new R3JitReflector(context),
+ /* enableSourceMaps */
+ true
+ );
+ return res["$def"];
+ }
+};
+function convertToR3QueryMetadata(facade) {
+ return __spreadProps(__spreadValues({}, facade), {
+ isSignal: facade.isSignal,
+ predicate: convertQueryPredicate(facade.predicate),
+ read: facade.read ? new WrappedNodeExpr(facade.read) : null,
+ static: facade.static,
+ emitDistinctChangesOnly: facade.emitDistinctChangesOnly
+ });
+}
+function convertQueryDeclarationToMetadata(declaration) {
+ return {
+ propertyName: declaration.propertyName,
+ first: declaration.first ?? false,
+ predicate: convertQueryPredicate(declaration.predicate),
+ descendants: declaration.descendants ?? false,
+ read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
+ static: declaration.static ?? false,
+ emitDistinctChangesOnly: declaration.emitDistinctChangesOnly ?? true,
+ isSignal: !!declaration.isSignal
+ };
+}
+function convertQueryPredicate(predicate) {
+ return Array.isArray(predicate) ? (
+ // The predicate is an array of strings so pass it through.
+ predicate
+ ) : (
+ // The predicate is a type - assume that we will need to unwrap any `forwardRef()` calls.
+ createMayBeForwardRefExpression(
+ new WrappedNodeExpr(predicate),
+ 1
+ /* ForwardRefHandling.Wrapped */
+ )
+ );
+}
+function convertDirectiveFacadeToMetadata(facade) {
+ const inputsFromMetadata = parseInputsArray(facade.inputs || []);
+ const outputsFromMetadata = parseMappingStringArray(facade.outputs || []);
+ const propMetadata = facade.propMetadata;
+ const inputsFromType = {};
+ const outputsFromType = {};
+ for (const field in propMetadata) {
+ if (propMetadata.hasOwnProperty(field)) {
+ propMetadata[field].forEach((ann) => {
+ if (isInput(ann)) {
+ inputsFromType[field] = {
+ bindingPropertyName: ann.alias || field,
+ classPropertyName: field,
+ required: ann.required || false,
+ // For JIT, decorators are used to declare signal inputs. That is because of
+ // a technical limitation where it's not possible to statically reflect class
+ // members of a directive/component at runtime before instantiating the class.
+ isSignal: !!ann.isSignal,
+ transformFunction: ann.transform != null ? new WrappedNodeExpr(ann.transform) : null
+ };
+ } else if (isOutput(ann)) {
+ outputsFromType[field] = ann.alias || field;
+ }
+ });
+ }
+ }
+ const hostDirectives = facade.hostDirectives?.length ? facade.hostDirectives.map((hostDirective) => {
+ return typeof hostDirective === "function" ? {
+ directive: wrapReference(hostDirective),
+ inputs: null,
+ outputs: null,
+ isForwardReference: false
+ } : {
+ directive: wrapReference(hostDirective.directive),
+ isForwardReference: false,
+ inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
+ outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null
+ };
+ }) : null;
+ return __spreadProps(__spreadValues({}, facade), {
+ typeArgumentCount: 0,
+ typeSourceSpan: facade.typeSourceSpan,
+ type: wrapReference(facade.type),
+ deps: null,
+ host: __spreadValues({}, extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host)),
+ inputs: __spreadValues(__spreadValues({}, inputsFromMetadata), inputsFromType),
+ outputs: __spreadValues(__spreadValues({}, outputsFromMetadata), outputsFromType),
+ queries: facade.queries.map(convertToR3QueryMetadata),
+ providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null,
+ viewQueries: facade.viewQueries.map(convertToR3QueryMetadata),
+ fullInheritance: false,
+ hostDirectives
+ });
+}
+function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
+ const hostDirectives = declaration.hostDirectives?.length ? declaration.hostDirectives.map((dir) => ({
+ directive: wrapReference(dir.directive),
+ isForwardReference: false,
+ inputs: dir.inputs ? getHostDirectiveBindingMapping(dir.inputs) : null,
+ outputs: dir.outputs ? getHostDirectiveBindingMapping(dir.outputs) : null
+ })) : null;
+ return {
+ name: declaration.type.name,
+ type: wrapReference(declaration.type),
+ typeSourceSpan,
+ selector: declaration.selector ?? null,
+ inputs: declaration.inputs ? inputsPartialMetadataToInputMetadata(declaration.inputs) : {},
+ outputs: declaration.outputs ?? {},
+ host: convertHostDeclarationToMetadata(declaration.host),
+ queries: (declaration.queries ?? []).map(convertQueryDeclarationToMetadata),
+ viewQueries: (declaration.viewQueries ?? []).map(convertQueryDeclarationToMetadata),
+ providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
+ exportAs: declaration.exportAs ?? null,
+ usesInheritance: declaration.usesInheritance ?? false,
+ lifecycle: { usesOnChanges: declaration.usesOnChanges ?? false },
+ deps: null,
+ typeArgumentCount: 0,
+ fullInheritance: false,
+ isStandalone: declaration.isStandalone ?? getJitStandaloneDefaultForVersion(declaration.version),
+ isSignal: declaration.isSignal ?? false,
+ hostDirectives
+ };
+}
+function convertHostDeclarationToMetadata(host = {}) {
+ return {
+ attributes: convertOpaqueValuesToExpressions(host.attributes ?? {}),
+ listeners: host.listeners ?? {},
+ properties: host.properties ?? {},
+ specialAttributes: {
+ classAttr: host.classAttribute,
+ styleAttr: host.styleAttribute
+ }
+ };
+}
+function getHostDirectiveBindingMapping(array) {
+ let result = null;
+ for (let i = 1; i < array.length; i += 2) {
+ result = result || {};
+ result[array[i - 1]] = array[i];
+ }
+ return result;
+}
+function convertOpaqueValuesToExpressions(obj) {
+ const result = {};
+ for (const key of Object.keys(obj)) {
+ result[key] = new WrappedNodeExpr(obj[key]);
+ }
+ return result;
+}
+function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
+ const { template: template2, interpolation, defer: defer2 } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation, decl.deferBlockDependencies);
+ const declarations = [];
+ if (decl.dependencies) {
+ for (const innerDep of decl.dependencies) {
+ switch (innerDep.kind) {
+ case "directive":
+ case "component":
+ declarations.push(convertDirectiveDeclarationToMetadata(innerDep));
+ break;
+ case "pipe":
+ declarations.push(convertPipeDeclarationToMetadata(innerDep));
+ break;
+ }
+ }
+ } else if (decl.components || decl.directives || decl.pipes) {
+ decl.components && declarations.push(...decl.components.map((dir) => convertDirectiveDeclarationToMetadata(
+ dir,
+ /* isComponent */
+ true
+ )));
+ decl.directives && declarations.push(...decl.directives.map((dir) => convertDirectiveDeclarationToMetadata(dir)));
+ decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
+ }
+ const hasDirectiveDependencies = declarations.some(({ kind }) => kind === R3TemplateDependencyKind.Directive || kind === R3TemplateDependencyKind.NgModule);
+ return __spreadProps(__spreadValues({}, convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan)), {
+ template: template2,
+ styles: decl.styles ?? [],
+ declarations,
+ viewProviders: decl.viewProviders !== void 0 ? new WrappedNodeExpr(decl.viewProviders) : null,
+ animations: decl.animations !== void 0 ? new WrappedNodeExpr(decl.animations) : null,
+ defer: defer2,
+ changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
+ encapsulation: decl.encapsulation ?? ViewEncapsulation$1.Emulated,
+ interpolation,
+ declarationListEmitMode: 2,
+ relativeContextFilePath: "",
+ i18nUseExternalIds: true,
+ relativeTemplatePath: null,
+ hasDirectiveDependencies
+ });
+}
+function convertDeclarationFacadeToMetadata(declaration) {
+ return __spreadProps(__spreadValues({}, declaration), {
+ type: new WrappedNodeExpr(declaration.type)
+ });
+}
+function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) {
+ return {
+ kind: R3TemplateDependencyKind.Directive,
+ isComponent: isComponent || declaration.kind === "component",
+ selector: declaration.selector,
+ type: new WrappedNodeExpr(declaration.type),
+ inputs: declaration.inputs ?? [],
+ outputs: declaration.outputs ?? [],
+ exportAs: declaration.exportAs ?? null
+ };
+}
+function convertPipeMapToMetadata(pipes) {
+ if (!pipes) {
+ return [];
+ }
+ return Object.keys(pipes).map((name) => {
+ return {
+ kind: R3TemplateDependencyKind.Pipe,
+ name,
+ type: new WrappedNodeExpr(pipes[name])
+ };
+ });
+}
+function convertPipeDeclarationToMetadata(pipe2) {
+ return {
+ kind: R3TemplateDependencyKind.Pipe,
+ name: pipe2.name,
+ type: new WrappedNodeExpr(pipe2.type)
+ };
+}
+function parseJitTemplate(template2, typeName, sourceMapUrl, preserveWhitespaces, interpolation, deferBlockDependencies) {
+ const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
+ const parsed = parseTemplate(template2, sourceMapUrl, {
+ preserveWhitespaces,
+ interpolationConfig
+ });
+ if (parsed.errors !== null) {
+ const errors = parsed.errors.map((err) => err.toString()).join(", ");
+ throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
+ }
+ const binder = new R3TargetBinder(null);
+ const boundTarget = binder.bind({ template: parsed.nodes });
+ return {
+ template: parsed,
+ interpolation: interpolationConfig,
+ defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies)
+ };
+}
+function convertToProviderExpression(obj, property2) {
+ if (obj.hasOwnProperty(property2)) {
+ return createMayBeForwardRefExpression(
+ new WrappedNodeExpr(obj[property2]),
+ 0
+ /* ForwardRefHandling.None */
+ );
+ } else {
+ return void 0;
+ }
+}
+function wrapExpression(obj, property2) {
+ if (obj.hasOwnProperty(property2)) {
+ return new WrappedNodeExpr(obj[property2]);
+ } else {
+ return void 0;
+ }
+}
+function computeProvidedIn(providedIn) {
+ const expression = typeof providedIn === "function" ? new WrappedNodeExpr(providedIn) : new LiteralExpr(providedIn ?? null);
+ return createMayBeForwardRefExpression(
+ expression,
+ 0
+ /* ForwardRefHandling.None */
+ );
+}
+function convertR3DependencyMetadataArray(facades) {
+ return facades == null ? null : facades.map(convertR3DependencyMetadata);
+}
+function convertR3DependencyMetadata(facade) {
+ const isAttributeDep = facade.attribute != null;
+ const rawToken = facade.token === null ? null : new WrappedNodeExpr(facade.token);
+ const token = isAttributeDep ? new WrappedNodeExpr(facade.attribute) : rawToken;
+ return createR3DependencyMetadata(token, isAttributeDep, facade.host, facade.optional, facade.self, facade.skipSelf);
+}
+function convertR3DeclareDependencyMetadata(facade) {
+ const isAttributeDep = facade.attribute ?? false;
+ const token = facade.token === null ? null : new WrappedNodeExpr(facade.token);
+ return createR3DependencyMetadata(token, isAttributeDep, facade.host ?? false, facade.optional ?? false, facade.self ?? false, facade.skipSelf ?? false);
+}
+function createR3DependencyMetadata(token, isAttributeDep, host, optional, self, skipSelf) {
+ const attributeNameType = isAttributeDep ? literal("unknown") : null;
+ return { token, attributeNameType, host, optional, self, skipSelf };
+}
+function createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies) {
+ const deferredBlocks = boundTarget.getDeferBlocks();
+ const blocks = /* @__PURE__ */ new Map();
+ for (let i = 0; i < deferredBlocks.length; i++) {
+ const dependencyFn = deferBlockDependencies?.[i];
+ blocks.set(deferredBlocks[i], dependencyFn ? new WrappedNodeExpr(dependencyFn) : null);
+ }
+ return { mode: 0, blocks };
+}
+function extractHostBindings(propMetadata, sourceSpan, host) {
+ const bindings = parseHostBindings(host || {});
+ const errors = verifyHostBindings(bindings, sourceSpan);
+ if (errors.length) {
+ throw new Error(errors.map((error) => error.msg).join("\n"));
+ }
+ for (const field in propMetadata) {
+ if (propMetadata.hasOwnProperty(field)) {
+ propMetadata[field].forEach((ann) => {
+ if (isHostBinding(ann)) {
+ bindings.properties[ann.hostPropertyName || field] = getSafePropertyAccessString("this", field);
+ } else if (isHostListener(ann)) {
+ bindings.listeners[ann.eventName || field] = `${field}(${(ann.args || []).join(",")})`;
+ }
+ });
+ }
+ }
+ return bindings;
+}
+function isHostBinding(value) {
+ return value.ngMetadataName === "HostBinding";
+}
+function isHostListener(value) {
+ return value.ngMetadataName === "HostListener";
+}
+function isInput(value) {
+ return value.ngMetadataName === "Input";
+}
+function isOutput(value) {
+ return value.ngMetadataName === "Output";
+}
+function inputsPartialMetadataToInputMetadata(inputs) {
+ return Object.keys(inputs).reduce((result, minifiedClassName) => {
+ const value = inputs[minifiedClassName];
+ if (typeof value === "string" || Array.isArray(value)) {
+ result[minifiedClassName] = parseLegacyInputPartialOutput(value);
+ } else {
+ result[minifiedClassName] = {
+ bindingPropertyName: value.publicName,
+ classPropertyName: minifiedClassName,
+ transformFunction: value.transformFunction !== null ? new WrappedNodeExpr(value.transformFunction) : null,
+ required: value.isRequired,
+ isSignal: value.isSignal
+ };
+ }
+ return result;
+ }, {});
+}
+function parseLegacyInputPartialOutput(value) {
+ if (typeof value === "string") {
+ return {
+ bindingPropertyName: value,
+ classPropertyName: value,
+ transformFunction: null,
+ required: false,
+ // legacy partial output does not capture signal inputs.
+ isSignal: false
+ };
+ }
+ return {
+ bindingPropertyName: value[0],
+ classPropertyName: value[1],
+ transformFunction: value[2] ? new WrappedNodeExpr(value[2]) : null,
+ required: false,
+ // legacy partial output does not capture signal inputs.
+ isSignal: false
+ };
+}
+function parseInputsArray(values) {
+ return values.reduce((results, value) => {
+ if (typeof value === "string") {
+ const [bindingPropertyName, classPropertyName] = parseMappingString(value);
+ results[classPropertyName] = {
+ bindingPropertyName,
+ classPropertyName,
+ required: false,
+ // Signal inputs not supported for the inputs array.
+ isSignal: false,
+ transformFunction: null
+ };
+ } else {
+ results[value.name] = {
+ bindingPropertyName: value.alias || value.name,
+ classPropertyName: value.name,
+ required: value.required || false,
+ // Signal inputs not supported for the inputs array.
+ isSignal: false,
+ transformFunction: value.transform != null ? new WrappedNodeExpr(value.transform) : null
+ };
+ }
+ return results;
+ }, {});
+}
+function parseMappingStringArray(values) {
+ return values.reduce((results, value) => {
+ const [alias, fieldName] = parseMappingString(value);
+ results[fieldName] = alias;
+ return results;
+ }, {});
+}
+function parseMappingString(value) {
+ const [fieldName, bindingPropertyName] = value.split(":", 2).map((str) => str.trim());
+ return [bindingPropertyName ?? fieldName, fieldName];
+}
+function convertDeclarePipeFacadeToMetadata(declaration) {
+ return {
+ name: declaration.type.name,
+ type: wrapReference(declaration.type),
+ typeArgumentCount: 0,
+ pipeName: declaration.name,
+ deps: null,
+ pure: declaration.pure ?? true,
+ isStandalone: declaration.isStandalone ?? getJitStandaloneDefaultForVersion(declaration.version)
+ };
+}
+function convertDeclareInjectorFacadeToMetadata(declaration) {
+ return {
+ name: declaration.type.name,
+ type: wrapReference(declaration.type),
+ providers: declaration.providers !== void 0 && declaration.providers.length > 0 ? new WrappedNodeExpr(declaration.providers) : null,
+ imports: declaration.imports !== void 0 ? declaration.imports.map((i) => new WrappedNodeExpr(i)) : []
+ };
+}
+function publishFacade(global) {
+ const ng = global.ng || (global.ng = {});
+ ng.ɵcompilerFacade = new CompilerFacadeImpl();
+}
+var CompilerConfig = class {
+ defaultEncapsulation;
+ preserveWhitespaces;
+ strictInjectionParameters;
+ constructor({ defaultEncapsulation = ViewEncapsulation$1.Emulated, preserveWhitespaces, strictInjectionParameters } = {}) {
+ this.defaultEncapsulation = defaultEncapsulation;
+ this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
+ this.strictInjectionParameters = strictInjectionParameters === true;
+ }
+};
+function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting = false) {
+ return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;
+}
+var _I18N_ATTR = "i18n";
+var _I18N_ATTR_PREFIX = "i18n-";
+var _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;
+var MEANING_SEPARATOR = "|";
+var ID_SEPARATOR = "@@";
+var i18nCommentsWarned = false;
+function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs, preserveSignificantWhitespace) {
+ const visitor = new _Visitor3(implicitTags, implicitAttrs, preserveSignificantWhitespace);
+ return visitor.extract(nodes, interpolationConfig);
+}
+function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {
+ const visitor = new _Visitor3(implicitTags, implicitAttrs);
+ return visitor.merge(nodes, translations, interpolationConfig);
+}
+var ExtractionResult = class {
+ messages;
+ errors;
+ constructor(messages, errors) {
+ this.messages = messages;
+ this.errors = errors;
+ }
+};
+var _VisitorMode;
+(function(_VisitorMode2) {
+ _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
+ _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
+})(_VisitorMode || (_VisitorMode = {}));
+var _Visitor3 = class {
+ _implicitTags;
+ _implicitAttrs;
+ _preserveSignificantWhitespace;
+ // Using non-null assertions because all variables are (re)set in init()
+ _depth;
+ // ...
+ _inI18nNode;
+ _inImplicitNode;
+ // ...
+ _inI18nBlock;
+ _blockMeaningAndDesc;
+ _blockChildren;
+ _blockStartDepth;
+ // {}
+ _inIcu;
+ // set to void 0 when not in a section
+ _msgCountAtSectionStart;
+ _errors;
+ _mode;
+ // _VisitorMode.Extract only
+ _messages;
+ // _VisitorMode.Merge only
+ _translations;
+ _createI18nMessage;
+ constructor(_implicitTags, _implicitAttrs, _preserveSignificantWhitespace = true) {
+ this._implicitTags = _implicitTags;
+ this._implicitAttrs = _implicitAttrs;
+ this._preserveSignificantWhitespace = _preserveSignificantWhitespace;
+ }
+ /**
+ * Extracts the messages from the tree
+ */
+ extract(nodes, interpolationConfig) {
+ this._init(_VisitorMode.Extract, interpolationConfig);
+ nodes.forEach((node) => node.visit(this, null));
+ if (this._inI18nBlock) {
+ this._reportError(nodes[nodes.length - 1], "Unclosed block");
+ }
+ return new ExtractionResult(this._messages, this._errors);
+ }
+ /**
+ * Returns a tree where all translatable nodes are translated
+ */
+ merge(nodes, translations, interpolationConfig) {
+ this._init(_VisitorMode.Merge, interpolationConfig);
+ this._translations = translations;
+ const wrapper = new Element2("wrapper", [], [], nodes, false, void 0, void 0, void 0, false);
+ const translatedNode = wrapper.visit(this, null);
+ if (this._inI18nBlock) {
+ this._reportError(nodes[nodes.length - 1], "Unclosed block");
+ }
+ return new ParseTreeResult(translatedNode.children, this._errors);
+ }
+ visitExpansionCase(icuCase, context) {
+ const expression = visitAll(this, icuCase.expression, context);
+ if (this._mode === _VisitorMode.Merge) {
+ return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);
+ }
+ }
+ visitExpansion(icu, context) {
+ this._mayBeAddBlockChildren(icu);
+ const wasInIcu = this._inIcu;
+ if (!this._inIcu) {
+ if (this._isInTranslatableSection) {
+ this._addMessage([icu]);
+ }
+ this._inIcu = true;
+ }
+ const cases = visitAll(this, icu.cases, context);
+ if (this._mode === _VisitorMode.Merge) {
+ icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);
+ }
+ this._inIcu = wasInIcu;
+ return icu;
+ }
+ visitComment(comment, context) {
+ const isOpening = _isOpeningComment(comment);
+ if (isOpening && this._isInTranslatableSection) {
+ this._reportError(comment, "Could not start a block inside a translatable section");
+ return;
+ }
+ const isClosing = _isClosingComment(comment);
+ if (isClosing && !this._inI18nBlock) {
+ this._reportError(comment, "Trying to close an unopened block");
+ return;
+ }
+ if (!this._inI18nNode && !this._inIcu) {
+ if (!this._inI18nBlock) {
+ if (isOpening) {
+ if (!i18nCommentsWarned && console && console.warn) {
+ i18nCommentsWarned = true;
+ const details = comment.sourceSpan.details ? `, ${comment.sourceSpan.details}` : "";
+ console.warn(`I18n comments are deprecated, use an element instead (${comment.sourceSpan.start}${details})`);
+ }
+ this._inI18nBlock = true;
+ this._blockStartDepth = this._depth;
+ this._blockChildren = [];
+ this._blockMeaningAndDesc = comment.value.replace(_I18N_COMMENT_PREFIX_REGEXP, "").trim();
+ this._openTranslatableSection(comment);
+ }
+ } else {
+ if (isClosing) {
+ if (this._depth == this._blockStartDepth) {
+ this._closeTranslatableSection(comment, this._blockChildren);
+ this._inI18nBlock = false;
+ const message = this._addMessage(this._blockChildren, this._blockMeaningAndDesc);
+ const nodes = this._translateMessage(comment, message);
+ return visitAll(this, nodes);
+ } else {
+ this._reportError(comment, "I18N blocks should not cross element boundaries");
+ return;
+ }
+ }
+ }
+ }
+ }
+ visitText(text2, context) {
+ if (this._isInTranslatableSection) {
+ this._mayBeAddBlockChildren(text2);
+ }
+ return text2;
+ }
+ visitElement(el, context) {
+ return this._visitElementLike(el, context);
+ }
+ visitAttribute(attribute2, context) {
+ throw new Error("unreachable code");
+ }
+ visitBlock(block, context) {
+ visitAll(this, block.children, context);
+ }
+ visitBlockParameter(parameter, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ return this._visitElementLike(component, context);
+ }
+ visitDirective(directive, context) {
+ throw new Error("unreachable code");
+ }
+ _init(mode, interpolationConfig) {
+ this._mode = mode;
+ this._inI18nBlock = false;
+ this._inI18nNode = false;
+ this._depth = 0;
+ this._inIcu = false;
+ this._msgCountAtSectionStart = void 0;
+ this._errors = [];
+ this._messages = [];
+ this._inImplicitNode = false;
+ this._createI18nMessage = createI18nMessageFactory(
+ interpolationConfig,
+ DEFAULT_CONTAINER_BLOCKS,
+ // When dropping significant whitespace we need to retain whitespace tokens or
+ // else we won't be able to reuse source spans because empty tokens would be
+ // removed and cause a mismatch.
+ /* retainEmptyTokens */
+ !this._preserveSignificantWhitespace,
+ /* preserveExpressionWhitespace */
+ this._preserveSignificantWhitespace
+ );
+ }
+ _visitElementLike(node, context) {
+ this._mayBeAddBlockChildren(node);
+ this._depth++;
+ const wasInI18nNode = this._inI18nNode;
+ const wasInImplicitNode = this._inImplicitNode;
+ let childNodes = [];
+ let translatedChildNodes = void 0;
+ const nodeName = node instanceof Component2 ? node.tagName : node.name;
+ const i18nAttr = _getI18nAttr(node);
+ const i18nMeta = i18nAttr ? i18nAttr.value : "";
+ const isImplicit = this._implicitTags.some((tag) => nodeName === tag) && !this._inIcu && !this._isInTranslatableSection;
+ const isTopLevelImplicit = !wasInImplicitNode && isImplicit;
+ this._inImplicitNode = wasInImplicitNode || isImplicit;
+ if (!this._isInTranslatableSection && !this._inIcu) {
+ if (i18nAttr || isTopLevelImplicit) {
+ this._inI18nNode = true;
+ const message = this._addMessage(node.children, i18nMeta);
+ translatedChildNodes = this._translateMessage(node, message);
+ }
+ if (this._mode == _VisitorMode.Extract) {
+ const isTranslatable = i18nAttr || isTopLevelImplicit;
+ if (isTranslatable)
+ this._openTranslatableSection(node);
+ visitAll(this, node.children);
+ if (isTranslatable)
+ this._closeTranslatableSection(node, node.children);
+ }
+ } else {
+ if (i18nAttr || isTopLevelImplicit) {
+ this._reportError(node, "Could not mark an element as translatable inside a translatable section");
+ }
+ if (this._mode == _VisitorMode.Extract) {
+ visitAll(this, node.children);
+ }
+ }
+ if (this._mode === _VisitorMode.Merge) {
+ const visitNodes = translatedChildNodes || node.children;
+ visitNodes.forEach((child) => {
+ const visited = child.visit(this, context);
+ if (visited && !this._isInTranslatableSection) {
+ childNodes = childNodes.concat(visited);
+ }
+ });
+ }
+ this._visitAttributesOf(node);
+ this._depth--;
+ this._inI18nNode = wasInI18nNode;
+ this._inImplicitNode = wasInImplicitNode;
+ if (this._mode === _VisitorMode.Merge) {
+ if (node instanceof Element2) {
+ return new Element2(node.name, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.isVoid);
+ } else {
+ return new Component2(node.componentName, node.tagName, node.fullName, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
+ }
+ }
+ return null;
+ }
+ // looks for translatable attributes
+ _visitAttributesOf(el) {
+ const explicitAttrNameToValue = {};
+ const implicitAttrNames = this._implicitAttrs[el instanceof Component2 ? el.tagName || "" : el.name] || [];
+ el.attrs.filter((attr) => attr instanceof Attribute && attr.name.startsWith(_I18N_ATTR_PREFIX)).forEach((attr) => {
+ explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] = attr.value;
+ });
+ el.attrs.forEach((attr) => {
+ if (attr.name in explicitAttrNameToValue) {
+ this._addMessage([attr], explicitAttrNameToValue[attr.name]);
+ } else if (implicitAttrNames.some((name) => attr.name === name)) {
+ this._addMessage([attr]);
+ }
+ });
+ }
+ // add a translatable message
+ _addMessage(ast, msgMeta) {
+ if (ast.length == 0 || this._isEmptyAttributeValue(ast) || this._isPlaceholderOnlyAttributeValue(ast) || this._isPlaceholderOnlyMessage(ast)) {
+ return null;
+ }
+ const { meaning, description, id } = _parseMessageMeta(msgMeta);
+ const message = this._createI18nMessage(ast, meaning, description, id);
+ this._messages.push(message);
+ return message;
+ }
+ // Check for cases like ``.
+ _isEmptyAttributeValue(ast) {
+ if (!isAttrNode(ast))
+ return false;
+ const node = ast[0];
+ return node.value.trim() === "";
+ }
+ // Check for cases like `
`.
+ _isPlaceholderOnlyAttributeValue(ast) {
+ if (!isAttrNode(ast))
+ return false;
+ const tokens = ast[0].valueTokens ?? [];
+ const interpolations = tokens.filter(
+ (token) => token.type === 17
+ /* TokenType.ATTR_VALUE_INTERPOLATION */
+ );
+ const plainText = tokens.filter(
+ (token) => token.type === 16
+ /* TokenType.ATTR_VALUE_TEXT */
+ ).map((token) => token.parts[0].trim()).join("");
+ return interpolations.length === 1 && plainText === "";
+ }
+ // Check for cases like `
{{ name }}
`.
+ _isPlaceholderOnlyMessage(ast) {
+ if (!isTextNode(ast))
+ return false;
+ const tokens = ast[0].tokens;
+ const interpolations = tokens.filter(
+ (token) => token.type === 8
+ /* TokenType.INTERPOLATION */
+ );
+ const plainText = tokens.filter(
+ (token) => token.type === 5
+ /* TokenType.TEXT */
+ ).map((token) => token.parts[0].trim()).join("");
+ return interpolations.length === 1 && plainText === "";
+ }
+ // Translates the given message given the `TranslationBundle`
+ // This is used for translating elements / blocks - see `_translateAttributes` for attributes
+ // no-op when called in extraction mode (returns [])
+ _translateMessage(el, message) {
+ if (message && this._mode === _VisitorMode.Merge) {
+ const nodes = this._translations.get(message);
+ if (nodes) {
+ return nodes;
+ }
+ this._reportError(el, `Translation unavailable for message id="${this._translations.digest(message)}"`);
+ }
+ return [];
+ }
+ // translate the attributes of an element and remove i18n specific attributes
+ _translateAttributes(node) {
+ const i18nParsedMessageMeta = {};
+ const translatedAttributes = [];
+ node.attrs.forEach((attr) => {
+ if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {
+ i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] = _parseMessageMeta(attr.value);
+ }
+ });
+ node.attrs.forEach((attr) => {
+ if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {
+ return;
+ }
+ if (attr.value && attr.value != "" && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {
+ const { meaning, description, id } = i18nParsedMessageMeta[attr.name];
+ const message = this._createI18nMessage([attr], meaning, description, id);
+ const nodes = this._translations.get(message);
+ if (nodes) {
+ if (nodes.length == 0) {
+ translatedAttributes.push(new Attribute(
+ attr.name,
+ "",
+ attr.sourceSpan,
+ void 0,
+ void 0,
+ void 0,
+ void 0
+ /* i18n */
+ ));
+ } else if (nodes[0] instanceof Text4) {
+ const value = nodes[0].value;
+ translatedAttributes.push(new Attribute(
+ attr.name,
+ value,
+ attr.sourceSpan,
+ void 0,
+ void 0,
+ void 0,
+ void 0
+ /* i18n */
+ ));
+ } else {
+ this._reportError(node, `Unexpected translation for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`);
+ }
+ } else {
+ this._reportError(node, `Translation unavailable for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`);
+ }
+ } else {
+ translatedAttributes.push(attr);
+ }
+ });
+ return translatedAttributes;
+ }
+ _translateDirectives(node) {
+ return node.directives.map((dir) => new Directive2(dir.name, this._translateAttributes(dir), dir.sourceSpan, dir.startSourceSpan, dir.endSourceSpan));
+ }
+ /**
+ * Add the node as a child of the block when:
+ * - we are in a block,
+ * - we are not inside a ICU message (those are handled separately),
+ * - the node is a "direct child" of the block
+ */
+ _mayBeAddBlockChildren(node) {
+ if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {
+ this._blockChildren.push(node);
+ }
+ }
+ /**
+ * Marks the start of a section, see `_closeTranslatableSection`
+ */
+ _openTranslatableSection(node) {
+ if (this._isInTranslatableSection) {
+ this._reportError(node, "Unexpected section start");
+ } else {
+ this._msgCountAtSectionStart = this._messages.length;
+ }
+ }
+ /**
+ * A translatable section could be:
+ * - the content of translatable element,
+ * - nodes between `` and `` comments
+ */
+ get _isInTranslatableSection() {
+ return this._msgCountAtSectionStart !== void 0;
+ }
+ /**
+ * Terminates a section.
+ *
+ * If a section has only one significant children (comments not significant) then we should not
+ * keep the message from this children:
+ *
+ * `
{ICU message}
` would produce two messages:
+ * - one for the
content with meaning and description,
+ * - another one for the ICU message.
+ *
+ * In this case the last message is discarded as it contains less information (the AST is
+ * otherwise identical).
+ *
+ * Note that we should still keep messages extracted from attributes inside the section (ie in the
+ * ICU message here)
+ */
+ _closeTranslatableSection(node, directChildren) {
+ if (!this._isInTranslatableSection) {
+ this._reportError(node, "Unexpected section end");
+ return;
+ }
+ const startIndex = this._msgCountAtSectionStart;
+ const significantChildren = directChildren.reduce((count, node2) => count + (node2 instanceof Comment2 ? 0 : 1), 0);
+ if (significantChildren == 1) {
+ for (let i = this._messages.length - 1; i >= startIndex; i--) {
+ const ast = this._messages[i].nodes;
+ if (!(ast.length == 1 && ast[0] instanceof Text$2)) {
+ this._messages.splice(i, 1);
+ break;
+ }
+ }
+ }
+ this._msgCountAtSectionStart = void 0;
+ }
+ _reportError(node, msg) {
+ this._errors.push(new ParseError(node.sourceSpan, msg));
+ }
+};
+function _isOpeningComment(n) {
+ return !!(n instanceof Comment2 && n.value && n.value.startsWith("i18n"));
+}
+function _isClosingComment(n) {
+ return !!(n instanceof Comment2 && n.value && n.value === "/i18n");
+}
+function _getI18nAttr(p) {
+ return p.attrs.find((attr) => attr instanceof Attribute && attr.name === _I18N_ATTR) || null;
+}
+function _parseMessageMeta(i18n2) {
+ if (!i18n2)
+ return { meaning: "", description: "", id: "" };
+ const idIndex = i18n2.indexOf(ID_SEPARATOR);
+ const descIndex = i18n2.indexOf(MEANING_SEPARATOR);
+ const [meaningAndDesc, id] = idIndex > -1 ? [i18n2.slice(0, idIndex), i18n2.slice(idIndex + 2)] : [i18n2, ""];
+ const [meaning, description] = descIndex > -1 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : ["", meaningAndDesc];
+ return { meaning, description, id: id.trim() };
+}
+function isTextNode(ast) {
+ return ast.length === 1 && ast[0] instanceof Text4;
+}
+function isAttrNode(ast) {
+ return ast.length === 1 && ast[0] instanceof Attribute;
+}
+var XmlTagDefinition = class {
+ closedByParent = false;
+ implicitNamespacePrefix = null;
+ isVoid = false;
+ ignoreFirstLf = false;
+ canSelfClose = true;
+ preventNamespaceInheritance = false;
+ requireExtraParent(currentParent) {
+ return false;
+ }
+ isClosedByChild(name) {
+ return false;
+ }
+ getContentType() {
+ return TagContentType.PARSABLE_DATA;
+ }
+};
+var _TAG_DEFINITION = new XmlTagDefinition();
+function getXmlTagDefinition(tagName) {
+ return _TAG_DEFINITION;
+}
+var XmlParser = class extends Parser$1 {
+ constructor() {
+ super(getXmlTagDefinition);
+ }
+ parse(source, url, options = {}) {
+ return super.parse(source, url, __spreadProps(__spreadValues({}, options), {
+ tokenizeBlocks: false,
+ tokenizeLet: false,
+ selectorlessEnabled: false
+ }));
+ }
+};
+var _VERSION$1 = "1.2";
+var _XMLNS$1 = "urn:oasis:names:tc:xliff:document:1.2";
+var _DEFAULT_SOURCE_LANG$1 = "en";
+var _PLACEHOLDER_TAG$2 = "x";
+var _MARKER_TAG$1 = "mrk";
+var _FILE_TAG = "file";
+var _SOURCE_TAG$1 = "source";
+var _SEGMENT_SOURCE_TAG = "seg-source";
+var _ALT_TRANS_TAG = "alt-trans";
+var _TARGET_TAG$1 = "target";
+var _UNIT_TAG$1 = "trans-unit";
+var _CONTEXT_GROUP_TAG = "context-group";
+var _CONTEXT_TAG = "context";
+var Xliff = class extends Serializer {
+ write(messages, locale) {
+ const visitor = new _WriteVisitor$1();
+ const transUnits = [];
+ messages.forEach((message) => {
+ let contextTags = [];
+ message.sources.forEach((source) => {
+ let contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: "location" });
+ contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { "context-type": "sourcefile" }, [
+ new Text$1(source.filePath)
+ ]), new CR(10), new Tag(_CONTEXT_TAG, { "context-type": "linenumber" }, [
+ new Text$1(`${source.startLine}`)
+ ]), new CR(8));
+ contextTags.push(new CR(8), contextGroupTag);
+ });
+ const transUnit = new Tag(_UNIT_TAG$1, { id: message.id, datatype: "html" });
+ transUnit.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), ...contextTags);
+ if (message.description) {
+ transUnit.children.push(new CR(8), new Tag("note", { priority: "1", from: "description" }, [
+ new Text$1(message.description)
+ ]));
+ }
+ if (message.meaning) {
+ transUnit.children.push(new CR(8), new Tag("note", { priority: "1", from: "meaning" }, [new Text$1(message.meaning)]));
+ }
+ transUnit.children.push(new CR(6));
+ transUnits.push(new CR(6), transUnit);
+ });
+ const body = new Tag("body", {}, [...transUnits, new CR(4)]);
+ const file = new Tag("file", {
+ "source-language": locale || _DEFAULT_SOURCE_LANG$1,
+ datatype: "plaintext",
+ original: "ng2.template"
+ }, [new CR(4), body, new CR(2)]);
+ const xliff = new Tag("xliff", { version: _VERSION$1, xmlns: _XMLNS$1 }, [
+ new CR(2),
+ file,
+ new CR()
+ ]);
+ return serialize$1([
+ new Declaration({ version: "1.0", encoding: "UTF-8" }),
+ new CR(),
+ xliff,
+ new CR()
+ ]);
+ }
+ load(content, url) {
+ const xliffParser = new XliffParser();
+ const { locale, msgIdToHtml, errors } = xliffParser.parse(content, url);
+ const i18nNodesByMsgId = {};
+ const converter = new XmlToI18n$2();
+ Object.keys(msgIdToHtml).forEach((msgId) => {
+ const { i18nNodes, errors: e } = converter.convert(msgIdToHtml[msgId], url);
+ errors.push(...e);
+ i18nNodesByMsgId[msgId] = i18nNodes;
+ });
+ if (errors.length) {
+ throw new Error(`xliff parse errors:
+${errors.join("\n")}`);
+ }
+ return { locale, i18nNodesByMsgId };
+ }
+ digest(message) {
+ return digest$1(message);
+ }
+};
+var _WriteVisitor$1 = class _WriteVisitor {
+ visitText(text2, context) {
+ return [new Text$1(text2.value)];
+ }
+ visitContainer(container, context) {
+ const nodes = [];
+ container.children.forEach((node) => nodes.push(...node.visit(this)));
+ return nodes;
+ }
+ visitIcu(icu, context) {
+ const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];
+ Object.keys(icu.cases).forEach((c) => {
+ nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `));
+ });
+ nodes.push(new Text$1(`}`));
+ return nodes;
+ }
+ visitTagPlaceholder(ph, context) {
+ const ctype = getCtypeForTag(ph.tag);
+ if (ph.isVoid) {
+ return [
+ new Tag(_PLACEHOLDER_TAG$2, { id: ph.startName, ctype, "equiv-text": `<${ph.tag}/>` })
+ ];
+ }
+ const startTagPh = new Tag(_PLACEHOLDER_TAG$2, {
+ id: ph.startName,
+ ctype,
+ "equiv-text": `<${ph.tag}>`
+ });
+ const closeTagPh = new Tag(_PLACEHOLDER_TAG$2, {
+ id: ph.closeName,
+ ctype,
+ "equiv-text": `${ph.tag}>`
+ });
+ return [startTagPh, ...this.serialize(ph.children), closeTagPh];
+ }
+ visitPlaceholder(ph, context) {
+ return [new Tag(_PLACEHOLDER_TAG$2, { id: ph.name, "equiv-text": `{{${ph.value}}}` })];
+ }
+ visitBlockPlaceholder(ph, context) {
+ const ctype = `x-${ph.name.toLowerCase().replace(/[^a-z0-9]/g, "-")}`;
+ const startTagPh = new Tag(_PLACEHOLDER_TAG$2, {
+ id: ph.startName,
+ ctype,
+ "equiv-text": `@${ph.name}`
+ });
+ const closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { id: ph.closeName, ctype, "equiv-text": `}` });
+ return [startTagPh, ...this.serialize(ph.children), closeTagPh];
+ }
+ visitIcuPlaceholder(ph, context) {
+ const equivText = `{${ph.value.expression}, ${ph.value.type}, ${Object.keys(ph.value.cases).map((value) => value + " {...}").join(" ")}}`;
+ return [new Tag(_PLACEHOLDER_TAG$2, { id: ph.name, "equiv-text": equivText })];
+ }
+ serialize(nodes) {
+ return [].concat(...nodes.map((node) => node.visit(this)));
+ }
+};
+var XliffParser = class {
+ // using non-null assertions because they're re(set) by parse()
+ _unitMlString;
+ _errors;
+ _msgIdToHtml;
+ _locale = null;
+ parse(xliff, url) {
+ this._unitMlString = null;
+ this._msgIdToHtml = {};
+ const xml = new XmlParser().parse(xliff, url);
+ this._errors = xml.errors;
+ visitAll(this, xml.rootNodes, null);
+ return {
+ msgIdToHtml: this._msgIdToHtml,
+ errors: this._errors,
+ locale: this._locale
+ };
+ }
+ visitElement(element2, context) {
+ switch (element2.name) {
+ case _UNIT_TAG$1:
+ this._unitMlString = null;
+ const idAttr = element2.attrs.find((attr) => attr.name === "id");
+ if (!idAttr) {
+ this._addError(element2, `<${_UNIT_TAG$1}> misses the "id" attribute`);
+ } else {
+ const id = idAttr.value;
+ if (this._msgIdToHtml.hasOwnProperty(id)) {
+ this._addError(element2, `Duplicated translations for msg ${id}`);
+ } else {
+ visitAll(this, element2.children, null);
+ if (typeof this._unitMlString === "string") {
+ this._msgIdToHtml[id] = this._unitMlString;
+ } else {
+ this._addError(element2, `Message ${id} misses a translation`);
+ }
+ }
+ }
+ break;
+ // ignore those tags
+ case _SOURCE_TAG$1:
+ case _SEGMENT_SOURCE_TAG:
+ case _ALT_TRANS_TAG:
+ break;
+ case _TARGET_TAG$1:
+ const innerTextStart = element2.startSourceSpan.end.offset;
+ const innerTextEnd = element2.endSourceSpan.start.offset;
+ const content = element2.startSourceSpan.start.file.content;
+ const innerText = content.slice(innerTextStart, innerTextEnd);
+ this._unitMlString = innerText;
+ break;
+ case _FILE_TAG:
+ const localeAttr = element2.attrs.find((attr) => attr.name === "target-language");
+ if (localeAttr) {
+ this._locale = localeAttr.value;
+ }
+ visitAll(this, element2.children, null);
+ break;
+ default:
+ visitAll(this, element2.children, null);
+ }
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitText(text2, context) {
+ }
+ visitComment(comment, context) {
+ }
+ visitExpansion(expansion, context) {
+ }
+ visitExpansionCase(expansionCase, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(parameter, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ }
+ visitDirective(directive, context) {
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+var XmlToI18n$2 = class XmlToI18n {
+ // using non-null assertion because it's re(set) by convert()
+ _errors;
+ convert(message, url) {
+ const xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
+ this._errors = xmlIcu.errors;
+ const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : [].concat(...visitAll(this, xmlIcu.rootNodes));
+ return {
+ i18nNodes,
+ errors: this._errors
+ };
+ }
+ visitText(text2, context) {
+ return new Text$2(text2.value, text2.sourceSpan);
+ }
+ visitElement(el, context) {
+ if (el.name === _PLACEHOLDER_TAG$2) {
+ const nameAttr = el.attrs.find((attr) => attr.name === "id");
+ if (nameAttr) {
+ return new Placeholder("", nameAttr.value, el.sourceSpan);
+ }
+ this._addError(el, `<${_PLACEHOLDER_TAG$2}> misses the "id" attribute`);
+ return null;
+ }
+ if (el.name === _MARKER_TAG$1) {
+ return [].concat(...visitAll(this, el.children));
+ }
+ this._addError(el, `Unexpected tag`);
+ return null;
+ }
+ visitExpansion(icu, context) {
+ const caseMap = {};
+ visitAll(this, icu.cases).forEach((c) => {
+ caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
+ });
+ return new Icu2(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
+ }
+ visitExpansionCase(icuCase, context) {
+ return {
+ value: icuCase.value,
+ nodes: visitAll(this, icuCase.expression)
+ };
+ }
+ visitComment(comment, context) {
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(parameter, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ this._addError(component, "Unexpected node");
+ }
+ visitDirective(directive, context) {
+ this._addError(directive, "Unexpected node");
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+function getCtypeForTag(tag) {
+ switch (tag.toLowerCase()) {
+ case "br":
+ return "lb";
+ case "img":
+ return "image";
+ default:
+ return `x-${tag}`;
+ }
+}
+var _VERSION = "2.0";
+var _XMLNS = "urn:oasis:names:tc:xliff:document:2.0";
+var _DEFAULT_SOURCE_LANG = "en";
+var _PLACEHOLDER_TAG$1 = "ph";
+var _PLACEHOLDER_SPANNING_TAG = "pc";
+var _MARKER_TAG = "mrk";
+var _XLIFF_TAG = "xliff";
+var _SOURCE_TAG = "source";
+var _TARGET_TAG = "target";
+var _UNIT_TAG = "unit";
+var Xliff2 = class extends Serializer {
+ write(messages, locale) {
+ const visitor = new _WriteVisitor2();
+ const units = [];
+ messages.forEach((message) => {
+ const unit = new Tag(_UNIT_TAG, { id: message.id });
+ const notes = new Tag("notes");
+ if (message.description || message.meaning) {
+ if (message.description) {
+ notes.children.push(new CR(8), new Tag("note", { category: "description" }, [new Text$1(message.description)]));
+ }
+ if (message.meaning) {
+ notes.children.push(new CR(8), new Tag("note", { category: "meaning" }, [new Text$1(message.meaning)]));
+ }
+ }
+ message.sources.forEach((source) => {
+ notes.children.push(new CR(8), new Tag("note", { category: "location" }, [
+ new Text$1(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? "," + source.endLine : ""}`)
+ ]));
+ });
+ notes.children.push(new CR(6));
+ unit.children.push(new CR(6), notes);
+ const segment = new Tag("segment");
+ segment.children.push(new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new CR(6));
+ unit.children.push(new CR(6), segment, new CR(4));
+ units.push(new CR(4), unit);
+ });
+ const file = new Tag("file", { "original": "ng.template", id: "ngi18n" }, [
+ ...units,
+ new CR(2)
+ ]);
+ const xliff = new Tag(_XLIFF_TAG, { version: _VERSION, xmlns: _XMLNS, srcLang: locale || _DEFAULT_SOURCE_LANG }, [new CR(2), file, new CR()]);
+ return serialize$1([
+ new Declaration({ version: "1.0", encoding: "UTF-8" }),
+ new CR(),
+ xliff,
+ new CR()
+ ]);
+ }
+ load(content, url) {
+ const xliff2Parser = new Xliff2Parser();
+ const { locale, msgIdToHtml, errors } = xliff2Parser.parse(content, url);
+ const i18nNodesByMsgId = {};
+ const converter = new XmlToI18n$1();
+ Object.keys(msgIdToHtml).forEach((msgId) => {
+ const { i18nNodes, errors: e } = converter.convert(msgIdToHtml[msgId], url);
+ errors.push(...e);
+ i18nNodesByMsgId[msgId] = i18nNodes;
+ });
+ if (errors.length) {
+ throw new Error(`xliff2 parse errors:
+${errors.join("\n")}`);
+ }
+ return { locale, i18nNodesByMsgId };
+ }
+ digest(message) {
+ return decimalDigest(message);
+ }
+};
+var _WriteVisitor2 = class {
+ _nextPlaceholderId = 0;
+ visitText(text2, context) {
+ return [new Text$1(text2.value)];
+ }
+ visitContainer(container, context) {
+ const nodes = [];
+ container.children.forEach((node) => nodes.push(...node.visit(this)));
+ return nodes;
+ }
+ visitIcu(icu, context) {
+ const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];
+ Object.keys(icu.cases).forEach((c) => {
+ nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `));
+ });
+ nodes.push(new Text$1(`}`));
+ return nodes;
+ }
+ visitTagPlaceholder(ph, context) {
+ const type = getTypeForTag(ph.tag);
+ if (ph.isVoid) {
+ const tagPh = new Tag(_PLACEHOLDER_TAG$1, {
+ id: (this._nextPlaceholderId++).toString(),
+ equiv: ph.startName,
+ type,
+ disp: `<${ph.tag}/>`
+ });
+ return [tagPh];
+ }
+ const tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {
+ id: (this._nextPlaceholderId++).toString(),
+ equivStart: ph.startName,
+ equivEnd: ph.closeName,
+ type,
+ dispStart: `<${ph.tag}>`,
+ dispEnd: `${ph.tag}>`
+ });
+ const nodes = [].concat(...ph.children.map((node) => node.visit(this)));
+ if (nodes.length) {
+ nodes.forEach((node) => tagPc.children.push(node));
+ } else {
+ tagPc.children.push(new Text$1(""));
+ }
+ return [tagPc];
+ }
+ visitPlaceholder(ph, context) {
+ const idStr = (this._nextPlaceholderId++).toString();
+ return [
+ new Tag(_PLACEHOLDER_TAG$1, {
+ id: idStr,
+ equiv: ph.name,
+ disp: `{{${ph.value}}}`
+ })
+ ];
+ }
+ visitBlockPlaceholder(ph, context) {
+ const tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {
+ id: (this._nextPlaceholderId++).toString(),
+ equivStart: ph.startName,
+ equivEnd: ph.closeName,
+ type: "other",
+ dispStart: `@${ph.name}`,
+ dispEnd: `}`
+ });
+ const nodes = [].concat(...ph.children.map((node) => node.visit(this)));
+ if (nodes.length) {
+ nodes.forEach((node) => tagPc.children.push(node));
+ } else {
+ tagPc.children.push(new Text$1(""));
+ }
+ return [tagPc];
+ }
+ visitIcuPlaceholder(ph, context) {
+ const cases = Object.keys(ph.value.cases).map((value) => value + " {...}").join(" ");
+ const idStr = (this._nextPlaceholderId++).toString();
+ return [
+ new Tag(_PLACEHOLDER_TAG$1, {
+ id: idStr,
+ equiv: ph.name,
+ disp: `{${ph.value.expression}, ${ph.value.type}, ${cases}}`
+ })
+ ];
+ }
+ serialize(nodes) {
+ this._nextPlaceholderId = 0;
+ return [].concat(...nodes.map((node) => node.visit(this)));
+ }
+};
+var Xliff2Parser = class {
+ // using non-null assertions because they're all (re)set by parse()
+ _unitMlString;
+ _errors;
+ _msgIdToHtml;
+ _locale = null;
+ parse(xliff, url) {
+ this._unitMlString = null;
+ this._msgIdToHtml = {};
+ const xml = new XmlParser().parse(xliff, url);
+ this._errors = xml.errors;
+ visitAll(this, xml.rootNodes, null);
+ return {
+ msgIdToHtml: this._msgIdToHtml,
+ errors: this._errors,
+ locale: this._locale
+ };
+ }
+ visitElement(element2, context) {
+ switch (element2.name) {
+ case _UNIT_TAG:
+ this._unitMlString = null;
+ const idAttr = element2.attrs.find((attr) => attr.name === "id");
+ if (!idAttr) {
+ this._addError(element2, `<${_UNIT_TAG}> misses the "id" attribute`);
+ } else {
+ const id = idAttr.value;
+ if (this._msgIdToHtml.hasOwnProperty(id)) {
+ this._addError(element2, `Duplicated translations for msg ${id}`);
+ } else {
+ visitAll(this, element2.children, null);
+ if (typeof this._unitMlString === "string") {
+ this._msgIdToHtml[id] = this._unitMlString;
+ } else {
+ this._addError(element2, `Message ${id} misses a translation`);
+ }
+ }
+ }
+ break;
+ case _SOURCE_TAG:
+ break;
+ case _TARGET_TAG:
+ const innerTextStart = element2.startSourceSpan.end.offset;
+ const innerTextEnd = element2.endSourceSpan.start.offset;
+ const content = element2.startSourceSpan.start.file.content;
+ const innerText = content.slice(innerTextStart, innerTextEnd);
+ this._unitMlString = innerText;
+ break;
+ case _XLIFF_TAG:
+ const localeAttr = element2.attrs.find((attr) => attr.name === "trgLang");
+ if (localeAttr) {
+ this._locale = localeAttr.value;
+ }
+ const versionAttr = element2.attrs.find((attr) => attr.name === "version");
+ if (versionAttr) {
+ const version = versionAttr.value;
+ if (version !== "2.0") {
+ this._addError(element2, `The XLIFF file version ${version} is not compatible with XLIFF 2.0 serializer`);
+ } else {
+ visitAll(this, element2.children, null);
+ }
+ }
+ break;
+ default:
+ visitAll(this, element2.children, null);
+ }
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitText(text2, context) {
+ }
+ visitComment(comment, context) {
+ }
+ visitExpansion(expansion, context) {
+ }
+ visitExpansionCase(expansionCase, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(parameter, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ }
+ visitDirective(directive, context) {
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+var XmlToI18n$1 = class XmlToI18n2 {
+ // using non-null assertion because re(set) by convert()
+ _errors;
+ convert(message, url) {
+ const xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
+ this._errors = xmlIcu.errors;
+ const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : [].concat(...visitAll(this, xmlIcu.rootNodes));
+ return {
+ i18nNodes,
+ errors: this._errors
+ };
+ }
+ visitText(text2, context) {
+ return new Text$2(text2.value, text2.sourceSpan);
+ }
+ visitElement(el, context) {
+ switch (el.name) {
+ case _PLACEHOLDER_TAG$1:
+ const nameAttr = el.attrs.find((attr) => attr.name === "equiv");
+ if (nameAttr) {
+ return [new Placeholder("", nameAttr.value, el.sourceSpan)];
+ }
+ this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equiv" attribute`);
+ break;
+ case _PLACEHOLDER_SPANNING_TAG:
+ const startAttr = el.attrs.find((attr) => attr.name === "equivStart");
+ const endAttr = el.attrs.find((attr) => attr.name === "equivEnd");
+ if (!startAttr) {
+ this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equivStart" attribute`);
+ } else if (!endAttr) {
+ this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equivEnd" attribute`);
+ } else {
+ const startId = startAttr.value;
+ const endId = endAttr.value;
+ const nodes = [];
+ return nodes.concat(new Placeholder("", startId, el.sourceSpan), ...el.children.map((node) => node.visit(this, null)), new Placeholder("", endId, el.sourceSpan));
+ }
+ break;
+ case _MARKER_TAG:
+ return [].concat(...visitAll(this, el.children));
+ default:
+ this._addError(el, `Unexpected tag`);
+ }
+ return null;
+ }
+ visitExpansion(icu, context) {
+ const caseMap = {};
+ visitAll(this, icu.cases).forEach((c) => {
+ caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
+ });
+ return new Icu2(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
+ }
+ visitExpansionCase(icuCase, context) {
+ return {
+ value: icuCase.value,
+ nodes: [].concat(...visitAll(this, icuCase.expression))
+ };
+ }
+ visitComment(comment, context) {
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(parameter, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ this._addError(component, "Unexpected node");
+ }
+ visitDirective(directive, context) {
+ this._addError(directive, "Unexpected node");
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+function getTypeForTag(tag) {
+ switch (tag.toLowerCase()) {
+ case "br":
+ case "b":
+ case "i":
+ case "u":
+ return "fmt";
+ case "img":
+ return "image";
+ case "a":
+ return "link";
+ default:
+ return "other";
+ }
+}
+var _TRANSLATIONS_TAG = "translationbundle";
+var _TRANSLATION_TAG = "translation";
+var _PLACEHOLDER_TAG = "ph";
+var Xtb = class extends Serializer {
+ write(messages, locale) {
+ throw new Error("Unsupported");
+ }
+ load(content, url) {
+ const xtbParser = new XtbParser();
+ const { locale, msgIdToHtml, errors } = xtbParser.parse(content, url);
+ const i18nNodesByMsgId = {};
+ const converter = new XmlToI18n3();
+ Object.keys(msgIdToHtml).forEach((msgId) => {
+ const valueFn = function() {
+ const { i18nNodes, errors: errors2 } = converter.convert(msgIdToHtml[msgId], url);
+ if (errors2.length) {
+ throw new Error(`xtb parse errors:
+${errors2.join("\n")}`);
+ }
+ return i18nNodes;
+ };
+ createLazyProperty(i18nNodesByMsgId, msgId, valueFn);
+ });
+ if (errors.length) {
+ throw new Error(`xtb parse errors:
+${errors.join("\n")}`);
+ }
+ return { locale, i18nNodesByMsgId };
+ }
+ digest(message) {
+ return digest(message);
+ }
+ createNameMapper(message) {
+ return new SimplePlaceholderMapper(message, toPublicName);
+ }
+};
+function createLazyProperty(messages, id, valueFn) {
+ Object.defineProperty(messages, id, {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ const value = valueFn();
+ Object.defineProperty(messages, id, { enumerable: true, value });
+ return value;
+ },
+ set: (_) => {
+ throw new Error("Could not overwrite an XTB translation");
+ }
+ });
+}
+var XtbParser = class {
+ // using non-null assertions because they're (re)set by parse()
+ _bundleDepth;
+ _errors;
+ _msgIdToHtml;
+ _locale = null;
+ parse(xtb, url) {
+ this._bundleDepth = 0;
+ this._msgIdToHtml = {};
+ const xml = new XmlParser().parse(xtb, url);
+ this._errors = xml.errors;
+ visitAll(this, xml.rootNodes);
+ return {
+ msgIdToHtml: this._msgIdToHtml,
+ errors: this._errors,
+ locale: this._locale
+ };
+ }
+ visitElement(element2, context) {
+ switch (element2.name) {
+ case _TRANSLATIONS_TAG:
+ this._bundleDepth++;
+ if (this._bundleDepth > 1) {
+ this._addError(element2, `<${_TRANSLATIONS_TAG}> elements can not be nested`);
+ }
+ const langAttr = element2.attrs.find((attr) => attr.name === "lang");
+ if (langAttr) {
+ this._locale = langAttr.value;
+ }
+ visitAll(this, element2.children, null);
+ this._bundleDepth--;
+ break;
+ case _TRANSLATION_TAG:
+ const idAttr = element2.attrs.find((attr) => attr.name === "id");
+ if (!idAttr) {
+ this._addError(element2, `<${_TRANSLATION_TAG}> misses the "id" attribute`);
+ } else {
+ const id = idAttr.value;
+ if (this._msgIdToHtml.hasOwnProperty(id)) {
+ this._addError(element2, `Duplicated translations for msg ${id}`);
+ } else {
+ const innerTextStart = element2.startSourceSpan.end.offset;
+ const innerTextEnd = element2.endSourceSpan.start.offset;
+ const content = element2.startSourceSpan.start.file.content;
+ const innerText = content.slice(innerTextStart, innerTextEnd);
+ this._msgIdToHtml[id] = innerText;
+ }
+ }
+ break;
+ default:
+ this._addError(element2, "Unexpected tag");
+ }
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitText(text2, context) {
+ }
+ visitComment(comment, context) {
+ }
+ visitExpansion(expansion, context) {
+ }
+ visitExpansionCase(expansionCase, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(block, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ this._addError(component, "Unexpected node");
+ }
+ visitDirective(directive, context) {
+ this._addError(directive, "Unexpected node");
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+var XmlToI18n3 = class {
+ // using non-null assertion because it's (re)set by convert()
+ _errors;
+ convert(message, url) {
+ const xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
+ this._errors = xmlIcu.errors;
+ const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : visitAll(this, xmlIcu.rootNodes);
+ return {
+ i18nNodes,
+ errors: this._errors
+ };
+ }
+ visitText(text2, context) {
+ return new Text$2(text2.value, text2.sourceSpan);
+ }
+ visitExpansion(icu, context) {
+ const caseMap = {};
+ visitAll(this, icu.cases).forEach((c) => {
+ caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);
+ });
+ return new Icu2(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
+ }
+ visitExpansionCase(icuCase, context) {
+ return {
+ value: icuCase.value,
+ nodes: visitAll(this, icuCase.expression)
+ };
+ }
+ visitElement(el, context) {
+ if (el.name === _PLACEHOLDER_TAG) {
+ const nameAttr = el.attrs.find((attr) => attr.name === "name");
+ if (nameAttr) {
+ return new Placeholder("", nameAttr.value, el.sourceSpan);
+ }
+ this._addError(el, `<${_PLACEHOLDER_TAG}> misses the "name" attribute`);
+ } else {
+ this._addError(el, `Unexpected tag`);
+ }
+ return null;
+ }
+ visitComment(comment, context) {
+ }
+ visitAttribute(attribute2, context) {
+ }
+ visitBlock(block, context) {
+ }
+ visitBlockParameter(block, context) {
+ }
+ visitLetDeclaration(decl, context) {
+ }
+ visitComponent(component, context) {
+ this._addError(component, "Unexpected node");
+ }
+ visitDirective(directive, context) {
+ this._addError(directive, "Unexpected node");
+ }
+ _addError(node, message) {
+ this._errors.push(new ParseError(node.sourceSpan, message));
+ }
+};
+var TranslationBundle = class _TranslationBundle {
+ _i18nNodesByMsgId;
+ digest;
+ mapperFactory;
+ _i18nToHtml;
+ constructor(_i18nNodesByMsgId = {}, locale, digest2, mapperFactory, missingTranslationStrategy = MissingTranslationStrategy.Warning, console2) {
+ this._i18nNodesByMsgId = _i18nNodesByMsgId;
+ this.digest = digest2;
+ this.mapperFactory = mapperFactory;
+ this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest2, mapperFactory, missingTranslationStrategy, console2);
+ }
+ // Creates a `TranslationBundle` by parsing the given `content` with the `serializer`.
+ static load(content, url, serializer2, missingTranslationStrategy, console2) {
+ const { locale, i18nNodesByMsgId } = serializer2.load(content, url);
+ const digestFn = (m) => serializer2.digest(m);
+ const mapperFactory = (m) => serializer2.createNameMapper(m);
+ return new _TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console2);
+ }
+ // Returns the translation as HTML nodes from the given source message.
+ get(srcMsg) {
+ const html = this._i18nToHtml.convert(srcMsg);
+ if (html.errors.length) {
+ throw new Error(html.errors.join("\n"));
+ }
+ return html.nodes;
+ }
+ has(srcMsg) {
+ return this.digest(srcMsg) in this._i18nNodesByMsgId;
+ }
+};
+var I18nToHtmlVisitor = class {
+ _i18nNodesByMsgId;
+ _locale;
+ _digest;
+ _mapperFactory;
+ _missingTranslationStrategy;
+ _console;
+ // using non-null assertions because they're (re)set by convert()
+ _srcMsg;
+ _errors = [];
+ _contextStack = [];
+ _mapper;
+ constructor(_i18nNodesByMsgId = {}, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {
+ this._i18nNodesByMsgId = _i18nNodesByMsgId;
+ this._locale = _locale;
+ this._digest = _digest;
+ this._mapperFactory = _mapperFactory;
+ this._missingTranslationStrategy = _missingTranslationStrategy;
+ this._console = _console;
+ }
+ convert(srcMsg) {
+ this._contextStack.length = 0;
+ this._errors.length = 0;
+ const text2 = this._convertToText(srcMsg);
+ const url = srcMsg.nodes[0].sourceSpan.start.file.url;
+ const html = new HtmlParser().parse(text2, url, { tokenizeExpansionForms: true });
+ return {
+ nodes: html.rootNodes,
+ errors: [...this._errors, ...html.errors]
+ };
+ }
+ visitText(text2, context) {
+ return escapeXml(text2.value);
+ }
+ visitContainer(container, context) {
+ return container.children.map((n) => n.visit(this)).join("");
+ }
+ visitIcu(icu, context) {
+ const cases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
+ const exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ? this._srcMsg.placeholders[icu.expression].text : icu.expression;
+ return `{${exp}, ${icu.type}, ${cases.join(" ")}}`;
+ }
+ visitPlaceholder(ph, context) {
+ const phName = this._mapper(ph.name);
+ if (this._srcMsg.placeholders.hasOwnProperty(phName)) {
+ return this._srcMsg.placeholders[phName].text;
+ }
+ if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {
+ return this._convertToText(this._srcMsg.placeholderToMessage[phName]);
+ }
+ this._addError(ph, `Unknown placeholder "${ph.name}"`);
+ return "";
+ }
+ // Loaded message contains only placeholders (vs tag and icu placeholders).
+ // However when a translation can not be found, we need to serialize the source message
+ // which can contain tag placeholders
+ visitTagPlaceholder(ph, context) {
+ const tag = `${ph.tag}`;
+ const attrs = Object.keys(ph.attrs).map((name) => `${name}="${ph.attrs[name]}"`).join(" ");
+ if (ph.isVoid) {
+ return `<${tag} ${attrs}/>`;
+ }
+ const children = ph.children.map((c) => c.visit(this)).join("");
+ return `<${tag} ${attrs}>${children}${tag}>`;
+ }
+ // Loaded message contains only placeholders (vs tag and icu placeholders).
+ // However when a translation can not be found, we need to serialize the source message
+ // which can contain tag placeholders
+ visitIcuPlaceholder(ph, context) {
+ return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);
+ }
+ visitBlockPlaceholder(ph, context) {
+ const params = ph.parameters.length === 0 ? "" : ` (${ph.parameters.join("; ")})`;
+ const children = ph.children.map((c) => c.visit(this)).join("");
+ return `@${ph.name}${params} {${children}}`;
+ }
+ /**
+ * Convert a source message to a translated text string:
+ * - text nodes are replaced with their translation,
+ * - placeholders are replaced with their content,
+ * - ICU nodes are converted to ICU expressions.
+ */
+ _convertToText(srcMsg) {
+ const id = this._digest(srcMsg);
+ const mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;
+ let nodes;
+ this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });
+ this._srcMsg = srcMsg;
+ if (this._i18nNodesByMsgId.hasOwnProperty(id)) {
+ nodes = this._i18nNodesByMsgId[id];
+ this._mapper = (name) => mapper ? mapper.toInternalName(name) : name;
+ } else {
+ if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {
+ const ctx = this._locale ? ` for locale "${this._locale}"` : "";
+ this._addError(srcMsg.nodes[0], `Missing translation for message "${id}"${ctx}`);
+ } else if (this._console && this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {
+ const ctx = this._locale ? ` for locale "${this._locale}"` : "";
+ this._console.warn(`Missing translation for message "${id}"${ctx}`);
+ }
+ nodes = srcMsg.nodes;
+ this._mapper = (name) => name;
+ }
+ const text2 = nodes.map((node) => node.visit(this)).join("");
+ const context = this._contextStack.pop();
+ this._srcMsg = context.msg;
+ this._mapper = context.mapper;
+ return text2;
+ }
+ _addError(el, msg) {
+ this._errors.push(new ParseError(el.sourceSpan, msg));
+ }
+};
+var I18NHtmlParser = class {
+ _htmlParser;
+ // @override
+ getTagDefinition;
+ _translationBundle;
+ constructor(_htmlParser, translations, translationsFormat, missingTranslation = MissingTranslationStrategy.Warning, console2) {
+ this._htmlParser = _htmlParser;
+ if (translations) {
+ const serializer2 = createSerializer(translationsFormat);
+ this._translationBundle = TranslationBundle.load(translations, "i18n", serializer2, missingTranslation, console2);
+ } else {
+ this._translationBundle = new TranslationBundle({}, null, digest$1, void 0, missingTranslation, console2);
+ }
+ }
+ parse(source, url, options = {}) {
+ const interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
+ const parseResult = this._htmlParser.parse(source, url, __spreadValues({ interpolationConfig }, options));
+ if (parseResult.errors.length) {
+ return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
+ }
+ return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});
+ }
+};
+function createSerializer(format) {
+ format = (format || "xlf").toLowerCase();
+ switch (format) {
+ case "xmb":
+ return new Xmb();
+ case "xtb":
+ return new Xtb();
+ case "xliff2":
+ case "xlf2":
+ return new Xliff2();
+ case "xliff":
+ case "xlf":
+ default:
+ return new Xliff();
+ }
+}
+var MessageBundle = class {
+ _htmlParser;
+ _implicitTags;
+ _implicitAttrs;
+ _locale;
+ _preserveWhitespace;
+ _messages = [];
+ constructor(_htmlParser, _implicitTags, _implicitAttrs, _locale = null, _preserveWhitespace = true) {
+ this._htmlParser = _htmlParser;
+ this._implicitTags = _implicitTags;
+ this._implicitAttrs = _implicitAttrs;
+ this._locale = _locale;
+ this._preserveWhitespace = _preserveWhitespace;
+ }
+ updateFromTemplate(source, url, interpolationConfig) {
+ const htmlParserResult = this._htmlParser.parse(source, url, {
+ tokenizeExpansionForms: true,
+ interpolationConfig
+ });
+ if (htmlParserResult.errors.length) {
+ return htmlParserResult.errors;
+ }
+ const rootNodes = this._preserveWhitespace ? htmlParserResult.rootNodes : visitAllWithSiblings(new WhitespaceVisitor(
+ /* preserveSignificantWhitespace */
+ false
+ ), htmlParserResult.rootNodes);
+ const i18nParserResult = extractMessages(
+ rootNodes,
+ interpolationConfig,
+ this._implicitTags,
+ this._implicitAttrs,
+ /* preserveSignificantWhitespace */
+ this._preserveWhitespace
+ );
+ if (i18nParserResult.errors.length) {
+ return i18nParserResult.errors;
+ }
+ this._messages.push(...i18nParserResult.messages);
+ return [];
+ }
+ // Return the message in the internal format
+ // The public (serialized) format might be different, see the `write` method.
+ getMessages() {
+ return this._messages;
+ }
+ write(serializer2, filterSources) {
+ const messages = {};
+ const mapperVisitor = new MapPlaceholderNames();
+ this._messages.forEach((message) => {
+ const id = serializer2.digest(message);
+ if (!messages.hasOwnProperty(id)) {
+ messages[id] = message;
+ } else {
+ messages[id].sources.push(...message.sources);
+ }
+ });
+ const msgList = Object.keys(messages).map((id) => {
+ const mapper = serializer2.createNameMapper(messages[id]);
+ const src = messages[id];
+ const nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes;
+ let transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id);
+ transformedMessage.sources = src.sources;
+ if (filterSources) {
+ transformedMessage.sources.forEach((source) => source.filePath = filterSources(source.filePath));
+ }
+ return transformedMessage;
+ });
+ return serializer2.write(msgList, this._locale);
+ }
+};
+var MapPlaceholderNames = class extends CloneVisitor {
+ convert(nodes, mapper) {
+ return mapper ? nodes.map((n) => n.visit(this, mapper)) : nodes;
+ }
+ visitTagPlaceholder(ph, mapper) {
+ const startName = mapper.toPublicName(ph.startName);
+ const closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName;
+ const children = ph.children.map((n) => n.visit(this, mapper));
+ return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
+ }
+ visitBlockPlaceholder(ph, mapper) {
+ const startName = mapper.toPublicName(ph.startName);
+ const closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName;
+ const children = ph.children.map((n) => n.visit(this, mapper));
+ return new BlockPlaceholder(ph.name, ph.parameters, startName, closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
+ }
+ visitPlaceholder(ph, mapper) {
+ return new Placeholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);
+ }
+ visitIcuPlaceholder(ph, mapper) {
+ return new IcuPlaceholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);
+ }
+};
+function compileClassMetadata(metadata) {
+ const fnCall = internalCompileClassMetadata(metadata);
+ return arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]).callFn([]);
+}
+function internalCompileClassMetadata(metadata) {
+ return importExpr(Identifiers.setClassMetadata).callFn([
+ metadata.type,
+ metadata.decorators,
+ metadata.ctorParameters ?? literal(null),
+ metadata.propDecorators ?? literal(null)
+ ]);
+}
+function compileComponentClassMetadata(metadata, dependencies) {
+ if (dependencies === null || dependencies.length === 0) {
+ return compileClassMetadata(metadata);
+ }
+ return internalCompileSetClassMetadataAsync(metadata, dependencies.map((dep) => new FnParam(dep.symbolName, DYNAMIC_TYPE)), compileComponentMetadataAsyncResolver(dependencies));
+}
+function compileOpaqueAsyncClassMetadata(metadata, deferResolver, deferredDependencyNames) {
+ return internalCompileSetClassMetadataAsync(metadata, deferredDependencyNames.map((name) => new FnParam(name, DYNAMIC_TYPE)), deferResolver);
+}
+function internalCompileSetClassMetadataAsync(metadata, wrapperParams, dependencyResolverFn) {
+ const setClassMetadataCall = internalCompileClassMetadata(metadata);
+ const setClassMetaWrapper = arrowFn(wrapperParams, [setClassMetadataCall.toStmt()]);
+ const setClassMetaAsync = importExpr(Identifiers.setClassMetadataAsync).callFn([metadata.type, dependencyResolverFn, setClassMetaWrapper]);
+ return arrowFn([], [devOnlyGuardedExpression(setClassMetaAsync).toStmt()]).callFn([]);
+}
+function compileComponentMetadataAsyncResolver(dependencies) {
+ const dynamicImports = dependencies.map(({ symbolName, importPath, isDefaultImport }) => {
+ const innerFn = (
+ // Default imports are always accessed through the `default` property.
+ arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(isDefaultImport ? "default" : symbolName))
+ );
+ return new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
+ });
+ return arrowFn([], literalArr(dynamicImports));
+}
+var MINIMUM_PARTIAL_LINKER_VERSION$5 = "12.0.0";
+var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
+function compileDeclareClassMetadata(metadata) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", metadata.type);
+ definitionMap.set("decorators", metadata.decorators);
+ definitionMap.set("ctorParameters", metadata.ctorParameters);
+ definitionMap.set("propDecorators", metadata.propDecorators);
+ return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]);
+}
+function compileComponentDeclareClassMetadata(metadata, dependencies) {
+ if (dependencies === null || dependencies.length === 0) {
+ return compileDeclareClassMetadata(metadata);
+ }
+ const definitionMap = new DefinitionMap();
+ const callbackReturnDefinitionMap = new DefinitionMap();
+ callbackReturnDefinitionMap.set("decorators", metadata.decorators);
+ callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
+ callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", metadata.type);
+ definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
+ definitionMap.set("resolveMetadata", arrowFn(dependencies.map((dep) => new FnParam(dep.symbolName, DYNAMIC_TYPE)), callbackReturnDefinitionMap.toLiteralMap()));
+ return importExpr(Identifiers.declareClassMetadataAsync).callFn([definitionMap.toLiteralMap()]);
+}
+function toOptionalLiteralArray(values, mapper) {
+ if (values === null || values.length === 0) {
+ return null;
+ }
+ return literalArr(values.map((value) => mapper(value)));
+}
+function toOptionalLiteralMap(object, mapper) {
+ const entries = Object.keys(object).map((key) => {
+ const value = object[key];
+ return { key, value: mapper(value), quoted: true };
+ });
+ if (entries.length > 0) {
+ return literalMap(entries);
+ } else {
+ return null;
+ }
+}
+function compileDependencies(deps) {
+ if (deps === "invalid") {
+ return literal("invalid");
+ } else if (deps === null) {
+ return literal(null);
+ } else {
+ return literalArr(deps.map(compileDependency));
+ }
+}
+function compileDependency(dep) {
+ const depMeta = new DefinitionMap();
+ depMeta.set("token", dep.token);
+ if (dep.attributeNameType !== null) {
+ depMeta.set("attribute", literal(true));
+ }
+ if (dep.host) {
+ depMeta.set("host", literal(true));
+ }
+ if (dep.optional) {
+ depMeta.set("optional", literal(true));
+ }
+ if (dep.self) {
+ depMeta.set("self", literal(true));
+ }
+ if (dep.skipSelf) {
+ depMeta.set("skipSelf", literal(true));
+ }
+ return depMeta.toLiteralMap();
+}
+function compileDeclareDirectiveFromMetadata(meta) {
+ const definitionMap = createDirectiveDefinitionMap(meta);
+ const expression = importExpr(Identifiers.declareDirective).callFn([definitionMap.toLiteralMap()]);
+ const type = createDirectiveType(meta);
+ return { expression, type, statements: [] };
+}
+function createDirectiveDefinitionMap(meta) {
+ const definitionMap = new DefinitionMap();
+ const minVersion = getMinimumVersionForPartialOutput(meta);
+ definitionMap.set("minVersion", literal(minVersion));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("type", meta.type.value);
+ if (meta.isStandalone !== void 0) {
+ definitionMap.set("isStandalone", literal(meta.isStandalone));
+ }
+ if (meta.isSignal) {
+ definitionMap.set("isSignal", literal(meta.isSignal));
+ }
+ if (meta.selector !== null) {
+ definitionMap.set("selector", literal(meta.selector));
+ }
+ definitionMap.set("inputs", needsNewInputPartialOutput(meta) ? createInputsPartialMetadata(meta.inputs) : legacyInputsPartialMetadata(meta.inputs));
+ definitionMap.set("outputs", conditionallyCreateDirectiveBindingLiteral(meta.outputs));
+ definitionMap.set("host", compileHostMetadata(meta.host));
+ definitionMap.set("providers", meta.providers);
+ if (meta.queries.length > 0) {
+ definitionMap.set("queries", literalArr(meta.queries.map(compileQuery)));
+ }
+ if (meta.viewQueries.length > 0) {
+ definitionMap.set("viewQueries", literalArr(meta.viewQueries.map(compileQuery)));
+ }
+ if (meta.exportAs !== null) {
+ definitionMap.set("exportAs", asLiteral(meta.exportAs));
+ }
+ if (meta.usesInheritance) {
+ definitionMap.set("usesInheritance", literal(true));
+ }
+ if (meta.lifecycle.usesOnChanges) {
+ definitionMap.set("usesOnChanges", literal(true));
+ }
+ if (meta.hostDirectives?.length) {
+ definitionMap.set("hostDirectives", createHostDirectives(meta.hostDirectives));
+ }
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ return definitionMap;
+}
+function getMinimumVersionForPartialOutput(meta) {
+ let minVersion = "14.0.0";
+ const hasDecoratorTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
+ if (hasDecoratorTransformFunctions) {
+ minVersion = "16.1.0";
+ }
+ if (needsNewInputPartialOutput(meta)) {
+ minVersion = "17.1.0";
+ }
+ if (meta.queries.some((q) => q.isSignal) || meta.viewQueries.some((q) => q.isSignal)) {
+ minVersion = "17.2.0";
+ }
+ return minVersion;
+}
+function needsNewInputPartialOutput(meta) {
+ return Object.values(meta.inputs).some((input) => input.isSignal);
+}
+function compileQuery(query) {
+ const meta = new DefinitionMap();
+ meta.set("propertyName", literal(query.propertyName));
+ if (query.first) {
+ meta.set("first", literal(true));
+ }
+ meta.set("predicate", Array.isArray(query.predicate) ? asLiteral(query.predicate) : convertFromMaybeForwardRefExpression(query.predicate));
+ if (!query.emitDistinctChangesOnly) {
+ meta.set("emitDistinctChangesOnly", literal(false));
+ }
+ if (query.descendants) {
+ meta.set("descendants", literal(true));
+ }
+ meta.set("read", query.read);
+ if (query.static) {
+ meta.set("static", literal(true));
+ }
+ if (query.isSignal) {
+ meta.set("isSignal", literal(true));
+ }
+ return meta.toLiteralMap();
+}
+function compileHostMetadata(meta) {
+ const hostMetadata = new DefinitionMap();
+ hostMetadata.set("attributes", toOptionalLiteralMap(meta.attributes, (expression) => expression));
+ hostMetadata.set("listeners", toOptionalLiteralMap(meta.listeners, literal));
+ hostMetadata.set("properties", toOptionalLiteralMap(meta.properties, literal));
+ if (meta.specialAttributes.styleAttr) {
+ hostMetadata.set("styleAttribute", literal(meta.specialAttributes.styleAttr));
+ }
+ if (meta.specialAttributes.classAttr) {
+ hostMetadata.set("classAttribute", literal(meta.specialAttributes.classAttr));
+ }
+ if (hostMetadata.values.length > 0) {
+ return hostMetadata.toLiteralMap();
+ } else {
+ return null;
+ }
+}
+function createHostDirectives(hostDirectives) {
+ const expressions = hostDirectives.map((current) => {
+ const keys = [
+ {
+ key: "directive",
+ value: current.isForwardReference ? generateForwardRef(current.directive.type) : current.directive.type,
+ quoted: false
+ }
+ ];
+ const inputsLiteral = current.inputs ? createHostDirectivesMappingArray(current.inputs) : null;
+ const outputsLiteral = current.outputs ? createHostDirectivesMappingArray(current.outputs) : null;
+ if (inputsLiteral) {
+ keys.push({ key: "inputs", value: inputsLiteral, quoted: false });
+ }
+ if (outputsLiteral) {
+ keys.push({ key: "outputs", value: outputsLiteral, quoted: false });
+ }
+ return literalMap(keys);
+ });
+ return literalArr(expressions);
+}
+function createInputsPartialMetadata(inputs) {
+ const keys = Object.getOwnPropertyNames(inputs);
+ if (keys.length === 0) {
+ return null;
+ }
+ return literalMap(keys.map((declaredName) => {
+ const value = inputs[declaredName];
+ return {
+ key: declaredName,
+ // put quotes around keys that contain potentially unsafe characters
+ quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(declaredName),
+ value: literalMap([
+ { key: "classPropertyName", quoted: false, value: asLiteral(value.classPropertyName) },
+ { key: "publicName", quoted: false, value: asLiteral(value.bindingPropertyName) },
+ { key: "isSignal", quoted: false, value: asLiteral(value.isSignal) },
+ { key: "isRequired", quoted: false, value: asLiteral(value.required) },
+ { key: "transformFunction", quoted: false, value: value.transformFunction ?? NULL_EXPR }
+ ])
+ };
+ }));
+}
+function legacyInputsPartialMetadata(inputs) {
+ const keys = Object.getOwnPropertyNames(inputs);
+ if (keys.length === 0) {
+ return null;
+ }
+ return literalMap(keys.map((declaredName) => {
+ const value = inputs[declaredName];
+ const publicName = value.bindingPropertyName;
+ const differentDeclaringName = publicName !== declaredName;
+ let result;
+ if (differentDeclaringName || value.transformFunction !== null) {
+ const values = [asLiteral(publicName), asLiteral(declaredName)];
+ if (value.transformFunction !== null) {
+ values.push(value.transformFunction);
+ }
+ result = literalArr(values);
+ } else {
+ result = asLiteral(publicName);
+ }
+ return {
+ key: declaredName,
+ // put quotes around keys that contain potentially unsafe characters
+ quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(declaredName),
+ value: result
+ };
+ }));
+}
+function compileDeclareComponentFromMetadata(meta, template2, additionalTemplateInfo) {
+ const definitionMap = createComponentDefinitionMap(meta, template2, additionalTemplateInfo);
+ const expression = importExpr(Identifiers.declareComponent).callFn([definitionMap.toLiteralMap()]);
+ const type = createComponentType(meta);
+ return { expression, type, statements: [] };
+}
+function createComponentDefinitionMap(meta, template2, templateInfo) {
+ const definitionMap = createDirectiveDefinitionMap(meta);
+ const blockVisitor = new BlockPresenceVisitor();
+ visitAll$1(blockVisitor, template2.nodes);
+ definitionMap.set("template", getTemplateExpression(template2, templateInfo));
+ if (templateInfo.isInline) {
+ definitionMap.set("isInline", literal(true));
+ }
+ if (blockVisitor.hasBlocks) {
+ definitionMap.set("minVersion", literal("17.0.0"));
+ }
+ definitionMap.set("styles", toOptionalLiteralArray(meta.styles, literal));
+ definitionMap.set("dependencies", compileUsedDependenciesMetadata(meta));
+ definitionMap.set("viewProviders", meta.viewProviders);
+ definitionMap.set("animations", meta.animations);
+ if (meta.changeDetection !== null) {
+ if (typeof meta.changeDetection === "object") {
+ throw new Error("Impossible state! Change detection flag is not resolved!");
+ }
+ definitionMap.set("changeDetection", importExpr(Identifiers.ChangeDetectionStrategy).prop(ChangeDetectionStrategy[meta.changeDetection]));
+ }
+ if (meta.encapsulation !== ViewEncapsulation$1.Emulated) {
+ definitionMap.set("encapsulation", importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation$1[meta.encapsulation]));
+ }
+ if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {
+ definitionMap.set("interpolation", literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));
+ }
+ if (template2.preserveWhitespaces === true) {
+ definitionMap.set("preserveWhitespaces", literal(true));
+ }
+ if (meta.defer.mode === 0) {
+ const resolvers = [];
+ let hasResolvers = false;
+ for (const deps of meta.defer.blocks.values()) {
+ if (deps === null) {
+ resolvers.push(literal(null));
+ } else {
+ resolvers.push(deps);
+ hasResolvers = true;
+ }
+ }
+ if (hasResolvers) {
+ definitionMap.set("deferBlockDependencies", literalArr(resolvers));
+ }
+ } else {
+ throw new Error("Unsupported defer function emit mode in partial compilation");
+ }
+ return definitionMap;
+}
+function getTemplateExpression(template2, templateInfo) {
+ if (templateInfo.inlineTemplateLiteralExpression !== null) {
+ return templateInfo.inlineTemplateLiteralExpression;
+ }
+ if (templateInfo.isInline) {
+ return literal(templateInfo.content, null, null);
+ }
+ const contents = templateInfo.content;
+ const file = new ParseSourceFile(contents, templateInfo.sourceUrl);
+ const start = new ParseLocation(file, 0, 0, 0);
+ const end = computeEndLocation(file, contents);
+ const span = new ParseSourceSpan(start, end);
+ return literal(contents, null, span);
+}
+function computeEndLocation(file, contents) {
+ const length = contents.length;
+ let lineStart = 0;
+ let lastLineStart = 0;
+ let line = 0;
+ do {
+ lineStart = contents.indexOf("\n", lastLineStart);
+ if (lineStart !== -1) {
+ lastLineStart = lineStart + 1;
+ line++;
+ }
+ } while (lineStart !== -1);
+ return new ParseLocation(file, length, line, length - lastLineStart);
+}
+function compileUsedDependenciesMetadata(meta) {
+ const wrapType = meta.declarationListEmitMode !== 0 ? generateForwardRef : (expr) => expr;
+ if (meta.declarationListEmitMode === 3) {
+ throw new Error(`Unsupported emit mode`);
+ }
+ return toOptionalLiteralArray(meta.declarations, (decl) => {
+ switch (decl.kind) {
+ case R3TemplateDependencyKind.Directive:
+ const dirMeta = new DefinitionMap();
+ dirMeta.set("kind", literal(decl.isComponent ? "component" : "directive"));
+ dirMeta.set("type", wrapType(decl.type));
+ dirMeta.set("selector", literal(decl.selector));
+ dirMeta.set("inputs", toOptionalLiteralArray(decl.inputs, literal));
+ dirMeta.set("outputs", toOptionalLiteralArray(decl.outputs, literal));
+ dirMeta.set("exportAs", toOptionalLiteralArray(decl.exportAs, literal));
+ return dirMeta.toLiteralMap();
+ case R3TemplateDependencyKind.Pipe:
+ const pipeMeta = new DefinitionMap();
+ pipeMeta.set("kind", literal("pipe"));
+ pipeMeta.set("type", wrapType(decl.type));
+ pipeMeta.set("name", literal(decl.name));
+ return pipeMeta.toLiteralMap();
+ case R3TemplateDependencyKind.NgModule:
+ const ngModuleMeta = new DefinitionMap();
+ ngModuleMeta.set("kind", literal("ngmodule"));
+ ngModuleMeta.set("type", wrapType(decl.type));
+ return ngModuleMeta.toLiteralMap();
+ }
+ });
+}
+var BlockPresenceVisitor = class extends RecursiveVisitor$1 {
+ hasBlocks = false;
+ visitDeferredBlock() {
+ this.hasBlocks = true;
+ }
+ visitDeferredBlockPlaceholder() {
+ this.hasBlocks = true;
+ }
+ visitDeferredBlockLoading() {
+ this.hasBlocks = true;
+ }
+ visitDeferredBlockError() {
+ this.hasBlocks = true;
+ }
+ visitIfBlock() {
+ this.hasBlocks = true;
+ }
+ visitIfBlockBranch() {
+ this.hasBlocks = true;
+ }
+ visitForLoopBlock() {
+ this.hasBlocks = true;
+ }
+ visitForLoopBlockEmpty() {
+ this.hasBlocks = true;
+ }
+ visitSwitchBlock() {
+ this.hasBlocks = true;
+ }
+ visitSwitchBlockCase() {
+ this.hasBlocks = true;
+ }
+};
+var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
+function compileDeclareFactoryFunction(meta) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", meta.type.value);
+ definitionMap.set("deps", compileDependencies(meta.deps));
+ definitionMap.set("target", importExpr(Identifiers.FactoryTarget).prop(FactoryTarget[meta.target]));
+ return {
+ expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]),
+ statements: [],
+ type: createFactoryType(meta)
+ };
+}
+var MINIMUM_PARTIAL_LINKER_VERSION$3 = "12.0.0";
+function compileDeclareInjectableFromMetadata(meta) {
+ const definitionMap = createInjectableDefinitionMap(meta);
+ const expression = importExpr(Identifiers.declareInjectable).callFn([definitionMap.toLiteralMap()]);
+ const type = createInjectableType(meta);
+ return { expression, type, statements: [] };
+}
+function createInjectableDefinitionMap(meta) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", meta.type.value);
+ if (meta.providedIn !== void 0) {
+ const providedIn = convertFromMaybeForwardRefExpression(meta.providedIn);
+ if (providedIn.value !== null) {
+ definitionMap.set("providedIn", providedIn);
+ }
+ }
+ if (meta.useClass !== void 0) {
+ definitionMap.set("useClass", convertFromMaybeForwardRefExpression(meta.useClass));
+ }
+ if (meta.useExisting !== void 0) {
+ definitionMap.set("useExisting", convertFromMaybeForwardRefExpression(meta.useExisting));
+ }
+ if (meta.useValue !== void 0) {
+ definitionMap.set("useValue", convertFromMaybeForwardRefExpression(meta.useValue));
+ }
+ if (meta.useFactory !== void 0) {
+ definitionMap.set("useFactory", meta.useFactory);
+ }
+ if (meta.deps !== void 0) {
+ definitionMap.set("deps", literalArr(meta.deps.map(compileDependency)));
+ }
+ return definitionMap;
+}
+var MINIMUM_PARTIAL_LINKER_VERSION$2 = "12.0.0";
+function compileDeclareInjectorFromMetadata(meta) {
+ const definitionMap = createInjectorDefinitionMap(meta);
+ const expression = importExpr(Identifiers.declareInjector).callFn([definitionMap.toLiteralMap()]);
+ const type = createInjectorType(meta);
+ return { expression, type, statements: [] };
+}
+function createInjectorDefinitionMap(meta) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", meta.type.value);
+ definitionMap.set("providers", meta.providers);
+ if (meta.imports.length > 0) {
+ definitionMap.set("imports", literalArr(meta.imports));
+ }
+ return definitionMap;
+}
+var MINIMUM_PARTIAL_LINKER_VERSION$1 = "14.0.0";
+function compileDeclareNgModuleFromMetadata(meta) {
+ const definitionMap = createNgModuleDefinitionMap(meta);
+ const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
+ const type = createNgModuleType(meta);
+ return { expression, type, statements: [] };
+}
+function createNgModuleDefinitionMap(meta) {
+ const definitionMap = new DefinitionMap();
+ if (meta.kind === R3NgModuleMetadataKind.Local) {
+ throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
+ }
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", meta.type.value);
+ if (meta.bootstrap.length > 0) {
+ definitionMap.set("bootstrap", refsToArray(meta.bootstrap, meta.containsForwardDecls));
+ }
+ if (meta.declarations.length > 0) {
+ definitionMap.set("declarations", refsToArray(meta.declarations, meta.containsForwardDecls));
+ }
+ if (meta.imports.length > 0) {
+ definitionMap.set("imports", refsToArray(meta.imports, meta.containsForwardDecls));
+ }
+ if (meta.exports.length > 0) {
+ definitionMap.set("exports", refsToArray(meta.exports, meta.containsForwardDecls));
+ }
+ if (meta.schemas !== null && meta.schemas.length > 0) {
+ definitionMap.set("schemas", literalArr(meta.schemas.map((ref) => ref.value)));
+ }
+ if (meta.id !== null) {
+ definitionMap.set("id", meta.id);
+ }
+ return definitionMap;
+}
+var MINIMUM_PARTIAL_LINKER_VERSION = "14.0.0";
+function compileDeclarePipeFromMetadata(meta) {
+ const definitionMap = createPipeDefinitionMap(meta);
+ const expression = importExpr(Identifiers.declarePipe).callFn([definitionMap.toLiteralMap()]);
+ const type = createPipeType(meta);
+ return { expression, type, statements: [] };
+}
+function createPipeDefinitionMap(meta) {
+ const definitionMap = new DefinitionMap();
+ definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
+ definitionMap.set("version", literal("20.1.7"));
+ definitionMap.set("ngImport", importExpr(Identifiers.core));
+ definitionMap.set("type", meta.type.value);
+ if (meta.isStandalone !== void 0) {
+ definitionMap.set("isStandalone", literal(meta.isStandalone));
+ }
+ definitionMap.set("name", literal(meta.pipeName ?? meta.name));
+ if (meta.pure === false) {
+ definitionMap.set("pure", literal(meta.pure));
+ }
+ return definitionMap;
+}
+function compileClassDebugInfo(debugInfo) {
+ const debugInfoObject = {
+ className: debugInfo.className
+ };
+ if (debugInfo.filePath) {
+ debugInfoObject.filePath = debugInfo.filePath;
+ debugInfoObject.lineNumber = debugInfo.lineNumber;
+ }
+ if (debugInfo.forbidOrphanRendering) {
+ debugInfoObject.forbidOrphanRendering = literal(true);
+ }
+ const fnCall = importExpr(Identifiers.setClassDebugInfo).callFn([debugInfo.type, mapLiteral(debugInfoObject)]);
+ const iife = arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]);
+ return iife.callFn([]);
+}
+function compileHmrInitializer(meta) {
+ const moduleName = "m";
+ const dataName = "d";
+ const timestampName = "t";
+ const idName = "id";
+ const importCallbackName = `${meta.className}_HmrLoad`;
+ const namespaces = meta.namespaceDependencies.map((dep) => {
+ return new ExternalExpr({ moduleName: dep.moduleName, name: null });
+ });
+ const defaultRead = variable(moduleName).prop("default");
+ const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([
+ meta.type,
+ defaultRead,
+ literalArr(namespaces),
+ literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
+ variable("import").prop("meta"),
+ variable(idName)
+ ]);
+ const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
+ const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([
+ variable(idName),
+ variable(timestampName),
+ variable("import").prop("meta").prop("url")
+ ]);
+ const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [
+ // The vite-ignore special comment is required to prevent Vite from generating a superfluous
+ // warning for each usage within the development code. If Vite provides a method to
+ // programmatically avoid this warning in the future, this added comment can be removed here.
+ new DynamicImportExpr(url, null, "@vite-ignore").prop("then").callFn([replaceCallback]).toStmt()
+ ], null, StmtModifier.Final);
+ const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop("id").identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop("timestamp")])));
+ const initialCall = variable(importCallbackName).callFn([variable("Date").prop("now").callFn([])]);
+ const hotRead = variable("import").prop("meta").prop("hot");
+ const hotListener = hotRead.clone().prop("on").callFn([literal("angular:component-update"), updateCallback]);
+ return arrowFn([], [
+ // const id = ;
+ new DeclareVarStmt(idName, literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, StmtModifier.Final),
+ // function Cmp_HmrLoad() {...}.
+ importCallback,
+ // ngDevMode && Cmp_HmrLoad(Date.now());
+ devOnlyGuardedExpression(initialCall).toStmt(),
+ // ngDevMode && import.meta.hot && import.meta.hot.on(...)
+ devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt()
+ ]).callFn([]);
+}
+function compileHmrUpdateCallback(definitions, constantStatements, meta) {
+ const namespaces = "ɵɵnamespaces";
+ const params = [meta.className, namespaces].map((name) => new FnParam(name, DYNAMIC_TYPE));
+ const body = [];
+ for (const local of meta.localDependencies) {
+ params.push(new FnParam(local.name));
+ }
+ for (let i = 0; i < meta.namespaceDependencies.length; i++) {
+ body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
+ }
+ body.push(...constantStatements);
+ for (const field of definitions) {
+ if (field.initializer !== null) {
+ body.push(variable(meta.className).prop(field.name).set(field.initializer).toStmt());
+ for (const stmt of field.statements) {
+ body.push(stmt);
+ }
+ }
+ }
+ return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
+}
+var VERSION = new Version("20.1.7");
+publishFacade(_global);
+
+export {
+ CssSelector,
+ SelectorMatcher,
+ SelectorListContext,
+ SelectorContext,
+ SelectorlessMatcher,
+ emitDistinctChangesOnlyDefaultValue,
+ ViewEncapsulation$1,
+ ChangeDetectionStrategy,
+ CUSTOM_ELEMENTS_SCHEMA,
+ NO_ERRORS_SCHEMA,
+ core,
+ FactoryTarget,
+ computeMsgId,
+ TypeModifier,
+ Type,
+ BuiltinTypeName,
+ BuiltinType,
+ ExpressionType,
+ ArrayType,
+ MapType,
+ TransplantedType,
+ DYNAMIC_TYPE,
+ STRING_TYPE,
+ NONE_TYPE,
+ UnaryOperator,
+ BinaryOperator,
+ Expression,
+ ReadVarExpr,
+ TypeofExpr,
+ VoidExpr,
+ WrappedNodeExpr,
+ InvokeFunctionExpr,
+ TaggedTemplateLiteralExpr,
+ InstantiateExpr,
+ LiteralExpr,
+ TemplateLiteralExpr,
+ TemplateLiteralElementExpr,
+ LocalizedString,
+ ExternalExpr,
+ ExternalReference,
+ ConditionalExpr,
+ DynamicImportExpr,
+ NotExpr,
+ FunctionExpr,
+ ArrowFunctionExpr,
+ UnaryOperatorExpr,
+ ParenthesizedExpr,
+ BinaryOperatorExpr,
+ ReadPropExpr,
+ ReadKeyExpr,
+ LiteralArrayExpr,
+ LiteralMapExpr,
+ CommaExpr,
+ StmtModifier,
+ LeadingComment,
+ JSDocComment,
+ Statement,
+ DeclareVarStmt,
+ DeclareFunctionStmt,
+ ExpressionStatement,
+ ReturnStatement,
+ IfStmt,
+ leadingComment,
+ jsDocComment,
+ literalMap,
+ literal,
+ output_ast,
+ ConstantPool,
+ Identifiers,
+ escapeRegExp,
+ Version,
+ EmitterVisitorContext,
+ getSafePropertyAccessString,
+ devOnlyGuardedExpression,
+ createMayBeForwardRefExpression,
+ compileFactoryFunction,
+ ParseSpan,
+ AST,
+ ASTWithName,
+ EmptyExpr$1,
+ ImplicitReceiver,
+ ThisReceiver,
+ Chain,
+ Conditional,
+ PropertyRead,
+ SafePropertyRead,
+ KeyedRead,
+ SafeKeyedRead,
+ BindingPipeType,
+ BindingPipe,
+ LiteralPrimitive,
+ LiteralArray,
+ LiteralMap,
+ Interpolation$1,
+ Binary,
+ Unary,
+ PrefixNot,
+ TypeofExpression,
+ VoidExpression,
+ NonNullAssert,
+ Call,
+ SafeCall,
+ TaggedTemplateLiteral,
+ TemplateLiteral,
+ TemplateLiteralElement,
+ ParenthesizedExpression,
+ AbsoluteSourceSpan,
+ ASTWithSource,
+ VariableBinding,
+ ExpressionBinding,
+ RecursiveAstVisitor2 as RecursiveAstVisitor,
+ ParsedProperty,
+ ParsedPropertyType,
+ ParsedEventType,
+ ParsedEvent,
+ ParsedVariable,
+ BindingType,
+ BoundElementProperty,
+ TagContentType,
+ splitNsName,
+ isNgContainer,
+ isNgContent,
+ isNgTemplate,
+ getNsPrefix,
+ mergeNsAndName,
+ Text$3,
+ BoundText,
+ TextAttribute,
+ BoundAttribute,
+ BoundEvent,
+ Element$1,
+ DeferredTrigger,
+ BoundDeferredTrigger,
+ NeverDeferredTrigger,
+ IdleDeferredTrigger,
+ ImmediateDeferredTrigger,
+ HoverDeferredTrigger,
+ TimerDeferredTrigger,
+ InteractionDeferredTrigger,
+ ViewportDeferredTrigger,
+ BlockNode,
+ DeferredBlockPlaceholder,
+ DeferredBlockLoading,
+ DeferredBlockError,
+ DeferredBlock,
+ SwitchBlock,
+ SwitchBlockCase,
+ ForLoopBlock,
+ ForLoopBlockEmpty,
+ IfBlock,
+ IfBlockBranch,
+ UnknownBlock,
+ LetDeclaration$1,
+ Component$1,
+ Directive$1,
+ Template,
+ Content,
+ Variable,
+ Reference,
+ Icu$1,
+ HostElement,
+ RecursiveVisitor$1,
+ visitAll$1,
+ Serializer,
+ Xmb,
+ createCssSelectorFromNode,
+ compileInjectable,
+ createInjectableType,
+ InterpolationConfig,
+ DEFAULT_INTERPOLATION_CONFIG,
+ ParseLocation,
+ ParseSourceFile,
+ ParseSourceSpan,
+ ParseErrorLevel,
+ ParseError,
+ r3JitTypeSourceSpan,
+ identifierName,
+ sanitizeIdentifier,
+ JitEvaluator,
+ compileInjector,
+ R3SelectorScopeMode,
+ R3NgModuleMetadataKind,
+ compileNgModule,
+ compilePipeFromMetadata,
+ R3TemplateDependencyKind,
+ NodeWithI18n,
+ Text4 as Text,
+ Expansion,
+ ExpansionCase,
+ Attribute,
+ Element2 as Element,
+ Comment2 as Comment,
+ Block,
+ Component2 as Component,
+ Directive2 as Directive,
+ BlockParameter,
+ LetDeclaration2 as LetDeclaration,
+ visitAll,
+ RecursiveVisitor2 as RecursiveVisitor,
+ TreeError,
+ ParseTreeResult,
+ TokenType,
+ StringTokenKind,
+ Lexer,
+ Token,
+ StringToken,
+ EOF,
+ SplitInterpolation,
+ TemplateBindingParseResult,
+ Parser2 as Parser,
+ SECURITY_SCHEMA,
+ ElementSchemaRegistry,
+ DomElementSchemaRegistry,
+ HtmlTagDefinition,
+ getHtmlTagDefinition,
+ setEnableTemplateSourceLocations,
+ HtmlParser,
+ parseTemplate,
+ makeBindingParser,
+ compileDirectiveFromMetadata,
+ compileComponentFromMetadata,
+ parseHostBindings,
+ verifyHostBindings,
+ encapsulateStyle,
+ compileDeferResolverFunction,
+ CombinedRecursiveAstVisitor,
+ findMatchingDirectivesAndPipes,
+ R3TargetBinder,
+ ResourceLoader,
+ CompilerFacadeImpl,
+ publishFacade,
+ CompilerConfig,
+ preserveWhitespacesDefault,
+ XmlParser,
+ Xliff,
+ Xliff2,
+ Xtb,
+ I18NHtmlParser,
+ MessageBundle,
+ compileClassMetadata,
+ compileComponentClassMetadata,
+ compileOpaqueAsyncClassMetadata,
+ compileDeclareClassMetadata,
+ compileComponentDeclareClassMetadata,
+ compileDeclareDirectiveFromMetadata,
+ compileDeclareComponentFromMetadata,
+ compileDeclareFactoryFunction,
+ compileDeclareInjectableFromMetadata,
+ compileDeclareInjectorFromMetadata,
+ compileDeclareNgModuleFromMetadata,
+ compileDeclarePipeFromMetadata,
+ compileClassDebugInfo,
+ compileHmrInitializer,
+ compileHmrUpdateCallback,
+ VERSION
+};
+/*! Bundled license information:
+
+@angular/compiler/fesm2022/compiler.mjs:
+ (**
+ * @license Angular v20.1.7
+ * (c) 2010-2025 Google LLC. https://angular.io/
+ * License: MIT
+ *)
+ (*!
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.dev/license
+ *)
+ (**
+ *
+ * @license
+ * Copyright Google LLC All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.dev/license
+ *)
+*/
+//# sourceMappingURL=chunk-MIBI5X5V.js.map
diff --git a/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js.map b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js.map
new file mode 100644
index 0000000..f807cd2
--- /dev/null
+++ b/.angular/cache/20.1.6/TFTPaths/vite/deps/chunk-MIBI5X5V.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["../../../../../../node_modules/@angular/compiler/fesm2022/compiler.mjs"],
+ "sourcesContent": ["/**\n * @license Angular v20.1.7\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nconst _SELECTOR_REGEXP = new RegExp('(\\\\:not\\\\()|' + // 1: \":not(\"\n '(([\\\\.\\\\#]?)[-\\\\w]+)|' + // 2: \"tag\"; 3: \".\"/\"#\";\n // \"-\" should appear first in the regexp below as FF31 parses \"[.-\\w]\" as a range\n // 4: attribute; 5: attribute_string; 6: attribute_value\n '(?:\\\\[([-.\\\\w*\\\\\\\\$]+)(?:=([\"\\']?)([^\\\\]\"\\']*)\\\\5)?\\\\])|' + // \"[name]\", \"[name=value]\",\n // \"[name=\"value\"]\",\n // \"[name='value']\"\n '(\\\\))|' + // 7: \")\"\n '(\\\\s*,\\\\s*)', // 8: \",\"\n'g');\n/**\n * A css selector contains an element name,\n * css classes and attribute/value pairs with the purpose\n * of selecting subsets out of them.\n */\nclass CssSelector {\n element = null;\n classNames = [];\n /**\n * The selectors are encoded in pairs where:\n * - even locations are attribute names\n * - odd locations are attribute values.\n *\n * Example:\n * Selector: `[key1=value1][key2]` would parse to:\n * ```\n * ['key1', 'value1', 'key2', '']\n * ```\n */\n attrs = [];\n notSelectors = [];\n static parse(selector) {\n const results = [];\n const _addResult = (res, cssSel) => {\n if (cssSel.notSelectors.length > 0 &&\n !cssSel.element &&\n cssSel.classNames.length == 0 &&\n cssSel.attrs.length == 0) {\n cssSel.element = '*';\n }\n res.push(cssSel);\n };\n let cssSelector = new CssSelector();\n let match;\n let current = cssSelector;\n let inNot = false;\n _SELECTOR_REGEXP.lastIndex = 0;\n while ((match = _SELECTOR_REGEXP.exec(selector))) {\n if (match[1 /* SelectorRegexp.NOT */]) {\n if (inNot) {\n throw new Error('Nesting :not in a selector is not allowed');\n }\n inNot = true;\n current = new CssSelector();\n cssSelector.notSelectors.push(current);\n }\n const tag = match[2 /* SelectorRegexp.TAG */];\n if (tag) {\n const prefix = match[3 /* SelectorRegexp.PREFIX */];\n if (prefix === '#') {\n // #hash\n current.addAttribute('id', tag.slice(1));\n }\n else if (prefix === '.') {\n // Class\n current.addClassName(tag.slice(1));\n }\n else {\n // Element\n current.setElement(tag);\n }\n }\n const attribute = match[4 /* SelectorRegexp.ATTRIBUTE */];\n if (attribute) {\n current.addAttribute(current.unescapeAttribute(attribute), match[6 /* SelectorRegexp.ATTRIBUTE_VALUE */]);\n }\n if (match[7 /* SelectorRegexp.NOT_END */]) {\n inNot = false;\n current = cssSelector;\n }\n if (match[8 /* SelectorRegexp.SEPARATOR */]) {\n if (inNot) {\n throw new Error('Multiple selectors in :not are not supported');\n }\n _addResult(results, cssSelector);\n cssSelector = current = new CssSelector();\n }\n }\n _addResult(results, cssSelector);\n return results;\n }\n /**\n * Unescape `\\$` sequences from the CSS attribute selector.\n *\n * This is needed because `$` can have a special meaning in CSS selectors,\n * but we might want to match an attribute that contains `$`.\n * [MDN web link for more\n * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n * @param attr the attribute to unescape.\n * @returns the unescaped string.\n */\n unescapeAttribute(attr) {\n let result = '';\n let escaping = false;\n for (let i = 0; i < attr.length; i++) {\n const char = attr.charAt(i);\n if (char === '\\\\') {\n escaping = true;\n continue;\n }\n if (char === '$' && !escaping) {\n throw new Error(`Error in attribute selector \"${attr}\". ` +\n `Unescaped \"$\" is not supported. Please escape with \"\\\\$\".`);\n }\n escaping = false;\n result += char;\n }\n return result;\n }\n /**\n * Escape `$` sequences from the CSS attribute selector.\n *\n * This is needed because `$` can have a special meaning in CSS selectors,\n * with this method we are escaping `$` with `\\$'.\n * [MDN web link for more\n * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n * @param attr the attribute to escape.\n * @returns the escaped string.\n */\n escapeAttribute(attr) {\n return attr.replace(/\\\\/g, '\\\\\\\\').replace(/\\$/g, '\\\\$');\n }\n isElementSelector() {\n return (this.hasElementSelector() &&\n this.classNames.length == 0 &&\n this.attrs.length == 0 &&\n this.notSelectors.length === 0);\n }\n hasElementSelector() {\n return !!this.element;\n }\n setElement(element = null) {\n this.element = element;\n }\n getAttrs() {\n const result = [];\n if (this.classNames.length > 0) {\n result.push('class', this.classNames.join(' '));\n }\n return result.concat(this.attrs);\n }\n addAttribute(name, value = '') {\n this.attrs.push(name, (value && value.toLowerCase()) || '');\n }\n addClassName(name) {\n this.classNames.push(name.toLowerCase());\n }\n toString() {\n let res = this.element || '';\n if (this.classNames) {\n this.classNames.forEach((klass) => (res += `.${klass}`));\n }\n if (this.attrs) {\n for (let i = 0; i < this.attrs.length; i += 2) {\n const name = this.escapeAttribute(this.attrs[i]);\n const value = this.attrs[i + 1];\n res += `[${name}${value ? '=' + value : ''}]`;\n }\n }\n this.notSelectors.forEach((notSelector) => (res += `:not(${notSelector})`));\n return res;\n }\n}\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nclass SelectorMatcher {\n static createNotMatcher(notSelectors) {\n const notMatcher = new SelectorMatcher();\n notMatcher.addSelectables(notSelectors, null);\n return notMatcher;\n }\n _elementMap = new Map();\n _elementPartialMap = new Map();\n _classMap = new Map();\n _classPartialMap = new Map();\n _attrValueMap = new Map();\n _attrValuePartialMap = new Map();\n _listContexts = [];\n addSelectables(cssSelectors, callbackCtxt) {\n let listContext = null;\n if (cssSelectors.length > 1) {\n listContext = new SelectorListContext(cssSelectors);\n this._listContexts.push(listContext);\n }\n for (let i = 0; i < cssSelectors.length; i++) {\n this._addSelectable(cssSelectors[i], callbackCtxt, listContext);\n }\n }\n /**\n * Add an object that can be found later on by calling `match`.\n * @param cssSelector A css selector\n * @param callbackCtxt An opaque object that will be given to the callback of the `match` function\n */\n _addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }\n _addTerminal(map, name, selectable) {\n let terminalList = map.get(name);\n if (!terminalList) {\n terminalList = [];\n map.set(name, terminalList);\n }\n terminalList.push(selectable);\n }\n _addPartial(map, name) {\n let matcher = map.get(name);\n if (!matcher) {\n matcher = new SelectorMatcher();\n map.set(name, matcher);\n }\n return matcher;\n }\n /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param cssSelector A css selector\n * @param matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return boolean true if a match was found\n */\n match(cssSelector, matchedCallback) {\n let result = false;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n for (let i = 0; i < this._listContexts.length; i++) {\n this._listContexts[i].alreadyMatched = false;\n }\n result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result;\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const className = classNames[i];\n result =\n this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n result;\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const name = attrs[i];\n const value = attrs[i + 1];\n const terminalValuesMap = this._attrValueMap.get(name);\n if (value) {\n result =\n this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n const partialValuesMap = this._attrValuePartialMap.get(name);\n if (value) {\n result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n }\n }\n return result;\n }\n /** @internal */\n _matchTerminal(map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n let selectables = map.get(name) || [];\n const starSelectables = map.get('*');\n if (starSelectables) {\n selectables = selectables.concat(starSelectables);\n }\n if (selectables.length === 0) {\n return false;\n }\n let selectable;\n let result = false;\n for (let i = 0; i < selectables.length; i++) {\n selectable = selectables[i];\n result = selectable.finalize(cssSelector, matchedCallback) || result;\n }\n return result;\n }\n /** @internal */\n _matchPartial(map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n const nestedSelector = map.get(name);\n if (!nestedSelector) {\n return false;\n }\n // TODO(perf): get rid of recursion and measure again\n // TODO(perf): don't pass the whole selector into the recursion,\n // but only the not processed parts\n return nestedSelector.match(cssSelector, matchedCallback);\n }\n}\nclass SelectorListContext {\n selectors;\n alreadyMatched = false;\n constructor(selectors) {\n this.selectors = selectors;\n }\n}\n// Store context to pass back selector and context when a selector is matched\nclass SelectorContext {\n selector;\n cbContext;\n listContext;\n notSelectors;\n constructor(selector, cbContext, listContext) {\n this.selector = selector;\n this.cbContext = cbContext;\n this.listContext = listContext;\n this.notSelectors = selector.notSelectors;\n }\n finalize(cssSelector, callback) {\n let result = true;\n if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n const notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n result = !notMatcher.match(cssSelector, null);\n }\n if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n if (this.listContext) {\n this.listContext.alreadyMatched = true;\n }\n callback(this.selector, this.cbContext);\n }\n return result;\n }\n}\nclass SelectorlessMatcher {\n registry;\n constructor(registry) {\n this.registry = registry;\n }\n match(name) {\n return this.registry.has(name) ? this.registry.get(name) : [];\n }\n}\n\n// Attention:\n// This file duplicates types and values from @angular/core\n// so that we are able to make @angular/compiler independent of @angular/core.\n// This is important to prevent a build cycle, as @angular/core needs to\n// be compiled with the compiler.\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nconst emitDistinctChangesOnlyDefaultValue = true;\nvar ViewEncapsulation$1;\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$1 || (ViewEncapsulation$1 = {}));\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\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 = {}));\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements',\n};\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema',\n};\nconst Type$1 = Function;\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 = {}));\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 = {}));\nfunction parserSelectorToSimpleSelector(selector) {\n const classes = selector.classNames && selector.classNames.length\n ? [8 /* SelectorFlags.CLASS */, ...selector.classNames]\n : [];\n const elementName = selector.element && selector.element !== '*' ? selector.element : '';\n return [elementName, ...selector.attrs, ...classes];\n}\nfunction parserSelectorToNegativeSelector(selector) {\n const classes = selector.classNames && selector.classNames.length\n ? [8 /* SelectorFlags.CLASS */, ...selector.classNames]\n : [];\n if (selector.element) {\n return [\n 1 /* SelectorFlags.NOT */ | 4 /* SelectorFlags.ELEMENT */,\n selector.element,\n ...selector.attrs,\n ...classes,\n ];\n }\n else if (selector.attrs.length) {\n return [1 /* SelectorFlags.NOT */ | 2 /* SelectorFlags.ATTRIBUTE */, ...selector.attrs, ...classes];\n }\n else {\n return selector.classNames && selector.classNames.length\n ? [1 /* SelectorFlags.NOT */ | 8 /* SelectorFlags.CLASS */, ...selector.classNames]\n : [];\n }\n}\nfunction parserSelectorToR3Selector(selector) {\n const positive = parserSelectorToSimpleSelector(selector);\n const negative = selector.notSelectors && selector.notSelectors.length\n ? selector.notSelectors.map((notSelector) => parserSelectorToNegativeSelector(notSelector))\n : [];\n return positive.concat(...negative);\n}\nfunction parseSelectorToR3Selector(selector) {\n return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];\n}\n\nvar core = /*#__PURE__*/Object.freeze({\n __proto__: null,\n CUSTOM_ELEMENTS_SCHEMA: CUSTOM_ELEMENTS_SCHEMA,\n get ChangeDetectionStrategy () { return ChangeDetectionStrategy; },\n get InputFlags () { return InputFlags; },\n get MissingTranslationStrategy () { return MissingTranslationStrategy; },\n NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA,\n get SecurityContext () { return SecurityContext; },\n Type: Type$1,\n get ViewEncapsulation () { return ViewEncapsulation$1; },\n emitDistinctChangesOnlyDefaultValue: emitDistinctChangesOnlyDefaultValue,\n parseSelectorToR3Selector: parseSelectorToR3Selector\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$1;\n(function (R3TemplateDependencyKind) {\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Directive\"] = 0] = \"Directive\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Pipe\"] = 1] = \"Pipe\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"NgModule\"] = 2] = \"NgModule\";\n})(R3TemplateDependencyKind$1 || (R3TemplateDependencyKind$1 = {}));\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\n/**\n * A lazily created TextEncoder instance for converting strings into UTF-8 bytes\n */\nlet textEncoder;\n/**\n * Return the message id or compute it using the XLIFF1 digest.\n */\nfunction digest$1(message) {\n return message.id || computeDigest(message);\n}\n/**\n * Compute the message id using the XLIFF1 digest.\n */\nfunction computeDigest(message) {\n return sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`);\n}\n/**\n * Return the message id or compute it using the XLIFF2/XMB/$localize digest.\n */\nfunction decimalDigest(message) {\n return message.id || computeDecimalDigest(message);\n}\n/**\n * Compute the message id using the XLIFF2/XMB/$localize digest.\n */\nfunction computeDecimalDigest(message) {\n const visitor = new _SerializerIgnoreIcuExpVisitor();\n const parts = message.nodes.map((a) => a.visit(visitor, null));\n return computeMsgId(parts.join(''), message.meaning);\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * The visitor is also used in the i18n parser tests\n *\n * @internal\n */\nclass _SerializerVisitor {\n visitText(text, context) {\n return text.value;\n }\n visitContainer(container, context) {\n return `[${container.children.map((child) => child.visit(this)).join(', ')}]`;\n }\n visitIcu(icu, context) {\n const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n return `{${icu.expression}, ${icu.type}, ${strCases.join(', ')}}`;\n }\n visitTagPlaceholder(ph, context) {\n return ph.isVoid\n ? ``\n : `${ph.children\n .map((child) => child.visit(this))\n .join(', ')}`;\n }\n visitPlaceholder(ph, context) {\n return ph.value ? `${ph.value}` : ``;\n }\n visitIcuPlaceholder(ph, context) {\n return `${ph.value.visit(this)}`;\n }\n visitBlockPlaceholder(ph, context) {\n return `${ph.children\n .map((child) => child.visit(this))\n .join(', ')}`;\n }\n}\nconst serializerVisitor$1 = new _SerializerVisitor();\nfunction serializeNodes(nodes) {\n return nodes.map((a) => a.visit(serializerVisitor$1, null));\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.\n *\n * @internal\n */\nclass _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {\n visitIcu(icu) {\n let strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n // Do not take the expression into account\n return `{${icu.type}, ${strCases.join(', ')}}`;\n }\n}\n/**\n * Compute the SHA1 of the given string\n *\n * see https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\n *\n * WARNING: this function has not been designed not tested with security in mind.\n * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.\n */\nfunction sha1(str) {\n textEncoder ??= new TextEncoder();\n const utf8 = [...textEncoder.encode(str)];\n const words32 = bytesToWords32(utf8, Endian.Big);\n const len = utf8.length * 8;\n const w = new Uint32Array(80);\n let a = 0x67452301, b = 0xefcdab89, c = 0x98badcfe, d = 0x10325476, e = 0xc3d2e1f0;\n words32[len >> 5] |= 0x80 << (24 - (len % 32));\n words32[(((len + 64) >> 9) << 4) + 15] = len;\n for (let i = 0; i < words32.length; i += 16) {\n const h0 = a, h1 = b, h2 = c, h3 = d, h4 = e;\n for (let j = 0; j < 80; j++) {\n if (j < 16) {\n w[j] = words32[i + j];\n }\n else {\n w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n }\n const fkVal = fk(j, b, c, d);\n const f = fkVal[0];\n const k = fkVal[1];\n const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n e = d;\n d = c;\n c = rol32(b, 30);\n b = a;\n a = temp;\n }\n a = add32(a, h0);\n b = add32(b, h1);\n c = add32(c, h2);\n d = add32(d, h3);\n e = add32(e, h4);\n }\n // Convert the output parts to a 160-bit hexadecimal string\n return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);\n}\n/**\n * Convert and format a number as a string representing a 32-bit unsigned hexadecimal number.\n * @param value The value to format as a string.\n * @returns A hexadecimal string representing the value.\n */\nfunction toHexU32(value) {\n // unsigned right shift of zero ensures an unsigned 32-bit number\n return (value >>> 0).toString(16).padStart(8, '0');\n}\nfunction fk(index, b, c, d) {\n if (index < 20) {\n return [(b & c) | (~b & d), 0x5a827999];\n }\n if (index < 40) {\n return [b ^ c ^ d, 0x6ed9eba1];\n }\n if (index < 60) {\n return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];\n }\n return [b ^ c ^ d, 0xca62c1d6];\n}\n/**\n * Compute the fingerprint of the given string\n *\n * The output is 64 bit number encoded as a decimal string\n *\n * based on:\n * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java\n */\nfunction fingerprint(str) {\n textEncoder ??= new TextEncoder();\n const utf8 = textEncoder.encode(str);\n const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);\n let hi = hash32(view, utf8.length, 0);\n let lo = hash32(view, utf8.length, 102072);\n if (hi == 0 && (lo == 0 || lo == 1)) {\n hi = hi ^ 0x130f9bef;\n lo = lo ^ -0x6b5f56d8;\n }\n return (BigInt.asUintN(32, BigInt(hi)) << BigInt(32)) | BigInt.asUintN(32, BigInt(lo));\n}\nfunction computeMsgId(msg, meaning = '') {\n let msgFingerprint = fingerprint(msg);\n if (meaning) {\n // Rotate the 64-bit message fingerprint one bit to the left and then add the meaning\n // fingerprint.\n msgFingerprint =\n BigInt.asUintN(64, msgFingerprint << BigInt(1)) |\n ((msgFingerprint >> BigInt(63)) & BigInt(1));\n msgFingerprint += fingerprint(meaning);\n }\n return BigInt.asUintN(63, msgFingerprint).toString();\n}\nfunction hash32(view, length, c) {\n let a = 0x9e3779b9, b = 0x9e3779b9;\n let index = 0;\n const end = length - 12;\n for (; index <= end; index += 12) {\n a += view.getUint32(index, true);\n b += view.getUint32(index + 4, true);\n c += view.getUint32(index + 8, true);\n const res = mix(a, b, c);\n (a = res[0]), (b = res[1]), (c = res[2]);\n }\n const remainder = length - index;\n // the first byte of c is reserved for the length\n c += length;\n if (remainder >= 4) {\n a += view.getUint32(index, true);\n index += 4;\n if (remainder >= 8) {\n b += view.getUint32(index, true);\n index += 4;\n // Partial 32-bit word for c\n if (remainder >= 9) {\n c += view.getUint8(index++) << 8;\n }\n if (remainder >= 10) {\n c += view.getUint8(index++) << 16;\n }\n if (remainder === 11) {\n c += view.getUint8(index++) << 24;\n }\n }\n else {\n // Partial 32-bit word for b\n if (remainder >= 5) {\n b += view.getUint8(index++);\n }\n if (remainder >= 6) {\n b += view.getUint8(index++) << 8;\n }\n if (remainder === 7) {\n b += view.getUint8(index++) << 16;\n }\n }\n }\n else {\n // Partial 32-bit word for a\n if (remainder >= 1) {\n a += view.getUint8(index++);\n }\n if (remainder >= 2) {\n a += view.getUint8(index++) << 8;\n }\n if (remainder === 3) {\n a += view.getUint8(index++) << 16;\n }\n }\n return mix(a, b, c)[2];\n}\nfunction mix(a, b, c) {\n a -= b;\n a -= c;\n a ^= c >>> 13;\n b -= c;\n b -= a;\n b ^= a << 8;\n c -= a;\n c -= b;\n c ^= b >>> 13;\n a -= b;\n a -= c;\n a ^= c >>> 12;\n b -= c;\n b -= a;\n b ^= a << 16;\n c -= a;\n c -= b;\n c ^= b >>> 5;\n a -= b;\n a -= c;\n a ^= c >>> 3;\n b -= c;\n b -= a;\n b ^= a << 10;\n c -= a;\n c -= b;\n c ^= b >>> 15;\n return [a, b, c];\n}\n// Utils\nvar Endian;\n(function (Endian) {\n Endian[Endian[\"Little\"] = 0] = \"Little\";\n Endian[Endian[\"Big\"] = 1] = \"Big\";\n})(Endian || (Endian = {}));\nfunction add32(a, b) {\n return add32to64(a, b)[1];\n}\nfunction add32to64(a, b) {\n const low = (a & 0xffff) + (b & 0xffff);\n const high = (a >>> 16) + (b >>> 16) + (low >>> 16);\n return [high >>> 16, (high << 16) | (low & 0xffff)];\n}\n// Rotate a 32b number left `count` position\nfunction rol32(a, count) {\n return (a << count) | (a >>> (32 - count));\n}\nfunction bytesToWords32(bytes, endian) {\n const size = (bytes.length + 3) >>> 2;\n const words32 = [];\n for (let i = 0; i < size; i++) {\n words32[i] = wordAt(bytes, i * 4, endian);\n }\n return words32;\n}\nfunction byteAt(bytes, index) {\n return index >= bytes.length ? 0 : bytes[index];\n}\nfunction wordAt(bytes, index, endian) {\n let word = 0;\n if (endian === Endian.Big) {\n for (let i = 0; i < 4; i++) {\n word += byteAt(bytes, index + i) << (24 - 8 * i);\n }\n }\n else {\n for (let i = 0; i < 4; i++) {\n word += byteAt(bytes, index + i) << (8 * i);\n }\n }\n return word;\n}\n\n//// Types\nvar TypeModifier;\n(function (TypeModifier) {\n TypeModifier[TypeModifier[\"None\"] = 0] = \"None\";\n TypeModifier[TypeModifier[\"Const\"] = 1] = \"Const\";\n})(TypeModifier || (TypeModifier = {}));\nclass Type {\n modifiers;\n constructor(modifiers = TypeModifier.None) {\n this.modifiers = modifiers;\n }\n hasModifier(modifier) {\n return (this.modifiers & modifier) !== 0;\n }\n}\nvar BuiltinTypeName;\n(function (BuiltinTypeName) {\n BuiltinTypeName[BuiltinTypeName[\"Dynamic\"] = 0] = \"Dynamic\";\n BuiltinTypeName[BuiltinTypeName[\"Bool\"] = 1] = \"Bool\";\n BuiltinTypeName[BuiltinTypeName[\"String\"] = 2] = \"String\";\n BuiltinTypeName[BuiltinTypeName[\"Int\"] = 3] = \"Int\";\n BuiltinTypeName[BuiltinTypeName[\"Number\"] = 4] = \"Number\";\n BuiltinTypeName[BuiltinTypeName[\"Function\"] = 5] = \"Function\";\n BuiltinTypeName[BuiltinTypeName[\"Inferred\"] = 6] = \"Inferred\";\n BuiltinTypeName[BuiltinTypeName[\"None\"] = 7] = \"None\";\n})(BuiltinTypeName || (BuiltinTypeName = {}));\nclass BuiltinType extends Type {\n name;\n constructor(name, modifiers) {\n super(modifiers);\n this.name = name;\n }\n visitType(visitor, context) {\n return visitor.visitBuiltinType(this, context);\n }\n}\nclass ExpressionType extends Type {\n value;\n typeParams;\n constructor(value, modifiers, typeParams = null) {\n super(modifiers);\n this.value = value;\n this.typeParams = typeParams;\n }\n visitType(visitor, context) {\n return visitor.visitExpressionType(this, context);\n }\n}\nclass ArrayType extends Type {\n of;\n constructor(of, modifiers) {\n super(modifiers);\n this.of = of;\n }\n visitType(visitor, context) {\n return visitor.visitArrayType(this, context);\n }\n}\nclass MapType extends Type {\n valueType;\n constructor(valueType, modifiers) {\n super(modifiers);\n this.valueType = valueType || null;\n }\n visitType(visitor, context) {\n return visitor.visitMapType(this, context);\n }\n}\nclass TransplantedType extends Type {\n type;\n constructor(type, modifiers) {\n super(modifiers);\n this.type = type;\n }\n visitType(visitor, context) {\n return visitor.visitTransplantedType(this, context);\n }\n}\nconst DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);\nconst INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);\nconst BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);\nconst INT_TYPE = new BuiltinType(BuiltinTypeName.Int);\nconst NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);\nconst STRING_TYPE = new BuiltinType(BuiltinTypeName.String);\nconst FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);\nconst NONE_TYPE = new BuiltinType(BuiltinTypeName.None);\n///// Expressions\nvar UnaryOperator;\n(function (UnaryOperator) {\n UnaryOperator[UnaryOperator[\"Minus\"] = 0] = \"Minus\";\n UnaryOperator[UnaryOperator[\"Plus\"] = 1] = \"Plus\";\n})(UnaryOperator || (UnaryOperator = {}));\nvar BinaryOperator;\n(function (BinaryOperator) {\n BinaryOperator[BinaryOperator[\"Equals\"] = 0] = \"Equals\";\n BinaryOperator[BinaryOperator[\"NotEquals\"] = 1] = \"NotEquals\";\n BinaryOperator[BinaryOperator[\"Assign\"] = 2] = \"Assign\";\n BinaryOperator[BinaryOperator[\"Identical\"] = 3] = \"Identical\";\n BinaryOperator[BinaryOperator[\"NotIdentical\"] = 4] = \"NotIdentical\";\n BinaryOperator[BinaryOperator[\"Minus\"] = 5] = \"Minus\";\n BinaryOperator[BinaryOperator[\"Plus\"] = 6] = \"Plus\";\n BinaryOperator[BinaryOperator[\"Divide\"] = 7] = \"Divide\";\n BinaryOperator[BinaryOperator[\"Multiply\"] = 8] = \"Multiply\";\n BinaryOperator[BinaryOperator[\"Modulo\"] = 9] = \"Modulo\";\n BinaryOperator[BinaryOperator[\"And\"] = 10] = \"And\";\n BinaryOperator[BinaryOperator[\"Or\"] = 11] = \"Or\";\n BinaryOperator[BinaryOperator[\"BitwiseOr\"] = 12] = \"BitwiseOr\";\n BinaryOperator[BinaryOperator[\"BitwiseAnd\"] = 13] = \"BitwiseAnd\";\n BinaryOperator[BinaryOperator[\"Lower\"] = 14] = \"Lower\";\n BinaryOperator[BinaryOperator[\"LowerEquals\"] = 15] = \"LowerEquals\";\n BinaryOperator[BinaryOperator[\"Bigger\"] = 16] = \"Bigger\";\n BinaryOperator[BinaryOperator[\"BiggerEquals\"] = 17] = \"BiggerEquals\";\n BinaryOperator[BinaryOperator[\"NullishCoalesce\"] = 18] = \"NullishCoalesce\";\n BinaryOperator[BinaryOperator[\"Exponentiation\"] = 19] = \"Exponentiation\";\n BinaryOperator[BinaryOperator[\"In\"] = 20] = \"In\";\n BinaryOperator[BinaryOperator[\"AdditionAssignment\"] = 21] = \"AdditionAssignment\";\n BinaryOperator[BinaryOperator[\"SubtractionAssignment\"] = 22] = \"SubtractionAssignment\";\n BinaryOperator[BinaryOperator[\"MultiplicationAssignment\"] = 23] = \"MultiplicationAssignment\";\n BinaryOperator[BinaryOperator[\"DivisionAssignment\"] = 24] = \"DivisionAssignment\";\n BinaryOperator[BinaryOperator[\"RemainderAssignment\"] = 25] = \"RemainderAssignment\";\n BinaryOperator[BinaryOperator[\"ExponentiationAssignment\"] = 26] = \"ExponentiationAssignment\";\n BinaryOperator[BinaryOperator[\"AndAssignment\"] = 27] = \"AndAssignment\";\n BinaryOperator[BinaryOperator[\"OrAssignment\"] = 28] = \"OrAssignment\";\n BinaryOperator[BinaryOperator[\"NullishCoalesceAssignment\"] = 29] = \"NullishCoalesceAssignment\";\n})(BinaryOperator || (BinaryOperator = {}));\nfunction nullSafeIsEquivalent(base, other) {\n if (base == null || other == null) {\n return base == other;\n }\n return base.isEquivalent(other);\n}\nfunction areAllEquivalentPredicate(base, other, equivalentPredicate) {\n const len = base.length;\n if (len !== other.length) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (!equivalentPredicate(base[i], other[i])) {\n return false;\n }\n }\n return true;\n}\nfunction areAllEquivalent(base, other) {\n return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement));\n}\nclass Expression {\n type;\n sourceSpan;\n constructor(type, sourceSpan) {\n this.type = type || null;\n this.sourceSpan = sourceSpan || null;\n }\n prop(name, sourceSpan) {\n return new ReadPropExpr(this, name, null, sourceSpan);\n }\n key(index, type, sourceSpan) {\n return new ReadKeyExpr(this, index, type, sourceSpan);\n }\n callFn(params, sourceSpan, pure) {\n return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);\n }\n instantiate(params, type, sourceSpan) {\n return new InstantiateExpr(this, params, type, sourceSpan);\n }\n conditional(trueCase, falseCase = null, sourceSpan) {\n return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);\n }\n equals(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);\n }\n notEquals(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);\n }\n identical(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);\n }\n notIdentical(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);\n }\n minus(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);\n }\n plus(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);\n }\n divide(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);\n }\n multiply(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);\n }\n modulo(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);\n }\n power(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Exponentiation, this, rhs, null, sourceSpan);\n }\n and(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);\n }\n bitwiseOr(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan);\n }\n bitwiseAnd(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan);\n }\n or(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);\n }\n lower(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);\n }\n lowerEquals(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);\n }\n bigger(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);\n }\n biggerEquals(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);\n }\n isBlank(sourceSpan) {\n // Note: We use equals by purpose here to compare to null and undefined in JS.\n // We use the typed null to allow strictNullChecks to narrow types.\n return this.equals(TYPED_NULL_EXPR, sourceSpan);\n }\n nullishCoalesce(rhs, sourceSpan) {\n return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);\n }\n toStmt() {\n return new ExpressionStatement(this, null);\n }\n}\nclass ReadVarExpr extends Expression {\n name;\n constructor(name, type, sourceSpan) {\n super(type, sourceSpan);\n this.name = name;\n }\n isEquivalent(e) {\n return e instanceof ReadVarExpr && this.name === e.name;\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitReadVarExpr(this, context);\n }\n clone() {\n return new ReadVarExpr(this.name, this.type, this.sourceSpan);\n }\n set(value) {\n return new BinaryOperatorExpr(BinaryOperator.Assign, this, value, null, this.sourceSpan);\n }\n}\nclass TypeofExpr extends Expression {\n expr;\n constructor(expr, type, sourceSpan) {\n super(type, sourceSpan);\n this.expr = expr;\n }\n visitExpression(visitor, context) {\n return visitor.visitTypeofExpr(this, context);\n }\n isEquivalent(e) {\n return e instanceof TypeofExpr && e.expr.isEquivalent(this.expr);\n }\n isConstant() {\n return this.expr.isConstant();\n }\n clone() {\n return new TypeofExpr(this.expr.clone());\n }\n}\nclass VoidExpr extends Expression {\n expr;\n constructor(expr, type, sourceSpan) {\n super(type, sourceSpan);\n this.expr = expr;\n }\n visitExpression(visitor, context) {\n return visitor.visitVoidExpr(this, context);\n }\n isEquivalent(e) {\n return e instanceof VoidExpr && e.expr.isEquivalent(this.expr);\n }\n isConstant() {\n return this.expr.isConstant();\n }\n clone() {\n return new VoidExpr(this.expr.clone());\n }\n}\nclass WrappedNodeExpr extends Expression {\n node;\n constructor(node, type, sourceSpan) {\n super(type, sourceSpan);\n this.node = node;\n }\n isEquivalent(e) {\n return e instanceof WrappedNodeExpr && this.node === e.node;\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitWrappedNodeExpr(this, context);\n }\n clone() {\n return new WrappedNodeExpr(this.node, this.type, this.sourceSpan);\n }\n}\nclass InvokeFunctionExpr extends Expression {\n fn;\n args;\n pure;\n constructor(fn, args, type, sourceSpan, pure = false) {\n super(type, sourceSpan);\n this.fn = fn;\n this.args = args;\n this.pure = pure;\n }\n // An alias for fn, which allows other logic to handle calls and property reads together.\n get receiver() {\n return this.fn;\n }\n isEquivalent(e) {\n return (e instanceof InvokeFunctionExpr &&\n this.fn.isEquivalent(e.fn) &&\n areAllEquivalent(this.args, e.args) &&\n this.pure === e.pure);\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitInvokeFunctionExpr(this, context);\n }\n clone() {\n return new InvokeFunctionExpr(this.fn.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan, this.pure);\n }\n}\nclass TaggedTemplateLiteralExpr extends Expression {\n tag;\n template;\n constructor(tag, template, type, sourceSpan) {\n super(type, sourceSpan);\n this.tag = tag;\n this.template = template;\n }\n isEquivalent(e) {\n return (e instanceof TaggedTemplateLiteralExpr &&\n this.tag.isEquivalent(e.tag) &&\n this.template.isEquivalent(e.template));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitTaggedTemplateLiteralExpr(this, context);\n }\n clone() {\n return new TaggedTemplateLiteralExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan);\n }\n}\nclass InstantiateExpr extends Expression {\n classExpr;\n args;\n constructor(classExpr, args, type, sourceSpan) {\n super(type, sourceSpan);\n this.classExpr = classExpr;\n this.args = args;\n }\n isEquivalent(e) {\n return (e instanceof InstantiateExpr &&\n this.classExpr.isEquivalent(e.classExpr) &&\n areAllEquivalent(this.args, e.args));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitInstantiateExpr(this, context);\n }\n clone() {\n return new InstantiateExpr(this.classExpr.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan);\n }\n}\nclass LiteralExpr extends Expression {\n value;\n constructor(value, type, sourceSpan) {\n super(type, sourceSpan);\n this.value = value;\n }\n isEquivalent(e) {\n return e instanceof LiteralExpr && this.value === e.value;\n }\n isConstant() {\n return true;\n }\n visitExpression(visitor, context) {\n return visitor.visitLiteralExpr(this, context);\n }\n clone() {\n return new LiteralExpr(this.value, this.type, this.sourceSpan);\n }\n}\nclass TemplateLiteralExpr extends Expression {\n elements;\n expressions;\n constructor(elements, expressions, sourceSpan) {\n super(null, sourceSpan);\n this.elements = elements;\n this.expressions = expressions;\n }\n isEquivalent(e) {\n return (e instanceof TemplateLiteralExpr &&\n areAllEquivalentPredicate(this.elements, e.elements, (a, b) => a.text === b.text) &&\n areAllEquivalent(this.expressions, e.expressions));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitTemplateLiteralExpr(this, context);\n }\n clone() {\n return new TemplateLiteralExpr(this.elements.map((el) => el.clone()), this.expressions.map((expr) => expr.clone()));\n }\n}\nclass TemplateLiteralElementExpr extends Expression {\n text;\n rawText;\n constructor(text, sourceSpan, rawText) {\n super(STRING_TYPE, sourceSpan);\n this.text = text;\n // If `rawText` is not provided, \"fake\" the raw string by escaping the following sequences:\n // - \"\\\" would otherwise indicate that the next character is a control character.\n // - \"`\" and \"${\" are template string control sequences that would otherwise prematurely\n // indicate the end of the template literal element.\n // Note that we can't rely on the `sourceSpan` here, because it may be incorrect (see\n // https://github.com/angular/angular/pull/60267#discussion_r1986402524).\n this.rawText = rawText ?? escapeForTemplateLiteral(escapeSlashes(text));\n }\n visitExpression(visitor, context) {\n return visitor.visitTemplateLiteralElementExpr(this, context);\n }\n isEquivalent(e) {\n return (e instanceof TemplateLiteralElementExpr && e.text === this.text && e.rawText === this.rawText);\n }\n isConstant() {\n return true;\n }\n clone() {\n return new TemplateLiteralElementExpr(this.text, this.sourceSpan, this.rawText);\n }\n}\nclass LiteralPiece {\n text;\n sourceSpan;\n constructor(text, sourceSpan) {\n this.text = text;\n this.sourceSpan = sourceSpan;\n }\n}\nclass PlaceholderPiece {\n text;\n sourceSpan;\n associatedMessage;\n /**\n * Create a new instance of a `PlaceholderPiece`.\n *\n * @param text the name of this placeholder (e.g. `PH_1`).\n * @param sourceSpan the location of this placeholder in its localized message the source code.\n * @param associatedMessage reference to another message that this placeholder is associated with.\n * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has\n * been extracted out from the message containing the placeholder.\n */\n constructor(text, sourceSpan, associatedMessage) {\n this.text = text;\n this.sourceSpan = sourceSpan;\n this.associatedMessage = associatedMessage;\n }\n}\nconst MEANING_SEPARATOR$1 = '|';\nconst ID_SEPARATOR$1 = '@@';\nconst LEGACY_ID_INDICATOR = '␟';\nclass LocalizedString extends Expression {\n metaBlock;\n messageParts;\n placeHolderNames;\n expressions;\n constructor(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan) {\n super(STRING_TYPE, sourceSpan);\n this.metaBlock = metaBlock;\n this.messageParts = messageParts;\n this.placeHolderNames = placeHolderNames;\n this.expressions = expressions;\n }\n isEquivalent(e) {\n // return e instanceof LocalizedString && this.message === e.message;\n return false;\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitLocalizedString(this, context);\n }\n clone() {\n return new LocalizedString(this.metaBlock, this.messageParts, this.placeHolderNames, this.expressions.map((expr) => expr.clone()), this.sourceSpan);\n }\n /**\n * Serialize the given `meta` and `messagePart` into \"cooked\" and \"raw\" strings that can be used\n * in a `$localize` tagged string. The format of the metadata is the same as that parsed by\n * `parseI18nMeta()`.\n *\n * @param meta The metadata to serialize\n * @param messagePart The first part of the tagged string\n */\n serializeI18nHead() {\n let metaBlock = this.metaBlock.description || '';\n if (this.metaBlock.meaning) {\n metaBlock = `${this.metaBlock.meaning}${MEANING_SEPARATOR$1}${metaBlock}`;\n }\n if (this.metaBlock.customId) {\n metaBlock = `${metaBlock}${ID_SEPARATOR$1}${this.metaBlock.customId}`;\n }\n if (this.metaBlock.legacyIds) {\n this.metaBlock.legacyIds.forEach((legacyId) => {\n metaBlock = `${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`;\n });\n }\n return createCookedRawString(metaBlock, this.messageParts[0].text, this.getMessagePartSourceSpan(0));\n }\n getMessagePartSourceSpan(i) {\n return this.messageParts[i]?.sourceSpan ?? this.sourceSpan;\n }\n getPlaceholderSourceSpan(i) {\n return (this.placeHolderNames[i]?.sourceSpan ?? this.expressions[i]?.sourceSpan ?? this.sourceSpan);\n }\n /**\n * Serialize the given `placeholderName` and `messagePart` into \"cooked\" and \"raw\" strings that\n * can be used in a `$localize` tagged string.\n *\n * The format is `:[@@]:`.\n *\n * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder\n * refers.\n *\n * @param partIndex The index of the message part to serialize.\n */\n serializeI18nTemplatePart(partIndex) {\n const placeholder = this.placeHolderNames[partIndex - 1];\n const messagePart = this.messageParts[partIndex];\n let metaBlock = placeholder.text;\n if (placeholder.associatedMessage?.legacyIds.length === 0) {\n metaBlock += `${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString, placeholder.associatedMessage.meaning)}`;\n }\n return createCookedRawString(metaBlock, messagePart.text, this.getMessagePartSourceSpan(partIndex));\n }\n}\nconst escapeSlashes = (str) => str.replace(/\\\\/g, '\\\\\\\\');\nconst escapeStartingColon = (str) => str.replace(/^:/, '\\\\:');\nconst escapeColons = (str) => str.replace(/:/g, '\\\\:');\nconst escapeForTemplateLiteral = (str) => str.replace(/`/g, '\\\\`').replace(/\\${/g, '$\\\\{');\n/**\n * Creates a `{cooked, raw}` object from the `metaBlock` and `messagePart`.\n *\n * The `raw` text must have various character sequences escaped:\n * * \"\\\" would otherwise indicate that the next character is a control character.\n * * \"`\" and \"${\" are template string control sequences that would otherwise prematurely indicate\n * the end of a message part.\n * * \":\" inside a metablock would prematurely indicate the end of the metablock.\n * * \":\" at the start of a messagePart with no metablock would erroneously indicate the start of a\n * metablock.\n *\n * @param metaBlock Any metadata that should be prepended to the string\n * @param messagePart The message part of the string\n */\nfunction createCookedRawString(metaBlock, messagePart, range) {\n if (metaBlock === '') {\n return {\n cooked: messagePart,\n raw: escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),\n range,\n };\n }\n else {\n return {\n cooked: `:${metaBlock}:${messagePart}`,\n raw: escapeForTemplateLiteral(`:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`),\n range,\n };\n }\n}\nclass ExternalExpr extends Expression {\n value;\n typeParams;\n constructor(value, type, typeParams = null, sourceSpan) {\n super(type, sourceSpan);\n this.value = value;\n this.typeParams = typeParams;\n }\n isEquivalent(e) {\n return (e instanceof ExternalExpr &&\n this.value.name === e.value.name &&\n this.value.moduleName === e.value.moduleName);\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitExternalExpr(this, context);\n }\n clone() {\n return new ExternalExpr(this.value, this.type, this.typeParams, this.sourceSpan);\n }\n}\nclass ExternalReference {\n moduleName;\n name;\n constructor(moduleName, name) {\n this.moduleName = moduleName;\n this.name = name;\n }\n}\nclass ConditionalExpr extends Expression {\n condition;\n falseCase;\n trueCase;\n constructor(condition, trueCase, falseCase = null, type, sourceSpan) {\n super(type || trueCase.type, sourceSpan);\n this.condition = condition;\n this.falseCase = falseCase;\n this.trueCase = trueCase;\n }\n isEquivalent(e) {\n return (e instanceof ConditionalExpr &&\n this.condition.isEquivalent(e.condition) &&\n this.trueCase.isEquivalent(e.trueCase) &&\n nullSafeIsEquivalent(this.falseCase, e.falseCase));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitConditionalExpr(this, context);\n }\n clone() {\n return new ConditionalExpr(this.condition.clone(), this.trueCase.clone(), this.falseCase?.clone(), this.type, this.sourceSpan);\n }\n}\nclass DynamicImportExpr extends Expression {\n url;\n urlComment;\n constructor(url, sourceSpan, urlComment) {\n super(null, sourceSpan);\n this.url = url;\n this.urlComment = urlComment;\n }\n isEquivalent(e) {\n return e instanceof DynamicImportExpr && this.url === e.url && this.urlComment === e.urlComment;\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitDynamicImportExpr(this, context);\n }\n clone() {\n return new DynamicImportExpr(typeof this.url === 'string' ? this.url : this.url.clone(), this.sourceSpan, this.urlComment);\n }\n}\nclass NotExpr extends Expression {\n condition;\n constructor(condition, sourceSpan) {\n super(BOOL_TYPE, sourceSpan);\n this.condition = condition;\n }\n isEquivalent(e) {\n return e instanceof NotExpr && this.condition.isEquivalent(e.condition);\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitNotExpr(this, context);\n }\n clone() {\n return new NotExpr(this.condition.clone(), this.sourceSpan);\n }\n}\nclass FnParam {\n name;\n type;\n constructor(name, type = null) {\n this.name = name;\n this.type = type;\n }\n isEquivalent(param) {\n return this.name === param.name;\n }\n clone() {\n return new FnParam(this.name, this.type);\n }\n}\nclass FunctionExpr extends Expression {\n params;\n statements;\n name;\n constructor(params, statements, type, sourceSpan, name) {\n super(type, sourceSpan);\n this.params = params;\n this.statements = statements;\n this.name = name;\n }\n isEquivalent(e) {\n return ((e instanceof FunctionExpr || e instanceof DeclareFunctionStmt) &&\n areAllEquivalent(this.params, e.params) &&\n areAllEquivalent(this.statements, e.statements));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitFunctionExpr(this, context);\n }\n toDeclStmt(name, modifiers) {\n return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan);\n }\n clone() {\n // TODO: Should we deep clone statements?\n return new FunctionExpr(this.params.map((p) => p.clone()), this.statements, this.type, this.sourceSpan, this.name);\n }\n}\nclass ArrowFunctionExpr extends Expression {\n params;\n body;\n // Note that `body: Expression` represents `() => expr` whereas\n // `body: Statement[]` represents `() => { expr }`.\n constructor(params, body, type, sourceSpan) {\n super(type, sourceSpan);\n this.params = params;\n this.body = body;\n }\n isEquivalent(e) {\n if (!(e instanceof ArrowFunctionExpr) || !areAllEquivalent(this.params, e.params)) {\n return false;\n }\n if (this.body instanceof Expression && e.body instanceof Expression) {\n return this.body.isEquivalent(e.body);\n }\n if (Array.isArray(this.body) && Array.isArray(e.body)) {\n return areAllEquivalent(this.body, e.body);\n }\n return false;\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitArrowFunctionExpr(this, context);\n }\n clone() {\n // TODO: Should we deep clone statements?\n return new ArrowFunctionExpr(this.params.map((p) => p.clone()), Array.isArray(this.body) ? this.body : this.body.clone(), this.type, this.sourceSpan);\n }\n toDeclStmt(name, modifiers) {\n return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan);\n }\n}\nclass UnaryOperatorExpr extends Expression {\n operator;\n expr;\n parens;\n constructor(operator, expr, type, sourceSpan, parens = true) {\n super(type || NUMBER_TYPE, sourceSpan);\n this.operator = operator;\n this.expr = expr;\n this.parens = parens;\n }\n isEquivalent(e) {\n return (e instanceof UnaryOperatorExpr &&\n this.operator === e.operator &&\n this.expr.isEquivalent(e.expr));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitUnaryOperatorExpr(this, context);\n }\n clone() {\n return new UnaryOperatorExpr(this.operator, this.expr.clone(), this.type, this.sourceSpan, this.parens);\n }\n}\nclass ParenthesizedExpr extends Expression {\n expr;\n constructor(expr, type, sourceSpan) {\n super(type, sourceSpan);\n this.expr = expr;\n }\n visitExpression(visitor, context) {\n return visitor.visitParenthesizedExpr(this, context);\n }\n isEquivalent(e) {\n // TODO: should this ignore paren depth? i.e. is `(1)` equivalent to `1`?\n return e instanceof ParenthesizedExpr && e.expr.isEquivalent(this.expr);\n }\n isConstant() {\n return this.expr.isConstant();\n }\n clone() {\n return new ParenthesizedExpr(this.expr.clone());\n }\n}\nclass BinaryOperatorExpr extends Expression {\n operator;\n rhs;\n lhs;\n constructor(operator, lhs, rhs, type, sourceSpan) {\n super(type || lhs.type, sourceSpan);\n this.operator = operator;\n this.rhs = rhs;\n this.lhs = lhs;\n }\n isEquivalent(e) {\n return (e instanceof BinaryOperatorExpr &&\n this.operator === e.operator &&\n this.lhs.isEquivalent(e.lhs) &&\n this.rhs.isEquivalent(e.rhs));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitBinaryOperatorExpr(this, context);\n }\n clone() {\n return new BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan);\n }\n isAssignment() {\n const op = this.operator;\n return (op === BinaryOperator.Assign ||\n op === BinaryOperator.AdditionAssignment ||\n op === BinaryOperator.SubtractionAssignment ||\n op === BinaryOperator.MultiplicationAssignment ||\n op === BinaryOperator.DivisionAssignment ||\n op === BinaryOperator.RemainderAssignment ||\n op === BinaryOperator.ExponentiationAssignment ||\n op === BinaryOperator.AndAssignment ||\n op === BinaryOperator.OrAssignment ||\n op === BinaryOperator.NullishCoalesceAssignment);\n }\n}\nclass ReadPropExpr extends Expression {\n receiver;\n name;\n constructor(receiver, name, type, sourceSpan) {\n super(type, sourceSpan);\n this.receiver = receiver;\n this.name = name;\n }\n // An alias for name, which allows other logic to handle property reads and keyed reads together.\n get index() {\n return this.name;\n }\n isEquivalent(e) {\n return (e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name);\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitReadPropExpr(this, context);\n }\n set(value) {\n return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.prop(this.name), value, null, this.sourceSpan);\n }\n clone() {\n return new ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan);\n }\n}\nclass ReadKeyExpr extends Expression {\n receiver;\n index;\n constructor(receiver, index, type, sourceSpan) {\n super(type, sourceSpan);\n this.receiver = receiver;\n this.index = index;\n }\n isEquivalent(e) {\n return (e instanceof ReadKeyExpr &&\n this.receiver.isEquivalent(e.receiver) &&\n this.index.isEquivalent(e.index));\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitReadKeyExpr(this, context);\n }\n set(value) {\n return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.key(this.index), value, null, this.sourceSpan);\n }\n clone() {\n return new ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan);\n }\n}\nclass LiteralArrayExpr extends Expression {\n entries;\n constructor(entries, type, sourceSpan) {\n super(type, sourceSpan);\n this.entries = entries;\n }\n isConstant() {\n return this.entries.every((e) => e.isConstant());\n }\n isEquivalent(e) {\n return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);\n }\n visitExpression(visitor, context) {\n return visitor.visitLiteralArrayExpr(this, context);\n }\n clone() {\n return new LiteralArrayExpr(this.entries.map((e) => e.clone()), this.type, this.sourceSpan);\n }\n}\nclass LiteralMapEntry {\n key;\n value;\n quoted;\n constructor(key, value, quoted) {\n this.key = key;\n this.value = value;\n this.quoted = quoted;\n }\n isEquivalent(e) {\n return this.key === e.key && this.value.isEquivalent(e.value);\n }\n clone() {\n return new LiteralMapEntry(this.key, this.value.clone(), this.quoted);\n }\n}\nclass LiteralMapExpr extends Expression {\n entries;\n valueType = null;\n constructor(entries, type, sourceSpan) {\n super(type, sourceSpan);\n this.entries = entries;\n if (type) {\n this.valueType = type.valueType;\n }\n }\n isEquivalent(e) {\n return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);\n }\n isConstant() {\n return this.entries.every((e) => e.value.isConstant());\n }\n visitExpression(visitor, context) {\n return visitor.visitLiteralMapExpr(this, context);\n }\n clone() {\n const entriesClone = this.entries.map((entry) => entry.clone());\n return new LiteralMapExpr(entriesClone, this.type, this.sourceSpan);\n }\n}\nclass CommaExpr extends Expression {\n parts;\n constructor(parts, sourceSpan) {\n super(parts[parts.length - 1].type, sourceSpan);\n this.parts = parts;\n }\n isEquivalent(e) {\n return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);\n }\n isConstant() {\n return false;\n }\n visitExpression(visitor, context) {\n return visitor.visitCommaExpr(this, context);\n }\n clone() {\n return new CommaExpr(this.parts.map((p) => p.clone()));\n }\n}\nconst NULL_EXPR = new LiteralExpr(null, null, null);\nconst TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);\n//// Statements\nvar StmtModifier;\n(function (StmtModifier) {\n StmtModifier[StmtModifier[\"None\"] = 0] = \"None\";\n StmtModifier[StmtModifier[\"Final\"] = 1] = \"Final\";\n StmtModifier[StmtModifier[\"Private\"] = 2] = \"Private\";\n StmtModifier[StmtModifier[\"Exported\"] = 4] = \"Exported\";\n StmtModifier[StmtModifier[\"Static\"] = 8] = \"Static\";\n})(StmtModifier || (StmtModifier = {}));\nclass LeadingComment {\n text;\n multiline;\n trailingNewline;\n constructor(text, multiline, trailingNewline) {\n this.text = text;\n this.multiline = multiline;\n this.trailingNewline = trailingNewline;\n }\n toString() {\n return this.multiline ? ` ${this.text} ` : this.text;\n }\n}\nclass JSDocComment extends LeadingComment {\n tags;\n constructor(tags) {\n super('', /* multiline */ true, /* trailingNewline */ true);\n this.tags = tags;\n }\n toString() {\n return serializeTags(this.tags);\n }\n}\nclass Statement {\n modifiers;\n sourceSpan;\n leadingComments;\n constructor(modifiers = StmtModifier.None, sourceSpan = null, leadingComments) {\n this.modifiers = modifiers;\n this.sourceSpan = sourceSpan;\n this.leadingComments = leadingComments;\n }\n hasModifier(modifier) {\n return (this.modifiers & modifier) !== 0;\n }\n addLeadingComment(leadingComment) {\n this.leadingComments = this.leadingComments ?? [];\n this.leadingComments.push(leadingComment);\n }\n}\nclass DeclareVarStmt extends Statement {\n name;\n value;\n type;\n constructor(name, value, type, modifiers, sourceSpan, leadingComments) {\n super(modifiers, sourceSpan, leadingComments);\n this.name = name;\n this.value = value;\n this.type = type || (value && value.type) || null;\n }\n isEquivalent(stmt) {\n return (stmt instanceof DeclareVarStmt &&\n this.name === stmt.name &&\n (this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value));\n }\n visitStatement(visitor, context) {\n return visitor.visitDeclareVarStmt(this, context);\n }\n}\nclass DeclareFunctionStmt extends Statement {\n name;\n params;\n statements;\n type;\n constructor(name, params, statements, type, modifiers, sourceSpan, leadingComments) {\n super(modifiers, sourceSpan, leadingComments);\n this.name = name;\n this.params = params;\n this.statements = statements;\n this.type = type || null;\n }\n isEquivalent(stmt) {\n return (stmt instanceof DeclareFunctionStmt &&\n areAllEquivalent(this.params, stmt.params) &&\n areAllEquivalent(this.statements, stmt.statements));\n }\n visitStatement(visitor, context) {\n return visitor.visitDeclareFunctionStmt(this, context);\n }\n}\nclass ExpressionStatement extends Statement {\n expr;\n constructor(expr, sourceSpan, leadingComments) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n this.expr = expr;\n }\n isEquivalent(stmt) {\n return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);\n }\n visitStatement(visitor, context) {\n return visitor.visitExpressionStmt(this, context);\n }\n}\nclass ReturnStatement extends Statement {\n value;\n constructor(value, sourceSpan = null, leadingComments) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n this.value = value;\n }\n isEquivalent(stmt) {\n return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);\n }\n visitStatement(visitor, context) {\n return visitor.visitReturnStmt(this, context);\n }\n}\nclass IfStmt extends Statement {\n condition;\n trueCase;\n falseCase;\n constructor(condition, trueCase, falseCase = [], sourceSpan, leadingComments) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n this.condition = condition;\n this.trueCase = trueCase;\n this.falseCase = falseCase;\n }\n isEquivalent(stmt) {\n return (stmt instanceof IfStmt &&\n this.condition.isEquivalent(stmt.condition) &&\n areAllEquivalent(this.trueCase, stmt.trueCase) &&\n areAllEquivalent(this.falseCase, stmt.falseCase));\n }\n visitStatement(visitor, context) {\n return visitor.visitIfStmt(this, context);\n }\n}\nlet RecursiveAstVisitor$1 = class RecursiveAstVisitor {\n visitType(ast, context) {\n return ast;\n }\n visitExpression(ast, context) {\n if (ast.type) {\n ast.type.visitType(this, context);\n }\n return ast;\n }\n visitBuiltinType(type, context) {\n return this.visitType(type, context);\n }\n visitExpressionType(type, context) {\n type.value.visitExpression(this, context);\n if (type.typeParams !== null) {\n type.typeParams.forEach((param) => this.visitType(param, context));\n }\n return this.visitType(type, context);\n }\n visitArrayType(type, context) {\n return this.visitType(type, context);\n }\n visitMapType(type, context) {\n return this.visitType(type, context);\n }\n visitTransplantedType(type, context) {\n return type;\n }\n visitWrappedNodeExpr(ast, context) {\n return ast;\n }\n visitReadVarExpr(ast, context) {\n return this.visitExpression(ast, context);\n }\n visitDynamicImportExpr(ast, context) {\n return this.visitExpression(ast, context);\n }\n visitInvokeFunctionExpr(ast, context) {\n ast.fn.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n }\n visitTaggedTemplateLiteralExpr(ast, context) {\n ast.tag.visitExpression(this, context);\n ast.template.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitInstantiateExpr(ast, context) {\n ast.classExpr.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralExpr(ast, context) {\n return this.visitExpression(ast, context);\n }\n visitLocalizedString(ast, context) {\n return this.visitExpression(ast, context);\n }\n visitExternalExpr(ast, context) {\n if (ast.typeParams) {\n ast.typeParams.forEach((type) => type.visitType(this, context));\n }\n return this.visitExpression(ast, context);\n }\n visitConditionalExpr(ast, context) {\n ast.condition.visitExpression(this, context);\n ast.trueCase.visitExpression(this, context);\n ast.falseCase.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitNotExpr(ast, context) {\n ast.condition.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitFunctionExpr(ast, context) {\n this.visitAllStatements(ast.statements, context);\n return this.visitExpression(ast, context);\n }\n visitArrowFunctionExpr(ast, context) {\n if (Array.isArray(ast.body)) {\n this.visitAllStatements(ast.body, context);\n }\n else {\n // Note: `body.visitExpression`, rather than `this.visitExpressiont(body)`,\n // because the latter won't recurse into the sub-expressions.\n ast.body.visitExpression(this, context);\n }\n return this.visitExpression(ast, context);\n }\n visitUnaryOperatorExpr(ast, context) {\n ast.expr.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitTypeofExpr(ast, context) {\n ast.expr.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitVoidExpr(ast, context) {\n ast.expr.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitBinaryOperatorExpr(ast, context) {\n ast.lhs.visitExpression(this, context);\n ast.rhs.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitReadPropExpr(ast, context) {\n ast.receiver.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitReadKeyExpr(ast, context) {\n ast.receiver.visitExpression(this, context);\n ast.index.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralArrayExpr(ast, context) {\n this.visitAllExpressions(ast.entries, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralMapExpr(ast, context) {\n ast.entries.forEach((entry) => entry.value.visitExpression(this, context));\n return this.visitExpression(ast, context);\n }\n visitCommaExpr(ast, context) {\n this.visitAllExpressions(ast.parts, context);\n return this.visitExpression(ast, context);\n }\n visitTemplateLiteralExpr(ast, context) {\n this.visitAllExpressions(ast.elements, context);\n this.visitAllExpressions(ast.expressions, context);\n return this.visitExpression(ast, context);\n }\n visitTemplateLiteralElementExpr(ast, context) {\n return this.visitExpression(ast, context);\n }\n visitParenthesizedExpr(ast, context) {\n ast.expr.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitAllExpressions(exprs, context) {\n exprs.forEach((expr) => expr.visitExpression(this, context));\n }\n visitDeclareVarStmt(stmt, context) {\n if (stmt.value) {\n stmt.value.visitExpression(this, context);\n }\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n }\n visitDeclareFunctionStmt(stmt, context) {\n this.visitAllStatements(stmt.statements, context);\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n }\n visitExpressionStmt(stmt, context) {\n stmt.expr.visitExpression(this, context);\n return stmt;\n }\n visitReturnStmt(stmt, context) {\n stmt.value.visitExpression(this, context);\n return stmt;\n }\n visitIfStmt(stmt, context) {\n stmt.condition.visitExpression(this, context);\n this.visitAllStatements(stmt.trueCase, context);\n this.visitAllStatements(stmt.falseCase, context);\n return stmt;\n }\n visitAllStatements(stmts, context) {\n stmts.forEach((stmt) => stmt.visitStatement(this, context));\n }\n};\nfunction leadingComment(text, multiline = false, trailingNewline = true) {\n return new LeadingComment(text, multiline, trailingNewline);\n}\nfunction jsDocComment(tags = []) {\n return new JSDocComment(tags);\n}\nfunction variable(name, type, sourceSpan) {\n return new ReadVarExpr(name, type, sourceSpan);\n}\nfunction importExpr(id, typeParams = null, sourceSpan) {\n return new ExternalExpr(id, null, typeParams, sourceSpan);\n}\nfunction importType(id, typeParams, typeModifiers) {\n return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;\n}\nfunction expressionType(expr, typeModifiers, typeParams) {\n return new ExpressionType(expr, typeModifiers, typeParams);\n}\nfunction transplantedType(type, typeModifiers) {\n return new TransplantedType(type, typeModifiers);\n}\nfunction typeofExpr(expr) {\n return new TypeofExpr(expr);\n}\nfunction literalArr(values, type, sourceSpan) {\n return new LiteralArrayExpr(values, type, sourceSpan);\n}\nfunction literalMap(values, type = null) {\n return new LiteralMapExpr(values.map((e) => new LiteralMapEntry(e.key, e.value, e.quoted)), type, null);\n}\nfunction unary(operator, expr, type, sourceSpan) {\n return new UnaryOperatorExpr(operator, expr, type, sourceSpan);\n}\nfunction not(expr, sourceSpan) {\n return new NotExpr(expr, sourceSpan);\n}\nfunction fn(params, body, type, sourceSpan, name) {\n return new FunctionExpr(params, body, type, sourceSpan, name);\n}\nfunction arrowFn(params, body, type, sourceSpan) {\n return new ArrowFunctionExpr(params, body, type, sourceSpan);\n}\nfunction ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments) {\n return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments);\n}\nfunction taggedTemplate(tag, template, type, sourceSpan) {\n return new TaggedTemplateLiteralExpr(tag, template, type, sourceSpan);\n}\nfunction literal(value, type, sourceSpan) {\n return new LiteralExpr(value, type, sourceSpan);\n}\nfunction localizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan) {\n return new LocalizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan);\n}\nfunction isNull(exp) {\n return exp instanceof LiteralExpr && exp.value === null;\n}\n/*\n * Serializes a `Tag` into a string.\n * Returns a string like \" @foo {bar} baz\" (note the leading whitespace before `@foo`).\n */\nfunction tagToString(tag) {\n let out = '';\n if (tag.tagName) {\n out += ` @${tag.tagName}`;\n }\n if (tag.text) {\n if (tag.text.match(/\\/\\*|\\*\\//)) {\n throw new Error('JSDoc text cannot contain \"/*\" and \"*/\"');\n }\n out += ' ' + tag.text.replace(/@/g, '\\\\@');\n }\n return out;\n}\nfunction serializeTags(tags) {\n if (tags.length === 0)\n return '';\n if (tags.length === 1 && tags[0].tagName && !tags[0].text) {\n // The JSDOC comment is a single simple tag: e.g `/** @tagname */`.\n return `*${tagToString(tags[0])} `;\n }\n let out = '*\\n';\n for (const tag of tags) {\n out += ' *';\n // If the tagToString is multi-line, insert \" * \" prefixes on lines.\n out += tagToString(tag).replace(/\\n/g, '\\n * ');\n out += '\\n';\n }\n out += ' ';\n return out;\n}\n\nvar output_ast = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ArrayType: ArrayType,\n ArrowFunctionExpr: ArrowFunctionExpr,\n BOOL_TYPE: BOOL_TYPE,\n get BinaryOperator () { return BinaryOperator; },\n BinaryOperatorExpr: BinaryOperatorExpr,\n BuiltinType: BuiltinType,\n get BuiltinTypeName () { return BuiltinTypeName; },\n CommaExpr: CommaExpr,\n ConditionalExpr: ConditionalExpr,\n DYNAMIC_TYPE: DYNAMIC_TYPE,\n DeclareFunctionStmt: DeclareFunctionStmt,\n DeclareVarStmt: DeclareVarStmt,\n DynamicImportExpr: DynamicImportExpr,\n Expression: Expression,\n ExpressionStatement: ExpressionStatement,\n ExpressionType: ExpressionType,\n ExternalExpr: ExternalExpr,\n ExternalReference: ExternalReference,\n FUNCTION_TYPE: FUNCTION_TYPE,\n FnParam: FnParam,\n FunctionExpr: FunctionExpr,\n INFERRED_TYPE: INFERRED_TYPE,\n INT_TYPE: INT_TYPE,\n IfStmt: IfStmt,\n InstantiateExpr: InstantiateExpr,\n InvokeFunctionExpr: InvokeFunctionExpr,\n JSDocComment: JSDocComment,\n LeadingComment: LeadingComment,\n LiteralArrayExpr: LiteralArrayExpr,\n LiteralExpr: LiteralExpr,\n LiteralMapEntry: LiteralMapEntry,\n LiteralMapExpr: LiteralMapExpr,\n LiteralPiece: LiteralPiece,\n LocalizedString: LocalizedString,\n MapType: MapType,\n NONE_TYPE: NONE_TYPE,\n NULL_EXPR: NULL_EXPR,\n NUMBER_TYPE: NUMBER_TYPE,\n NotExpr: NotExpr,\n ParenthesizedExpr: ParenthesizedExpr,\n PlaceholderPiece: PlaceholderPiece,\n ReadKeyExpr: ReadKeyExpr,\n ReadPropExpr: ReadPropExpr,\n ReadVarExpr: ReadVarExpr,\n RecursiveAstVisitor: RecursiveAstVisitor$1,\n ReturnStatement: ReturnStatement,\n STRING_TYPE: STRING_TYPE,\n Statement: Statement,\n get StmtModifier () { return StmtModifier; },\n TYPED_NULL_EXPR: TYPED_NULL_EXPR,\n TaggedTemplateLiteralExpr: TaggedTemplateLiteralExpr,\n TemplateLiteralElementExpr: TemplateLiteralElementExpr,\n TemplateLiteralExpr: TemplateLiteralExpr,\n TransplantedType: TransplantedType,\n Type: Type,\n get TypeModifier () { return TypeModifier; },\n TypeofExpr: TypeofExpr,\n get UnaryOperator () { return UnaryOperator; },\n UnaryOperatorExpr: UnaryOperatorExpr,\n VoidExpr: VoidExpr,\n WrappedNodeExpr: WrappedNodeExpr,\n areAllEquivalent: areAllEquivalent,\n arrowFn: arrowFn,\n expressionType: expressionType,\n fn: fn,\n ifStmt: ifStmt,\n importExpr: importExpr,\n importType: importType,\n isNull: isNull,\n jsDocComment: jsDocComment,\n leadingComment: leadingComment,\n literal: literal,\n literalArr: literalArr,\n literalMap: literalMap,\n localizedString: localizedString,\n not: not,\n nullSafeIsEquivalent: nullSafeIsEquivalent,\n taggedTemplate: taggedTemplate,\n transplantedType: transplantedType,\n typeofExpr: typeofExpr,\n unary: unary,\n variable: variable\n});\n\nconst CONSTANT_PREFIX = '_c';\n/**\n * `ConstantPool` tries to reuse literal factories when two or more literals are identical.\n * We determine whether literals are identical by creating a key out of their AST using the\n * `KeyVisitor`. This constant is used to replace dynamic expressions which can't be safely\n * converted into a key. E.g. given an expression `{foo: bar()}`, since we don't know what\n * the result of `bar` will be, we create a key that looks like `{foo: }`. Note\n * that we use a variable, rather than something like `null` in order to avoid collisions.\n */\nconst UNKNOWN_VALUE_KEY = variable('');\n/**\n * Context to use when producing a key.\n *\n * This ensures we see the constant not the reference variable when producing\n * a key.\n */\nconst KEY_CONTEXT = {};\n/**\n * Generally all primitive values are excluded from the `ConstantPool`, but there is an exclusion\n * for strings that reach a certain length threshold. This constant defines the length threshold for\n * strings.\n */\nconst POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50;\n/**\n * A node that is a place-holder that allows the node to be replaced when the actual\n * node is known.\n *\n * This allows the constant pool to change an expression from a direct reference to\n * a constant to a shared constant. It returns a fix-up node that is later allowed to\n * change the referenced expression.\n */\nclass FixupExpression extends Expression {\n resolved;\n original;\n shared = false;\n constructor(resolved) {\n super(resolved.type);\n this.resolved = resolved;\n this.original = resolved;\n }\n visitExpression(visitor, context) {\n if (context === KEY_CONTEXT) {\n // When producing a key we want to traverse the constant not the\n // variable used to refer to it.\n return this.original.visitExpression(visitor, context);\n }\n else {\n return this.resolved.visitExpression(visitor, context);\n }\n }\n isEquivalent(e) {\n return e instanceof FixupExpression && this.resolved.isEquivalent(e.resolved);\n }\n isConstant() {\n return true;\n }\n clone() {\n throw new Error(`Not supported.`);\n }\n fixup(expression) {\n this.resolved = expression;\n this.shared = true;\n }\n}\n/**\n * A constant pool allows a code emitter to share constant in an output context.\n *\n * The constant pool also supports sharing access to ivy definitions references.\n */\nclass ConstantPool {\n isClosureCompilerEnabled;\n statements = [];\n literals = new Map();\n literalFactories = new Map();\n sharedConstants = new Map();\n /**\n * Constant pool also tracks claimed names from {@link uniqueName}.\n * This is useful to avoid collisions if variables are intended to be\n * named a certain way- but may conflict. We wouldn't want to always suffix\n * them with unique numbers.\n */\n _claimedNames = new Map();\n nextNameIndex = 0;\n constructor(isClosureCompilerEnabled = false) {\n this.isClosureCompilerEnabled = isClosureCompilerEnabled;\n }\n getConstLiteral(literal, forceShared) {\n if ((literal instanceof LiteralExpr && !isLongStringLiteral(literal)) ||\n literal instanceof FixupExpression) {\n // Do no put simple literals into the constant pool or try to produce a constant for a\n // reference to a constant.\n return literal;\n }\n const key = GenericKeyFn.INSTANCE.keyOf(literal);\n let fixup = this.literals.get(key);\n let newValue = false;\n if (!fixup) {\n fixup = new FixupExpression(literal);\n this.literals.set(key, fixup);\n newValue = true;\n }\n if ((!newValue && !fixup.shared) || (newValue && forceShared)) {\n // Replace the expression with a variable\n const name = this.freshName();\n let value;\n let usage;\n if (this.isClosureCompilerEnabled && isLongStringLiteral(literal)) {\n // For string literals, Closure will **always** inline the string at\n // **all** usages, duplicating it each time. For large strings, this\n // unnecessarily bloats bundle size. To work around this restriction, we\n // wrap the string in a function, and call that function for each usage.\n // This tricks Closure into using inline logic for functions instead of\n // string literals. Function calls are only inlined if the body is small\n // enough to be worth it. By doing this, very large strings will be\n // shared across multiple usages, rather than duplicating the string at\n // each usage site.\n //\n // const myStr = function() { return \"very very very long string\"; };\n // const usage1 = myStr();\n // const usage2 = myStr();\n value = new FunctionExpr([], // Params.\n [\n // Statements.\n new ReturnStatement(literal),\n ]);\n usage = variable(name).callFn([]);\n }\n else {\n // Just declare and use the variable directly, without a function call\n // indirection. This saves a few bytes and avoids an unnecessary call.\n value = literal;\n usage = variable(name);\n }\n this.statements.push(new DeclareVarStmt(name, value, INFERRED_TYPE, StmtModifier.Final));\n fixup.fixup(usage);\n }\n return fixup;\n }\n getSharedConstant(def, expr) {\n const key = def.keyOf(expr);\n if (!this.sharedConstants.has(key)) {\n const id = this.freshName();\n this.sharedConstants.set(key, variable(id));\n this.statements.push(def.toSharedConstantDeclaration(id, expr));\n }\n return this.sharedConstants.get(key);\n }\n getLiteralFactory(literal) {\n // Create a pure function that builds an array of a mix of constant and variable expressions\n if (literal instanceof LiteralArrayExpr) {\n const argumentsForKey = literal.entries.map((e) => (e.isConstant() ? e : UNKNOWN_VALUE_KEY));\n const key = GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey));\n return this._getLiteralFactory(key, literal.entries, (entries) => literalArr(entries));\n }\n else {\n const expressionForKey = literalMap(literal.entries.map((e) => ({\n key: e.key,\n value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY,\n quoted: e.quoted,\n })));\n const key = GenericKeyFn.INSTANCE.keyOf(expressionForKey);\n return this._getLiteralFactory(key, literal.entries.map((e) => e.value), (entries) => literalMap(entries.map((value, index) => ({\n key: literal.entries[index].key,\n value,\n quoted: literal.entries[index].quoted,\n }))));\n }\n }\n // TODO: useUniqueName(false) is necessary for naming compatibility with\n // TemplateDefinitionBuilder, but should be removed once Template Pipeline is the default.\n getSharedFunctionReference(fn, prefix, useUniqueName = true) {\n const isArrow = fn instanceof ArrowFunctionExpr;\n for (const current of this.statements) {\n // Arrow functions are saved as variables so we check if the\n // value of the variable is the same as the arrow function.\n if (isArrow && current instanceof DeclareVarStmt && current.value?.isEquivalent(fn)) {\n return variable(current.name);\n }\n // Function declarations are saved as function statements\n // so we compare them directly to the passed-in function.\n if (!isArrow &&\n current instanceof DeclareFunctionStmt &&\n fn instanceof FunctionExpr &&\n fn.isEquivalent(current)) {\n return variable(current.name);\n }\n }\n // Otherwise declare the function.\n const name = useUniqueName ? this.uniqueName(prefix) : prefix;\n this.statements.push(fn instanceof FunctionExpr\n ? fn.toDeclStmt(name, StmtModifier.Final)\n : new DeclareVarStmt(name, fn, INFERRED_TYPE, StmtModifier.Final, fn.sourceSpan));\n return variable(name);\n }\n _getLiteralFactory(key, values, resultMap) {\n let literalFactory = this.literalFactories.get(key);\n const literalFactoryArguments = values.filter((e) => !e.isConstant());\n if (!literalFactory) {\n const resultExpressions = values.map((e, index) => e.isConstant() ? this.getConstLiteral(e, true) : variable(`a${index}`));\n const parameters = resultExpressions\n .filter(isVariable)\n .map((e) => new FnParam(e.name, DYNAMIC_TYPE));\n const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE);\n const name = this.freshName();\n this.statements.push(new DeclareVarStmt(name, pureFunctionDeclaration, INFERRED_TYPE, StmtModifier.Final));\n literalFactory = variable(name);\n this.literalFactories.set(key, literalFactory);\n }\n return { literalFactory, literalFactoryArguments };\n }\n /**\n * Produce a unique name in the context of this pool.\n *\n * The name might be unique among different prefixes if any of the prefixes end in\n * a digit so the prefix should be a constant string (not based on user input) and\n * must not end in a digit.\n */\n uniqueName(name, alwaysIncludeSuffix = true) {\n const count = this._claimedNames.get(name) ?? 0;\n const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;\n this._claimedNames.set(name, count + 1);\n return result;\n }\n freshName() {\n return this.uniqueName(CONSTANT_PREFIX);\n }\n}\nclass GenericKeyFn {\n static INSTANCE = new GenericKeyFn();\n keyOf(expr) {\n if (expr instanceof LiteralExpr && typeof expr.value === 'string') {\n return `\"${expr.value}\"`;\n }\n else if (expr instanceof LiteralExpr) {\n return String(expr.value);\n }\n else if (expr instanceof LiteralArrayExpr) {\n const entries = [];\n for (const entry of expr.entries) {\n entries.push(this.keyOf(entry));\n }\n return `[${entries.join(',')}]`;\n }\n else if (expr instanceof LiteralMapExpr) {\n const entries = [];\n for (const entry of expr.entries) {\n let key = entry.key;\n if (entry.quoted) {\n key = `\"${key}\"`;\n }\n entries.push(key + ':' + this.keyOf(entry.value));\n }\n return `{${entries.join(',')}}`;\n }\n else if (expr instanceof ExternalExpr) {\n return `import(\"${expr.value.moduleName}\", ${expr.value.name})`;\n }\n else if (expr instanceof ReadVarExpr) {\n return `read(${expr.name})`;\n }\n else if (expr instanceof TypeofExpr) {\n return `typeof(${this.keyOf(expr.expr)})`;\n }\n else {\n throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`);\n }\n }\n}\nfunction isVariable(e) {\n return e instanceof ReadVarExpr;\n}\nfunction isLongStringLiteral(expr) {\n return (expr instanceof LiteralExpr &&\n typeof expr.value === 'string' &&\n expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS);\n}\n\nconst CORE = '@angular/core';\nclass Identifiers {\n /* Methods */\n static NEW_METHOD = 'factory';\n static TRANSFORM_METHOD = 'transform';\n static PATCH_DEPS = 'patchedDeps';\n static core = { name: null, moduleName: CORE };\n /* Instructions */\n static namespaceHTML = { name: 'ɵɵnamespaceHTML', moduleName: CORE };\n static namespaceMathML = { name: 'ɵɵnamespaceMathML', moduleName: CORE };\n static namespaceSVG = { name: 'ɵɵnamespaceSVG', moduleName: CORE };\n static element = { name: 'ɵɵelement', moduleName: CORE };\n static elementStart = { name: 'ɵɵelementStart', moduleName: CORE };\n static elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE };\n static domElement = { name: 'ɵɵdomElement', moduleName: CORE };\n static domElementStart = { name: 'ɵɵdomElementStart', moduleName: CORE };\n static domElementEnd = { name: 'ɵɵdomElementEnd', moduleName: CORE };\n static domElementContainer = {\n name: 'ɵɵdomElementContainer',\n moduleName: CORE,\n };\n static domElementContainerStart = {\n name: 'ɵɵdomElementContainerStart',\n moduleName: CORE,\n };\n static domElementContainerEnd = {\n name: 'ɵɵdomElementContainerEnd',\n moduleName: CORE,\n };\n static domTemplate = { name: 'ɵɵdomTemplate', moduleName: CORE };\n static domListener = { name: 'ɵɵdomListener', moduleName: CORE };\n static advance = { name: 'ɵɵadvance', moduleName: CORE };\n static syntheticHostProperty = {\n name: 'ɵɵsyntheticHostProperty',\n moduleName: CORE,\n };\n static syntheticHostListener = {\n name: 'ɵɵsyntheticHostListener',\n moduleName: CORE,\n };\n static attribute = { name: 'ɵɵattribute', moduleName: CORE };\n static classProp = { name: 'ɵɵclassProp', moduleName: CORE };\n static elementContainerStart = {\n name: 'ɵɵelementContainerStart',\n moduleName: CORE,\n };\n static elementContainerEnd = {\n name: 'ɵɵelementContainerEnd',\n moduleName: CORE,\n };\n static elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE };\n static styleMap = { name: 'ɵɵstyleMap', moduleName: CORE };\n static classMap = { name: 'ɵɵclassMap', moduleName: CORE };\n static styleProp = { name: 'ɵɵstyleProp', moduleName: CORE };\n static interpolate = {\n name: 'ɵɵinterpolate',\n moduleName: CORE,\n };\n static interpolate1 = {\n name: 'ɵɵinterpolate1',\n moduleName: CORE,\n };\n static interpolate2 = {\n name: 'ɵɵinterpolate2',\n moduleName: CORE,\n };\n static interpolate3 = {\n name: 'ɵɵinterpolate3',\n moduleName: CORE,\n };\n static interpolate4 = {\n name: 'ɵɵinterpolate4',\n moduleName: CORE,\n };\n static interpolate5 = {\n name: 'ɵɵinterpolate5',\n moduleName: CORE,\n };\n static interpolate6 = {\n name: 'ɵɵinterpolate6',\n moduleName: CORE,\n };\n static interpolate7 = {\n name: 'ɵɵinterpolate7',\n moduleName: CORE,\n };\n static interpolate8 = {\n name: 'ɵɵinterpolate8',\n moduleName: CORE,\n };\n static interpolateV = {\n name: 'ɵɵinterpolateV',\n moduleName: CORE,\n };\n static nextContext = { name: 'ɵɵnextContext', moduleName: CORE };\n static resetView = { name: 'ɵɵresetView', moduleName: CORE };\n static templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };\n static defer = { name: 'ɵɵdefer', moduleName: CORE };\n static deferWhen = { name: 'ɵɵdeferWhen', moduleName: CORE };\n static deferOnIdle = { name: 'ɵɵdeferOnIdle', moduleName: CORE };\n static deferOnImmediate = { name: 'ɵɵdeferOnImmediate', moduleName: CORE };\n static deferOnTimer = { name: 'ɵɵdeferOnTimer', moduleName: CORE };\n static deferOnHover = { name: 'ɵɵdeferOnHover', moduleName: CORE };\n static deferOnInteraction = { name: 'ɵɵdeferOnInteraction', moduleName: CORE };\n static deferOnViewport = { name: 'ɵɵdeferOnViewport', moduleName: CORE };\n static deferPrefetchWhen = { name: 'ɵɵdeferPrefetchWhen', moduleName: CORE };\n static deferPrefetchOnIdle = {\n name: 'ɵɵdeferPrefetchOnIdle',\n moduleName: CORE,\n };\n static deferPrefetchOnImmediate = {\n name: 'ɵɵdeferPrefetchOnImmediate',\n moduleName: CORE,\n };\n static deferPrefetchOnTimer = {\n name: 'ɵɵdeferPrefetchOnTimer',\n moduleName: CORE,\n };\n static deferPrefetchOnHover = {\n name: 'ɵɵdeferPrefetchOnHover',\n moduleName: CORE,\n };\n static deferPrefetchOnInteraction = {\n name: 'ɵɵdeferPrefetchOnInteraction',\n moduleName: CORE,\n };\n static deferPrefetchOnViewport = {\n name: 'ɵɵdeferPrefetchOnViewport',\n moduleName: CORE,\n };\n static deferHydrateWhen = { name: 'ɵɵdeferHydrateWhen', moduleName: CORE };\n static deferHydrateNever = { name: 'ɵɵdeferHydrateNever', moduleName: CORE };\n static deferHydrateOnIdle = {\n name: 'ɵɵdeferHydrateOnIdle',\n moduleName: CORE,\n };\n static deferHydrateOnImmediate = {\n name: 'ɵɵdeferHydrateOnImmediate',\n moduleName: CORE,\n };\n static deferHydrateOnTimer = {\n name: 'ɵɵdeferHydrateOnTimer',\n moduleName: CORE,\n };\n static deferHydrateOnHover = {\n name: 'ɵɵdeferHydrateOnHover',\n moduleName: CORE,\n };\n static deferHydrateOnInteraction = {\n name: 'ɵɵdeferHydrateOnInteraction',\n moduleName: CORE,\n };\n static deferHydrateOnViewport = {\n name: 'ɵɵdeferHydrateOnViewport',\n moduleName: CORE,\n };\n static deferEnableTimerScheduling = {\n name: 'ɵɵdeferEnableTimerScheduling',\n moduleName: CORE,\n };\n static conditionalCreate = { name: 'ɵɵconditionalCreate', moduleName: CORE };\n static conditionalBranchCreate = {\n name: 'ɵɵconditionalBranchCreate',\n moduleName: CORE,\n };\n static conditional = { name: 'ɵɵconditional', moduleName: CORE };\n static repeater = { name: 'ɵɵrepeater', moduleName: CORE };\n static repeaterCreate = { name: 'ɵɵrepeaterCreate', moduleName: CORE };\n static repeaterTrackByIndex = {\n name: 'ɵɵrepeaterTrackByIndex',\n moduleName: CORE,\n };\n static repeaterTrackByIdentity = {\n name: 'ɵɵrepeaterTrackByIdentity',\n moduleName: CORE,\n };\n static componentInstance = { name: 'ɵɵcomponentInstance', moduleName: CORE };\n static text = { name: 'ɵɵtext', moduleName: CORE };\n static enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };\n static disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE };\n static getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE };\n static textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE };\n static textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE };\n static textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE };\n static textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE };\n static textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE };\n static textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE };\n static textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE };\n static textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE };\n static textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE };\n static textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE };\n static restoreView = { name: 'ɵɵrestoreView', moduleName: CORE };\n static pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE };\n static pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE };\n static pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE };\n static pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE };\n static pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE };\n static pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE };\n static pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE };\n static pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE };\n static pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE };\n static pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE };\n static pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE };\n static pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE };\n static pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE };\n static pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE };\n static pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };\n static domProperty = { name: 'ɵɵdomProperty', moduleName: CORE };\n static property = { name: 'ɵɵproperty', moduleName: CORE };\n static i18n = { name: 'ɵɵi18n', moduleName: CORE };\n static i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };\n static i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };\n static i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE };\n static i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE };\n static i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE };\n static i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE };\n static pipe = { name: 'ɵɵpipe', moduleName: CORE };\n static projection = { name: 'ɵɵprojection', moduleName: CORE };\n static projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE };\n static reference = { name: 'ɵɵreference', moduleName: CORE };\n static inject = { name: 'ɵɵinject', moduleName: CORE };\n static injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE };\n static directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };\n static invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE };\n static invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE };\n static templateRefExtractor = {\n name: 'ɵɵtemplateRefExtractor',\n moduleName: CORE,\n };\n static forwardRef = { name: 'forwardRef', moduleName: CORE };\n static resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };\n static replaceMetadata = { name: 'ɵɵreplaceMetadata', moduleName: CORE };\n static getReplaceMetadataURL = {\n name: 'ɵɵgetReplaceMetadataURL',\n moduleName: CORE,\n };\n static ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };\n static declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };\n static InjectableDeclaration = {\n name: 'ɵɵInjectableDeclaration',\n moduleName: CORE,\n };\n static resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE };\n static resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE };\n static resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE };\n static getComponentDepsFactory = {\n name: 'ɵɵgetComponentDepsFactory',\n moduleName: CORE,\n };\n static defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE };\n static declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE };\n static setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE };\n static ChangeDetectionStrategy = {\n name: 'ChangeDetectionStrategy',\n moduleName: CORE,\n };\n static ViewEncapsulation = {\n name: 'ViewEncapsulation',\n moduleName: CORE,\n };\n static ComponentDeclaration = {\n name: 'ɵɵComponentDeclaration',\n moduleName: CORE,\n };\n static FactoryDeclaration = {\n name: 'ɵɵFactoryDeclaration',\n moduleName: CORE,\n };\n static declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE };\n static FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE };\n static defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE };\n static declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE };\n static DirectiveDeclaration = {\n name: 'ɵɵDirectiveDeclaration',\n moduleName: CORE,\n };\n static InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE };\n static InjectorDeclaration = {\n name: 'ɵɵInjectorDeclaration',\n moduleName: CORE,\n };\n static defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE };\n static declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE };\n static NgModuleDeclaration = {\n name: 'ɵɵNgModuleDeclaration',\n moduleName: CORE,\n };\n static ModuleWithProviders = {\n name: 'ModuleWithProviders',\n moduleName: CORE,\n };\n static defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };\n static declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };\n static setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };\n static registerNgModuleType = {\n name: 'ɵɵregisterNgModuleType',\n moduleName: CORE,\n };\n static PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };\n static definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };\n static declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };\n static declareClassMetadata = {\n name: 'ɵɵngDeclareClassMetadata',\n moduleName: CORE,\n };\n static declareClassMetadataAsync = {\n name: 'ɵɵngDeclareClassMetadataAsync',\n moduleName: CORE,\n };\n static setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE };\n static setClassMetadataAsync = {\n name: 'ɵsetClassMetadataAsync',\n moduleName: CORE,\n };\n static setClassDebugInfo = { name: 'ɵsetClassDebugInfo', moduleName: CORE };\n static queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE };\n static viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE };\n static loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE };\n static contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };\n // Signal queries\n static viewQuerySignal = { name: 'ɵɵviewQuerySignal', moduleName: CORE };\n static contentQuerySignal = { name: 'ɵɵcontentQuerySignal', moduleName: CORE };\n static queryAdvance = { name: 'ɵɵqueryAdvance', moduleName: CORE };\n // Two-way bindings\n static twoWayProperty = { name: 'ɵɵtwoWayProperty', moduleName: CORE };\n static twoWayBindingSet = { name: 'ɵɵtwoWayBindingSet', moduleName: CORE };\n static twoWayListener = { name: 'ɵɵtwoWayListener', moduleName: CORE };\n static declareLet = { name: 'ɵɵdeclareLet', moduleName: CORE };\n static storeLet = { name: 'ɵɵstoreLet', moduleName: CORE };\n static readContextLet = { name: 'ɵɵreadContextLet', moduleName: CORE };\n static attachSourceLocations = {\n name: 'ɵɵattachSourceLocations',\n moduleName: CORE,\n };\n static NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };\n static InheritDefinitionFeature = {\n name: 'ɵɵInheritDefinitionFeature',\n moduleName: CORE,\n };\n static CopyDefinitionFeature = {\n name: 'ɵɵCopyDefinitionFeature',\n moduleName: CORE,\n };\n static ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };\n static HostDirectivesFeature = {\n name: 'ɵɵHostDirectivesFeature',\n moduleName: CORE,\n };\n static ExternalStylesFeature = {\n name: 'ɵɵExternalStylesFeature',\n moduleName: CORE,\n };\n static listener = { name: 'ɵɵlistener', moduleName: CORE };\n static getInheritedFactory = {\n name: 'ɵɵgetInheritedFactory',\n moduleName: CORE,\n };\n // sanitization-related functions\n static sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };\n static sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };\n static sanitizeResourceUrl = {\n name: 'ɵɵsanitizeResourceUrl',\n moduleName: CORE,\n };\n static sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE };\n static sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };\n static sanitizeUrlOrResourceUrl = {\n name: 'ɵɵsanitizeUrlOrResourceUrl',\n moduleName: CORE,\n };\n static trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };\n static trustConstantResourceUrl = {\n name: 'ɵɵtrustConstantResourceUrl',\n moduleName: CORE,\n };\n static validateIframeAttribute = {\n name: 'ɵɵvalidateIframeAttribute',\n moduleName: CORE,\n };\n // type-checking\n static InputSignalBrandWriteType = { name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', moduleName: CORE };\n static UnwrapDirectiveSignalInputs = { name: 'ɵUnwrapDirectiveSignalInputs', moduleName: CORE };\n static unwrapWritableSignal = { name: 'ɵunwrapWritableSignal', moduleName: CORE };\n static assertType = { name: 'ɵassertType', moduleName: CORE };\n}\n\nconst DASH_CASE_REGEXP = /-+([a-z0-9])/g;\nfunction dashCaseToCamelCase(input) {\n return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());\n}\nfunction splitAtColon(input, defaultValues) {\n return _splitAt(input, ':', defaultValues);\n}\nfunction splitAtPeriod(input, defaultValues) {\n return _splitAt(input, '.', defaultValues);\n}\nfunction _splitAt(input, character, defaultValues) {\n const characterIndex = input.indexOf(character);\n if (characterIndex == -1)\n return defaultValues;\n return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];\n}\nfunction noUndefined(val) {\n return val === undefined ? null : val;\n}\n// Escape characters that have a special meaning in Regular Expressions\nfunction escapeRegExp(s) {\n return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n}\nfunction utf8Encode(str) {\n let encoded = [];\n for (let index = 0; index < str.length; index++) {\n let codePoint = str.charCodeAt(index);\n // decode surrogate\n // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > index + 1) {\n const low = str.charCodeAt(index + 1);\n if (low >= 0xdc00 && low <= 0xdfff) {\n index++;\n codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;\n }\n }\n if (codePoint <= 0x7f) {\n encoded.push(codePoint);\n }\n else if (codePoint <= 0x7ff) {\n encoded.push(((codePoint >> 6) & 0x1f) | 0xc0, (codePoint & 0x3f) | 0x80);\n }\n else if (codePoint <= 0xffff) {\n encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n }\n else if (codePoint <= 0x1fffff) {\n encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n }\n }\n return encoded;\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 const name = token.overriddenName || token.name;\n if (name) {\n return `${name}`;\n }\n if (!token.toString) {\n return 'object';\n }\n // WARNING: do not try to `JSON.stringify(token)` here\n // see https://github.com/angular/angular/issues/23440\n const result = token.toString();\n if (result == null) {\n return '' + result;\n }\n const newLineIndex = result.indexOf('\\n');\n return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result;\n}\nclass Version {\n full;\n major;\n minor;\n patch;\n constructor(full) {\n this.full = full;\n const splits = full.split('.');\n this.major = splits[0];\n this.minor = splits[1];\n this.patch = splits.slice(2).join('.');\n }\n}\nconst _global = globalThis;\nconst V1_TO_18 = /^([1-9]|1[0-8])\\./;\nfunction getJitStandaloneDefaultForVersion(version) {\n if (version.startsWith('0.')) {\n // 0.0.0 is always \"latest\", default is true.\n return true;\n }\n if (V1_TO_18.test(version)) {\n // Angular v2 - v18 default is false.\n return false;\n }\n // All other Angular versions (v19+) default to true.\n return true;\n}\n\n// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\nconst VERSION$1 = 3;\nconst JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';\nclass SourceMapGenerator {\n file;\n sourcesContent = new Map();\n lines = [];\n lastCol0 = 0;\n hasMappings = false;\n constructor(file = null) {\n this.file = file;\n }\n // The content is `null` when the content is expected to be loaded using the URL\n addSource(url, content = null) {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }\n addLine() {\n this.lines.push([]);\n this.lastCol0 = 0;\n return this;\n }\n addMapping(col0, sourceUrl, sourceLine0, sourceCol0) {\n if (!this.currentLine) {\n throw new Error(`A line must be added before mappings can be added`);\n }\n if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {\n throw new Error(`Unknown source file \"${sourceUrl}\"`);\n }\n if (col0 == null) {\n throw new Error(`The column in the generated code must be provided`);\n }\n if (col0 < this.lastCol0) {\n throw new Error(`Mapping should be added in output order`);\n }\n if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {\n throw new Error(`The source location must be provided when a source url is provided`);\n }\n this.hasMappings = true;\n this.lastCol0 = col0;\n this.currentLine.push({ col0, sourceUrl, sourceLine0, sourceCol0 });\n return this;\n }\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n get currentLine() {\n return this.lines.slice(-1)[0];\n }\n toJSON() {\n if (!this.hasMappings) {\n return null;\n }\n const sourcesIndex = new Map();\n const sources = [];\n const sourcesContent = [];\n Array.from(this.sourcesContent.keys()).forEach((url, i) => {\n sourcesIndex.set(url, i);\n sources.push(url);\n sourcesContent.push(this.sourcesContent.get(url) || null);\n });\n let mappings = '';\n let lastCol0 = 0;\n let lastSourceIndex = 0;\n let lastSourceLine0 = 0;\n let lastSourceCol0 = 0;\n this.lines.forEach((segments) => {\n lastCol0 = 0;\n mappings += segments\n .map((segment) => {\n // zero-based starting column of the line in the generated code\n let segAsStr = toBase64VLQ(segment.col0 - lastCol0);\n lastCol0 = segment.col0;\n if (segment.sourceUrl != null) {\n // zero-based index into the “sources” list\n segAsStr += toBase64VLQ(sourcesIndex.get(segment.sourceUrl) - lastSourceIndex);\n lastSourceIndex = sourcesIndex.get(segment.sourceUrl);\n // the zero-based starting line in the original source\n segAsStr += toBase64VLQ(segment.sourceLine0 - lastSourceLine0);\n lastSourceLine0 = segment.sourceLine0;\n // the zero-based starting column in the original source\n segAsStr += toBase64VLQ(segment.sourceCol0 - lastSourceCol0);\n lastSourceCol0 = segment.sourceCol0;\n }\n return segAsStr;\n })\n .join(',');\n mappings += ';';\n });\n mappings = mappings.slice(0, -1);\n return {\n 'file': this.file || '',\n 'version': VERSION$1,\n 'sourceRoot': '',\n 'sources': sources,\n 'sourcesContent': sourcesContent,\n 'mappings': mappings,\n };\n }\n toJsComment() {\n return this.hasMappings\n ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0))\n : '';\n }\n}\nfunction toBase64String(value) {\n let b64 = '';\n const encoded = utf8Encode(value);\n for (let i = 0; i < encoded.length;) {\n const i1 = encoded[i++];\n const i2 = i < encoded.length ? encoded[i++] : null;\n const i3 = i < encoded.length ? encoded[i++] : null;\n b64 += toBase64Digit(i1 >> 2);\n b64 += toBase64Digit(((i1 & 3) << 4) | (i2 === null ? 0 : i2 >> 4));\n b64 += i2 === null ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 === null ? 0 : i3 >> 6));\n b64 += i2 === null || i3 === null ? '=' : toBase64Digit(i3 & 63);\n }\n return b64;\n}\nfunction toBase64VLQ(value) {\n value = value < 0 ? (-value << 1) + 1 : value << 1;\n let out = '';\n do {\n let digit = value & 31;\n value = value >> 5;\n if (value > 0) {\n digit = digit | 32;\n }\n out += toBase64Digit(digit);\n } while (value > 0);\n return out;\n}\nconst B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nfunction toBase64Digit(value) {\n if (value < 0 || value >= 64) {\n throw new Error(`Can only encode value in the range [0, 63]`);\n }\n return B64_DIGITS[value];\n}\n\nconst _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\\\|\\n|\\r|\\$/g;\nconst _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;\nconst _INDENT_WITH = ' ';\nclass _EmittedLine {\n indent;\n partsLength = 0;\n parts = [];\n srcSpans = [];\n constructor(indent) {\n this.indent = indent;\n }\n}\nconst BINARY_OPERATORS$1 = new Map([\n [BinaryOperator.And, '&&'],\n [BinaryOperator.Bigger, '>'],\n [BinaryOperator.BiggerEquals, '>='],\n [BinaryOperator.BitwiseOr, '|'],\n [BinaryOperator.BitwiseAnd, '&'],\n [BinaryOperator.Divide, '/'],\n [BinaryOperator.Assign, '='],\n [BinaryOperator.Equals, '=='],\n [BinaryOperator.Identical, '==='],\n [BinaryOperator.Lower, '<'],\n [BinaryOperator.LowerEquals, '<='],\n [BinaryOperator.Minus, '-'],\n [BinaryOperator.Modulo, '%'],\n [BinaryOperator.Exponentiation, '**'],\n [BinaryOperator.Multiply, '*'],\n [BinaryOperator.NotEquals, '!='],\n [BinaryOperator.NotIdentical, '!=='],\n [BinaryOperator.NullishCoalesce, '??'],\n [BinaryOperator.Or, '||'],\n [BinaryOperator.Plus, '+'],\n [BinaryOperator.In, 'in'],\n [BinaryOperator.AdditionAssignment, '+='],\n [BinaryOperator.SubtractionAssignment, '-='],\n [BinaryOperator.MultiplicationAssignment, '*='],\n [BinaryOperator.DivisionAssignment, '/='],\n [BinaryOperator.RemainderAssignment, '%='],\n [BinaryOperator.ExponentiationAssignment, '**='],\n [BinaryOperator.AndAssignment, '&&='],\n [BinaryOperator.OrAssignment, '||='],\n [BinaryOperator.NullishCoalesceAssignment, '??='],\n]);\nclass EmitterVisitorContext {\n _indent;\n static createRoot() {\n return new EmitterVisitorContext(0);\n }\n _lines;\n constructor(_indent) {\n this._indent = _indent;\n this._lines = [new _EmittedLine(_indent)];\n }\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n get _currentLine() {\n return this._lines[this._lines.length - 1];\n }\n println(from, lastPart = '') {\n this.print(from || null, lastPart, true);\n }\n lineIsEmpty() {\n return this._currentLine.parts.length === 0;\n }\n lineLength() {\n return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;\n }\n print(from, part, newLine = false) {\n if (part.length > 0) {\n this._currentLine.parts.push(part);\n this._currentLine.partsLength += part.length;\n this._currentLine.srcSpans.push((from && from.sourceSpan) || null);\n }\n if (newLine) {\n this._lines.push(new _EmittedLine(this._indent));\n }\n }\n removeEmptyLastLine() {\n if (this.lineIsEmpty()) {\n this._lines.pop();\n }\n }\n incIndent() {\n this._indent++;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n }\n decIndent() {\n this._indent--;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n }\n toSource() {\n return this.sourceLines\n .map((l) => (l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''))\n .join('\\n');\n }\n toSourceMapGenerator(genFilePath, startsAtLine = 0) {\n const map = new SourceMapGenerator(genFilePath);\n let firstOffsetMapped = false;\n const mapFirstOffsetIfNeeded = () => {\n if (!firstOffsetMapped) {\n // Add a single space so that tools won't try to load the file from disk.\n // Note: We are using virtual urls like `ng:///`, so we have to\n // provide a content here.\n map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);\n firstOffsetMapped = true;\n }\n };\n for (let i = 0; i < startsAtLine; i++) {\n map.addLine();\n mapFirstOffsetIfNeeded();\n }\n this.sourceLines.forEach((line, lineIdx) => {\n map.addLine();\n const spans = line.srcSpans;\n const parts = line.parts;\n let col0 = line.indent * _INDENT_WITH.length;\n let spanIdx = 0;\n // skip leading parts without source spans\n while (spanIdx < spans.length && !spans[spanIdx]) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {\n firstOffsetMapped = true;\n }\n else {\n mapFirstOffsetIfNeeded();\n }\n while (spanIdx < spans.length) {\n const span = spans[spanIdx];\n const source = span.start.file;\n const sourceLine = span.start.line;\n const sourceCol = span.start.col;\n map\n .addSource(source.url, source.content)\n .addMapping(col0, source.url, sourceLine, sourceCol);\n col0 += parts[spanIdx].length;\n spanIdx++;\n // assign parts without span or the same span to the previous segment\n while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n }\n });\n return map;\n }\n spanOf(line, column) {\n const emittedLine = this._lines[line];\n if (emittedLine) {\n let columnsLeft = column - _createIndent(emittedLine.indent).length;\n for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {\n const part = emittedLine.parts[partIndex];\n if (part.length > columnsLeft) {\n return emittedLine.srcSpans[partIndex];\n }\n columnsLeft -= part.length;\n }\n }\n return null;\n }\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n get sourceLines() {\n if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {\n return this._lines.slice(0, -1);\n }\n return this._lines;\n }\n}\nclass AbstractEmitterVisitor {\n _escapeDollarInStrings;\n lastIfCondition = null;\n constructor(_escapeDollarInStrings) {\n this._escapeDollarInStrings = _escapeDollarInStrings;\n }\n printLeadingComments(stmt, ctx) {\n if (stmt.leadingComments === undefined) {\n return;\n }\n for (const comment of stmt.leadingComments) {\n if (comment instanceof JSDocComment) {\n ctx.print(stmt, `/*${comment.toString()}*/`, comment.trailingNewline);\n }\n else {\n if (comment.multiline) {\n ctx.print(stmt, `/* ${comment.text} */`, comment.trailingNewline);\n }\n else {\n comment.text.split('\\n').forEach((line) => {\n ctx.println(stmt, `// ${line}`);\n });\n }\n }\n }\n }\n visitExpressionStmt(stmt, ctx) {\n this.printLeadingComments(stmt, ctx);\n stmt.expr.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n }\n visitReturnStmt(stmt, ctx) {\n this.printLeadingComments(stmt, ctx);\n ctx.print(stmt, `return `);\n stmt.value.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n }\n visitIfStmt(stmt, ctx) {\n this.printLeadingComments(stmt, ctx);\n ctx.print(stmt, `if (`);\n this.lastIfCondition = stmt.condition; // We can skip redundant parentheses for the condition.\n stmt.condition.visitExpression(this, ctx);\n this.lastIfCondition = null;\n ctx.print(stmt, `) {`);\n const hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;\n if (stmt.trueCase.length <= 1 && !hasElseCase) {\n ctx.print(stmt, ` `);\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.removeEmptyLastLine();\n ctx.print(stmt, ` `);\n }\n else {\n ctx.println();\n ctx.incIndent();\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.decIndent();\n if (hasElseCase) {\n ctx.println(stmt, `} else {`);\n ctx.incIndent();\n this.visitAllStatements(stmt.falseCase, ctx);\n ctx.decIndent();\n }\n }\n ctx.println(stmt, `}`);\n return null;\n }\n visitInvokeFunctionExpr(expr, ctx) {\n const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;\n if (shouldParenthesize) {\n ctx.print(expr.fn, '(');\n }\n expr.fn.visitExpression(this, ctx);\n if (shouldParenthesize) {\n ctx.print(expr.fn, ')');\n }\n ctx.print(expr, `(`);\n this.visitAllExpressions(expr.args, ctx, ',');\n ctx.print(expr, `)`);\n return null;\n }\n visitTaggedTemplateLiteralExpr(expr, ctx) {\n expr.tag.visitExpression(this, ctx);\n expr.template.visitExpression(this, ctx);\n return null;\n }\n visitTemplateLiteralExpr(expr, ctx) {\n ctx.print(expr, '`');\n for (let i = 0; i < expr.elements.length; i++) {\n expr.elements[i].visitExpression(this, ctx);\n const expression = i < expr.expressions.length ? expr.expressions[i] : null;\n if (expression !== null) {\n ctx.print(expression, '${');\n expression.visitExpression(this, ctx);\n ctx.print(expression, '}');\n }\n }\n ctx.print(expr, '`');\n }\n visitTemplateLiteralElementExpr(expr, ctx) {\n ctx.print(expr, expr.rawText);\n }\n visitWrappedNodeExpr(ast, ctx) {\n throw new Error('Abstract emitter cannot visit WrappedNodeExpr.');\n }\n visitTypeofExpr(expr, ctx) {\n ctx.print(expr, 'typeof ');\n expr.expr.visitExpression(this, ctx);\n }\n visitVoidExpr(expr, ctx) {\n ctx.print(expr, 'void ');\n expr.expr.visitExpression(this, ctx);\n }\n visitReadVarExpr(ast, ctx) {\n ctx.print(ast, ast.name);\n return null;\n }\n visitInstantiateExpr(ast, ctx) {\n ctx.print(ast, `new `);\n ast.classExpr.visitExpression(this, ctx);\n ctx.print(ast, `(`);\n this.visitAllExpressions(ast.args, ctx, ',');\n ctx.print(ast, `)`);\n return null;\n }\n visitLiteralExpr(ast, ctx) {\n const value = ast.value;\n if (typeof value === 'string') {\n ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));\n }\n else {\n ctx.print(ast, `${value}`);\n }\n return null;\n }\n visitLocalizedString(ast, ctx) {\n const head = ast.serializeI18nHead();\n ctx.print(ast, '$localize `' + head.raw);\n for (let i = 1; i < ast.messageParts.length; i++) {\n ctx.print(ast, '${');\n ast.expressions[i - 1].visitExpression(this, ctx);\n ctx.print(ast, `}${ast.serializeI18nTemplatePart(i).raw}`);\n }\n ctx.print(ast, '`');\n return null;\n }\n visitConditionalExpr(ast, ctx) {\n ctx.print(ast, `(`);\n ast.condition.visitExpression(this, ctx);\n ctx.print(ast, '? ');\n ast.trueCase.visitExpression(this, ctx);\n ctx.print(ast, ': ');\n ast.falseCase.visitExpression(this, ctx);\n ctx.print(ast, `)`);\n return null;\n }\n visitDynamicImportExpr(ast, ctx) {\n ctx.print(ast, `import(${ast.url})`);\n }\n visitNotExpr(ast, ctx) {\n ctx.print(ast, '!');\n ast.condition.visitExpression(this, ctx);\n return null;\n }\n visitUnaryOperatorExpr(ast, ctx) {\n let opStr;\n switch (ast.operator) {\n case UnaryOperator.Plus:\n opStr = '+';\n break;\n case UnaryOperator.Minus:\n opStr = '-';\n break;\n default:\n throw new Error(`Unknown operator ${ast.operator}`);\n }\n const parens = ast !== this.lastIfCondition;\n if (parens)\n ctx.print(ast, `(`);\n ctx.print(ast, opStr);\n ast.expr.visitExpression(this, ctx);\n if (parens)\n ctx.print(ast, `)`);\n return null;\n }\n visitBinaryOperatorExpr(ast, ctx) {\n const operator = BINARY_OPERATORS$1.get(ast.operator);\n if (!operator) {\n throw new Error(`Unknown operator ${ast.operator}`);\n }\n const parens = ast !== this.lastIfCondition;\n if (parens)\n ctx.print(ast, `(`);\n ast.lhs.visitExpression(this, ctx);\n ctx.print(ast, ` ${operator} `);\n ast.rhs.visitExpression(this, ctx);\n if (parens)\n ctx.print(ast, `)`);\n return null;\n }\n visitReadPropExpr(ast, ctx) {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, `.`);\n ctx.print(ast, ast.name);\n return null;\n }\n visitReadKeyExpr(ast, ctx) {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, `[`);\n ast.index.visitExpression(this, ctx);\n ctx.print(ast, `]`);\n return null;\n }\n visitLiteralArrayExpr(ast, ctx) {\n ctx.print(ast, `[`);\n this.visitAllExpressions(ast.entries, ctx, ',');\n ctx.print(ast, `]`);\n return null;\n }\n visitLiteralMapExpr(ast, ctx) {\n ctx.print(ast, `{`);\n this.visitAllObjects((entry) => {\n ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`);\n entry.value.visitExpression(this, ctx);\n }, ast.entries, ctx, ',');\n ctx.print(ast, `}`);\n return null;\n }\n visitCommaExpr(ast, ctx) {\n ctx.print(ast, '(');\n this.visitAllExpressions(ast.parts, ctx, ',');\n ctx.print(ast, ')');\n return null;\n }\n visitParenthesizedExpr(ast, ctx) {\n // We parenthesize everything regardless of an explicit ParenthesizedExpr, so we can just visit\n // the inner expression.\n // TODO: Do we *need* to parenthesize everything?\n ast.expr.visitExpression(this, ctx);\n }\n visitAllExpressions(expressions, ctx, separator) {\n this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);\n }\n visitAllObjects(handler, expressions, ctx, separator) {\n let incrementedIndent = false;\n for (let i = 0; i < expressions.length; i++) {\n if (i > 0) {\n if (ctx.lineLength() > 80) {\n ctx.print(null, separator, true);\n if (!incrementedIndent) {\n // continuation are marked with double indent.\n ctx.incIndent();\n ctx.incIndent();\n incrementedIndent = true;\n }\n }\n else {\n ctx.print(null, separator, false);\n }\n }\n handler(expressions[i]);\n }\n if (incrementedIndent) {\n // continuation are marked with double indent.\n ctx.decIndent();\n ctx.decIndent();\n }\n }\n visitAllStatements(statements, ctx) {\n statements.forEach((stmt) => stmt.visitStatement(this, ctx));\n }\n}\nfunction escapeIdentifier(input, escapeDollar, alwaysQuote = true) {\n if (input == null) {\n return null;\n }\n const body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, (...match) => {\n if (match[0] == '$') {\n return escapeDollar ? '\\\\$' : '$';\n }\n else if (match[0] == '\\n') {\n return '\\\\n';\n }\n else if (match[0] == '\\r') {\n return '\\\\r';\n }\n else {\n return `\\\\${match[0]}`;\n }\n });\n const requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);\n return requiresQuotes ? `'${body}'` : body;\n}\nfunction _createIndent(count) {\n let res = '';\n for (let i = 0; i < count; i++) {\n res += _INDENT_WITH;\n }\n return res;\n}\n\nfunction typeWithParameters(type, numParams) {\n if (numParams === 0) {\n return expressionType(type);\n }\n const params = [];\n for (let i = 0; i < numParams; i++) {\n params.push(DYNAMIC_TYPE);\n }\n return expressionType(type, undefined, params);\n}\nfunction getSafePropertyAccessString(accessor, name) {\n const escapedName = escapeIdentifier(name, false, false);\n return escapedName !== name ? `${accessor}[${escapedName}]` : `${accessor}.${name}`;\n}\nfunction jitOnlyGuardedExpression(expr) {\n return guardedExpression('ngJitMode', expr);\n}\nfunction devOnlyGuardedExpression(expr) {\n return guardedExpression('ngDevMode', expr);\n}\nfunction guardedExpression(guard, expr) {\n const guardExpr = new ExternalExpr({ name: guard, moduleName: null });\n const guardNotDefined = new BinaryOperatorExpr(BinaryOperator.Identical, new TypeofExpr(guardExpr), literal('undefined'));\n const guardUndefinedOrTrue = new BinaryOperatorExpr(BinaryOperator.Or, guardNotDefined, guardExpr, \n /* type */ undefined, \n /* sourceSpan */ undefined);\n return new BinaryOperatorExpr(BinaryOperator.And, guardUndefinedOrTrue, expr);\n}\nfunction wrapReference(value) {\n const wrapped = new WrappedNodeExpr(value);\n return { value: wrapped, type: wrapped };\n}\nfunction refsToArray(refs, shouldForwardDeclare) {\n const values = literalArr(refs.map((ref) => ref.value));\n return shouldForwardDeclare ? arrowFn([], values) : values;\n}\nfunction createMayBeForwardRefExpression(expression, forwardRef) {\n return { expression, forwardRef };\n}\n/**\n * Convert a `MaybeForwardRefExpression` to an `Expression`, possibly wrapping its expression in a\n * `forwardRef()` call.\n *\n * If `MaybeForwardRefExpression.forwardRef` is `ForwardRefHandling.Unwrapped` then the expression\n * was originally wrapped in a `forwardRef()` call to prevent the value from being eagerly evaluated\n * in the code.\n *\n * See `packages/compiler-cli/src/ngtsc/annotations/src/injectable.ts` and\n * `packages/compiler/src/jit_compiler_facade.ts` for more information.\n */\nfunction convertFromMaybeForwardRefExpression({ expression, forwardRef, }) {\n switch (forwardRef) {\n case 0 /* ForwardRefHandling.None */:\n case 1 /* ForwardRefHandling.Wrapped */:\n return expression;\n case 2 /* ForwardRefHandling.Unwrapped */:\n return generateForwardRef(expression);\n }\n}\n/**\n * Generate an expression that has the given `expr` wrapped in the following form:\n *\n * ```ts\n * forwardRef(() => expr)\n * ```\n */\nfunction generateForwardRef(expr) {\n return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);\n}\n\nvar R3FactoryDelegateType;\n(function (R3FactoryDelegateType) {\n R3FactoryDelegateType[R3FactoryDelegateType[\"Class\"] = 0] = \"Class\";\n R3FactoryDelegateType[R3FactoryDelegateType[\"Function\"] = 1] = \"Function\";\n})(R3FactoryDelegateType || (R3FactoryDelegateType = {}));\n/**\n * Construct a factory function expression for the given `R3FactoryMetadata`.\n */\nfunction compileFactoryFunction(meta) {\n const t = variable('__ngFactoryType__');\n let baseFactoryVar = null;\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedFactoryMetadata(meta)\n ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value)\n : t;\n let ctorExpr = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target));\n }\n }\n else {\n // There is no constructor, use the base class' factory to construct typeForCtor.\n baseFactoryVar = variable(`ɵ${meta.name}_BaseFactory`);\n ctorExpr = baseFactoryVar.callFn([typeForCtor]);\n }\n const body = [];\n let retExpr = null;\n function makeConditionalFactory(nonCtorExpr) {\n const r = variable('__ngConditionalFactory__');\n body.push(new DeclareVarStmt(r.name, NULL_EXPR, INFERRED_TYPE));\n const ctorStmt = ctorExpr !== null\n ? r.set(ctorExpr).toStmt()\n : importExpr(Identifiers.invalidFactory).callFn([]).toStmt();\n body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n if (isDelegatedFactoryMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.target);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ? InstantiateExpr : InvokeFunctionExpr)(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n }\n else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n }\n else {\n retExpr = ctorExpr;\n }\n if (retExpr === null) {\n // The expression cannot be formed so render an `ɵɵinvalidFactory()` call.\n body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt());\n }\n else if (baseFactoryVar !== null) {\n // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.\n const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);\n // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`\n const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));\n body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));\n }\n else {\n // This is straightforward factory, just return it.\n body.push(new ReturnStatement(retExpr));\n }\n let factoryFn = fn([new FnParam(t.name, DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`);\n if (baseFactoryVar !== null) {\n // There is a base factory variable so wrap its declaration along with the factory function into\n // an IIFE.\n factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)])\n .callFn([], /* sourceSpan */ undefined, /* pure */ true);\n }\n return {\n expression: factoryFn,\n statements: [],\n type: createFactoryType(meta),\n };\n}\nfunction createFactoryType(meta) {\n const ctorDepsType = meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : NONE_TYPE;\n return expressionType(importExpr(Identifiers.FactoryDeclaration, [\n typeWithParameters(meta.type.type, meta.typeArgumentCount),\n ctorDepsType,\n ]));\n}\nfunction injectDependencies(deps, target) {\n return deps.map((dep, index) => compileInjectDependency(dep, target, index));\n}\nfunction compileInjectDependency(dep, target, index) {\n // Interpret the dependency according to its resolved type.\n if (dep.token === null) {\n return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]);\n }\n else if (dep.attributeNameType === null) {\n // Build up the injection flags according to the metadata.\n const flags = 0 /* InjectFlags.Default */ |\n (dep.self ? 2 /* InjectFlags.Self */ : 0) |\n (dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) |\n (dep.host ? 1 /* InjectFlags.Host */ : 0) |\n (dep.optional ? 8 /* InjectFlags.Optional */ : 0) |\n (target === FactoryTarget.Pipe ? 16 /* InjectFlags.ForPipe */ : 0);\n // If this dependency is optional or otherwise has non-default flags, then additional\n // parameters describing how to inject the dependency must be passed to the inject function\n // that's being used.\n let flagsParam = flags !== 0 /* InjectFlags.Default */ || dep.optional ? literal(flags) : null;\n // Build up the arguments to the injectFn call.\n const injectArgs = [dep.token];\n if (flagsParam) {\n injectArgs.push(flagsParam);\n }\n const injectFn = getInjectFn(target);\n return importExpr(injectFn).callFn(injectArgs);\n }\n else {\n // The `dep.attributeTypeName` value is defined, which indicates that this is an `@Attribute()`\n // type dependency. For the generated JS we still want to use the `dep.token` value in case the\n // name given for the attribute is not a string literal. For example given `@Attribute(foo())`,\n // we want to generate `ɵɵinjectAttribute(foo())`.\n //\n // The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate\n // typings.\n return importExpr(Identifiers.injectAttribute).callFn([dep.token]);\n }\n}\nfunction createCtorDepsType(deps) {\n let hasTypes = false;\n const attributeTypes = deps.map((dep) => {\n const type = createCtorDepType(dep);\n if (type !== null) {\n hasTypes = true;\n return type;\n }\n else {\n return literal(null);\n }\n });\n if (hasTypes) {\n return expressionType(literalArr(attributeTypes));\n }\n else {\n return NONE_TYPE;\n }\n}\nfunction createCtorDepType(dep) {\n const entries = [];\n if (dep.attributeNameType !== null) {\n entries.push({ key: 'attribute', value: dep.attributeNameType, quoted: false });\n }\n if (dep.optional) {\n entries.push({ key: 'optional', value: literal(true), quoted: false });\n }\n if (dep.host) {\n entries.push({ key: 'host', value: literal(true), quoted: false });\n }\n if (dep.self) {\n entries.push({ key: 'self', value: literal(true), quoted: false });\n }\n if (dep.skipSelf) {\n entries.push({ key: 'skipSelf', value: literal(true), quoted: false });\n }\n return entries.length > 0 ? literalMap(entries) : null;\n}\nfunction isDelegatedFactoryMetadata(meta) {\n return meta.delegateType !== undefined;\n}\nfunction isExpressionFactoryMetadata(meta) {\n return meta.expression !== undefined;\n}\nfunction getInjectFn(target) {\n switch (target) {\n case FactoryTarget.Component:\n case FactoryTarget.Directive:\n case FactoryTarget.Pipe:\n return Identifiers.directiveInject;\n case FactoryTarget.NgModule:\n case FactoryTarget.Injectable:\n default:\n return Identifiers.inject;\n }\n}\n\nclass ParseSpan {\n start;\n end;\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n toAbsolute(absoluteOffset) {\n return new AbsoluteSourceSpan(absoluteOffset + this.start, absoluteOffset + this.end);\n }\n}\nclass AST {\n span;\n sourceSpan;\n constructor(span, \n /**\n * Absolute location of the expression AST in a source code file.\n */\n sourceSpan) {\n this.span = span;\n this.sourceSpan = sourceSpan;\n }\n toString() {\n return 'AST';\n }\n}\nclass ASTWithName extends AST {\n nameSpan;\n constructor(span, sourceSpan, nameSpan) {\n super(span, sourceSpan);\n this.nameSpan = nameSpan;\n }\n}\nlet EmptyExpr$1 = class EmptyExpr extends AST {\n visit(visitor, context = null) {\n // do nothing\n }\n};\nclass ImplicitReceiver extends AST {\n visit(visitor, context = null) {\n return visitor.visitImplicitReceiver(this, context);\n }\n}\n/**\n * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class\n * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the\n * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]=\"this.title\"`\n * is the same as `[attr.title]=\"title\"`.). Inheriting allows for the `this` accesses to be treated\n * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`.\n * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future.\n */\nclass ThisReceiver extends ImplicitReceiver {\n visit(visitor, context = null) {\n return visitor.visitThisReceiver?.(this, context);\n }\n}\n/**\n * Multiple expressions separated by a semicolon.\n */\nclass Chain extends AST {\n expressions;\n constructor(span, sourceSpan, expressions) {\n super(span, sourceSpan);\n this.expressions = expressions;\n }\n visit(visitor, context = null) {\n return visitor.visitChain(this, context);\n }\n}\nclass Conditional extends AST {\n condition;\n trueExp;\n falseExp;\n constructor(span, sourceSpan, condition, trueExp, falseExp) {\n super(span, sourceSpan);\n this.condition = condition;\n this.trueExp = trueExp;\n this.falseExp = falseExp;\n }\n visit(visitor, context = null) {\n return visitor.visitConditional(this, context);\n }\n}\nclass PropertyRead extends ASTWithName {\n receiver;\n name;\n constructor(span, sourceSpan, nameSpan, receiver, name) {\n super(span, sourceSpan, nameSpan);\n this.receiver = receiver;\n this.name = name;\n }\n visit(visitor, context = null) {\n return visitor.visitPropertyRead(this, context);\n }\n}\nclass SafePropertyRead extends ASTWithName {\n receiver;\n name;\n constructor(span, sourceSpan, nameSpan, receiver, name) {\n super(span, sourceSpan, nameSpan);\n this.receiver = receiver;\n this.name = name;\n }\n visit(visitor, context = null) {\n return visitor.visitSafePropertyRead(this, context);\n }\n}\nclass KeyedRead extends AST {\n receiver;\n key;\n constructor(span, sourceSpan, receiver, key) {\n super(span, sourceSpan);\n this.receiver = receiver;\n this.key = key;\n }\n visit(visitor, context = null) {\n return visitor.visitKeyedRead(this, context);\n }\n}\nclass SafeKeyedRead extends AST {\n receiver;\n key;\n constructor(span, sourceSpan, receiver, key) {\n super(span, sourceSpan);\n this.receiver = receiver;\n this.key = key;\n }\n visit(visitor, context = null) {\n return visitor.visitSafeKeyedRead(this, context);\n }\n}\n/** Possible types for a pipe. */\nvar BindingPipeType;\n(function (BindingPipeType) {\n /**\n * Pipe is being referenced by its name, for example:\n * `@Pipe({name: 'foo'}) class FooPipe` and `{{123 | foo}}`.\n */\n BindingPipeType[BindingPipeType[\"ReferencedByName\"] = 0] = \"ReferencedByName\";\n /**\n * Pipe is being referenced by its class name, for example:\n * `@Pipe() class FooPipe` and `{{123 | FooPipe}}`.\n */\n BindingPipeType[BindingPipeType[\"ReferencedDirectly\"] = 1] = \"ReferencedDirectly\";\n})(BindingPipeType || (BindingPipeType = {}));\nclass BindingPipe extends ASTWithName {\n exp;\n name;\n args;\n type;\n constructor(span, sourceSpan, exp, name, args, type, nameSpan) {\n super(span, sourceSpan, nameSpan);\n this.exp = exp;\n this.name = name;\n this.args = args;\n this.type = type;\n }\n visit(visitor, context = null) {\n return visitor.visitPipe(this, context);\n }\n}\nclass LiteralPrimitive extends AST {\n value;\n constructor(span, sourceSpan, value) {\n super(span, sourceSpan);\n this.value = value;\n }\n visit(visitor, context = null) {\n return visitor.visitLiteralPrimitive(this, context);\n }\n}\nclass LiteralArray extends AST {\n expressions;\n constructor(span, sourceSpan, expressions) {\n super(span, sourceSpan);\n this.expressions = expressions;\n }\n visit(visitor, context = null) {\n return visitor.visitLiteralArray(this, context);\n }\n}\nclass LiteralMap extends AST {\n keys;\n values;\n constructor(span, sourceSpan, keys, values) {\n super(span, sourceSpan);\n this.keys = keys;\n this.values = values;\n }\n visit(visitor, context = null) {\n return visitor.visitLiteralMap(this, context);\n }\n}\nlet Interpolation$1 = class Interpolation extends AST {\n strings;\n expressions;\n constructor(span, sourceSpan, strings, expressions) {\n super(span, sourceSpan);\n this.strings = strings;\n this.expressions = expressions;\n }\n visit(visitor, context = null) {\n return visitor.visitInterpolation(this, context);\n }\n};\nclass Binary extends AST {\n operation;\n left;\n right;\n constructor(span, sourceSpan, operation, left, right) {\n super(span, sourceSpan);\n this.operation = operation;\n this.left = left;\n this.right = right;\n }\n visit(visitor, context = null) {\n return visitor.visitBinary(this, context);\n }\n static isAssignmentOperation(op) {\n return (op === '=' ||\n op === '+=' ||\n op === '-=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '**=' ||\n op === '&&=' ||\n op === '||=' ||\n op === '??=');\n }\n}\n/**\n * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST\n * node that was originally used. This inheritance relation can be deleted in some future major,\n * after consumers have been given a chance to fully support Unary.\n */\nclass Unary extends Binary {\n operator;\n expr;\n // Redeclare the properties that are inherited from `Binary` as `never`, as consumers should not\n // depend on these fields when operating on `Unary`.\n left = null;\n right = null;\n operation = null;\n /**\n * Creates a unary minus expression \"-x\", represented as `Binary` using \"0 - x\".\n */\n static createMinus(span, sourceSpan, expr) {\n return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);\n }\n /**\n * Creates a unary plus expression \"+x\", represented as `Binary` using \"x - 0\".\n */\n static createPlus(span, sourceSpan, expr) {\n return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));\n }\n /**\n * During the deprecation period this constructor is private, to avoid consumers from creating\n * a `Unary` with the fallback properties for `Binary`.\n */\n constructor(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) {\n super(span, sourceSpan, binaryOp, binaryLeft, binaryRight);\n this.operator = operator;\n this.expr = expr;\n }\n visit(visitor, context = null) {\n if (visitor.visitUnary !== undefined) {\n return visitor.visitUnary(this, context);\n }\n return visitor.visitBinary(this, context);\n }\n}\nclass PrefixNot extends AST {\n expression;\n constructor(span, sourceSpan, expression) {\n super(span, sourceSpan);\n this.expression = expression;\n }\n visit(visitor, context = null) {\n return visitor.visitPrefixNot(this, context);\n }\n}\nclass TypeofExpression extends AST {\n expression;\n constructor(span, sourceSpan, expression) {\n super(span, sourceSpan);\n this.expression = expression;\n }\n visit(visitor, context = null) {\n return visitor.visitTypeofExpression(this, context);\n }\n}\nclass VoidExpression extends AST {\n expression;\n constructor(span, sourceSpan, expression) {\n super(span, sourceSpan);\n this.expression = expression;\n }\n visit(visitor, context = null) {\n return visitor.visitVoidExpression(this, context);\n }\n}\nclass NonNullAssert extends AST {\n expression;\n constructor(span, sourceSpan, expression) {\n super(span, sourceSpan);\n this.expression = expression;\n }\n visit(visitor, context = null) {\n return visitor.visitNonNullAssert(this, context);\n }\n}\nclass Call extends AST {\n receiver;\n args;\n argumentSpan;\n constructor(span, sourceSpan, receiver, args, argumentSpan) {\n super(span, sourceSpan);\n this.receiver = receiver;\n this.args = args;\n this.argumentSpan = argumentSpan;\n }\n visit(visitor, context = null) {\n return visitor.visitCall(this, context);\n }\n}\nclass SafeCall extends AST {\n receiver;\n args;\n argumentSpan;\n constructor(span, sourceSpan, receiver, args, argumentSpan) {\n super(span, sourceSpan);\n this.receiver = receiver;\n this.args = args;\n this.argumentSpan = argumentSpan;\n }\n visit(visitor, context = null) {\n return visitor.visitSafeCall(this, context);\n }\n}\nclass TaggedTemplateLiteral extends AST {\n tag;\n template;\n constructor(span, sourceSpan, tag, template) {\n super(span, sourceSpan);\n this.tag = tag;\n this.template = template;\n }\n visit(visitor, context) {\n return visitor.visitTaggedTemplateLiteral(this, context);\n }\n}\nclass TemplateLiteral extends AST {\n elements;\n expressions;\n constructor(span, sourceSpan, elements, expressions) {\n super(span, sourceSpan);\n this.elements = elements;\n this.expressions = expressions;\n }\n visit(visitor, context) {\n return visitor.visitTemplateLiteral(this, context);\n }\n}\nclass TemplateLiteralElement extends AST {\n text;\n constructor(span, sourceSpan, text) {\n super(span, sourceSpan);\n this.text = text;\n }\n visit(visitor, context) {\n return visitor.visitTemplateLiteralElement(this, context);\n }\n}\nclass ParenthesizedExpression extends AST {\n expression;\n constructor(span, sourceSpan, expression) {\n super(span, sourceSpan);\n this.expression = expression;\n }\n visit(visitor, context) {\n return visitor.visitParenthesizedExpression(this, context);\n }\n}\n/**\n * Records the absolute position of a text span in a source file, where `start` and `end` are the\n * starting and ending byte offsets, respectively, of the text span in a source file.\n */\nclass AbsoluteSourceSpan {\n start;\n end;\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n}\nclass ASTWithSource extends AST {\n ast;\n source;\n location;\n errors;\n constructor(ast, source, location, absoluteOffset, errors) {\n super(new ParseSpan(0, source === null ? 0 : source.length), new AbsoluteSourceSpan(absoluteOffset, source === null ? absoluteOffset : absoluteOffset + source.length));\n this.ast = ast;\n this.source = source;\n this.location = location;\n this.errors = errors;\n }\n visit(visitor, context = null) {\n if (visitor.visitASTWithSource) {\n return visitor.visitASTWithSource(this, context);\n }\n return this.ast.visit(visitor, context);\n }\n toString() {\n return `${this.source} in ${this.location}`;\n }\n}\nclass VariableBinding {\n sourceSpan;\n key;\n value;\n /**\n * @param sourceSpan entire span of the binding.\n * @param key name of the LHS along with its span.\n * @param value optional value for the RHS along with its span.\n */\n constructor(sourceSpan, key, value) {\n this.sourceSpan = sourceSpan;\n this.key = key;\n this.value = value;\n }\n}\nclass ExpressionBinding {\n sourceSpan;\n key;\n value;\n /**\n * @param sourceSpan entire span of the binding.\n * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its\n * span. Note that the length of the span may not be the same as\n * `key.source.length`. For example,\n * 1. key.source = ngFor, key.span is for \"ngFor\"\n * 2. key.source = ngForOf, key.span is for \"of\"\n * 3. key.source = ngForTrackBy, key.span is for \"trackBy\"\n * @param value optional expression for the RHS.\n */\n constructor(sourceSpan, key, value) {\n this.sourceSpan = sourceSpan;\n this.key = key;\n this.value = value;\n }\n}\nclass RecursiveAstVisitor {\n visit(ast, context) {\n // The default implementation just visits every node.\n // Classes that extend RecursiveAstVisitor should override this function\n // to selectively visit the specified node.\n ast.visit(this, context);\n }\n visitUnary(ast, context) {\n this.visit(ast.expr, context);\n }\n visitBinary(ast, context) {\n this.visit(ast.left, context);\n this.visit(ast.right, context);\n }\n visitChain(ast, context) {\n this.visitAll(ast.expressions, context);\n }\n visitConditional(ast, context) {\n this.visit(ast.condition, context);\n this.visit(ast.trueExp, context);\n this.visit(ast.falseExp, context);\n }\n visitPipe(ast, context) {\n this.visit(ast.exp, context);\n this.visitAll(ast.args, context);\n }\n visitImplicitReceiver(ast, context) { }\n visitThisReceiver(ast, context) { }\n visitInterpolation(ast, context) {\n this.visitAll(ast.expressions, context);\n }\n visitKeyedRead(ast, context) {\n this.visit(ast.receiver, context);\n this.visit(ast.key, context);\n }\n visitLiteralArray(ast, context) {\n this.visitAll(ast.expressions, context);\n }\n visitLiteralMap(ast, context) {\n this.visitAll(ast.values, context);\n }\n visitLiteralPrimitive(ast, context) { }\n visitPrefixNot(ast, context) {\n this.visit(ast.expression, context);\n }\n visitTypeofExpression(ast, context) {\n this.visit(ast.expression, context);\n }\n visitVoidExpression(ast, context) {\n this.visit(ast.expression, context);\n }\n visitNonNullAssert(ast, context) {\n this.visit(ast.expression, context);\n }\n visitPropertyRead(ast, context) {\n this.visit(ast.receiver, context);\n }\n visitSafePropertyRead(ast, context) {\n this.visit(ast.receiver, context);\n }\n visitSafeKeyedRead(ast, context) {\n this.visit(ast.receiver, context);\n this.visit(ast.key, context);\n }\n visitCall(ast, context) {\n this.visit(ast.receiver, context);\n this.visitAll(ast.args, context);\n }\n visitSafeCall(ast, context) {\n this.visit(ast.receiver, context);\n this.visitAll(ast.args, context);\n }\n visitTemplateLiteral(ast, context) {\n // Iterate in the declaration order. Note that there will\n // always be one expression less than the number of elements.\n for (let i = 0; i < ast.elements.length; i++) {\n this.visit(ast.elements[i], context);\n const expression = i < ast.expressions.length ? ast.expressions[i] : null;\n if (expression !== null) {\n this.visit(expression, context);\n }\n }\n }\n visitTemplateLiteralElement(ast, context) { }\n visitTaggedTemplateLiteral(ast, context) {\n this.visit(ast.tag, context);\n this.visit(ast.template, context);\n }\n visitParenthesizedExpression(ast, context) {\n this.visit(ast.expression, context);\n }\n // This is not part of the AstVisitor interface, just a helper method\n visitAll(asts, context) {\n for (const ast of asts) {\n this.visit(ast, context);\n }\n }\n}\n// Bindings\nclass ParsedProperty {\n name;\n expression;\n type;\n sourceSpan;\n keySpan;\n valueSpan;\n isLiteral;\n isLegacyAnimation;\n constructor(name, expression, type, sourceSpan, keySpan, valueSpan) {\n this.name = name;\n this.expression = expression;\n this.type = type;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n this.isLiteral = this.type === ParsedPropertyType.LITERAL_ATTR;\n this.isLegacyAnimation = this.type === ParsedPropertyType.LEGACY_ANIMATION;\n }\n}\nvar ParsedPropertyType;\n(function (ParsedPropertyType) {\n ParsedPropertyType[ParsedPropertyType[\"DEFAULT\"] = 0] = \"DEFAULT\";\n ParsedPropertyType[ParsedPropertyType[\"LITERAL_ATTR\"] = 1] = \"LITERAL_ATTR\";\n ParsedPropertyType[ParsedPropertyType[\"LEGACY_ANIMATION\"] = 2] = \"LEGACY_ANIMATION\";\n ParsedPropertyType[ParsedPropertyType[\"TWO_WAY\"] = 3] = \"TWO_WAY\";\n})(ParsedPropertyType || (ParsedPropertyType = {}));\nvar ParsedEventType;\n(function (ParsedEventType) {\n // DOM or Directive event\n ParsedEventType[ParsedEventType[\"Regular\"] = 0] = \"Regular\";\n // Legacy animation specific event\n ParsedEventType[ParsedEventType[\"LegacyAnimation\"] = 1] = \"LegacyAnimation\";\n // Event side of a two-way binding (e.g. `[(property)]=\"expression\"`).\n ParsedEventType[ParsedEventType[\"TwoWay\"] = 2] = \"TwoWay\";\n})(ParsedEventType || (ParsedEventType = {}));\nclass ParsedEvent {\n name;\n targetOrPhase;\n type;\n handler;\n sourceSpan;\n handlerSpan;\n keySpan;\n constructor(name, targetOrPhase, type, handler, sourceSpan, handlerSpan, keySpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }\n}\n/**\n * ParsedVariable represents a variable declaration in a microsyntax expression.\n */\nclass ParsedVariable {\n name;\n value;\n sourceSpan;\n keySpan;\n valueSpan;\n constructor(name, value, sourceSpan, keySpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n }\n}\nvar BindingType;\n(function (BindingType) {\n // A regular binding to a property (e.g. `[property]=\"expression\"`).\n BindingType[BindingType[\"Property\"] = 0] = \"Property\";\n // A binding to an element attribute (e.g. `[attr.name]=\"expression\"`).\n BindingType[BindingType[\"Attribute\"] = 1] = \"Attribute\";\n // A binding to a CSS class (e.g. `[class.name]=\"condition\"`).\n BindingType[BindingType[\"Class\"] = 2] = \"Class\";\n // A binding to a style rule (e.g. `[style.rule]=\"expression\"`).\n BindingType[BindingType[\"Style\"] = 3] = \"Style\";\n // A binding to a legacy animation reference (e.g. `[animate.key]=\"expression\"`).\n BindingType[BindingType[\"LegacyAnimation\"] = 4] = \"LegacyAnimation\";\n // Property side of a two-way binding (e.g. `[(property)]=\"expression\"`).\n BindingType[BindingType[\"TwoWay\"] = 5] = \"TwoWay\";\n})(BindingType || (BindingType = {}));\nclass BoundElementProperty {\n name;\n type;\n securityContext;\n value;\n unit;\n sourceSpan;\n keySpan;\n valueSpan;\n constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan) {\n this.name = name;\n this.type = type;\n this.securityContext = securityContext;\n this.value = value;\n this.unit = unit;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n }\n}\n\nvar TagContentType;\n(function (TagContentType) {\n TagContentType[TagContentType[\"RAW_TEXT\"] = 0] = \"RAW_TEXT\";\n TagContentType[TagContentType[\"ESCAPABLE_RAW_TEXT\"] = 1] = \"ESCAPABLE_RAW_TEXT\";\n TagContentType[TagContentType[\"PARSABLE_DATA\"] = 2] = \"PARSABLE_DATA\";\n})(TagContentType || (TagContentType = {}));\nfunction splitNsName(elementName, fatal = true) {\n if (elementName[0] != ':') {\n return [null, elementName];\n }\n const colonIndex = elementName.indexOf(':', 1);\n if (colonIndex === -1) {\n if (fatal) {\n throw new Error(`Unsupported format \"${elementName}\" expecting \":namespace:name\"`);\n }\n else {\n return [null, elementName];\n }\n }\n return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n}\n// `` tags work the same regardless the namespace\nfunction isNgContainer(tagName) {\n return splitNsName(tagName)[1] === 'ng-container';\n}\n// `` tags work the same regardless the namespace\nfunction isNgContent(tagName) {\n return splitNsName(tagName)[1] === 'ng-content';\n}\n// `` tags work the same regardless the namespace\nfunction isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}\nfunction getNsPrefix(fullName) {\n return fullName === null ? null : splitNsName(fullName)[0];\n}\nfunction mergeNsAndName(prefix, localName) {\n return prefix ? `:${prefix}:${localName}` : localName;\n}\n\n/**\n * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently\n * require the implementation of a visitor for Comments as they are only collected at\n * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`\n * is true.\n */\nlet Comment$1 = class Comment {\n value;\n sourceSpan;\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n visit(_visitor) {\n throw new Error('visit() not implemented for Comment');\n }\n};\nlet Text$3 = class Text {\n value;\n sourceSpan;\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor) {\n return visitor.visitText(this);\n }\n};\nclass BoundText {\n value;\n sourceSpan;\n i18n;\n constructor(value, sourceSpan, i18n) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitBoundText(this);\n }\n}\n/**\n * Represents a text attribute in the template.\n *\n * `valueSpan` may not be present in cases where there is no value ``.\n * `keySpan` may also not be present for synthetic attributes from ICU expansions.\n */\nclass TextAttribute {\n name;\n value;\n sourceSpan;\n keySpan;\n valueSpan;\n i18n;\n constructor(name, value, sourceSpan, keySpan, valueSpan, i18n) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitTextAttribute(this);\n }\n}\nclass BoundAttribute {\n name;\n type;\n securityContext;\n value;\n unit;\n sourceSpan;\n keySpan;\n valueSpan;\n i18n;\n constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n) {\n this.name = name;\n this.type = type;\n this.securityContext = securityContext;\n this.value = value;\n this.unit = unit;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n this.i18n = i18n;\n }\n static fromBoundElementProperty(prop, i18n) {\n if (prop.keySpan === undefined) {\n throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`);\n }\n return new BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n);\n }\n visit(visitor) {\n return visitor.visitBoundAttribute(this);\n }\n}\nclass BoundEvent {\n name;\n type;\n handler;\n target;\n phase;\n sourceSpan;\n handlerSpan;\n keySpan;\n constructor(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) {\n this.name = name;\n this.type = type;\n this.handler = handler;\n this.target = target;\n this.phase = phase;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }\n static fromParsedEvent(event) {\n const target = event.type === ParsedEventType.Regular ? event.targetOrPhase : null;\n const phase = event.type === ParsedEventType.LegacyAnimation ? event.targetOrPhase : null;\n if (event.keySpan === undefined) {\n throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);\n }\n return new BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan);\n }\n visit(visitor) {\n return visitor.visitBoundEvent(this);\n }\n}\nlet Element$1 = class Element {\n name;\n attributes;\n inputs;\n outputs;\n directives;\n children;\n references;\n isSelfClosing;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n isVoid;\n i18n;\n constructor(name, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, isVoid, i18n) {\n this.name = name;\n this.attributes = attributes;\n this.inputs = inputs;\n this.outputs = outputs;\n this.directives = directives;\n this.children = children;\n this.references = references;\n this.isSelfClosing = isSelfClosing;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.isVoid = isVoid;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitElement(this);\n }\n};\nclass DeferredTrigger {\n nameSpan;\n sourceSpan;\n prefetchSpan;\n whenOrOnSourceSpan;\n hydrateSpan;\n constructor(nameSpan, sourceSpan, prefetchSpan, whenOrOnSourceSpan, hydrateSpan) {\n this.nameSpan = nameSpan;\n this.sourceSpan = sourceSpan;\n this.prefetchSpan = prefetchSpan;\n this.whenOrOnSourceSpan = whenOrOnSourceSpan;\n this.hydrateSpan = hydrateSpan;\n }\n visit(visitor) {\n return visitor.visitDeferredTrigger(this);\n }\n}\nclass BoundDeferredTrigger extends DeferredTrigger {\n value;\n constructor(value, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan) {\n // BoundDeferredTrigger is for 'when' triggers. These aren't really \"triggers\" and don't have a\n // nameSpan. Trigger names are the built in event triggers like hover, interaction, etc.\n super(/** nameSpan */ null, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan);\n this.value = value;\n }\n}\nclass NeverDeferredTrigger extends DeferredTrigger {\n}\nclass IdleDeferredTrigger extends DeferredTrigger {\n}\nclass ImmediateDeferredTrigger extends DeferredTrigger {\n}\nclass HoverDeferredTrigger extends DeferredTrigger {\n reference;\n constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n this.reference = reference;\n }\n}\nclass TimerDeferredTrigger extends DeferredTrigger {\n delay;\n constructor(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n this.delay = delay;\n }\n}\nclass InteractionDeferredTrigger extends DeferredTrigger {\n reference;\n constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n this.reference = reference;\n }\n}\nclass ViewportDeferredTrigger extends DeferredTrigger {\n reference;\n constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n this.reference = reference;\n }\n}\nclass BlockNode {\n nameSpan;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n constructor(nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {\n this.nameSpan = nameSpan;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n}\nclass DeferredBlockPlaceholder extends BlockNode {\n children;\n minimumTime;\n i18n;\n constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.children = children;\n this.minimumTime = minimumTime;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitDeferredBlockPlaceholder(this);\n }\n}\nclass DeferredBlockLoading extends BlockNode {\n children;\n afterTime;\n minimumTime;\n i18n;\n constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.children = children;\n this.afterTime = afterTime;\n this.minimumTime = minimumTime;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitDeferredBlockLoading(this);\n }\n}\nclass DeferredBlockError extends BlockNode {\n children;\n i18n;\n constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.children = children;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitDeferredBlockError(this);\n }\n}\nclass DeferredBlock extends BlockNode {\n children;\n placeholder;\n loading;\n error;\n mainBlockSpan;\n i18n;\n triggers;\n prefetchTriggers;\n hydrateTriggers;\n definedTriggers;\n definedPrefetchTriggers;\n definedHydrateTriggers;\n constructor(children, triggers, prefetchTriggers, hydrateTriggers, placeholder, loading, error, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.children = children;\n this.placeholder = placeholder;\n this.loading = loading;\n this.error = error;\n this.mainBlockSpan = mainBlockSpan;\n this.i18n = i18n;\n this.triggers = triggers;\n this.prefetchTriggers = prefetchTriggers;\n this.hydrateTriggers = hydrateTriggers;\n // We cache the keys since we know that they won't change and we\n // don't want to enumarate them every time we're traversing the AST.\n this.definedTriggers = Object.keys(triggers);\n this.definedPrefetchTriggers = Object.keys(prefetchTriggers);\n this.definedHydrateTriggers = Object.keys(hydrateTriggers);\n }\n visit(visitor) {\n return visitor.visitDeferredBlock(this);\n }\n visitAll(visitor) {\n // Visit the hydrate triggers first to match their insertion order.\n this.visitTriggers(this.definedHydrateTriggers, this.hydrateTriggers, visitor);\n this.visitTriggers(this.definedTriggers, this.triggers, visitor);\n this.visitTriggers(this.definedPrefetchTriggers, this.prefetchTriggers, visitor);\n visitAll$1(visitor, this.children);\n const remainingBlocks = [this.placeholder, this.loading, this.error].filter((x) => x !== null);\n visitAll$1(visitor, remainingBlocks);\n }\n visitTriggers(keys, triggers, visitor) {\n visitAll$1(visitor, keys.map((k) => triggers[k]));\n }\n}\nclass SwitchBlock extends BlockNode {\n expression;\n cases;\n unknownBlocks;\n constructor(expression, cases, \n /**\n * These blocks are only captured to allow for autocompletion in the language service. They\n * aren't meant to be processed in any other way.\n */\n unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.expression = expression;\n this.cases = cases;\n this.unknownBlocks = unknownBlocks;\n }\n visit(visitor) {\n return visitor.visitSwitchBlock(this);\n }\n}\nclass SwitchBlockCase extends BlockNode {\n expression;\n children;\n i18n;\n constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.expression = expression;\n this.children = children;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitSwitchBlockCase(this);\n }\n}\nclass ForLoopBlock extends BlockNode {\n item;\n expression;\n trackBy;\n trackKeywordSpan;\n contextVariables;\n children;\n empty;\n mainBlockSpan;\n i18n;\n constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.item = item;\n this.expression = expression;\n this.trackBy = trackBy;\n this.trackKeywordSpan = trackKeywordSpan;\n this.contextVariables = contextVariables;\n this.children = children;\n this.empty = empty;\n this.mainBlockSpan = mainBlockSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitForLoopBlock(this);\n }\n}\nclass ForLoopBlockEmpty extends BlockNode {\n children;\n i18n;\n constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.children = children;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitForLoopBlockEmpty(this);\n }\n}\nclass IfBlock extends BlockNode {\n branches;\n constructor(branches, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.branches = branches;\n }\n visit(visitor) {\n return visitor.visitIfBlock(this);\n }\n}\nclass IfBlockBranch extends BlockNode {\n expression;\n children;\n expressionAlias;\n i18n;\n constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.expression = expression;\n this.children = children;\n this.expressionAlias = expressionAlias;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitIfBlockBranch(this);\n }\n}\nclass UnknownBlock {\n name;\n sourceSpan;\n nameSpan;\n constructor(name, sourceSpan, nameSpan) {\n this.name = name;\n this.sourceSpan = sourceSpan;\n this.nameSpan = nameSpan;\n }\n visit(visitor) {\n return visitor.visitUnknownBlock(this);\n }\n}\nlet LetDeclaration$1 = class LetDeclaration {\n name;\n value;\n sourceSpan;\n nameSpan;\n valueSpan;\n constructor(name, value, sourceSpan, nameSpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.nameSpan = nameSpan;\n this.valueSpan = valueSpan;\n }\n visit(visitor) {\n return visitor.visitLetDeclaration(this);\n }\n};\nlet Component$1 = class Component {\n componentName;\n tagName;\n fullName;\n attributes;\n inputs;\n outputs;\n directives;\n children;\n references;\n isSelfClosing;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n i18n;\n constructor(componentName, tagName, fullName, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n this.componentName = componentName;\n this.tagName = tagName;\n this.fullName = fullName;\n this.attributes = attributes;\n this.inputs = inputs;\n this.outputs = outputs;\n this.directives = directives;\n this.children = children;\n this.references = references;\n this.isSelfClosing = isSelfClosing;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitComponent(this);\n }\n};\nlet Directive$1 = class Directive {\n name;\n attributes;\n inputs;\n outputs;\n references;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n i18n;\n constructor(name, attributes, inputs, outputs, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n this.name = name;\n this.attributes = attributes;\n this.inputs = inputs;\n this.outputs = outputs;\n this.references = references;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitDirective(this);\n }\n};\nclass Template {\n tagName;\n attributes;\n inputs;\n outputs;\n directives;\n templateAttrs;\n children;\n references;\n variables;\n isSelfClosing;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n i18n;\n constructor(\n // tagName is the name of the container element, if applicable.\n // `null` is a special case for when there is a structural directive on an `ng-template` so\n // the renderer can differentiate between the synthetic template and the one written in the\n // file.\n tagName, attributes, inputs, outputs, directives, templateAttrs, children, references, variables, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n this.tagName = tagName;\n this.attributes = attributes;\n this.inputs = inputs;\n this.outputs = outputs;\n this.directives = directives;\n this.templateAttrs = templateAttrs;\n this.children = children;\n this.references = references;\n this.variables = variables;\n this.isSelfClosing = isSelfClosing;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitTemplate(this);\n }\n}\nclass Content {\n selector;\n attributes;\n children;\n isSelfClosing;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n i18n;\n name = 'ng-content';\n constructor(selector, attributes, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {\n this.selector = selector;\n this.attributes = attributes;\n this.children = children;\n this.isSelfClosing = isSelfClosing;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitContent(this);\n }\n}\nclass Variable {\n name;\n value;\n sourceSpan;\n keySpan;\n valueSpan;\n constructor(name, value, sourceSpan, keySpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n }\n visit(visitor) {\n return visitor.visitVariable(this);\n }\n}\nclass Reference {\n name;\n value;\n sourceSpan;\n keySpan;\n valueSpan;\n constructor(name, value, sourceSpan, keySpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n }\n visit(visitor) {\n return visitor.visitReference(this);\n }\n}\nlet Icu$1 = class Icu {\n vars;\n placeholders;\n sourceSpan;\n i18n;\n constructor(vars, placeholders, sourceSpan, i18n) {\n this.vars = vars;\n this.placeholders = placeholders;\n this.sourceSpan = sourceSpan;\n this.i18n = i18n;\n }\n visit(visitor) {\n return visitor.visitIcu(this);\n }\n};\n/**\n * AST node that represents the host element of a directive.\n * This node is used only for type checking purposes and cannot be produced from a user's template.\n */\nclass HostElement {\n tagNames;\n bindings;\n listeners;\n sourceSpan;\n constructor(tagNames, bindings, listeners, sourceSpan) {\n this.tagNames = tagNames;\n this.bindings = bindings;\n this.listeners = listeners;\n this.sourceSpan = sourceSpan;\n if (tagNames.length === 0) {\n throw new Error('HostElement must have at least one tag name.');\n }\n }\n visit() {\n throw new Error(`HostElement cannot be visited`);\n }\n}\nlet RecursiveVisitor$1 = class RecursiveVisitor {\n visitElement(element) {\n visitAll$1(this, element.attributes);\n visitAll$1(this, element.inputs);\n visitAll$1(this, element.outputs);\n visitAll$1(this, element.directives);\n visitAll$1(this, element.children);\n visitAll$1(this, element.references);\n }\n visitTemplate(template) {\n visitAll$1(this, template.attributes);\n visitAll$1(this, template.inputs);\n visitAll$1(this, template.outputs);\n visitAll$1(this, template.directives);\n visitAll$1(this, template.children);\n visitAll$1(this, template.references);\n visitAll$1(this, template.variables);\n }\n visitDeferredBlock(deferred) {\n deferred.visitAll(this);\n }\n visitDeferredBlockPlaceholder(block) {\n visitAll$1(this, block.children);\n }\n visitDeferredBlockError(block) {\n visitAll$1(this, block.children);\n }\n visitDeferredBlockLoading(block) {\n visitAll$1(this, block.children);\n }\n visitSwitchBlock(block) {\n visitAll$1(this, block.cases);\n }\n visitSwitchBlockCase(block) {\n visitAll$1(this, block.children);\n }\n visitForLoopBlock(block) {\n const blockItems = [block.item, ...block.contextVariables, ...block.children];\n block.empty && blockItems.push(block.empty);\n visitAll$1(this, blockItems);\n }\n visitForLoopBlockEmpty(block) {\n visitAll$1(this, block.children);\n }\n visitIfBlock(block) {\n visitAll$1(this, block.branches);\n }\n visitIfBlockBranch(block) {\n const blockItems = block.children;\n block.expressionAlias && blockItems.push(block.expressionAlias);\n visitAll$1(this, blockItems);\n }\n visitContent(content) {\n visitAll$1(this, content.children);\n }\n visitComponent(component) {\n visitAll$1(this, component.attributes);\n visitAll$1(this, component.inputs);\n visitAll$1(this, component.outputs);\n visitAll$1(this, component.directives);\n visitAll$1(this, component.children);\n visitAll$1(this, component.references);\n }\n visitDirective(directive) {\n visitAll$1(this, directive.attributes);\n visitAll$1(this, directive.inputs);\n visitAll$1(this, directive.outputs);\n visitAll$1(this, directive.references);\n }\n visitVariable(variable) { }\n visitReference(reference) { }\n visitTextAttribute(attribute) { }\n visitBoundAttribute(attribute) { }\n visitBoundEvent(attribute) { }\n visitText(text) { }\n visitBoundText(text) { }\n visitIcu(icu) { }\n visitDeferredTrigger(trigger) { }\n visitUnknownBlock(block) { }\n visitLetDeclaration(decl) { }\n};\nfunction visitAll$1(visitor, nodes) {\n const result = [];\n if (visitor.visit) {\n for (const node of nodes) {\n visitor.visit(node);\n }\n }\n else {\n for (const node of nodes) {\n const newNode = node.visit(visitor);\n if (newNode) {\n result.push(newNode);\n }\n }\n }\n return result;\n}\n\nclass Message {\n nodes;\n placeholders;\n placeholderToMessage;\n meaning;\n description;\n customId;\n sources;\n id;\n /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */\n legacyIds = [];\n messageString;\n /**\n * @param nodes message AST\n * @param placeholders maps placeholder names to static content and their source spans\n * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)\n * @param meaning\n * @param description\n * @param customId\n */\n constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {\n this.nodes = nodes;\n this.placeholders = placeholders;\n this.placeholderToMessage = placeholderToMessage;\n this.meaning = meaning;\n this.description = description;\n this.customId = customId;\n this.id = this.customId;\n this.messageString = serializeMessage(this.nodes);\n if (nodes.length) {\n this.sources = [\n {\n filePath: nodes[0].sourceSpan.start.file.url,\n startLine: nodes[0].sourceSpan.start.line + 1,\n startCol: nodes[0].sourceSpan.start.col + 1,\n endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,\n endCol: nodes[0].sourceSpan.start.col + 1,\n },\n ];\n }\n else {\n this.sources = [];\n }\n }\n}\nlet Text$2 = class Text {\n value;\n sourceSpan;\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitText(this, context);\n }\n};\n// TODO(vicb): do we really need this node (vs an array) ?\nclass Container {\n children;\n sourceSpan;\n constructor(children, sourceSpan) {\n this.children = children;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitContainer(this, context);\n }\n}\nclass Icu {\n expression;\n type;\n cases;\n sourceSpan;\n expressionPlaceholder;\n constructor(expression, type, cases, sourceSpan, expressionPlaceholder) {\n this.expression = expression;\n this.type = type;\n this.cases = cases;\n this.sourceSpan = sourceSpan;\n this.expressionPlaceholder = expressionPlaceholder;\n }\n visit(visitor, context) {\n return visitor.visitIcu(this, context);\n }\n}\nclass TagPlaceholder {\n tag;\n attrs;\n startName;\n closeName;\n children;\n isVoid;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n constructor(tag, attrs, startName, closeName, children, isVoid, \n // TODO sourceSpan should cover all (we need a startSourceSpan and endSourceSpan)\n sourceSpan, startSourceSpan, endSourceSpan) {\n this.tag = tag;\n this.attrs = attrs;\n this.startName = startName;\n this.closeName = closeName;\n this.children = children;\n this.isVoid = isVoid;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitTagPlaceholder(this, context);\n }\n}\nclass Placeholder {\n value;\n name;\n sourceSpan;\n constructor(value, name, sourceSpan) {\n this.value = value;\n this.name = name;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitPlaceholder(this, context);\n }\n}\nclass IcuPlaceholder {\n value;\n name;\n sourceSpan;\n /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */\n previousMessage;\n constructor(value, name, sourceSpan) {\n this.value = value;\n this.name = name;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitIcuPlaceholder(this, context);\n }\n}\nclass BlockPlaceholder {\n name;\n parameters;\n startName;\n closeName;\n children;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n constructor(name, parameters, startName, closeName, children, sourceSpan, startSourceSpan, endSourceSpan) {\n this.name = name;\n this.parameters = parameters;\n this.startName = startName;\n this.closeName = closeName;\n this.children = children;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitBlockPlaceholder(this, context);\n }\n}\n// Clone the AST\nclass CloneVisitor {\n visitText(text, context) {\n return new Text$2(text.value, text.sourceSpan);\n }\n visitContainer(container, context) {\n const children = container.children.map((n) => n.visit(this, context));\n return new Container(children, container.sourceSpan);\n }\n visitIcu(icu, context) {\n const cases = {};\n Object.keys(icu.cases).forEach((key) => (cases[key] = icu.cases[key].visit(this, context)));\n const msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan, icu.expressionPlaceholder);\n return msg;\n }\n visitTagPlaceholder(ph, context) {\n const children = ph.children.map((n) => n.visit(this, context));\n return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);\n }\n visitPlaceholder(ph, context) {\n return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n }\n visitIcuPlaceholder(ph, context) {\n return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n }\n visitBlockPlaceholder(ph, context) {\n const children = ph.children.map((n) => n.visit(this, context));\n return new BlockPlaceholder(ph.name, ph.parameters, ph.startName, ph.closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);\n }\n}\n// Visit all the nodes recursively\nclass RecurseVisitor {\n visitText(text, context) { }\n visitContainer(container, context) {\n container.children.forEach((child) => child.visit(this));\n }\n visitIcu(icu, context) {\n Object.keys(icu.cases).forEach((k) => {\n icu.cases[k].visit(this);\n });\n }\n visitTagPlaceholder(ph, context) {\n ph.children.forEach((child) => child.visit(this));\n }\n visitPlaceholder(ph, context) { }\n visitIcuPlaceholder(ph, context) { }\n visitBlockPlaceholder(ph, context) {\n ph.children.forEach((child) => child.visit(this));\n }\n}\n/**\n * Serialize the message to the Localize backtick string format that would appear in compiled code.\n */\nfunction serializeMessage(messageNodes) {\n const visitor = new LocalizeMessageStringVisitor();\n const str = messageNodes.map((n) => n.visit(visitor)).join('');\n return str;\n}\nclass LocalizeMessageStringVisitor {\n visitText(text) {\n return text.value;\n }\n visitContainer(container) {\n return container.children.map((child) => child.visit(this)).join('');\n }\n visitIcu(icu) {\n const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n return `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`;\n }\n visitTagPlaceholder(ph) {\n const children = ph.children.map((child) => child.visit(this)).join('');\n return `{$${ph.startName}}${children}{$${ph.closeName}}`;\n }\n visitPlaceholder(ph) {\n return `{$${ph.name}}`;\n }\n visitIcuPlaceholder(ph) {\n return `{$${ph.name}}`;\n }\n visitBlockPlaceholder(ph) {\n const children = ph.children.map((child) => child.visit(this)).join('');\n return `{$${ph.startName}}${children}{$${ph.closeName}}`;\n }\n}\n\nclass Serializer {\n // Creates a name mapper, see `PlaceholderMapper`\n // Returning `null` means that no name mapping is used.\n createNameMapper(message) {\n return null;\n }\n}\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nclass SimplePlaceholderMapper extends RecurseVisitor {\n mapName;\n internalToPublic = {};\n publicToNextId = {};\n publicToInternal = {};\n // create a mapping from the message\n constructor(message, mapName) {\n super();\n this.mapName = mapName;\n message.nodes.forEach((node) => node.visit(this));\n }\n toPublicName(internalName) {\n return this.internalToPublic.hasOwnProperty(internalName)\n ? this.internalToPublic[internalName]\n : null;\n }\n toInternalName(publicName) {\n return this.publicToInternal.hasOwnProperty(publicName)\n ? this.publicToInternal[publicName]\n : null;\n }\n visitText(text, context) {\n return null;\n }\n visitTagPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.startName);\n super.visitTagPlaceholder(ph, context);\n this.visitPlaceholderName(ph.closeName);\n }\n visitPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.name);\n }\n visitBlockPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.startName);\n super.visitBlockPlaceholder(ph, context);\n this.visitPlaceholderName(ph.closeName);\n }\n visitIcuPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.name);\n }\n // XMB placeholders could only contains A-Z, 0-9 and _\n visitPlaceholderName(internalName) {\n if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n return;\n }\n let publicName = this.mapName(internalName);\n if (this.publicToInternal.hasOwnProperty(publicName)) {\n // Create a new XMB when it has already been used\n const nextId = this.publicToNextId[publicName];\n this.publicToNextId[publicName] = nextId + 1;\n publicName = `${publicName}_${nextId}`;\n }\n else {\n this.publicToNextId[publicName] = 1;\n }\n this.internalToPublic[internalName] = publicName;\n this.publicToInternal[publicName] = internalName;\n }\n}\n\nlet _Visitor$2 = class _Visitor {\n visitTag(tag) {\n const strAttrs = this._serializeAttributes(tag.attrs);\n if (tag.children.length == 0) {\n return `<${tag.name}${strAttrs}/>`;\n }\n const strChildren = tag.children.map((node) => node.visit(this));\n return `<${tag.name}${strAttrs}>${strChildren.join('')}${tag.name}>`;\n }\n visitText(text) {\n return text.value;\n }\n visitDeclaration(decl) {\n return ``;\n }\n _serializeAttributes(attrs) {\n const strAttrs = Object.keys(attrs)\n .map((name) => `${name}=\"${attrs[name]}\"`)\n .join(' ');\n return strAttrs.length > 0 ? ' ' + strAttrs : '';\n }\n visitDoctype(doctype) {\n return ``;\n }\n};\nconst _visitor = new _Visitor$2();\nfunction serialize$1(nodes) {\n return nodes.map((node) => node.visit(_visitor)).join('');\n}\nclass Declaration {\n attrs = {};\n constructor(unescapedAttrs) {\n Object.keys(unescapedAttrs).forEach((k) => {\n this.attrs[k] = escapeXml(unescapedAttrs[k]);\n });\n }\n visit(visitor) {\n return visitor.visitDeclaration(this);\n }\n}\nclass Doctype {\n rootTag;\n dtd;\n constructor(rootTag, dtd) {\n this.rootTag = rootTag;\n this.dtd = dtd;\n }\n visit(visitor) {\n return visitor.visitDoctype(this);\n }\n}\nclass Tag {\n name;\n children;\n attrs = {};\n constructor(name, unescapedAttrs = {}, children = []) {\n this.name = name;\n this.children = children;\n Object.keys(unescapedAttrs).forEach((k) => {\n this.attrs[k] = escapeXml(unescapedAttrs[k]);\n });\n }\n visit(visitor) {\n return visitor.visitTag(this);\n }\n}\nlet Text$1 = class Text {\n value;\n constructor(unescapedValue) {\n this.value = escapeXml(unescapedValue);\n }\n visit(visitor) {\n return visitor.visitText(this);\n }\n};\nclass CR extends Text$1 {\n constructor(ws = 0) {\n super(`\\n${new Array(ws + 1).join(' ')}`);\n }\n}\nconst _ESCAPED_CHARS = [\n [/&/g, '&'],\n [/\"/g, '"'],\n [/'/g, '''],\n [//g, '>'],\n];\n// Escape `_ESCAPED_CHARS` characters in the given text with encoded entities\nfunction escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}\n\n/**\n * Defines the `handler` value on the serialized XMB, indicating that Angular\n * generated the bundle. This is useful for analytics in Translation Console.\n *\n * NOTE: Keep in sync with\n * packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.ts.\n */\nconst _XMB_HANDLER = 'angular';\nconst _MESSAGES_TAG = 'messagebundle';\nconst _MESSAGE_TAG = 'msg';\nconst _PLACEHOLDER_TAG$3 = 'ph';\nconst _EXAMPLE_TAG = 'ex';\nconst _SOURCE_TAG$2 = 'source';\nconst _DOCTYPE = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n`;\nclass Xmb extends Serializer {\n write(messages, locale) {\n const exampleVisitor = new ExampleVisitor();\n const visitor = new _Visitor$1();\n const rootNode = new Tag(_MESSAGES_TAG);\n rootNode.attrs['handler'] = _XMB_HANDLER;\n messages.forEach((message) => {\n const attrs = { id: message.id };\n if (message.description) {\n attrs['desc'] = message.description;\n }\n if (message.meaning) {\n attrs['meaning'] = message.meaning;\n }\n let sourceTags = [];\n message.sources.forEach((source) => {\n sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [\n new Text$1(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? ',' + source.endLine : ''}`),\n ]));\n });\n rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, [...sourceTags, ...visitor.serialize(message.nodes)]));\n });\n rootNode.children.push(new CR());\n return serialize$1([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n new CR(),\n new Doctype(_MESSAGES_TAG, _DOCTYPE),\n new CR(),\n exampleVisitor.addDefaultExamples(rootNode),\n new CR(),\n ]);\n }\n load(content, url) {\n throw new Error('Unsupported');\n }\n digest(message) {\n return digest(message);\n }\n createNameMapper(message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n }\n}\nlet _Visitor$1 = class _Visitor {\n visitText(text, context) {\n return [new Text$1(text.value)];\n }\n visitContainer(container, context) {\n const nodes = [];\n container.children.forEach((node) => nodes.push(...node.visit(this)));\n return nodes;\n }\n visitIcu(icu, context) {\n const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)];\n Object.keys(icu.cases).forEach((c) => {\n nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `));\n });\n nodes.push(new Text$1(`}`));\n return nodes;\n }\n visitTagPlaceholder(ph, context) {\n const startTagAsText = new Text$1(`<${ph.tag}>`);\n const startEx = new Tag(_EXAMPLE_TAG, {}, [startTagAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.startName }, [\n startEx,\n startTagAsText,\n ]);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n const closeTagAsText = new Text$1(`${ph.tag}>`);\n const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeTagAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.closeName }, [\n closeEx,\n closeTagAsText,\n ]);\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n visitPlaceholder(ph, context) {\n const interpolationAsText = new Text$1(`{{${ph.value}}}`);\n // Example tag needs to be not-empty for TC.\n const exTag = new Tag(_EXAMPLE_TAG, {}, [interpolationAsText]);\n return [\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n new Tag(_PLACEHOLDER_TAG$3, { name: ph.name }, [exTag, interpolationAsText]),\n ];\n }\n visitBlockPlaceholder(ph, context) {\n const startAsText = new Text$1(`@${ph.name}`);\n const startEx = new Tag(_EXAMPLE_TAG, {}, [startAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.startName }, [startEx, startAsText]);\n const closeAsText = new Text$1(`}`);\n const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { name: ph.closeName }, [closeEx, closeAsText]);\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n visitIcuPlaceholder(ph, context) {\n const icuExpression = ph.value.expression;\n const icuType = ph.value.type;\n const icuCases = Object.keys(ph.value.cases)\n .map((value) => value + ' {...}')\n .join(' ');\n const icuAsText = new Text$1(`{${icuExpression}, ${icuType}, ${icuCases}}`);\n const exTag = new Tag(_EXAMPLE_TAG, {}, [icuAsText]);\n return [\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n new Tag(_PLACEHOLDER_TAG$3, { name: ph.name }, [exTag, icuAsText]),\n ];\n }\n serialize(nodes) {\n return [].concat(...nodes.map((node) => node.visit(this)));\n }\n};\nfunction digest(message) {\n return decimalDigest(message);\n}\n// TC requires at least one non-empty example on placeholders\nclass ExampleVisitor {\n addDefaultExamples(node) {\n node.visit(this);\n return node;\n }\n visitTag(tag) {\n if (tag.name === _PLACEHOLDER_TAG$3) {\n if (!tag.children || tag.children.length == 0) {\n const exText = new Text$1(tag.attrs['name'] || '...');\n tag.children = [new Tag(_EXAMPLE_TAG, {}, [exText])];\n }\n }\n else if (tag.children) {\n tag.children.forEach((node) => node.visit(this));\n }\n }\n visitText(text) { }\n visitDeclaration(decl) { }\n visitDoctype(doctype) { }\n}\n// XMB/XTB placeholders can only contain A-Z, 0-9 and _\nfunction toPublicName(internalName) {\n return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n\n/** Name of the i18n attributes **/\nconst I18N_ATTR = 'i18n';\nconst I18N_ATTR_PREFIX = 'i18n-';\n/** Prefix of var expressions used in ICUs */\nconst I18N_ICU_VAR_PREFIX = 'VAR_';\nfunction isI18nAttribute(name) {\n return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX);\n}\nfunction hasI18nAttrs(node) {\n return node.attrs.some((attr) => isI18nAttribute(attr.name));\n}\nfunction icuFromI18nMessage(message) {\n return message.nodes[0];\n}\n/**\n * Format the placeholder names in a map of placeholders to expressions.\n *\n * The placeholder names are converted from \"internal\" format (e.g. `START_TAG_DIV_1`) to \"external\"\n * format (e.g. `startTagDiv_1`).\n *\n * @param params A map of placeholder names to expressions.\n * @param useCamelCase whether to camelCase the placeholder name when formatting.\n * @returns A new map of formatted placeholder names to expressions.\n */\nfunction formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) {\n const _params = {};\n if (params && Object.keys(params).length) {\n Object.keys(params).forEach((key) => (_params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]));\n }\n return _params;\n}\n/**\n * Converts internal placeholder names to public-facing format\n * (for example to use in goog.getMsg call).\n * Example: `START_TAG_DIV_1` is converted to `startTagDiv_1`.\n *\n * @param name The placeholder name that should be formatted\n * @returns Formatted placeholder name\n */\nfunction formatI18nPlaceholderName(name, useCamelCase = true) {\n const publicName = toPublicName(name);\n if (!useCamelCase) {\n return publicName;\n }\n const chunks = publicName.split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n let postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n let raw = chunks.shift().toLowerCase();\n if (chunks.length) {\n raw += chunks.map((c) => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase()).join('');\n }\n return postfix ? `${raw}_${postfix}` : raw;\n}\n\n/**\n * Checks whether an object key contains potentially unsafe chars, thus the key should be wrapped in\n * quotes. Note: we do not wrap all keys into quotes, as it may have impact on minification and may\n * not work in some cases when object keys are mangled by a minifier.\n *\n * TODO(FW-1136): this is a temporary solution, we need to come up with a better way of working with\n * inputs that contain potentially unsafe chars.\n */\nconst UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;\n/** Name of the temporary to use during data binding */\nconst TEMPORARY_NAME = '_t';\n/** Name of the context parameter passed into a template function */\nconst CONTEXT_NAME = 'ctx';\n/** Name of the RenderFlag passed into a template function */\nconst RENDER_FLAGS = 'rf';\n/**\n * Creates an allocator for a temporary variable.\n *\n * A variable declaration is added to the statements the first time the allocator is invoked.\n */\nfunction temporaryAllocator(pushStatement, name) {\n let temp = null;\n return () => {\n if (!temp) {\n pushStatement(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE));\n temp = variable(name);\n }\n return temp;\n };\n}\nfunction asLiteral(value) {\n if (Array.isArray(value)) {\n return literalArr(value.map(asLiteral));\n }\n return literal(value, INFERRED_TYPE);\n}\n/**\n * Serializes inputs and outputs for `defineDirective` and `defineComponent`.\n *\n * This will attempt to generate optimized data structures to minimize memory or\n * file size of fully compiled applications.\n */\nfunction conditionallyCreateDirectiveBindingLiteral(map, forInputs) {\n const keys = Object.getOwnPropertyNames(map);\n if (keys.length === 0) {\n return null;\n }\n return literalMap(keys.map((key) => {\n const value = map[key];\n let declaredName;\n let publicName;\n let minifiedName;\n let expressionValue;\n if (typeof value === 'string') {\n // canonical syntax: `dirProp: publicProp`\n declaredName = key;\n minifiedName = key;\n publicName = value;\n expressionValue = asLiteral(publicName);\n }\n else {\n minifiedName = key;\n declaredName = value.classPropertyName;\n publicName = value.bindingPropertyName;\n const differentDeclaringName = publicName !== declaredName;\n const hasDecoratorInputTransform = value.transformFunction !== null;\n let flags = InputFlags.None;\n // Build up input flags\n if (value.isSignal) {\n flags |= InputFlags.SignalBased;\n }\n if (hasDecoratorInputTransform) {\n flags |= InputFlags.HasDecoratorInputTransform;\n }\n // Inputs, compared to outputs, will track their declared name (for `ngOnChanges`), support\n // decorator input transform functions, or store flag information if there is any.\n if (forInputs &&\n (differentDeclaringName || hasDecoratorInputTransform || flags !== InputFlags.None)) {\n const result = [literal(flags), asLiteral(publicName)];\n if (differentDeclaringName || hasDecoratorInputTransform) {\n result.push(asLiteral(declaredName));\n if (hasDecoratorInputTransform) {\n result.push(value.transformFunction);\n }\n }\n expressionValue = literalArr(result);\n }\n else {\n expressionValue = asLiteral(publicName);\n }\n }\n return {\n key: minifiedName,\n // put quotes around keys that contain potentially unsafe characters\n quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),\n value: expressionValue,\n };\n }));\n}\n/**\n * A representation for an object literal used during codegen of definition objects. The generic\n * type `T` allows to reference a documented type of the generated structure, such that the\n * property names that are set can be resolved to their documented declaration.\n */\nclass DefinitionMap {\n values = [];\n set(key, value) {\n if (value) {\n const existing = this.values.find((value) => value.key === key);\n if (existing) {\n existing.value = value;\n }\n else {\n this.values.push({ key: key, value, quoted: false });\n }\n }\n }\n toLiteralMap() {\n return literalMap(this.values);\n }\n}\n/**\n * Creates a `CssSelector` from an AST node.\n */\nfunction createCssSelectorFromNode(node) {\n const elementName = node instanceof Element$1 ? node.name : 'ng-template';\n const attributes = getAttrsForDirectiveMatching(node);\n const cssSelector = new CssSelector();\n const elementNameNoNs = splitNsName(elementName)[1];\n cssSelector.setElement(elementNameNoNs);\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const nameNoNs = splitNsName(name)[1];\n const value = attributes[name];\n cssSelector.addAttribute(nameNoNs, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach((className) => cssSelector.addClassName(className));\n }\n });\n return cssSelector;\n}\n/**\n * Extract a map of properties to values for a given element or template node, which can be used\n * by the directive matching machinery.\n *\n * @param elOrTpl the element or template in question\n * @return an object set up for directive matching. For attributes on the element/template, this\n * object maps a property name to its (static) value. For any bindings, this map simply maps the\n * property name to an empty string.\n */\nfunction getAttrsForDirectiveMatching(elOrTpl) {\n const attributesMap = {};\n if (elOrTpl instanceof Template && elOrTpl.tagName !== 'ng-template') {\n elOrTpl.templateAttrs.forEach((a) => (attributesMap[a.name] = ''));\n }\n else {\n elOrTpl.attributes.forEach((a) => {\n if (!isI18nAttribute(a.name)) {\n attributesMap[a.name] = a.value;\n }\n });\n elOrTpl.inputs.forEach((i) => {\n if (i.type === BindingType.Property || i.type === BindingType.TwoWay) {\n attributesMap[i.name] = '';\n }\n });\n elOrTpl.outputs.forEach((o) => {\n attributesMap[o.name] = '';\n });\n }\n return attributesMap;\n}\n\nfunction compileInjectable(meta, resolveForwardRefs) {\n let result = null;\n const factoryMeta = {\n name: meta.name,\n type: meta.type,\n typeArgumentCount: meta.typeArgumentCount,\n deps: [],\n target: FactoryTarget.Injectable,\n };\n if (meta.useClass !== undefined) {\n // meta.useClass has two modes of operation. Either deps are specified, in which case `new` is\n // used to instantiate the class with dependencies injected, or deps are not specified and\n // the factory of the class is used to instantiate it.\n //\n // A special case exists for useClass: Type where Type is the injectable type itself and no\n // deps are specified, in which case 'useClass' is effectively ignored.\n const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value);\n let deps = undefined;\n if (meta.deps !== undefined) {\n deps = meta.deps;\n }\n if (deps !== undefined) {\n // factory: () => new meta.useClass(...deps)\n result = compileFactoryFunction({\n ...factoryMeta,\n delegate: meta.useClass.expression,\n delegateDeps: deps,\n delegateType: R3FactoryDelegateType.Class,\n });\n }\n else if (useClassOnSelf) {\n result = compileFactoryFunction(factoryMeta);\n }\n else {\n result = {\n statements: [],\n expression: delegateToFactory(meta.type.value, meta.useClass.expression, resolveForwardRefs),\n };\n }\n }\n else if (meta.useFactory !== undefined) {\n if (meta.deps !== undefined) {\n result = compileFactoryFunction({\n ...factoryMeta,\n delegate: meta.useFactory,\n delegateDeps: meta.deps || [],\n delegateType: R3FactoryDelegateType.Function,\n });\n }\n else {\n result = { statements: [], expression: arrowFn([], meta.useFactory.callFn([])) };\n }\n }\n else if (meta.useValue !== undefined) {\n // Note: it's safe to use `meta.useValue` instead of the `USE_VALUE in meta` check used for\n // client code because meta.useValue is an Expression which will be defined even if the actual\n // value is undefined.\n result = compileFactoryFunction({\n ...factoryMeta,\n expression: meta.useValue.expression,\n });\n }\n else if (meta.useExisting !== undefined) {\n // useExisting is an `inject` call on the existing token.\n result = compileFactoryFunction({\n ...factoryMeta,\n expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]),\n });\n }\n else {\n result = {\n statements: [],\n expression: delegateToFactory(meta.type.value, meta.type.value, resolveForwardRefs),\n };\n }\n const token = meta.type.value;\n const injectableProps = new DefinitionMap();\n injectableProps.set('token', token);\n injectableProps.set('factory', result.expression);\n // Only generate providedIn property if it has a non-null value\n if (meta.providedIn.expression.value !== null) {\n injectableProps.set('providedIn', convertFromMaybeForwardRefExpression(meta.providedIn));\n }\n const expression = importExpr(Identifiers.ɵɵdefineInjectable)\n .callFn([injectableProps.toLiteralMap()], undefined, true);\n return {\n expression,\n type: createInjectableType(meta),\n statements: result.statements,\n };\n}\nfunction createInjectableType(meta) {\n return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [\n typeWithParameters(meta.type.type, meta.typeArgumentCount),\n ]));\n}\nfunction delegateToFactory(type, useType, unwrapForwardRefs) {\n if (type.node === useType.node) {\n // The types are the same, so we can simply delegate directly to the type's factory.\n // ```\n // factory: type.ɵfac\n // ```\n return useType.prop('ɵfac');\n }\n if (!unwrapForwardRefs) {\n // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that\n // accepts a sub-type as an argument.\n // ```\n // factory: function(t) { return useType.ɵfac(t); }\n // ```\n return createFactoryFunction(useType);\n }\n // The useType is actually wrapped in a `forwardRef()` so we need to resolve that before\n // calling its factory.\n // ```\n // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }\n // ```\n const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([useType]);\n return createFactoryFunction(unwrappedType);\n}\nfunction createFactoryFunction(type) {\n const t = new FnParam('__ngFactoryType__', DYNAMIC_TYPE);\n return arrowFn([t], type.prop('ɵfac').callFn([variable(t.name)]));\n}\n\nconst UNUSABLE_INTERPOLATION_REGEXPS = [\n /@/, // control flow reserved symbol\n /^\\s*$/, // empty\n /[<>]/, // html tag\n /^[{}]$/, // i18n expansion\n /&(#|[a-z])/i, // character reference,\n /^\\/\\//, // comment\n];\nfunction assertInterpolationSymbols(identifier, value) {\n if (value != null && !(Array.isArray(value) && value.length == 2)) {\n throw new Error(`Expected '${identifier}' to be an array, [start, end].`);\n }\n else if (value != null) {\n const start = value[0];\n const end = value[1];\n // Check for unusable interpolation symbols\n UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp) => {\n if (regexp.test(start) || regexp.test(end)) {\n throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);\n }\n });\n }\n}\n\nclass InterpolationConfig {\n start;\n end;\n static fromArray(markers) {\n if (!markers) {\n return DEFAULT_INTERPOLATION_CONFIG;\n }\n assertInterpolationSymbols('interpolation', markers);\n return new InterpolationConfig(markers[0], markers[1]);\n }\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n}\nconst DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');\nconst DEFAULT_CONTAINER_BLOCKS = new Set(['switch']);\n\nconst $EOF = 0;\nconst $BSPACE = 8;\nconst $TAB = 9;\nconst $LF = 10;\nconst $VTAB = 11;\nconst $FF = 12;\nconst $CR = 13;\nconst $SPACE = 32;\nconst $BANG = 33;\nconst $DQ = 34;\nconst $HASH = 35;\nconst $$ = 36;\nconst $PERCENT = 37;\nconst $AMPERSAND = 38;\nconst $SQ = 39;\nconst $LPAREN = 40;\nconst $RPAREN = 41;\nconst $STAR = 42;\nconst $PLUS = 43;\nconst $COMMA = 44;\nconst $MINUS = 45;\nconst $PERIOD = 46;\nconst $SLASH = 47;\nconst $COLON = 58;\nconst $SEMICOLON = 59;\nconst $LT = 60;\nconst $EQ = 61;\nconst $GT = 62;\nconst $QUESTION = 63;\nconst $0 = 48;\nconst $7 = 55;\nconst $9 = 57;\nconst $A = 65;\nconst $E = 69;\nconst $F = 70;\nconst $X = 88;\nconst $Z = 90;\nconst $LBRACKET = 91;\nconst $BACKSLASH = 92;\nconst $RBRACKET = 93;\nconst $CARET = 94;\nconst $_ = 95;\nconst $a = 97;\nconst $b = 98;\nconst $e = 101;\nconst $f = 102;\nconst $n = 110;\nconst $r = 114;\nconst $t = 116;\nconst $u = 117;\nconst $v = 118;\nconst $x = 120;\nconst $z = 122;\nconst $LBRACE = 123;\nconst $BAR = 124;\nconst $RBRACE = 125;\nconst $NBSP = 160;\nconst $AT = 64;\nconst $BT = 96;\nfunction isWhitespace(code) {\n return (code >= $TAB && code <= $SPACE) || code == $NBSP;\n}\nfunction isDigit(code) {\n return $0 <= code && code <= $9;\n}\nfunction isAsciiLetter(code) {\n return (code >= $a && code <= $z) || (code >= $A && code <= $Z);\n}\nfunction isAsciiHexDigit(code) {\n return (code >= $a && code <= $f) || (code >= $A && code <= $F) || isDigit(code);\n}\nfunction isNewLine(code) {\n return code === $LF || code === $CR;\n}\nfunction isOctalDigit(code) {\n return $0 <= code && code <= $7;\n}\nfunction isQuote(code) {\n return code === $SQ || code === $DQ || code === $BT;\n}\n\nclass ParseLocation {\n file;\n offset;\n line;\n col;\n constructor(file, offset, line, col) {\n this.file = file;\n this.offset = offset;\n this.line = line;\n this.col = col;\n }\n toString() {\n return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;\n }\n moveBy(delta) {\n const source = this.file.content;\n const len = source.length;\n let offset = this.offset;\n let line = this.line;\n let col = this.col;\n while (offset > 0 && delta < 0) {\n offset--;\n delta++;\n const ch = source.charCodeAt(offset);\n if (ch == $LF) {\n line--;\n const priorLine = source\n .substring(0, offset - 1)\n .lastIndexOf(String.fromCharCode($LF));\n col = priorLine > 0 ? offset - priorLine : offset;\n }\n else {\n col--;\n }\n }\n while (offset < len && delta > 0) {\n const ch = source.charCodeAt(offset);\n offset++;\n delta--;\n if (ch == $LF) {\n line++;\n col = 0;\n }\n else {\n col++;\n }\n }\n return new ParseLocation(this.file, offset, line, col);\n }\n // Return the source around the location\n // Up to `maxChars` or `maxLines` on each side of the location\n getContext(maxChars, maxLines) {\n const content = this.file.content;\n let startOffset = this.offset;\n if (startOffset != null) {\n if (startOffset > content.length - 1) {\n startOffset = content.length - 1;\n }\n let endOffset = startOffset;\n let ctxChars = 0;\n let ctxLines = 0;\n while (ctxChars < maxChars && startOffset > 0) {\n startOffset--;\n ctxChars++;\n if (content[startOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n ctxChars = 0;\n ctxLines = 0;\n while (ctxChars < maxChars && endOffset < content.length - 1) {\n endOffset++;\n ctxChars++;\n if (content[endOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n return {\n before: content.substring(startOffset, this.offset),\n after: content.substring(this.offset, endOffset + 1),\n };\n }\n return null;\n }\n}\nclass ParseSourceFile {\n content;\n url;\n constructor(content, url) {\n this.content = content;\n this.url = url;\n }\n}\nclass ParseSourceSpan {\n start;\n end;\n fullStart;\n details;\n /**\n * Create an object that holds information about spans of tokens/nodes captured during\n * lexing/parsing of text.\n *\n * @param start\n * The location of the start of the span (having skipped leading trivia).\n * Skipping leading trivia makes source-spans more \"user friendly\", since things like HTML\n * elements will appear to begin at the start of the opening tag, rather than at the start of any\n * leading trivia, which could include newlines.\n *\n * @param end\n * The location of the end of the span.\n *\n * @param fullStart\n * The start of the token without skipping the leading trivia.\n * This is used by tooling that splits tokens further, such as extracting Angular interpolations\n * from text tokens. Such tooling creates new source-spans relative to the original token's\n * source-span. If leading trivia characters have been skipped then the new source-spans may be\n * incorrectly offset.\n *\n * @param details\n * Additional information (such as identifier names) that should be associated with the span.\n */\n constructor(start, end, fullStart = start, details = null) {\n this.start = start;\n this.end = end;\n this.fullStart = fullStart;\n this.details = details;\n }\n toString() {\n return this.start.file.content.substring(this.start.offset, this.end.offset);\n }\n}\nvar ParseErrorLevel;\n(function (ParseErrorLevel) {\n ParseErrorLevel[ParseErrorLevel[\"WARNING\"] = 0] = \"WARNING\";\n ParseErrorLevel[ParseErrorLevel[\"ERROR\"] = 1] = \"ERROR\";\n})(ParseErrorLevel || (ParseErrorLevel = {}));\nclass ParseError extends Error {\n span;\n msg;\n level;\n relatedError;\n constructor(\n /** Location of the error. */\n span, \n /** Error message. */\n msg, \n /** Severity level of the error. */\n level = ParseErrorLevel.ERROR, \n /**\n * Error that caused the error to be surfaced. For example, an error in a sub-expression that\n * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context.\n */\n relatedError) {\n super(msg);\n this.span = span;\n this.msg = msg;\n this.level = level;\n this.relatedError = relatedError;\n // Extending `Error` ends up breaking some internal tests. This appears to be a known issue\n // when extending errors in TS and the workaround is to explicitly set the prototype.\n // https://stackoverflow.com/questions/41102060/typescript-extending-error-class\n Object.setPrototypeOf(this, new.target.prototype);\n }\n contextualMessage() {\n const ctx = this.span.start.getContext(100, 3);\n return ctx\n ? `${this.msg} (\"${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}\")`\n : this.msg;\n }\n toString() {\n const details = this.span.details ? `, ${this.span.details}` : '';\n return `${this.contextualMessage()}: ${this.span.start}${details}`;\n }\n}\n/**\n * Generates Source Span object for a given R3 Type for JIT mode.\n *\n * @param kind Component or Directive.\n * @param typeName name of the Component or Directive.\n * @param sourceUrl reference to Component or Directive source.\n * @returns instance of ParseSourceSpan that represent a given Component or Directive.\n */\nfunction r3JitTypeSourceSpan(kind, typeName, sourceUrl) {\n const sourceFileName = `in ${kind} ${typeName} in ${sourceUrl}`;\n const sourceFile = new ParseSourceFile('', sourceFileName);\n return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n}\nlet _anonymousTypeIndex = 0;\nfunction identifierName(compileIdentifier) {\n if (!compileIdentifier || !compileIdentifier.reference) {\n return null;\n }\n const ref = compileIdentifier.reference;\n if (ref['__anonymousType']) {\n return ref['__anonymousType'];\n }\n if (ref['__forward_ref__']) {\n // We do not want to try to stringify a `forwardRef()` function because that would cause the\n // inner function to be evaluated too early, defeating the whole point of the `forwardRef`.\n return '__forward_ref__';\n }\n let identifier = stringify(ref);\n if (identifier.indexOf('(') >= 0) {\n // case: anonymous functions!\n identifier = `anonymous_${_anonymousTypeIndex++}`;\n ref['__anonymousType'] = identifier;\n }\n else {\n identifier = sanitizeIdentifier(identifier);\n }\n return identifier;\n}\nfunction sanitizeIdentifier(name) {\n return name.replace(/\\W/g, '_');\n}\n\n/**\n * In TypeScript, tagged template functions expect a \"template object\", which is an array of\n * \"cooked\" strings plus a `raw` property that contains an array of \"raw\" strings. This is\n * typically constructed with a function called `__makeTemplateObject(cooked, raw)`, but it may not\n * be available in all environments.\n *\n * This is a JavaScript polyfill that uses __makeTemplateObject when it's available, but otherwise\n * creates an inline helper with the same functionality.\n *\n * In the inline function, if `Object.defineProperty` is available we use that to attach the `raw`\n * array.\n */\nconst makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e})';\nclass AbstractJsEmitterVisitor extends AbstractEmitterVisitor {\n constructor() {\n super(false);\n }\n visitWrappedNodeExpr(ast, ctx) {\n throw new Error('Cannot emit a WrappedNodeExpr in Javascript.');\n }\n visitDeclareVarStmt(stmt, ctx) {\n ctx.print(stmt, `var ${stmt.name}`);\n if (stmt.value) {\n ctx.print(stmt, ' = ');\n stmt.value.visitExpression(this, ctx);\n }\n ctx.println(stmt, `;`);\n return null;\n }\n visitTaggedTemplateLiteralExpr(ast, ctx) {\n // The following convoluted piece of code is effectively the downlevelled equivalent of\n // ```\n // tag`...`\n // ```\n // which is effectively like:\n // ```\n // tag(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n // ```\n const elements = ast.template.elements;\n ast.tag.visitExpression(this, ctx);\n ctx.print(ast, `(${makeTemplateObjectPolyfill}(`);\n ctx.print(ast, `[${elements.map((part) => escapeIdentifier(part.text, false)).join(', ')}], `);\n ctx.print(ast, `[${elements.map((part) => escapeIdentifier(part.rawText, false)).join(', ')}])`);\n ast.template.expressions.forEach((expression) => {\n ctx.print(ast, ', ');\n expression.visitExpression(this, ctx);\n });\n ctx.print(ast, ')');\n return null;\n }\n visitTemplateLiteralExpr(expr, ctx) {\n ctx.print(expr, '`');\n for (let i = 0; i < expr.elements.length; i++) {\n expr.elements[i].visitExpression(this, ctx);\n const expression = i < expr.expressions.length ? expr.expressions[i] : null;\n if (expression !== null) {\n ctx.print(expression, '${');\n expression.visitExpression(this, ctx);\n ctx.print(expression, '}');\n }\n }\n ctx.print(expr, '`');\n }\n visitTemplateLiteralElementExpr(expr, ctx) {\n ctx.print(expr, expr.rawText);\n return null;\n }\n visitFunctionExpr(ast, ctx) {\n ctx.print(ast, `function${ast.name ? ' ' + ast.name : ''}(`);\n this._visitParams(ast.params, ctx);\n ctx.println(ast, `) {`);\n ctx.incIndent();\n this.visitAllStatements(ast.statements, ctx);\n ctx.decIndent();\n ctx.print(ast, `}`);\n return null;\n }\n visitArrowFunctionExpr(ast, ctx) {\n ctx.print(ast, '(');\n this._visitParams(ast.params, ctx);\n ctx.print(ast, ') =>');\n if (Array.isArray(ast.body)) {\n ctx.println(ast, `{`);\n ctx.incIndent();\n this.visitAllStatements(ast.body, ctx);\n ctx.decIndent();\n ctx.print(ast, `}`);\n }\n else {\n const isObjectLiteral = ast.body instanceof LiteralMapExpr;\n if (isObjectLiteral) {\n ctx.print(ast, '(');\n }\n ast.body.visitExpression(this, ctx);\n if (isObjectLiteral) {\n ctx.print(ast, ')');\n }\n }\n return null;\n }\n visitDeclareFunctionStmt(stmt, ctx) {\n ctx.print(stmt, `function ${stmt.name}(`);\n this._visitParams(stmt.params, ctx);\n ctx.println(stmt, `) {`);\n ctx.incIndent();\n this.visitAllStatements(stmt.statements, ctx);\n ctx.decIndent();\n ctx.println(stmt, `}`);\n return null;\n }\n visitLocalizedString(ast, ctx) {\n // The following convoluted piece of code is effectively the downlevelled equivalent of\n // ```\n // $localize `...`\n // ```\n // which is effectively like:\n // ```\n // $localize(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n // ```\n ctx.print(ast, `$localize(${makeTemplateObjectPolyfill}(`);\n const parts = [ast.serializeI18nHead()];\n for (let i = 1; i < ast.messageParts.length; i++) {\n parts.push(ast.serializeI18nTemplatePart(i));\n }\n ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.cooked, false)).join(', ')}], `);\n ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.raw, false)).join(', ')}])`);\n ast.expressions.forEach((expression) => {\n ctx.print(ast, ', ');\n expression.visitExpression(this, ctx);\n });\n ctx.print(ast, ')');\n return null;\n }\n _visitParams(params, ctx) {\n this.visitAllObjects((param) => ctx.print(null, param.name), params, ctx, ',');\n }\n}\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy within the JIT\n * compiler. 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;\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 const trustedTypes = _global['trustedTypes'];\n policy = null;\n if (trustedTypes) {\n try {\n policy = trustedTypes.createPolicy('angular#unsafe-jit', {\n createScript: (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 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()?.createScript(script) || script;\n}\n/**\n * Unsafely call the Function constructor with the given string arguments.\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 the JIT compiler, as use in other code can lead to XSS\n * vulnerabilities.\n */\nfunction newTrustedFunctionForJIT(...args) {\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 * A helper class to manage the evaluation of JIT generated code.\n */\nclass JitEvaluator {\n /**\n *\n * @param sourceUrl The URL of the generated code.\n * @param statements An array of Angular statement AST nodes to be evaluated.\n * @param refResolver Resolves `o.ExternalReference`s into values.\n * @param createSourceMaps If true then create a source-map for the generated code and include it\n * inline as a source-map comment.\n * @returns A map of all the variables in the generated code.\n */\n evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {\n const converter = new JitEmitterVisitor(refResolver);\n const ctx = EmitterVisitorContext.createRoot();\n // Ensure generated code is in strict mode\n if (statements.length > 0 && !isUseStrictStatement(statements[0])) {\n statements = [literal('use strict').toStmt(), ...statements];\n }\n converter.visitAllStatements(statements, ctx);\n converter.createReturnStmt(ctx);\n return this.evaluateCode(sourceUrl, ctx, converter.getArgs(), createSourceMaps);\n }\n /**\n * Evaluate a piece of JIT generated code.\n * @param sourceUrl The URL of this generated code.\n * @param ctx A context object that contains an AST of the code to be evaluated.\n * @param vars A map containing the names and values of variables that the evaluated code might\n * reference.\n * @param createSourceMap If true then create a source-map for the generated code and include it\n * inline as a source-map comment.\n * @returns The result of evaluating the code.\n */\n evaluateCode(sourceUrl, ctx, vars, createSourceMap) {\n let fnBody = `\"use strict\";${ctx.toSource()}\\n//# sourceURL=${sourceUrl}`;\n const fnArgNames = [];\n const fnArgValues = [];\n for (const argName in vars) {\n fnArgValues.push(vars[argName]);\n fnArgNames.push(argName);\n }\n if (createSourceMap) {\n // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n // E.g. ```\n // function anonymous(a,b,c\n // /**/) { ... }```\n // We don't want to hard code this fact, so we auto detect it via an empty function first.\n const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat('return null;')).toString();\n const headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n fnBody += `\\n${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;\n }\n const fn = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));\n return this.executeFunction(fn, fnArgValues);\n }\n /**\n * Execute a JIT generated function by calling it.\n *\n * This method can be overridden in tests to capture the functions that are generated\n * by this `JitEvaluator` class.\n *\n * @param fn A function to execute.\n * @param args The arguments to pass to the function being executed.\n * @returns The return value of the executed function.\n */\n executeFunction(fn, args) {\n return fn(...args);\n }\n}\n/**\n * An Angular AST visitor that converts AST nodes into executable JavaScript code.\n */\nclass JitEmitterVisitor extends AbstractJsEmitterVisitor {\n refResolver;\n _evalArgNames = [];\n _evalArgValues = [];\n _evalExportedVars = [];\n constructor(refResolver) {\n super();\n this.refResolver = refResolver;\n }\n createReturnStmt(ctx) {\n const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new LiteralMapEntry(resultVar, variable(resultVar), false))));\n stmt.visitStatement(this, ctx);\n }\n getArgs() {\n const result = {};\n for (let i = 0; i < this._evalArgNames.length; i++) {\n result[this._evalArgNames[i]] = this._evalArgValues[i];\n }\n return result;\n }\n visitExternalExpr(ast, ctx) {\n this._emitReferenceToExternal(ast, this.refResolver.resolveExternalReference(ast.value), ctx);\n return null;\n }\n visitWrappedNodeExpr(ast, ctx) {\n this._emitReferenceToExternal(ast, ast.node, ctx);\n return null;\n }\n visitDeclareVarStmt(stmt, ctx) {\n if (stmt.hasModifier(StmtModifier.Exported)) {\n this._evalExportedVars.push(stmt.name);\n }\n return super.visitDeclareVarStmt(stmt, ctx);\n }\n visitDeclareFunctionStmt(stmt, ctx) {\n if (stmt.hasModifier(StmtModifier.Exported)) {\n this._evalExportedVars.push(stmt.name);\n }\n return super.visitDeclareFunctionStmt(stmt, ctx);\n }\n _emitReferenceToExternal(ast, value, ctx) {\n let id = this._evalArgValues.indexOf(value);\n if (id === -1) {\n id = this._evalArgValues.length;\n this._evalArgValues.push(value);\n const name = identifierName({ reference: value }) || 'val';\n this._evalArgNames.push(`jit_${name}_${id}`);\n }\n ctx.print(ast, this._evalArgNames[id]);\n }\n}\nfunction isUseStrictStatement(statement) {\n return statement.isEquivalent(literal('use strict').toStmt());\n}\n\nfunction compileInjector(meta) {\n const definitionMap = new DefinitionMap();\n if (meta.providers !== null) {\n definitionMap.set('providers', meta.providers);\n }\n if (meta.imports.length > 0) {\n definitionMap.set('imports', literalArr(meta.imports));\n }\n const expression = importExpr(Identifiers.defineInjector)\n .callFn([definitionMap.toLiteralMap()], undefined, true);\n const type = createInjectorType(meta);\n return { expression, type, statements: [] };\n}\nfunction createInjectorType(meta) {\n return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));\n}\n\n/**\n * Implementation of `CompileReflector` which resolves references to @angular/core\n * symbols at runtime, according to a consumer-provided mapping.\n *\n * Only supports `resolveExternalReference`, all other methods throw.\n */\nclass R3JitReflector {\n context;\n constructor(context) {\n this.context = context;\n }\n resolveExternalReference(ref) {\n // This reflector only handles @angular/core imports.\n if (ref.moduleName !== '@angular/core') {\n throw new Error(`Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`);\n }\n if (!this.context.hasOwnProperty(ref.name)) {\n throw new Error(`No value provided for @angular/core symbol '${ref.name}'.`);\n }\n return this.context[ref.name];\n }\n}\n\n/**\n * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted\n * as a part of the NgModule definition.\n */\nvar R3SelectorScopeMode;\n(function (R3SelectorScopeMode) {\n /**\n * Emit the declarations inline into the module definition.\n *\n * This option is useful in certain contexts where it's known that JIT support is required. The\n * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if\n * they are unused, but the NgModule is used.\n */\n R3SelectorScopeMode[R3SelectorScopeMode[\"Inline\"] = 0] = \"Inline\";\n /**\n * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is\n * guarded with the `ngJitMode` flag.\n *\n * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to\n * false, which allows unused directives and pipes to be tree-shaken.\n */\n R3SelectorScopeMode[R3SelectorScopeMode[\"SideEffect\"] = 1] = \"SideEffect\";\n /**\n * Don't generate selector scopes at all.\n *\n * This is useful for contexts where JIT support is known to be unnecessary.\n */\n R3SelectorScopeMode[R3SelectorScopeMode[\"Omit\"] = 2] = \"Omit\";\n})(R3SelectorScopeMode || (R3SelectorScopeMode = {}));\n/**\n * The type of the NgModule meta data.\n * - Global: Used for full and partial compilation modes which mainly includes R3References.\n * - Local: Used for the local compilation mode which mainly includes the raw expressions as appears\n * in the NgModule decorator.\n */\nvar R3NgModuleMetadataKind;\n(function (R3NgModuleMetadataKind) {\n R3NgModuleMetadataKind[R3NgModuleMetadataKind[\"Global\"] = 0] = \"Global\";\n R3NgModuleMetadataKind[R3NgModuleMetadataKind[\"Local\"] = 1] = \"Local\";\n})(R3NgModuleMetadataKind || (R3NgModuleMetadataKind = {}));\n/**\n * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.\n */\nfunction compileNgModule(meta) {\n const statements = [];\n const definitionMap = new DefinitionMap();\n definitionMap.set('type', meta.type.value);\n // Assign bootstrap definition. In local compilation mode (i.e., for\n // `R3NgModuleMetadataKind.LOCAL`) we assign the bootstrap field using the runtime\n // `ɵɵsetNgModuleScope`.\n if (meta.kind === R3NgModuleMetadataKind.Global && meta.bootstrap.length > 0) {\n definitionMap.set('bootstrap', refsToArray(meta.bootstrap, meta.containsForwardDecls));\n }\n if (meta.selectorScopeMode === R3SelectorScopeMode.Inline) {\n // If requested to emit scope information inline, pass the `declarations`, `imports` and\n // `exports` to the `ɵɵdefineNgModule()` call directly.\n if (meta.declarations.length > 0) {\n definitionMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls));\n }\n if (meta.imports.length > 0) {\n definitionMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls));\n }\n if (meta.exports.length > 0) {\n definitionMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls));\n }\n }\n else if (meta.selectorScopeMode === R3SelectorScopeMode.SideEffect) {\n // In this mode, scope information is not passed into `ɵɵdefineNgModule` as it\n // would prevent tree-shaking of the declarations, imports and exports references. Instead, it's\n // patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the\n // `ngJitMode` flag.\n const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);\n if (setNgModuleScopeCall !== null) {\n statements.push(setNgModuleScopeCall);\n }\n }\n else ;\n if (meta.schemas !== null && meta.schemas.length > 0) {\n definitionMap.set('schemas', literalArr(meta.schemas.map((ref) => ref.value)));\n }\n if (meta.id !== null) {\n definitionMap.set('id', meta.id);\n // Generate a side-effectful call to register this NgModule by its id, as per the semantics of\n // NgModule ids.\n statements.push(importExpr(Identifiers.registerNgModuleType).callFn([meta.type.value, meta.id]).toStmt());\n }\n const expression = importExpr(Identifiers.defineNgModule)\n .callFn([definitionMap.toLiteralMap()], undefined, true);\n const type = createNgModuleType(meta);\n return { expression, type, statements };\n}\n/**\n * This function is used in JIT mode to generate the call to `ɵɵdefineNgModule()` from a call to\n * `ɵɵngDeclareNgModule()`.\n */\nfunction compileNgModuleDeclarationExpression(meta) {\n const definitionMap = new DefinitionMap();\n definitionMap.set('type', new WrappedNodeExpr(meta.type));\n if (meta.bootstrap !== undefined) {\n definitionMap.set('bootstrap', new WrappedNodeExpr(meta.bootstrap));\n }\n if (meta.declarations !== undefined) {\n definitionMap.set('declarations', new WrappedNodeExpr(meta.declarations));\n }\n if (meta.imports !== undefined) {\n definitionMap.set('imports', new WrappedNodeExpr(meta.imports));\n }\n if (meta.exports !== undefined) {\n definitionMap.set('exports', new WrappedNodeExpr(meta.exports));\n }\n if (meta.schemas !== undefined) {\n definitionMap.set('schemas', new WrappedNodeExpr(meta.schemas));\n }\n if (meta.id !== undefined) {\n definitionMap.set('id', new WrappedNodeExpr(meta.id));\n }\n return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);\n}\nfunction createNgModuleType(meta) {\n if (meta.kind === R3NgModuleMetadataKind.Local) {\n return new ExpressionType(meta.type.value);\n }\n const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes, } = meta;\n return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [\n new ExpressionType(moduleType.type),\n publicDeclarationTypes === null\n ? tupleTypeOf(declarations)\n : tupleOfTypes(publicDeclarationTypes),\n includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,\n tupleTypeOf(exports),\n ]));\n}\n/**\n * Generates a function call to `ɵɵsetNgModuleScope` with all necessary information so that the\n * transitive module scope can be computed during runtime in JIT mode. This call is marked pure\n * such that the references to declarations, imports and exports may be elided causing these\n * symbols to become tree-shakeable.\n */\nfunction generateSetNgModuleScopeCall(meta) {\n const scopeMap = new DefinitionMap();\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.declarations.length > 0) {\n scopeMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls));\n }\n }\n else {\n if (meta.declarationsExpression) {\n scopeMap.set('declarations', meta.declarationsExpression);\n }\n }\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.imports.length > 0) {\n scopeMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls));\n }\n }\n else {\n if (meta.importsExpression) {\n scopeMap.set('imports', meta.importsExpression);\n }\n }\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.exports.length > 0) {\n scopeMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls));\n }\n }\n else {\n if (meta.exportsExpression) {\n scopeMap.set('exports', meta.exportsExpression);\n }\n }\n if (meta.kind === R3NgModuleMetadataKind.Local && meta.bootstrapExpression) {\n scopeMap.set('bootstrap', meta.bootstrapExpression);\n }\n if (Object.keys(scopeMap.values).length === 0) {\n return null;\n }\n // setNgModuleScope(...)\n const fnCall = new InvokeFunctionExpr(\n /* fn */ importExpr(Identifiers.setNgModuleScope), \n /* args */ [meta.type.value, scopeMap.toLiteralMap()]);\n // (ngJitMode guard) && setNgModuleScope(...)\n const guardedCall = jitOnlyGuardedExpression(fnCall);\n // function() { (ngJitMode guard) && setNgModuleScope(...); }\n const iife = new FunctionExpr(/* params */ [], /* statements */ [guardedCall.toStmt()]);\n // (function() { (ngJitMode guard) && setNgModuleScope(...); })()\n const iifeCall = new InvokeFunctionExpr(/* fn */ iife, /* args */ []);\n return iifeCall.toStmt();\n}\nfunction tupleTypeOf(exp) {\n const types = exp.map((ref) => typeofExpr(ref.type));\n return exp.length > 0 ? expressionType(literalArr(types)) : NONE_TYPE;\n}\nfunction tupleOfTypes(types) {\n const typeofTypes = types.map((type) => typeofExpr(type));\n return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;\n}\n\nfunction compilePipeFromMetadata(metadata) {\n const definitionMapValues = [];\n // e.g. `name: 'myPipe'`\n definitionMapValues.push({\n key: 'name',\n value: literal(metadata.pipeName ?? metadata.name),\n quoted: false,\n });\n // e.g. `type: MyPipe`\n definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });\n // e.g. `pure: true`\n definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });\n if (metadata.isStandalone === false) {\n definitionMapValues.push({ key: 'standalone', value: literal(false), quoted: false });\n }\n const expression = importExpr(Identifiers.definePipe)\n .callFn([literalMap(definitionMapValues)], undefined, true);\n const type = createPipeType(metadata);\n return { expression, type, statements: [] };\n}\nfunction createPipeType(metadata) {\n return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [\n typeWithParameters(metadata.type.type, metadata.typeArgumentCount),\n new ExpressionType(new LiteralExpr(metadata.pipeName)),\n new ExpressionType(new LiteralExpr(metadata.isStandalone)),\n ]));\n}\n\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 = {}));\n\n/**\n * The following set contains all keywords that can be used in the animation css shorthand\n * property and is used during the scoping of keyframes to make sure such keywords\n * are not modified.\n */\nconst animationKeywords = new Set([\n // global values\n 'inherit',\n 'initial',\n 'revert',\n 'unset',\n // animation-direction\n 'alternate',\n 'alternate-reverse',\n 'normal',\n 'reverse',\n // animation-fill-mode\n 'backwards',\n 'both',\n 'forwards',\n 'none',\n // animation-play-state\n 'paused',\n 'running',\n // animation-timing-function\n 'ease',\n 'ease-in',\n 'ease-in-out',\n 'ease-out',\n 'linear',\n 'step-start',\n 'step-end',\n // `steps()` function\n 'end',\n 'jump-both',\n 'jump-end',\n 'jump-none',\n 'jump-start',\n 'start',\n]);\n/**\n * The following array contains all of the CSS at-rule identifiers which are scoped.\n */\nconst scopedAtRuleIdentifiers = [\n '@media',\n '@supports',\n '@document',\n '@layer',\n '@container',\n '@scope',\n '@starting-style',\n];\n/**\n * The following class has its origin from a port of shadowCSS from webcomponents.js to TypeScript.\n * It has since diverge in many ways to tailor Angular's needs.\n *\n * Source:\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n *\n * The original file level comment is reproduced below\n */\n/*\n This is a limited shim for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles\n\n The intention here is to support only the styling features which can be\n relatively simply implemented. The goal is to allow users to avoid the\n most obvious pitfalls and do so without compromising performance significantly.\n For ShadowDOM styling that's not covered here, a set of best practices\n can be provided that should allow users to accomplish more complex styling.\n\n The following is a list of specific ShadowDOM styling features and a brief\n discussion of the approach used to shim.\n\n Shimmed features:\n\n * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host\n element using the :host rule. To shim this feature, the :host styles are\n reformatted and prefixed with a given scope name and promoted to a\n document level stylesheet.\n For example, given a scope name of .foo, a rule like this:\n\n :host {\n background: red;\n }\n }\n\n becomes:\n\n .foo {\n background: red;\n }\n\n * encapsulation: Styles defined within ShadowDOM, apply only to\n dom inside the ShadowDOM.\n The selectors are scoped by adding an attribute selector suffix to each\n simple selector that contains the host element tag name. Each element\n in the element's ShadowDOM template is also given the scope attribute.\n Thus, these rules match only elements that have the scope attribute.\n For example, given a scope name of x-foo, a rule like this:\n\n div {\n font-weight: bold;\n }\n\n becomes:\n\n div[x-foo] {\n font-weight: bold;\n }\n\n Note that elements that are dynamically added to a scope must have the scope\n selector added to them manually.\n\n * upper/lower bound encapsulation: Styles which are defined outside a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\n inside a shadowRoot.\n\n This styling behavior is not emulated. Some possible ways to do this that\n were rejected due to complexity and/or performance concerns include: (1) reset\n every possible property for every possible selector for a given scope name;\n (2) re-implement css in javascript.\n\n As an alternative, users should make sure to use selectors\n specific to the scope in which they are working.\n\n * ::distributed: This behavior is not emulated. It's often not necessary\n to style the contents of a specific insertion point and instead, descendants\n of the host element can be styled selectively. Users can also create an\n extra node around an insertion point and style that node's contents\n via descendent selectors. For example, with a shadowRoot like this:\n\n \n \n\n could become:\n\n \n \n \n
\n\n Note the use of @polyfill in the comment above a ShadowDOM specific style\n declaration. This is a directive to the styling shim to use the selector\n in comments in lieu of the next selector when running under polyfill.\n*/\nclass ShadowCss {\n /*\n * Shim some cssText with the given selector. Returns cssText that can be included in the document\n *\n * The selector is the attribute added to all elements inside the host,\n * The hostSelector is the attribute added to the host itself.\n */\n shimCssText(cssText, selector, hostSelector = '') {\n // **NOTE**: Do not strip comments as this will cause component sourcemaps to break\n // due to shift in lines.\n // Collect comments and replace them with a placeholder, this is done to avoid complicating\n // the rule parsing RegExp and keep it safer.\n const comments = [];\n cssText = cssText.replace(_commentRe, (m) => {\n if (m.match(_commentWithHashRe)) {\n comments.push(m);\n }\n else {\n // Replace non hash comments with empty lines.\n // This is done so that we do not leak any sensitive data in comments.\n const newLinesMatches = m.match(_newLinesRe);\n comments.push((newLinesMatches?.join('') ?? '') + '\\n');\n }\n return COMMENT_PLACEHOLDER;\n });\n cssText = this._insertDirectives(cssText);\n const scopedCssText = this._scopeCssText(cssText, selector, hostSelector);\n // Add back comments at the original position.\n let commentIdx = 0;\n return scopedCssText.replace(_commentWithHashPlaceHolderRe, () => comments[commentIdx++]);\n }\n _insertDirectives(cssText) {\n cssText = this._insertPolyfillDirectivesInCssText(cssText);\n return this._insertPolyfillRulesInCssText(cssText);\n }\n /**\n * Process styles to add scope to keyframes.\n *\n * Modify both the names of the keyframes defined in the component styles and also the css\n * animation rules using them.\n *\n * Animation rules using keyframes defined elsewhere are not modified to allow for globally\n * defined keyframes.\n *\n * For example, we convert this css:\n *\n * ```scss\n * .box {\n * animation: box-animation 1s forwards;\n * }\n *\n * @keyframes box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * to this:\n *\n * ```scss\n * .box {\n * animation: scopeName_box-animation 1s forwards;\n * }\n *\n * @keyframes scopeName_box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * @param cssText the component's css text that needs to be scoped.\n * @param scopeSelector the component's scope selector.\n *\n * @returns the scoped css text.\n */\n _scopeKeyframesRelatedCss(cssText, scopeSelector) {\n const unscopedKeyframesSet = new Set();\n const scopedKeyframesCssText = processRules(cssText, (rule) => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));\n return processRules(scopedKeyframesCssText, (rule) => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));\n }\n /**\n * Scopes local keyframes names, returning the updated css rule and it also\n * adds the original keyframe name to a provided set to collect all keyframes names\n * so that it can later be used to scope the animation rules.\n *\n * For example, it takes a rule such as:\n *\n * ```scss\n * @keyframes box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * and returns:\n *\n * ```scss\n * @keyframes scopeName_box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n * and as a side effect it adds \"box-animation\" to the `unscopedKeyframesSet` set\n *\n * @param cssRule the css rule to process.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be\n * modified as a side effect)\n *\n * @returns the css rule modified with the scoped keyframes name.\n */\n _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {\n return {\n ...rule,\n selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\\s+))(['\"]?)(.+)\\2(\\s*)$/, (_, start, quote, keyframeName, endSpaces) => {\n unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));\n return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;\n }),\n };\n }\n /**\n * Function used to scope a keyframes name (obtained from an animation declaration)\n * using an existing set of unscopedKeyframes names to discern if the scoping needs to be\n * performed (keyframes names of keyframes not defined in the component's css need not to be\n * scoped).\n *\n * @param keyframe the keyframes name to check.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names.\n *\n * @returns the scoped name of the keyframe, or the original name is the name need not to be\n * scoped.\n */\n _scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {\n return keyframe.replace(/^(\\s*)(['\"]?)(.+?)\\2(\\s*)$/, (_, spaces1, quote, name, spaces2) => {\n name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`;\n return `${spaces1}${quote}${name}${quote}${spaces2}`;\n });\n }\n /**\n * Regular expression used to extrapolate the possible keyframes from an\n * animation declaration (with possibly multiple animation definitions)\n *\n * The regular expression can be divided in three parts\n * - (^|\\s+|,)\n * captures how many (if any) leading whitespaces are present or a comma\n * - (?:(?:(['\"])((?:\\\\\\\\|\\\\\\2|(?!\\2).)+)\\2)|(-?[A-Za-z][\\w\\-]*))\n * captures two different possible keyframes, ones which are quoted or ones which are valid css\n * indents (custom properties excluded)\n * - (?=[,\\s;]|$)\n * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a\n * semicolon or the end of the string\n */\n _animationDeclarationKeyframesRe = /(^|\\s+|,)(?:(?:(['\"])((?:\\\\\\\\|\\\\\\2|(?!\\2).)+)\\2)|(-?[A-Za-z][\\w\\-]*))(?=[,\\s]|$)/g;\n /**\n * Scope an animation rule so that the keyframes mentioned in such rule\n * are scoped if defined in the component's css and left untouched otherwise.\n *\n * It can scope values of both the 'animation' and 'animation-name' properties.\n *\n * @param rule css rule to scope.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names.\n *\n * @returns the updated css rule.\n **/\n _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {\n let content = rule.content.replace(/((?:^|\\s+|;)(?:-webkit-)?animation\\s*:\\s*),*([^;]+)/g, (_, start, animationDeclarations) => start +\n animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => {\n if (quotedName) {\n return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;\n }\n else {\n return animationKeywords.has(nonQuotedName)\n ? original\n : `${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;\n }\n }));\n content = content.replace(/((?:^|\\s+|;)(?:-webkit-)?animation-name(?:\\s*):(?:\\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes\n .split(',')\n .map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))\n .join(',')}`);\n return { ...rule, content };\n }\n /*\n * Process styles to convert native ShadowDOM rules that will trip\n * up the css parser; we rely on decorating the stylesheet with inert rules.\n *\n * For example, we convert this rule:\n *\n * polyfill-next-selector { content: ':host menu-item'; }\n * ::content menu-item {\n *\n * to this:\n *\n * scopeName menu-item {\n *\n **/\n _insertPolyfillDirectivesInCssText(cssText) {\n return cssText.replace(_cssContentNextSelectorRe, function (...m) {\n return m[2] + '{';\n });\n }\n /*\n * Process styles to add rules which will only apply under the polyfill\n *\n * For example, we convert this rule:\n *\n * polyfill-rule {\n * content: ':host menu-item';\n * ...\n * }\n *\n * to this:\n *\n * scopeName menu-item {...}\n *\n **/\n _insertPolyfillRulesInCssText(cssText) {\n return cssText.replace(_cssContentRuleRe, (...m) => {\n const rule = m[0].replace(m[1], '').replace(m[2], '');\n return m[4] + rule;\n });\n }\n /* Ensure styles are scoped. Pseudo-scoping takes a rule like:\n *\n * .foo {... }\n *\n * and converts this to\n *\n * scopeName .foo { ... }\n */\n _scopeCssText(cssText, scopeSelector, hostSelector) {\n const unscopedRules = this._extractUnscopedRulesFromCssText(cssText);\n // replace :host and :host-context with -shadowcsshost and -shadowcsshostcontext respectively\n cssText = this._insertPolyfillHostInCssText(cssText);\n cssText = this._convertColonHost(cssText);\n cssText = this._convertColonHostContext(cssText);\n cssText = this._convertShadowDOMSelectors(cssText);\n if (scopeSelector) {\n cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);\n cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);\n }\n cssText = cssText + '\\n' + unscopedRules;\n return cssText.trim();\n }\n /*\n * Process styles to add rules which will only apply under the polyfill\n * and do not process via CSSOM. (CSSOM is destructive to rules on rare\n * occasions, e.g. -webkit-calc on Safari.)\n * For example, we convert this rule:\n *\n * @polyfill-unscoped-rule {\n * content: 'menu-item';\n * ... }\n *\n * to this:\n *\n * menu-item {...}\n *\n **/\n _extractUnscopedRulesFromCssText(cssText) {\n let r = '';\n let m;\n _cssContentUnscopedRuleRe.lastIndex = 0;\n while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {\n const rule = m[0].replace(m[2], '').replace(m[1], m[4]);\n r += rule + '\\n\\n';\n }\n return r;\n }\n /*\n * convert a rule like :host(.foo) > .bar { }\n *\n * to\n *\n * .foo > .bar\n */\n _convertColonHost(cssText) {\n return cssText.replace(_cssColonHostRe, (_, hostSelectors, otherSelectors) => {\n if (hostSelectors) {\n const convertedSelectors = [];\n const hostSelectorArray = hostSelectors.split(',').map((p) => p.trim());\n for (const hostSelector of hostSelectorArray) {\n if (!hostSelector)\n break;\n const convertedSelector = _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, '') + otherSelectors;\n convertedSelectors.push(convertedSelector);\n }\n return convertedSelectors.join(',');\n }\n else {\n return _polyfillHostNoCombinator + otherSelectors;\n }\n });\n }\n /*\n * convert a rule like :host-context(.foo) > .bar { }\n *\n * to\n *\n * .foo > .bar, .foo > .bar { }\n *\n * and\n *\n * :host-context(.foo:host) .bar { ... }\n *\n * to\n *\n * .foo .bar { ... }\n */\n _convertColonHostContext(cssText) {\n const length = cssText.length;\n let parens = 0;\n let prev = 0;\n let result = '';\n // Splits up the selectors on their top-level commas, processes the :host-context in them\n // individually and stitches them back together. This ensures that individual selectors don't\n // affect each other.\n for (let i = 0; i < length; i++) {\n const char = cssText[i];\n // If we hit a comma and there are no open parentheses, take the current chunk and process it.\n if (char === ',' && parens === 0) {\n result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ',';\n prev = i + 1;\n continue;\n }\n // We've hit the end. Take everything since the last comma.\n if (i === length - 1) {\n result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));\n break;\n }\n if (char === '(') {\n parens++;\n }\n else if (char === ')') {\n parens--;\n }\n }\n return result;\n }\n _convertColonHostContextInSelectorPart(cssText) {\n return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {\n // We have captured a selector that contains a `:host-context` rule.\n // For backward compatibility `:host-context` may contain a comma separated list of selectors.\n // Each context selector group will contain a list of host-context selectors that must match\n // an ancestor of the host.\n // (Normally `contextSelectorGroups` will only contain a single array of context selectors.)\n const contextSelectorGroups = [[]];\n // There may be more than `:host-context` in this selector so `selectorText` could look like:\n // `:host-context(.one):host-context(.two)`.\n // Execute `_cssColonHostContextRe` over and over until we have extracted all the\n // `:host-context` selectors from this selector.\n let match;\n while ((match = _cssColonHostContextRe.exec(selectorText))) {\n // `match` = [':host-context()', , ]\n // The `` could actually be a comma separated list: `:host-context(.one, .two)`.\n const newContextSelectors = (match[1] ?? '')\n .trim()\n .split(',')\n .map((m) => m.trim())\n .filter((m) => m !== '');\n // We must duplicate the current selector group for each of these new selectors.\n // For example if the current groups are:\n // ```\n // [\n // ['a', 'b', 'c'],\n // ['x', 'y', 'z'],\n // ]\n // ```\n // And we have a new set of comma separated selectors: `:host-context(m,n)` then the new\n // groups are:\n // ```\n // [\n // ['a', 'b', 'c', 'm'],\n // ['x', 'y', 'z', 'm'],\n // ['a', 'b', 'c', 'n'],\n // ['x', 'y', 'z', 'n'],\n // ]\n // ```\n const contextSelectorGroupsLength = contextSelectorGroups.length;\n repeatGroups(contextSelectorGroups, newContextSelectors.length);\n for (let i = 0; i < newContextSelectors.length; i++) {\n for (let j = 0; j < contextSelectorGroupsLength; j++) {\n contextSelectorGroups[j + i * contextSelectorGroupsLength].push(newContextSelectors[i]);\n }\n }\n // Update the `selectorText` and see repeat to see if there are more `:host-context`s.\n selectorText = match[2];\n }\n // The context selectors now must be combined with each other to capture all the possible\n // selectors that `:host-context` can match. See `_combineHostContextSelectors()` for more\n // info about how this is done.\n return contextSelectorGroups\n .map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix))\n .join(', ');\n });\n }\n /*\n * Convert combinators like ::shadow and pseudo-elements like ::content\n * by replacing with space.\n */\n _convertShadowDOMSelectors(cssText) {\n return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);\n }\n // change a selector like 'div' to 'name div'\n _scopeSelectors(cssText, scopeSelector, hostSelector) {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] !== '@') {\n selector = this._scopeSelector({\n selector,\n scopeSelector,\n hostSelector,\n isParentSelector: true,\n });\n }\n else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {\n content = this._stripScopingSelectors(rule.content);\n }\n return new CssRule(selector, content);\n });\n }\n /**\n * Handle a css text that is within a rule that should not contain scope selectors by simply\n * removing them! An example of such a rule is `@font-face`.\n *\n * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.\n * Normally this would be a syntax error by the author of the styles. But in some rare cases, such\n * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we\n * can end up with broken css if the imported styles happen to contain @font-face rules.\n *\n * For example:\n *\n * ```\n * :host ::ng-deep {\n * import 'some/lib/containing/font-face';\n * }\n *\n * Similar logic applies to `@page` rules which can contain a particular set of properties,\n * as well as some specific at-rules. Since they can't be encapsulated, we have to strip\n * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3\n * ```\n */\n _stripScopingSelectors(cssText) {\n return processRules(cssText, (rule) => {\n const selector = rule.selector\n .replace(_shadowDeepSelectors, ' ')\n .replace(_polyfillHostNoCombinatorRe, ' ');\n return new CssRule(selector, rule.content);\n });\n }\n _safeSelector;\n _shouldScopeIndicator;\n // `isParentSelector` is used to distinguish the selectors which are coming from\n // the initial selector string and any nested selectors, parsed recursively,\n // for example `selector = 'a:where(.one)'` could be the parent, while recursive call\n // would have `selector = '.one'`.\n _scopeSelector({ selector, scopeSelector, hostSelector, isParentSelector = false, }) {\n // Split the selector into independent parts by `,` (comma) unless\n // comma is within parenthesis, for example `:is(.one, two)`.\n // Negative lookup after comma allows not splitting inside nested parenthesis,\n // up to three levels (((,))).\n const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*\\))) ?/;\n return selector\n .split(selectorSplitRe)\n .map((part) => part.split(_shadowDeepSelectors))\n .map((deepParts) => {\n const [shallowPart, ...otherParts] = deepParts;\n const applyScope = (shallowPart) => {\n if (this._selectorNeedsScoping(shallowPart, scopeSelector)) {\n return this._applySelectorScope({\n selector: shallowPart,\n scopeSelector,\n hostSelector,\n isParentSelector,\n });\n }\n else {\n return shallowPart;\n }\n };\n return [applyScope(shallowPart), ...otherParts].join(' ');\n })\n .join(', ');\n }\n _selectorNeedsScoping(selector, scopeSelector) {\n const re = this._makeScopeMatcher(scopeSelector);\n return !re.test(selector);\n }\n _makeScopeMatcher(scopeSelector) {\n const lre = /\\[/g;\n const rre = /\\]/g;\n scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n }\n // scope via name and [is=name]\n _applySimpleSelectorScope(selector, scopeSelector, hostSelector) {\n // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n const replaceBy = `[${hostSelector}]`;\n let result = selector;\n while (result.match(_polyfillHostNoCombinatorRe)) {\n result = result.replace(_polyfillHostNoCombinatorRe, (_hnc, selector) => {\n return selector.replace(/([^:\\)]*)(:*)(.*)/, (_, before, colon, after) => {\n return before + replaceBy + colon + after;\n });\n });\n }\n return result.replace(_polyfillHostRe, replaceBy);\n }\n return scopeSelector + ' ' + selector;\n }\n // return a selector with [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */\n _applySelectorScope({ selector, scopeSelector, hostSelector, isParentSelector, }) {\n const isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);\n const attrName = `[${scopeSelector}]`;\n const _scopeSelectorPart = (p) => {\n let scopedP = p.trim();\n if (!scopedP) {\n return p;\n }\n if (p.includes(_polyfillHostNoCombinator)) {\n scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);\n if (!p.match(_polyfillHostNoCombinatorOutsidePseudoFunction)) {\n const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)([\\s\\S]*)/);\n scopedP = before + attrName + colon + after;\n }\n }\n else {\n // remove :host since it should be unnecessary\n const t = p.replace(_polyfillHostRe, '');\n if (t.length > 0) {\n const matches = t.match(/([^:]*)(:*)([\\s\\S]*)/);\n if (matches) {\n scopedP = matches[1] + attrName + matches[2] + matches[3];\n }\n }\n }\n return scopedP;\n };\n // Wraps `_scopeSelectorPart()` to not use it directly on selectors with\n // pseudo selector functions like `:where()`. Selectors within pseudo selector\n // functions are recursively sent to `_scopeSelector()`.\n const _pseudoFunctionAwareScopeSelectorPart = (selectorPart) => {\n let scopedPart = '';\n // Collect all outer `:where()` and `:is()` selectors,\n // counting parenthesis to keep nested selectors intact.\n const pseudoSelectorParts = [];\n let pseudoSelectorMatch;\n while ((pseudoSelectorMatch = _cssPrefixWithPseudoSelectorFunction.exec(selectorPart)) !== null) {\n let openedBrackets = 1;\n let index = _cssPrefixWithPseudoSelectorFunction.lastIndex;\n while (index < selectorPart.length) {\n const currentSymbol = selectorPart[index];\n index++;\n if (currentSymbol === '(') {\n openedBrackets++;\n continue;\n }\n if (currentSymbol === ')') {\n openedBrackets--;\n if (openedBrackets === 0) {\n break;\n }\n continue;\n }\n }\n pseudoSelectorParts.push(`${pseudoSelectorMatch[0]}${selectorPart.slice(_cssPrefixWithPseudoSelectorFunction.lastIndex, index)}`);\n _cssPrefixWithPseudoSelectorFunction.lastIndex = index;\n }\n // If selector consists of only `:where()` and `:is()` on the outer level\n // scope those pseudo-selectors individually, otherwise scope the whole\n // selector.\n if (pseudoSelectorParts.join('') === selectorPart) {\n scopedPart = pseudoSelectorParts\n .map((selectorPart) => {\n const [cssPseudoSelectorFunction] = selectorPart.match(_cssPrefixWithPseudoSelectorFunction) ?? [];\n // Unwrap the pseudo selector to scope its contents.\n // For example,\n // - `:where(selectorToScope)` -> `selectorToScope`;\n // - `:is(.foo, .bar)` -> `.foo, .bar`.\n const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction?.length, -1);\n if (selectorToScope.includes(_polyfillHostNoCombinator)) {\n this._shouldScopeIndicator = true;\n }\n const scopedInnerPart = this._scopeSelector({\n selector: selectorToScope,\n scopeSelector,\n hostSelector,\n });\n // Put the result back into the pseudo selector function.\n return `${cssPseudoSelectorFunction}${scopedInnerPart})`;\n })\n .join('');\n }\n else {\n this._shouldScopeIndicator =\n this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);\n scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;\n }\n return scopedPart;\n };\n if (isParentSelector) {\n this._safeSelector = new SafeSelector(selector);\n selector = this._safeSelector.content();\n }\n let scopedSelector = '';\n let startIndex = 0;\n let res;\n // Combinators aren't used as a delimiter if they are within parenthesis,\n // for example `:where(.one .two)` stays intact.\n // Similarly to selector separation by comma initially, negative lookahead\n // is used here to not break selectors within nested parenthesis up to three\n // nested layers.\n const sep = /( |>|\\+|~(?!=))(?!([^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*\\)))\\s*/g;\n // If a selector appears before :host it should not be shimmed as it\n // matches on ancestor elements and not on elements in the host's shadow\n // `:host-context(div)` is transformed to\n // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`\n // the `div` is not part of the component in the 2nd selectors and should not be scoped.\n // Historically `component-tag:host` was matching the component so we also want to preserve\n // this behavior to avoid breaking legacy apps (it should not match).\n // The behavior should be:\n // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)\n // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a\n // `:host-context(tag)`)\n const hasHost = selector.includes(_polyfillHostNoCombinator);\n // Only scope parts after or on the same level as the first `-shadowcsshost-no-combinator`\n // when it is present. The selector has the same level when it is a part of a pseudo\n // selector, like `:where()`, for example `:where(:host, .foo)` would result in `.foo`\n // being scoped.\n if (isParentSelector || this._shouldScopeIndicator) {\n this._shouldScopeIndicator = !hasHost;\n }\n while ((res = sep.exec(selector)) !== null) {\n const separator = res[1];\n // Do not trim the selector, as otherwise this will break sourcemaps\n // when they are defined on multiple lines\n // Example:\n // div,\n // p { color: red}\n const part = selector.slice(startIndex, res.index);\n // A space following an escaped hex value and followed by another hex character\n // (ie: \".\\fc ber\" for \".über\") is not a separator between 2 selectors\n // also keep in mind that backslashes are replaced by a placeholder by SafeSelector\n // These escaped selectors happen for example when esbuild runs with optimization.minify.\n if (part.match(/__esc-ph-(\\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\\d]/)) {\n continue;\n }\n const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part);\n scopedSelector += `${scopedPart} ${separator} `;\n startIndex = sep.lastIndex;\n }\n const part = selector.substring(startIndex);\n scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);\n // replace the placeholders with their original values\n // using values stored inside the `safeSelector` instance.\n return this._safeSelector.restore(scopedSelector);\n }\n _insertPolyfillHostInCssText(selector) {\n return selector\n .replace(_colonHostContextRe, _polyfillHostContext)\n .replace(_colonHostRe, _polyfillHost);\n }\n}\nclass SafeSelector {\n placeholders = [];\n index = 0;\n _content;\n constructor(selector) {\n // Replaces attribute selectors with placeholders.\n // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n selector = this._escapeRegexMatches(selector, /(\\[[^\\]]*\\])/g);\n // CSS allows for certain special characters to be used in selectors if they're escaped.\n // E.g. `.foo:blue` won't match a class called `foo:blue`, because the colon denotes a\n // pseudo-class, but writing `.foo\\:blue` will match, because the colon was escaped.\n // Replace all escape sequences (`\\` followed by a character) with a placeholder so\n // that our handling of pseudo-selectors doesn't mess with them.\n // Escaped characters have a specific placeholder so they can be detected separately.\n selector = selector.replace(/(\\\\.)/g, (_, keep) => {\n const replaceBy = `__esc-ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n // WS and \"+\" would otherwise be interpreted as selector separators.\n this._content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, (_, pseudo, exp) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(exp);\n this.index++;\n return pseudo + replaceBy;\n });\n }\n restore(content) {\n return content.replace(/__(?:ph|esc-ph)-(\\d+)__/g, (_ph, index) => this.placeholders[+index]);\n }\n content() {\n return this._content;\n }\n /**\n * Replaces all of the substrings that match a regex within a\n * special string (e.g. `__ph-0__`, `__ph-1__`, etc).\n */\n _escapeRegexMatches(content, pattern) {\n return content.replace(pattern, (_, keep) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n }\n}\nconst _cssScopedPseudoFunctionPrefix = '(:(where|is)\\\\()?';\nconst _cssPrefixWithPseudoSelectorFunction = /:(where|is)\\(/gi;\nconst _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\\s]*?(['\"])(.*?)\\1[;\\s]*}([^{]*?){/gim;\nconst _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nconst _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nconst _polyfillHost = '-shadowcsshost';\n// note: :host-context pre-processed to -shadowcsshostcontext.\nconst _polyfillHostContext = '-shadowcsscontext';\nconst _parenSuffix = '(?:\\\\((' + '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' + ')\\\\))';\nconst _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + '?([^,{]*)', 'gim');\n// note: :host-context patterns are terminated with `{`, as opposed to :host which\n// is both `{` and `,` because :host-context handles top-level commas differently.\nconst _hostContextPattern = _polyfillHostContext + _parenSuffix + '?([^{]*)';\nconst _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, 'gim');\nconst _cssColonHostContextRe = new RegExp(_hostContextPattern, 'im');\nconst _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\nconst _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\\\))`, 'g');\nconst _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s,]*)/;\nconst _shadowDOMSelectorsRe = [\n /::shadow/g,\n /::content/g,\n // Deprecated selectors\n /\\/shadow-deep\\//g,\n /\\/shadow\\//g,\n];\n// The deep combinator is deprecated in the CSS spec\n// Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.\n// see https://github.com/angular/angular/pull/17677\nconst _shadowDeepSelectors = /(?:>>>)|(?:\\/deep\\/)|(?:::ng-deep)/g;\nconst _selectorReSuffix = '([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$';\nconst _polyfillHostRe = /-shadowcsshost/gim;\nconst _colonHostRe = /:host/gim;\nconst _colonHostContextRe = /:host-context/gim;\nconst _newLinesRe = /\\r?\\n/g;\nconst _commentRe = /\\/\\*[\\s\\S]*?\\*\\//g;\nconst _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=/g;\nconst COMMENT_PLACEHOLDER = '%COMMENT%';\nconst _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, 'g');\nconst BLOCK_PLACEHOLDER = '%BLOCK%';\nconst _ruleRe = new RegExp(`(\\\\s*(?:${COMMENT_PLACEHOLDER}\\\\s*)*)([^;\\\\{\\\\}]+?)(\\\\s*)((?:{%BLOCK%}?\\\\s*;?)|(?:\\\\s*;))`, 'g');\nconst CONTENT_PAIRS = new Map([['{', '}']]);\nconst COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%';\nconst SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';\nconst COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';\nconst _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');\nconst _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');\nconst _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');\nclass CssRule {\n selector;\n content;\n constructor(selector, content) {\n this.selector = selector;\n this.content = content;\n }\n}\nfunction processRules(input, ruleCallback) {\n const escaped = escapeInStrings(input);\n const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);\n let nextBlockIndex = 0;\n const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {\n const selector = m[2];\n let content = '';\n let suffix = m[4];\n let contentPrefix = '';\n if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = '{';\n }\n const rule = ruleCallback(new CssRule(selector, content));\n return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;\n });\n return unescapeInStrings(escapedResult);\n}\nclass StringWithEscapedBlocks {\n escapedString;\n blocks;\n constructor(escapedString, blocks) {\n this.escapedString = escapedString;\n this.blocks = blocks;\n }\n}\nfunction escapeBlocks(input, charPairs, placeholder) {\n const resultParts = [];\n const escapedBlocks = [];\n let openCharCount = 0;\n let nonBlockStartIndex = 0;\n let blockStartIndex = -1;\n let openChar;\n let closeChar;\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n if (char === '\\\\') {\n i++;\n }\n else if (char === closeChar) {\n openCharCount--;\n if (openCharCount === 0) {\n escapedBlocks.push(input.substring(blockStartIndex, i));\n resultParts.push(placeholder);\n nonBlockStartIndex = i;\n blockStartIndex = -1;\n openChar = closeChar = undefined;\n }\n }\n else if (char === openChar) {\n openCharCount++;\n }\n else if (openCharCount === 0 && charPairs.has(char)) {\n openChar = char;\n closeChar = charPairs.get(char);\n openCharCount = 1;\n blockStartIndex = i + 1;\n resultParts.push(input.substring(nonBlockStartIndex, blockStartIndex));\n }\n }\n if (blockStartIndex !== -1) {\n escapedBlocks.push(input.substring(blockStartIndex));\n resultParts.push(placeholder);\n }\n else {\n resultParts.push(input.substring(nonBlockStartIndex));\n }\n return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);\n}\n/**\n * Object containing as keys characters that should be substituted by placeholders\n * when found in strings during the css text parsing, and as values the respective\n * placeholders\n */\nconst ESCAPE_IN_STRING_MAP = {\n ';': SEMI_IN_PLACEHOLDER,\n ',': COMMA_IN_PLACEHOLDER,\n ':': COLON_IN_PLACEHOLDER,\n};\n/**\n * Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or\n * double quotes) replace specific characters with their respective placeholders as indicated\n * by the `ESCAPE_IN_STRING_MAP` map.\n *\n * For example convert the text\n * `animation: \"my-anim:at\\\"ion\" 1s;`\n * to\n * `animation: \"my-anim%COLON_IN_PLACEHOLDER%at\\\"ion\" 1s;`\n *\n * This is necessary in order to remove the meaning of some characters when found inside strings\n * (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the\n * division between property and value during a declaration, none of these meanings apply when such\n * characters are within strings and so in order to prevent parsing issues they need to be replaced\n * with placeholder text for the duration of the css manipulation process).\n *\n * @param input the original css text.\n *\n * @returns the css text with specific characters in strings replaced by placeholders.\n **/\nfunction escapeInStrings(input) {\n let result = input;\n let currentQuoteChar = null;\n for (let i = 0; i < result.length; i++) {\n const char = result[i];\n if (char === '\\\\') {\n i++;\n }\n else {\n if (currentQuoteChar !== null) {\n // index i is inside a quoted sub-string\n if (char === currentQuoteChar) {\n currentQuoteChar = null;\n }\n else {\n const placeholder = ESCAPE_IN_STRING_MAP[char];\n if (placeholder) {\n result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;\n i += placeholder.length - 1;\n }\n }\n }\n else if (char === \"'\" || char === '\"') {\n currentQuoteChar = char;\n }\n }\n }\n return result;\n}\n/**\n * Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their\n * original representation, this is simply used to revert the changes applied by the\n * escapeInStrings function.\n *\n * For example it reverts the text:\n * `animation: \"my-anim%COLON_IN_PLACEHOLDER%at\\\"ion\" 1s;`\n * to it's original form of:\n * `animation: \"my-anim:at\\\"ion\" 1s;`\n *\n * Note: For the sake of simplicity this function does not check that the placeholders are\n * actually inside strings as it would anyway be extremely unlikely to find them outside of strings.\n *\n * @param input the css text containing the placeholders.\n *\n * @returns the css text without the placeholders.\n */\nfunction unescapeInStrings(input) {\n let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');\n result = result.replace(_cssSemiInPlaceholderReGlobal, ';');\n result = result.replace(_cssColonInPlaceholderReGlobal, ':');\n return result;\n}\n/**\n * Unescape all quotes present in a string, but only if the string was actually already\n * quoted.\n *\n * This generates a \"canonical\" representation of strings which can be used to match strings\n * which would otherwise only differ because of differently escaped quotes.\n *\n * For example it converts the string (assumed to be quoted):\n * `this \\\\\"is\\\\\" a \\\\'\\\\\\\\'test`\n * to:\n * `this \"is\" a '\\\\\\\\'test`\n * (note that the latter backslashes are not removed as they are not actually escaping the single\n * quote)\n *\n *\n * @param input the string possibly containing escaped quotes.\n * @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not\n * then it means that it doesn't represent an inner string and thus no unescaping is required)\n *\n * @returns the string in the \"canonical\" representation without escaped quotes.\n */\nfunction unescapeQuotes(str, isQuoted) {\n return !isQuoted ? str : str.replace(/((?:^|[^\\\\])(?:\\\\\\\\)*)\\\\(?=['\"])/g, '$1');\n}\n/**\n * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`\n * to create a selector that matches the same as `:host-context()`.\n *\n * Given a single context selector `A` we need to output selectors that match on the host and as an\n * ancestor of the host:\n *\n * ```\n * A , A {}\n * ```\n *\n * When there is more than one context selector we also have to create combinations of those\n * selectors with each other. For example if there are `A` and `B` selectors the output is:\n *\n * ```\n * AB, AB , A B,\n * B A, A B , B A {}\n * ```\n *\n * And so on...\n *\n * @param contextSelectors an array of context selectors that will be combined.\n * @param otherSelectors the rest of the selectors that are not context selectors.\n */\nfunction _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = '') {\n const hostMarker = _polyfillHostNoCombinator;\n _polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test\n const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);\n // If there are no context selectors then just output a host marker\n if (contextSelectors.length === 0) {\n return hostMarker + otherSelectors;\n }\n const combined = [contextSelectors.pop() || ''];\n while (contextSelectors.length > 0) {\n const length = combined.length;\n const contextSelector = contextSelectors.pop();\n for (let i = 0; i < length; i++) {\n const previousSelectors = combined[i];\n // Add the new selector as a descendant of the previous selectors\n combined[length * 2 + i] = previousSelectors + ' ' + contextSelector;\n // Add the new selector as an ancestor of the previous selectors\n combined[length + i] = contextSelector + ' ' + previousSelectors;\n // Add the new selector to act on the same element as the previous selectors\n combined[i] = contextSelector + previousSelectors;\n }\n }\n // Finally connect the selector to the `hostMarker`s: either acting directly on the host\n // (A) or as an ancestor (A ).\n return combined\n .map((s) => otherSelectorsHasHost\n ? `${pseudoPrefix}${s}${otherSelectors}`\n : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`)\n .join(',');\n}\n/**\n * Mutate the given `groups` array so that there are `multiples` clones of the original array\n * stored.\n *\n * For example `repeatGroups([a, b], 3)` will result in `[a, b, a, b, a, b]` - but importantly the\n * newly added groups will be clones of the original.\n *\n * @param groups An array of groups of strings that will be repeated. This array is mutated\n * in-place.\n * @param multiples The number of times the current groups should appear.\n */\nfunction repeatGroups(groups, multiples) {\n const length = groups.length;\n for (let i = 1; i < multiples; i++) {\n for (let j = 0; j < length; j++) {\n groups[j + i * length] = groups[j].slice(0);\n }\n }\n}\n\n/**\n * Distinguishes different kinds of IR operations.\n *\n * Includes both creation and update operations.\n */\nvar OpKind;\n(function (OpKind) {\n /**\n * A special operation type which is used to represent the beginning and end nodes of a linked\n * list of operations.\n */\n OpKind[OpKind[\"ListEnd\"] = 0] = \"ListEnd\";\n /**\n * An operation which wraps an output AST statement.\n */\n OpKind[OpKind[\"Statement\"] = 1] = \"Statement\";\n /**\n * An operation which declares and initializes a `SemanticVariable`.\n */\n OpKind[OpKind[\"Variable\"] = 2] = \"Variable\";\n /**\n * An operation to begin rendering of an element.\n */\n OpKind[OpKind[\"ElementStart\"] = 3] = \"ElementStart\";\n /**\n * An operation to render an element with no children.\n */\n OpKind[OpKind[\"Element\"] = 4] = \"Element\";\n /**\n * An operation which declares an embedded view.\n */\n OpKind[OpKind[\"Template\"] = 5] = \"Template\";\n /**\n * An operation to end rendering of an element previously started with `ElementStart`.\n */\n OpKind[OpKind[\"ElementEnd\"] = 6] = \"ElementEnd\";\n /**\n * An operation to begin an `ng-container`.\n */\n OpKind[OpKind[\"ContainerStart\"] = 7] = \"ContainerStart\";\n /**\n * An operation for an `ng-container` with no children.\n */\n OpKind[OpKind[\"Container\"] = 8] = \"Container\";\n /**\n * An operation to end an `ng-container`.\n */\n OpKind[OpKind[\"ContainerEnd\"] = 9] = \"ContainerEnd\";\n /**\n * An operation disable binding for subsequent elements, which are descendants of a non-bindable\n * node.\n */\n OpKind[OpKind[\"DisableBindings\"] = 10] = \"DisableBindings\";\n /**\n * Create a conditional creation instruction op.\n */\n OpKind[OpKind[\"ConditionalCreate\"] = 11] = \"ConditionalCreate\";\n /**\n * Create a conditional branch creation instruction op.\n */\n OpKind[OpKind[\"ConditionalBranchCreate\"] = 12] = \"ConditionalBranchCreate\";\n /**\n * An op to conditionally render a template.\n */\n OpKind[OpKind[\"Conditional\"] = 13] = \"Conditional\";\n /**\n * An operation to re-enable binding, after it was previously disabled.\n */\n OpKind[OpKind[\"EnableBindings\"] = 14] = \"EnableBindings\";\n /**\n * An operation to render a text node.\n */\n OpKind[OpKind[\"Text\"] = 15] = \"Text\";\n /**\n * An operation declaring an event listener for an element.\n */\n OpKind[OpKind[\"Listener\"] = 16] = \"Listener\";\n /**\n * An operation to interpolate text into a text node.\n */\n OpKind[OpKind[\"InterpolateText\"] = 17] = \"InterpolateText\";\n /**\n * An intermediate binding op, that has not yet been processed into an individual property,\n * attribute, style, etc.\n */\n OpKind[OpKind[\"Binding\"] = 18] = \"Binding\";\n /**\n * An operation to bind an expression to a property of an element.\n */\n OpKind[OpKind[\"Property\"] = 19] = \"Property\";\n /**\n * An operation to bind an expression to a style property of an element.\n */\n OpKind[OpKind[\"StyleProp\"] = 20] = \"StyleProp\";\n /**\n * An operation to bind an expression to a class property of an element.\n */\n OpKind[OpKind[\"ClassProp\"] = 21] = \"ClassProp\";\n /**\n * An operation to bind an expression to the styles of an element.\n */\n OpKind[OpKind[\"StyleMap\"] = 22] = \"StyleMap\";\n /**\n * An operation to bind an expression to the classes of an element.\n */\n OpKind[OpKind[\"ClassMap\"] = 23] = \"ClassMap\";\n /**\n * An operation to advance the runtime's implicit slot context during the update phase of a view.\n */\n OpKind[OpKind[\"Advance\"] = 24] = \"Advance\";\n /**\n * An operation to instantiate a pipe.\n */\n OpKind[OpKind[\"Pipe\"] = 25] = \"Pipe\";\n /**\n * An operation to associate an attribute with an element.\n */\n OpKind[OpKind[\"Attribute\"] = 26] = \"Attribute\";\n /**\n * An attribute that has been extracted for inclusion in the consts array.\n */\n OpKind[OpKind[\"ExtractedAttribute\"] = 27] = \"ExtractedAttribute\";\n /**\n * An operation that configures a `@defer` block.\n */\n OpKind[OpKind[\"Defer\"] = 28] = \"Defer\";\n /**\n * An operation that controls when a `@defer` loads.\n */\n OpKind[OpKind[\"DeferOn\"] = 29] = \"DeferOn\";\n /**\n * An operation that controls when a `@defer` loads, using a custom expression as the condition.\n */\n OpKind[OpKind[\"DeferWhen\"] = 30] = \"DeferWhen\";\n /**\n * An i18n message that has been extracted for inclusion in the consts array.\n */\n OpKind[OpKind[\"I18nMessage\"] = 31] = \"I18nMessage\";\n /**\n * A binding to a native DOM property.\n */\n OpKind[OpKind[\"DomProperty\"] = 32] = \"DomProperty\";\n /**\n * A namespace change, which causes the subsequent elements to be processed as either HTML or SVG.\n */\n OpKind[OpKind[\"Namespace\"] = 33] = \"Namespace\";\n /**\n * Configure a content projeciton definition for the view.\n */\n OpKind[OpKind[\"ProjectionDef\"] = 34] = \"ProjectionDef\";\n /**\n * Create a content projection slot.\n */\n OpKind[OpKind[\"Projection\"] = 35] = \"Projection\";\n /**\n * Create a repeater creation instruction op.\n */\n OpKind[OpKind[\"RepeaterCreate\"] = 36] = \"RepeaterCreate\";\n /**\n * An update up for a repeater.\n */\n OpKind[OpKind[\"Repeater\"] = 37] = \"Repeater\";\n /**\n * An operation to bind an expression to the property side of a two-way binding.\n */\n OpKind[OpKind[\"TwoWayProperty\"] = 38] = \"TwoWayProperty\";\n /**\n * An operation declaring the event side of a two-way binding.\n */\n OpKind[OpKind[\"TwoWayListener\"] = 39] = \"TwoWayListener\";\n /**\n * A creation-time operation that initializes the slot for a `@let` declaration.\n */\n OpKind[OpKind[\"DeclareLet\"] = 40] = \"DeclareLet\";\n /**\n * An update-time operation that stores the current value of a `@let` declaration.\n */\n OpKind[OpKind[\"StoreLet\"] = 41] = \"StoreLet\";\n /**\n * The start of an i18n block.\n */\n OpKind[OpKind[\"I18nStart\"] = 42] = \"I18nStart\";\n /**\n * A self-closing i18n on a single element.\n */\n OpKind[OpKind[\"I18n\"] = 43] = \"I18n\";\n /**\n * The end of an i18n block.\n */\n OpKind[OpKind[\"I18nEnd\"] = 44] = \"I18nEnd\";\n /**\n * An expression in an i18n message.\n */\n OpKind[OpKind[\"I18nExpression\"] = 45] = \"I18nExpression\";\n /**\n * An instruction that applies a set of i18n expressions.\n */\n OpKind[OpKind[\"I18nApply\"] = 46] = \"I18nApply\";\n /**\n * An instruction to create an ICU expression.\n */\n OpKind[OpKind[\"IcuStart\"] = 47] = \"IcuStart\";\n /**\n * An instruction to update an ICU expression.\n */\n OpKind[OpKind[\"IcuEnd\"] = 48] = \"IcuEnd\";\n /**\n * An instruction representing a placeholder in an ICU expression.\n */\n OpKind[OpKind[\"IcuPlaceholder\"] = 49] = \"IcuPlaceholder\";\n /**\n * An i18n context containing information needed to generate an i18n message.\n */\n OpKind[OpKind[\"I18nContext\"] = 50] = \"I18nContext\";\n /**\n * A creation op that corresponds to i18n attributes on an element.\n */\n OpKind[OpKind[\"I18nAttributes\"] = 51] = \"I18nAttributes\";\n /**\n * Creation op that attaches the location at which an element was defined in a template to it.\n */\n OpKind[OpKind[\"SourceLocation\"] = 52] = \"SourceLocation\";\n})(OpKind || (OpKind = {}));\n/**\n * Distinguishes different kinds of IR expressions.\n */\nvar ExpressionKind;\n(function (ExpressionKind) {\n /**\n * Read of a variable in a lexical scope.\n */\n ExpressionKind[ExpressionKind[\"LexicalRead\"] = 0] = \"LexicalRead\";\n /**\n * A reference to the current view context.\n */\n ExpressionKind[ExpressionKind[\"Context\"] = 1] = \"Context\";\n /**\n * A reference to the view context, for use inside a track function.\n */\n ExpressionKind[ExpressionKind[\"TrackContext\"] = 2] = \"TrackContext\";\n /**\n * Read of a variable declared in a `VariableOp`.\n */\n ExpressionKind[ExpressionKind[\"ReadVariable\"] = 3] = \"ReadVariable\";\n /**\n * Runtime operation to navigate to the next view context in the view hierarchy.\n */\n ExpressionKind[ExpressionKind[\"NextContext\"] = 4] = \"NextContext\";\n /**\n * Runtime operation to retrieve the value of a local reference.\n */\n ExpressionKind[ExpressionKind[\"Reference\"] = 5] = \"Reference\";\n /**\n * A call storing the value of a `@let` declaration.\n */\n ExpressionKind[ExpressionKind[\"StoreLet\"] = 6] = \"StoreLet\";\n /**\n * A reference to a `@let` declaration read from the context view.\n */\n ExpressionKind[ExpressionKind[\"ContextLetReference\"] = 7] = \"ContextLetReference\";\n /**\n * Runtime operation to snapshot the current view context.\n */\n ExpressionKind[ExpressionKind[\"GetCurrentView\"] = 8] = \"GetCurrentView\";\n /**\n * Runtime operation to restore a snapshotted view.\n */\n ExpressionKind[ExpressionKind[\"RestoreView\"] = 9] = \"RestoreView\";\n /**\n * Runtime operation to reset the current view context after `RestoreView`.\n */\n ExpressionKind[ExpressionKind[\"ResetView\"] = 10] = \"ResetView\";\n /**\n * Defines and calls a function with change-detected arguments.\n */\n ExpressionKind[ExpressionKind[\"PureFunctionExpr\"] = 11] = \"PureFunctionExpr\";\n /**\n * Indicates a positional parameter to a pure function definition.\n */\n ExpressionKind[ExpressionKind[\"PureFunctionParameterExpr\"] = 12] = \"PureFunctionParameterExpr\";\n /**\n * Binding to a pipe transformation.\n */\n ExpressionKind[ExpressionKind[\"PipeBinding\"] = 13] = \"PipeBinding\";\n /**\n * Binding to a pipe transformation with a variable number of arguments.\n */\n ExpressionKind[ExpressionKind[\"PipeBindingVariadic\"] = 14] = \"PipeBindingVariadic\";\n /*\n * A safe property read requiring expansion into a null check.\n */\n ExpressionKind[ExpressionKind[\"SafePropertyRead\"] = 15] = \"SafePropertyRead\";\n /**\n * A safe keyed read requiring expansion into a null check.\n */\n ExpressionKind[ExpressionKind[\"SafeKeyedRead\"] = 16] = \"SafeKeyedRead\";\n /**\n * A safe function call requiring expansion into a null check.\n */\n ExpressionKind[ExpressionKind[\"SafeInvokeFunction\"] = 17] = \"SafeInvokeFunction\";\n /**\n * An intermediate expression that will be expanded from a safe read into an explicit ternary.\n */\n ExpressionKind[ExpressionKind[\"SafeTernaryExpr\"] = 18] = \"SafeTernaryExpr\";\n /**\n * An empty expression that will be stipped before generating the final output.\n */\n ExpressionKind[ExpressionKind[\"EmptyExpr\"] = 19] = \"EmptyExpr\";\n /*\n * An assignment to a temporary variable.\n */\n ExpressionKind[ExpressionKind[\"AssignTemporaryExpr\"] = 20] = \"AssignTemporaryExpr\";\n /**\n * A reference to a temporary variable.\n */\n ExpressionKind[ExpressionKind[\"ReadTemporaryExpr\"] = 21] = \"ReadTemporaryExpr\";\n /**\n * An expression that will cause a literal slot index to be emitted.\n */\n ExpressionKind[ExpressionKind[\"SlotLiteralExpr\"] = 22] = \"SlotLiteralExpr\";\n /**\n * A test expression for a conditional op.\n */\n ExpressionKind[ExpressionKind[\"ConditionalCase\"] = 23] = \"ConditionalCase\";\n /**\n * An expression that will be automatically extracted to the component const array.\n */\n ExpressionKind[ExpressionKind[\"ConstCollected\"] = 24] = \"ConstCollected\";\n /**\n * Operation that sets the value of a two-way binding.\n */\n ExpressionKind[ExpressionKind[\"TwoWayBindingSet\"] = 25] = \"TwoWayBindingSet\";\n})(ExpressionKind || (ExpressionKind = {}));\nvar VariableFlags;\n(function (VariableFlags) {\n VariableFlags[VariableFlags[\"None\"] = 0] = \"None\";\n /**\n * Always inline this variable, regardless of the number of times it's used.\n * An `AlwaysInline` variable may not depend on context, because doing so may cause side effects\n * that are illegal when multi-inlined. (The optimizer will enforce this constraint.)\n */\n VariableFlags[VariableFlags[\"AlwaysInline\"] = 1] = \"AlwaysInline\";\n})(VariableFlags || (VariableFlags = {}));\n/**\n * Distinguishes between different kinds of `SemanticVariable`s.\n */\nvar SemanticVariableKind;\n(function (SemanticVariableKind) {\n /**\n * Represents the context of a particular view.\n */\n SemanticVariableKind[SemanticVariableKind[\"Context\"] = 0] = \"Context\";\n /**\n * Represents an identifier declared in the lexical scope of a view.\n */\n SemanticVariableKind[SemanticVariableKind[\"Identifier\"] = 1] = \"Identifier\";\n /**\n * Represents a saved state that can be used to restore a view in a listener handler function.\n */\n SemanticVariableKind[SemanticVariableKind[\"SavedView\"] = 2] = \"SavedView\";\n /**\n * An alias generated by a special embedded view type (e.g. a `@for` block).\n */\n SemanticVariableKind[SemanticVariableKind[\"Alias\"] = 3] = \"Alias\";\n})(SemanticVariableKind || (SemanticVariableKind = {}));\n/**\n * Whether to compile in compatibilty mode. In compatibility mode, the template pipeline will\n * attempt to match the output of `TemplateDefinitionBuilder` as exactly as possible, at the cost\n * of producing quirky or larger code in some cases.\n */\nvar CompatibilityMode;\n(function (CompatibilityMode) {\n CompatibilityMode[CompatibilityMode[\"Normal\"] = 0] = \"Normal\";\n CompatibilityMode[CompatibilityMode[\"TemplateDefinitionBuilder\"] = 1] = \"TemplateDefinitionBuilder\";\n})(CompatibilityMode || (CompatibilityMode = {}));\n/**\n * Enumeration of the types of attributes which can be applied to an element.\n */\nvar BindingKind;\n(function (BindingKind) {\n /**\n * Static attributes.\n */\n BindingKind[BindingKind[\"Attribute\"] = 0] = \"Attribute\";\n /**\n * Class bindings.\n */\n BindingKind[BindingKind[\"ClassName\"] = 1] = \"ClassName\";\n /**\n * Style bindings.\n */\n BindingKind[BindingKind[\"StyleProperty\"] = 2] = \"StyleProperty\";\n /**\n * Dynamic property bindings.\n */\n BindingKind[BindingKind[\"Property\"] = 3] = \"Property\";\n /**\n * Property or attribute bindings on a template.\n */\n BindingKind[BindingKind[\"Template\"] = 4] = \"Template\";\n /**\n * Internationalized attributes.\n */\n BindingKind[BindingKind[\"I18n\"] = 5] = \"I18n\";\n /**\n * Legacy animation property bindings.\n */\n BindingKind[BindingKind[\"LegacyAnimation\"] = 6] = \"LegacyAnimation\";\n /**\n * Property side of a two-way binding.\n */\n BindingKind[BindingKind[\"TwoWayProperty\"] = 7] = \"TwoWayProperty\";\n})(BindingKind || (BindingKind = {}));\n/**\n * Enumeration of possible times i18n params can be resolved.\n */\nvar I18nParamResolutionTime;\n(function (I18nParamResolutionTime) {\n /**\n * Param is resolved at message creation time. Most params should be resolved at message creation\n * time. However, ICU params need to be handled in post-processing.\n */\n I18nParamResolutionTime[I18nParamResolutionTime[\"Creation\"] = 0] = \"Creation\";\n /**\n * Param is resolved during post-processing. This should be used for params whose value comes from\n * an ICU.\n */\n I18nParamResolutionTime[I18nParamResolutionTime[\"Postproccessing\"] = 1] = \"Postproccessing\";\n})(I18nParamResolutionTime || (I18nParamResolutionTime = {}));\n/**\n * The contexts in which an i18n expression can be used.\n */\nvar I18nExpressionFor;\n(function (I18nExpressionFor) {\n /**\n * This expression is used as a value (i.e. inside an i18n block).\n */\n I18nExpressionFor[I18nExpressionFor[\"I18nText\"] = 0] = \"I18nText\";\n /**\n * This expression is used in a binding.\n */\n I18nExpressionFor[I18nExpressionFor[\"I18nAttribute\"] = 1] = \"I18nAttribute\";\n})(I18nExpressionFor || (I18nExpressionFor = {}));\n/**\n * Flags that describe what an i18n param value. These determine how the value is serialized into\n * the final map.\n */\nvar I18nParamValueFlags;\n(function (I18nParamValueFlags) {\n I18nParamValueFlags[I18nParamValueFlags[\"None\"] = 0] = \"None\";\n /**\n * This value represents an element tag.\n */\n I18nParamValueFlags[I18nParamValueFlags[\"ElementTag\"] = 1] = \"ElementTag\";\n /**\n * This value represents a template tag.\n */\n I18nParamValueFlags[I18nParamValueFlags[\"TemplateTag\"] = 2] = \"TemplateTag\";\n /**\n * This value represents the opening of a tag.\n */\n I18nParamValueFlags[I18nParamValueFlags[\"OpenTag\"] = 4] = \"OpenTag\";\n /**\n * This value represents the closing of a tag.\n */\n I18nParamValueFlags[I18nParamValueFlags[\"CloseTag\"] = 8] = \"CloseTag\";\n /**\n * This value represents an i18n expression index.\n */\n I18nParamValueFlags[I18nParamValueFlags[\"ExpressionIndex\"] = 16] = \"ExpressionIndex\";\n})(I18nParamValueFlags || (I18nParamValueFlags = {}));\n/**\n * Whether the active namespace is HTML, MathML, or SVG mode.\n */\nvar Namespace;\n(function (Namespace) {\n Namespace[Namespace[\"HTML\"] = 0] = \"HTML\";\n Namespace[Namespace[\"SVG\"] = 1] = \"SVG\";\n Namespace[Namespace[\"Math\"] = 2] = \"Math\";\n})(Namespace || (Namespace = {}));\n/**\n * The type of a `@defer` trigger, for use in the ir.\n */\nvar DeferTriggerKind;\n(function (DeferTriggerKind) {\n DeferTriggerKind[DeferTriggerKind[\"Idle\"] = 0] = \"Idle\";\n DeferTriggerKind[DeferTriggerKind[\"Immediate\"] = 1] = \"Immediate\";\n DeferTriggerKind[DeferTriggerKind[\"Timer\"] = 2] = \"Timer\";\n DeferTriggerKind[DeferTriggerKind[\"Hover\"] = 3] = \"Hover\";\n DeferTriggerKind[DeferTriggerKind[\"Interaction\"] = 4] = \"Interaction\";\n DeferTriggerKind[DeferTriggerKind[\"Viewport\"] = 5] = \"Viewport\";\n DeferTriggerKind[DeferTriggerKind[\"Never\"] = 6] = \"Never\";\n})(DeferTriggerKind || (DeferTriggerKind = {}));\n/**\n * Kinds of i18n contexts. They can be created because of root i18n blocks, or ICUs.\n */\nvar I18nContextKind;\n(function (I18nContextKind) {\n I18nContextKind[I18nContextKind[\"RootI18n\"] = 0] = \"RootI18n\";\n I18nContextKind[I18nContextKind[\"Icu\"] = 1] = \"Icu\";\n I18nContextKind[I18nContextKind[\"Attr\"] = 2] = \"Attr\";\n})(I18nContextKind || (I18nContextKind = {}));\nvar TemplateKind;\n(function (TemplateKind) {\n TemplateKind[TemplateKind[\"NgTemplate\"] = 0] = \"NgTemplate\";\n TemplateKind[TemplateKind[\"Structural\"] = 1] = \"Structural\";\n TemplateKind[TemplateKind[\"Block\"] = 2] = \"Block\";\n})(TemplateKind || (TemplateKind = {}));\n\n/**\n * Marker symbol for `ConsumesSlotOpTrait`.\n */\nconst ConsumesSlot = Symbol('ConsumesSlot');\n/**\n * Marker symbol for `DependsOnSlotContextOpTrait`.\n */\nconst DependsOnSlotContext = Symbol('DependsOnSlotContext');\n/**\n * Marker symbol for `ConsumesVars` trait.\n */\nconst ConsumesVarsTrait = Symbol('ConsumesVars');\n/**\n * Marker symbol for `UsesVarOffset` trait.\n */\nconst UsesVarOffset = Symbol('UsesVarOffset');\n/**\n * Default values for most `ConsumesSlotOpTrait` fields (used with the spread operator to initialize\n * implementors of the trait).\n */\nconst TRAIT_CONSUMES_SLOT = {\n [ConsumesSlot]: true,\n numSlotsUsed: 1,\n};\n/**\n * Default values for most `DependsOnSlotContextOpTrait` fields (used with the spread operator to\n * initialize implementors of the trait).\n */\nconst TRAIT_DEPENDS_ON_SLOT_CONTEXT = {\n [DependsOnSlotContext]: true,\n};\n/**\n * Default values for `UsesVars` fields (used with the spread operator to initialize\n * implementors of the trait).\n */\nconst TRAIT_CONSUMES_VARS = {\n [ConsumesVarsTrait]: true,\n};\n/**\n * Test whether an operation implements `ConsumesSlotOpTrait`.\n */\nfunction hasConsumesSlotTrait(op) {\n return op[ConsumesSlot] === true;\n}\nfunction hasDependsOnSlotContextTrait(value) {\n return value[DependsOnSlotContext] === true;\n}\nfunction hasConsumesVarsTrait(value) {\n return value[ConsumesVarsTrait] === true;\n}\n/**\n * Test whether an expression implements `UsesVarOffsetTrait`.\n */\nfunction hasUsesVarOffsetTrait(expr) {\n return expr[UsesVarOffset] === true;\n}\n\n/**\n * Create a `StatementOp`.\n */\nfunction createStatementOp(statement) {\n return {\n kind: OpKind.Statement,\n statement,\n ...NEW_OP,\n };\n}\n/**\n * Create a `VariableOp`.\n */\nfunction createVariableOp(xref, variable, initializer, flags) {\n return {\n kind: OpKind.Variable,\n xref,\n variable,\n initializer,\n flags,\n ...NEW_OP,\n };\n}\n/**\n * Static structure shared by all operations.\n *\n * Used as a convenience via the spread operator (`...NEW_OP`) when creating new operations, and\n * ensures the fields are always in the same order.\n */\nconst NEW_OP = {\n debugListId: null,\n prev: null,\n next: null,\n};\n\n/**\n * Create an `InterpolationTextOp`.\n */\nfunction createInterpolateTextOp(xref, interpolation, sourceSpan) {\n return {\n kind: OpKind.InterpolateText,\n target: xref,\n interpolation,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\nclass Interpolation {\n strings;\n expressions;\n i18nPlaceholders;\n constructor(strings, expressions, i18nPlaceholders) {\n this.strings = strings;\n this.expressions = expressions;\n this.i18nPlaceholders = i18nPlaceholders;\n if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {\n throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);\n }\n }\n}\n/**\n * Create a `BindingOp`, not yet transformed into a particular type of binding.\n */\nfunction createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {\n return {\n kind: OpKind.Binding,\n bindingKind: kind,\n target,\n name,\n expression,\n unit,\n securityContext,\n isTextAttribute,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext: null,\n i18nMessage,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Create a `PropertyOp`.\n */\nfunction createPropertyOp(target, name, expression, isLegacyAnimationTrigger, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {\n return {\n kind: OpKind.Property,\n target,\n name,\n expression,\n isLegacyAnimationTrigger,\n securityContext,\n sanitizer: null,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/**\n * Create a `TwoWayPropertyOp`.\n */\nfunction createTwoWayPropertyOp(target, name, expression, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {\n return {\n kind: OpKind.TwoWayProperty,\n target,\n name,\n expression,\n securityContext,\n sanitizer: null,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/** Create a `StylePropOp`. */\nfunction createStylePropOp(xref, name, expression, unit, sourceSpan) {\n return {\n kind: OpKind.StyleProp,\n target: xref,\n name,\n expression,\n unit,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/**\n * Create a `ClassPropOp`.\n */\nfunction createClassPropOp(xref, name, expression, sourceSpan) {\n return {\n kind: OpKind.ClassProp,\n target: xref,\n name,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/** Create a `StyleMapOp`. */\nfunction createStyleMapOp(xref, expression, sourceSpan) {\n return {\n kind: OpKind.StyleMap,\n target: xref,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/**\n * Create a `ClassMapOp`.\n */\nfunction createClassMapOp(xref, expression, sourceSpan) {\n return {\n kind: OpKind.ClassMap,\n target: xref,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/**\n * Create an `AttributeOp`.\n */\nfunction createAttributeOp(target, namespace, name, expression, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {\n return {\n kind: OpKind.Attribute,\n target,\n namespace,\n name,\n expression,\n securityContext,\n sanitizer: null,\n isTextAttribute,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext: null,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n/**\n * Create an `AdvanceOp`.\n */\nfunction createAdvanceOp(delta, sourceSpan) {\n return {\n kind: OpKind.Advance,\n delta,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Create a conditional op, which will display an embedded view according to a condtion.\n */\nfunction createConditionalOp(target, test, conditions, sourceSpan) {\n return {\n kind: OpKind.Conditional,\n target,\n test,\n conditions,\n processed: null,\n sourceSpan,\n contextValue: null,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n };\n}\nfunction createRepeaterOp(repeaterCreate, targetSlot, collection, sourceSpan) {\n return {\n kind: OpKind.Repeater,\n target: repeaterCreate,\n targetSlot,\n collection,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n };\n}\nfunction createDeferWhenOp(target, expr, modifier, sourceSpan) {\n return {\n kind: OpKind.DeferWhen,\n target,\n expr,\n modifier,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n };\n}\n/**\n * Create an i18n expression op.\n */\nfunction createI18nExpressionOp(context, target, i18nOwner, handle, expression, icuPlaceholder, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {\n return {\n kind: OpKind.I18nExpression,\n context,\n target,\n i18nOwner,\n handle,\n expression,\n icuPlaceholder,\n i18nPlaceholder,\n resolutionTime,\n usage,\n name,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_VARS,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n };\n}\n/**\n * Creates an op to apply i18n expression ops.\n */\nfunction createI18nApplyOp(owner, handle, sourceSpan) {\n return {\n kind: OpKind.I18nApply,\n owner,\n handle,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Creates a `StoreLetOp`.\n */\nfunction createStoreLetOp(target, declaredName, value, sourceSpan) {\n return {\n kind: OpKind.StoreLet,\n target,\n declaredName,\n value,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * Check whether a given `o.Expression` is a logical IR expression type.\n */\nfunction isIrExpression(expr) {\n return expr instanceof ExpressionBase;\n}\n/**\n * Base type used for all logical IR expressions.\n */\nclass ExpressionBase extends Expression {\n constructor(sourceSpan = null) {\n super(null, sourceSpan);\n }\n}\n/**\n * Logical expression representing a lexical read of a variable name.\n */\nclass LexicalReadExpr extends ExpressionBase {\n name;\n kind = ExpressionKind.LexicalRead;\n constructor(name) {\n super();\n this.name = name;\n }\n visitExpression(visitor, context) { }\n isEquivalent(other) {\n // We assume that the lexical reads are in the same context, which must be true for parent\n // expressions to be equivalent.\n // TODO: is this generally safe?\n return this.name === other.name;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new LexicalReadExpr(this.name);\n }\n}\n/**\n * Runtime operation to retrieve the value of a local reference.\n */\nclass ReferenceExpr extends ExpressionBase {\n target;\n targetSlot;\n offset;\n kind = ExpressionKind.Reference;\n constructor(target, targetSlot, offset) {\n super();\n this.target = target;\n this.targetSlot = targetSlot;\n this.offset = offset;\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof ReferenceExpr && e.target === this.target;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new ReferenceExpr(this.target, this.targetSlot, this.offset);\n }\n}\nclass StoreLetExpr extends ExpressionBase {\n target;\n value;\n sourceSpan;\n kind = ExpressionKind.StoreLet;\n [ConsumesVarsTrait] = true;\n [DependsOnSlotContext] = true;\n constructor(target, value, sourceSpan) {\n super();\n this.target = target;\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n visitExpression() { }\n isEquivalent(e) {\n return (e instanceof StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value));\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.value = transformExpressionsInExpression(this.value, transform, flags);\n }\n clone() {\n return new StoreLetExpr(this.target, this.value, this.sourceSpan);\n }\n}\nclass ContextLetReferenceExpr extends ExpressionBase {\n target;\n targetSlot;\n kind = ExpressionKind.ContextLetReference;\n constructor(target, targetSlot) {\n super();\n this.target = target;\n this.targetSlot = targetSlot;\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof ContextLetReferenceExpr && e.target === this.target;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new ContextLetReferenceExpr(this.target, this.targetSlot);\n }\n}\n/**\n * A reference to the current view context (usually the `ctx` variable in a template function).\n */\nclass ContextExpr extends ExpressionBase {\n view;\n kind = ExpressionKind.Context;\n constructor(view) {\n super();\n this.view = view;\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof ContextExpr && e.view === this.view;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new ContextExpr(this.view);\n }\n}\n/**\n * A reference to the current view context inside a track function.\n */\nclass TrackContextExpr extends ExpressionBase {\n view;\n kind = ExpressionKind.TrackContext;\n constructor(view) {\n super();\n this.view = view;\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof TrackContextExpr && e.view === this.view;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new TrackContextExpr(this.view);\n }\n}\n/**\n * Runtime operation to navigate to the next view context in the view hierarchy.\n */\nclass NextContextExpr extends ExpressionBase {\n kind = ExpressionKind.NextContext;\n steps = 1;\n constructor() {\n super();\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof NextContextExpr && e.steps === this.steps;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n const expr = new NextContextExpr();\n expr.steps = this.steps;\n return expr;\n }\n}\n/**\n * Runtime operation to snapshot the current view context.\n *\n * The result of this operation can be stored in a variable and later used with the `RestoreView`\n * operation.\n */\nclass GetCurrentViewExpr extends ExpressionBase {\n kind = ExpressionKind.GetCurrentView;\n constructor() {\n super();\n }\n visitExpression() { }\n isEquivalent(e) {\n return e instanceof GetCurrentViewExpr;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n return new GetCurrentViewExpr();\n }\n}\n/**\n * Runtime operation to restore a snapshotted view.\n */\nclass RestoreViewExpr extends ExpressionBase {\n view;\n kind = ExpressionKind.RestoreView;\n constructor(view) {\n super();\n this.view = view;\n }\n visitExpression(visitor, context) {\n if (typeof this.view !== 'number') {\n this.view.visitExpression(visitor, context);\n }\n }\n isEquivalent(e) {\n if (!(e instanceof RestoreViewExpr) || typeof e.view !== typeof this.view) {\n return false;\n }\n if (typeof this.view === 'number') {\n return this.view === e.view;\n }\n else {\n return this.view.isEquivalent(e.view);\n }\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n if (typeof this.view !== 'number') {\n this.view = transformExpressionsInExpression(this.view, transform, flags);\n }\n }\n clone() {\n return new RestoreViewExpr(this.view instanceof Expression ? this.view.clone() : this.view);\n }\n}\n/**\n * Runtime operation to reset the current view context after `RestoreView`.\n */\nclass ResetViewExpr extends ExpressionBase {\n expr;\n kind = ExpressionKind.ResetView;\n constructor(expr) {\n super();\n this.expr = expr;\n }\n visitExpression(visitor, context) {\n this.expr.visitExpression(visitor, context);\n }\n isEquivalent(e) {\n return e instanceof ResetViewExpr && this.expr.isEquivalent(e.expr);\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n clone() {\n return new ResetViewExpr(this.expr.clone());\n }\n}\nclass TwoWayBindingSetExpr extends ExpressionBase {\n target;\n value;\n kind = ExpressionKind.TwoWayBindingSet;\n constructor(target, value) {\n super();\n this.target = target;\n this.value = value;\n }\n visitExpression(visitor, context) {\n this.target.visitExpression(visitor, context);\n this.value.visitExpression(visitor, context);\n }\n isEquivalent(other) {\n return this.target.isEquivalent(other.target) && this.value.isEquivalent(other.value);\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.target = transformExpressionsInExpression(this.target, transform, flags);\n this.value = transformExpressionsInExpression(this.value, transform, flags);\n }\n clone() {\n return new TwoWayBindingSetExpr(this.target, this.value);\n }\n}\n/**\n * Read of a variable declared as an `ir.VariableOp` and referenced through its `ir.XrefId`.\n */\nclass ReadVariableExpr extends ExpressionBase {\n xref;\n kind = ExpressionKind.ReadVariable;\n name = null;\n constructor(xref) {\n super();\n this.xref = xref;\n }\n visitExpression() { }\n isEquivalent(other) {\n return other instanceof ReadVariableExpr && other.xref === this.xref;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions() { }\n clone() {\n const expr = new ReadVariableExpr(this.xref);\n expr.name = this.name;\n return expr;\n }\n}\nclass PureFunctionExpr extends ExpressionBase {\n kind = ExpressionKind.PureFunctionExpr;\n [ConsumesVarsTrait] = true;\n [UsesVarOffset] = true;\n varOffset = null;\n /**\n * The expression which should be memoized as a pure computation.\n *\n * This expression contains internal `PureFunctionParameterExpr`s, which are placeholders for the\n * positional argument expressions in `args.\n */\n body;\n /**\n * Positional arguments to the pure function which will memoize the `body` expression, which act\n * as memoization keys.\n */\n args;\n /**\n * Once extracted to the `ConstantPool`, a reference to the function which defines the computation\n * of `body`.\n */\n fn = null;\n constructor(expression, args) {\n super();\n this.body = expression;\n this.args = args;\n }\n visitExpression(visitor, context) {\n this.body?.visitExpression(visitor, context);\n for (const arg of this.args) {\n arg.visitExpression(visitor, context);\n }\n }\n isEquivalent(other) {\n if (!(other instanceof PureFunctionExpr) || other.args.length !== this.args.length) {\n return false;\n }\n return (other.body !== null &&\n this.body !== null &&\n other.body.isEquivalent(this.body) &&\n other.args.every((arg, idx) => arg.isEquivalent(this.args[idx])));\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n if (this.body !== null) {\n // TODO: figure out if this is the right flag to pass here.\n this.body = transformExpressionsInExpression(this.body, transform, flags | VisitorContextFlag.InChildOperation);\n }\n else if (this.fn !== null) {\n this.fn = transformExpressionsInExpression(this.fn, transform, flags);\n }\n for (let i = 0; i < this.args.length; i++) {\n this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags);\n }\n }\n clone() {\n const expr = new PureFunctionExpr(this.body?.clone() ?? null, this.args.map((arg) => arg.clone()));\n expr.fn = this.fn?.clone() ?? null;\n expr.varOffset = this.varOffset;\n return expr;\n }\n}\nclass PureFunctionParameterExpr extends ExpressionBase {\n index;\n kind = ExpressionKind.PureFunctionParameterExpr;\n constructor(index) {\n super();\n this.index = index;\n }\n visitExpression() { }\n isEquivalent(other) {\n return other instanceof PureFunctionParameterExpr && other.index === this.index;\n }\n isConstant() {\n return true;\n }\n transformInternalExpressions() { }\n clone() {\n return new PureFunctionParameterExpr(this.index);\n }\n}\nclass PipeBindingExpr extends ExpressionBase {\n target;\n targetSlot;\n name;\n args;\n kind = ExpressionKind.PipeBinding;\n [ConsumesVarsTrait] = true;\n [UsesVarOffset] = true;\n varOffset = null;\n constructor(target, targetSlot, name, args) {\n super();\n this.target = target;\n this.targetSlot = targetSlot;\n this.name = name;\n this.args = args;\n }\n visitExpression(visitor, context) {\n for (const arg of this.args) {\n arg.visitExpression(visitor, context);\n }\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n for (let idx = 0; idx < this.args.length; idx++) {\n this.args[idx] = transformExpressionsInExpression(this.args[idx], transform, flags);\n }\n }\n clone() {\n const r = new PipeBindingExpr(this.target, this.targetSlot, this.name, this.args.map((a) => a.clone()));\n r.varOffset = this.varOffset;\n return r;\n }\n}\nclass PipeBindingVariadicExpr extends ExpressionBase {\n target;\n targetSlot;\n name;\n args;\n numArgs;\n kind = ExpressionKind.PipeBindingVariadic;\n [ConsumesVarsTrait] = true;\n [UsesVarOffset] = true;\n varOffset = null;\n constructor(target, targetSlot, name, args, numArgs) {\n super();\n this.target = target;\n this.targetSlot = targetSlot;\n this.name = name;\n this.args = args;\n this.numArgs = numArgs;\n }\n visitExpression(visitor, context) {\n this.args.visitExpression(visitor, context);\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.args = transformExpressionsInExpression(this.args, transform, flags);\n }\n clone() {\n const r = new PipeBindingVariadicExpr(this.target, this.targetSlot, this.name, this.args.clone(), this.numArgs);\n r.varOffset = this.varOffset;\n return r;\n }\n}\nclass SafePropertyReadExpr extends ExpressionBase {\n receiver;\n name;\n kind = ExpressionKind.SafePropertyRead;\n constructor(receiver, name) {\n super();\n this.receiver = receiver;\n this.name = name;\n }\n // An alias for name, which allows other logic to handle property reads and keyed reads together.\n get index() {\n return this.name;\n }\n visitExpression(visitor, context) {\n this.receiver.visitExpression(visitor, context);\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n }\n clone() {\n return new SafePropertyReadExpr(this.receiver.clone(), this.name);\n }\n}\nclass SafeKeyedReadExpr extends ExpressionBase {\n receiver;\n index;\n kind = ExpressionKind.SafeKeyedRead;\n constructor(receiver, index, sourceSpan) {\n super(sourceSpan);\n this.receiver = receiver;\n this.index = index;\n }\n visitExpression(visitor, context) {\n this.receiver.visitExpression(visitor, context);\n this.index.visitExpression(visitor, context);\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n this.index = transformExpressionsInExpression(this.index, transform, flags);\n }\n clone() {\n return new SafeKeyedReadExpr(this.receiver.clone(), this.index.clone(), this.sourceSpan);\n }\n}\nclass SafeInvokeFunctionExpr extends ExpressionBase {\n receiver;\n args;\n kind = ExpressionKind.SafeInvokeFunction;\n constructor(receiver, args) {\n super();\n this.receiver = receiver;\n this.args = args;\n }\n visitExpression(visitor, context) {\n this.receiver.visitExpression(visitor, context);\n for (const a of this.args) {\n a.visitExpression(visitor, context);\n }\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n for (let i = 0; i < this.args.length; i++) {\n this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags);\n }\n }\n clone() {\n return new SafeInvokeFunctionExpr(this.receiver.clone(), this.args.map((a) => a.clone()));\n }\n}\nclass SafeTernaryExpr extends ExpressionBase {\n guard;\n expr;\n kind = ExpressionKind.SafeTernaryExpr;\n constructor(guard, expr) {\n super();\n this.guard = guard;\n this.expr = expr;\n }\n visitExpression(visitor, context) {\n this.guard.visitExpression(visitor, context);\n this.expr.visitExpression(visitor, context);\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.guard = transformExpressionsInExpression(this.guard, transform, flags);\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n clone() {\n return new SafeTernaryExpr(this.guard.clone(), this.expr.clone());\n }\n}\nclass EmptyExpr extends ExpressionBase {\n kind = ExpressionKind.EmptyExpr;\n visitExpression(visitor, context) { }\n isEquivalent(e) {\n return e instanceof EmptyExpr;\n }\n isConstant() {\n return true;\n }\n clone() {\n return new EmptyExpr();\n }\n transformInternalExpressions() { }\n}\nclass AssignTemporaryExpr extends ExpressionBase {\n expr;\n xref;\n kind = ExpressionKind.AssignTemporaryExpr;\n name = null;\n constructor(expr, xref) {\n super();\n this.expr = expr;\n this.xref = xref;\n }\n visitExpression(visitor, context) {\n this.expr.visitExpression(visitor, context);\n }\n isEquivalent() {\n return false;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n clone() {\n const a = new AssignTemporaryExpr(this.expr.clone(), this.xref);\n a.name = this.name;\n return a;\n }\n}\nclass ReadTemporaryExpr extends ExpressionBase {\n xref;\n kind = ExpressionKind.ReadTemporaryExpr;\n name = null;\n constructor(xref) {\n super();\n this.xref = xref;\n }\n visitExpression(visitor, context) { }\n isEquivalent() {\n return this.xref === this.xref;\n }\n isConstant() {\n return false;\n }\n transformInternalExpressions(transform, flags) { }\n clone() {\n const r = new ReadTemporaryExpr(this.xref);\n r.name = this.name;\n return r;\n }\n}\nclass SlotLiteralExpr extends ExpressionBase {\n slot;\n kind = ExpressionKind.SlotLiteralExpr;\n constructor(slot) {\n super();\n this.slot = slot;\n }\n visitExpression(visitor, context) { }\n isEquivalent(e) {\n return e instanceof SlotLiteralExpr && e.slot === this.slot;\n }\n isConstant() {\n return true;\n }\n clone() {\n return new SlotLiteralExpr(this.slot);\n }\n transformInternalExpressions() { }\n}\nclass ConditionalCaseExpr extends ExpressionBase {\n expr;\n target;\n targetSlot;\n alias;\n kind = ExpressionKind.ConditionalCase;\n /**\n * Create an expression for one branch of a conditional.\n * @param expr The expression to be tested for this case. Might be null, as in an `else` case.\n * @param target The Xref of the view to be displayed if this condition is true.\n */\n constructor(expr, target, targetSlot, alias = null) {\n super();\n this.expr = expr;\n this.target = target;\n this.targetSlot = targetSlot;\n this.alias = alias;\n }\n visitExpression(visitor, context) {\n if (this.expr !== null) {\n this.expr.visitExpression(visitor, context);\n }\n }\n isEquivalent(e) {\n return e instanceof ConditionalCaseExpr && e.expr === this.expr;\n }\n isConstant() {\n return true;\n }\n clone() {\n return new ConditionalCaseExpr(this.expr, this.target, this.targetSlot);\n }\n transformInternalExpressions(transform, flags) {\n if (this.expr !== null) {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n }\n}\nclass ConstCollectedExpr extends ExpressionBase {\n expr;\n kind = ExpressionKind.ConstCollected;\n constructor(expr) {\n super();\n this.expr = expr;\n }\n transformInternalExpressions(transform, flags) {\n this.expr = transform(this.expr, flags);\n }\n visitExpression(visitor, context) {\n this.expr.visitExpression(visitor, context);\n }\n isEquivalent(e) {\n if (!(e instanceof ConstCollectedExpr)) {\n return false;\n }\n return this.expr.isEquivalent(e.expr);\n }\n isConstant() {\n return this.expr.isConstant();\n }\n clone() {\n return new ConstCollectedExpr(this.expr);\n }\n}\n/**\n * Visits all `Expression`s in the AST of `op` with the `visitor` function.\n */\nfunction visitExpressionsInOp(op, visitor) {\n transformExpressionsInOp(op, (expr, flags) => {\n visitor(expr, flags);\n return expr;\n }, VisitorContextFlag.None);\n}\nvar VisitorContextFlag;\n(function (VisitorContextFlag) {\n VisitorContextFlag[VisitorContextFlag[\"None\"] = 0] = \"None\";\n VisitorContextFlag[VisitorContextFlag[\"InChildOperation\"] = 1] = \"InChildOperation\";\n})(VisitorContextFlag || (VisitorContextFlag = {}));\nfunction transformExpressionsInInterpolation(interpolation, transform, flags) {\n for (let i = 0; i < interpolation.expressions.length; i++) {\n interpolation.expressions[i] = transformExpressionsInExpression(interpolation.expressions[i], transform, flags);\n }\n}\n/**\n * Transform all `Expression`s in the AST of `op` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nfunction transformExpressionsInOp(op, transform, flags) {\n switch (op.kind) {\n case OpKind.StyleProp:\n case OpKind.StyleMap:\n case OpKind.ClassProp:\n case OpKind.ClassMap:\n case OpKind.Binding:\n if (op.expression instanceof Interpolation) {\n transformExpressionsInInterpolation(op.expression, transform, flags);\n }\n else {\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n }\n break;\n case OpKind.Property:\n case OpKind.DomProperty:\n case OpKind.Attribute:\n if (op.expression instanceof Interpolation) {\n transformExpressionsInInterpolation(op.expression, transform, flags);\n }\n else {\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n }\n op.sanitizer =\n op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags);\n break;\n case OpKind.TwoWayProperty:\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n op.sanitizer =\n op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags);\n break;\n case OpKind.I18nExpression:\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n break;\n case OpKind.InterpolateText:\n transformExpressionsInInterpolation(op.interpolation, transform, flags);\n break;\n case OpKind.Statement:\n transformExpressionsInStatement(op.statement, transform, flags);\n break;\n case OpKind.Variable:\n op.initializer = transformExpressionsInExpression(op.initializer, transform, flags);\n break;\n case OpKind.Conditional:\n for (const condition of op.conditions) {\n if (condition.expr === null) {\n // This is a default case.\n continue;\n }\n condition.expr = transformExpressionsInExpression(condition.expr, transform, flags);\n }\n if (op.processed !== null) {\n op.processed = transformExpressionsInExpression(op.processed, transform, flags);\n }\n if (op.contextValue !== null) {\n op.contextValue = transformExpressionsInExpression(op.contextValue, transform, flags);\n }\n break;\n case OpKind.Listener:\n case OpKind.TwoWayListener:\n for (const innerOp of op.handlerOps) {\n transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation);\n }\n break;\n case OpKind.ExtractedAttribute:\n op.expression =\n op.expression && transformExpressionsInExpression(op.expression, transform, flags);\n op.trustedValueFn =\n op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform, flags);\n break;\n case OpKind.RepeaterCreate:\n if (op.trackByOps === null) {\n op.track = transformExpressionsInExpression(op.track, transform, flags);\n }\n else {\n for (const innerOp of op.trackByOps) {\n transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation);\n }\n }\n if (op.trackByFn !== null) {\n op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform, flags);\n }\n break;\n case OpKind.Repeater:\n op.collection = transformExpressionsInExpression(op.collection, transform, flags);\n break;\n case OpKind.Defer:\n if (op.loadingConfig !== null) {\n op.loadingConfig = transformExpressionsInExpression(op.loadingConfig, transform, flags);\n }\n if (op.placeholderConfig !== null) {\n op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform, flags);\n }\n if (op.resolverFn !== null) {\n op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform, flags);\n }\n break;\n case OpKind.I18nMessage:\n for (const [placeholder, expr] of op.params) {\n op.params.set(placeholder, transformExpressionsInExpression(expr, transform, flags));\n }\n for (const [placeholder, expr] of op.postprocessingParams) {\n op.postprocessingParams.set(placeholder, transformExpressionsInExpression(expr, transform, flags));\n }\n break;\n case OpKind.DeferWhen:\n op.expr = transformExpressionsInExpression(op.expr, transform, flags);\n break;\n case OpKind.StoreLet:\n op.value = transformExpressionsInExpression(op.value, transform, flags);\n break;\n case OpKind.Advance:\n case OpKind.Container:\n case OpKind.ContainerEnd:\n case OpKind.ContainerStart:\n case OpKind.DeferOn:\n case OpKind.DisableBindings:\n case OpKind.Element:\n case OpKind.ElementEnd:\n case OpKind.ElementStart:\n case OpKind.EnableBindings:\n case OpKind.I18n:\n case OpKind.I18nApply:\n case OpKind.I18nContext:\n case OpKind.I18nEnd:\n case OpKind.I18nStart:\n case OpKind.IcuEnd:\n case OpKind.IcuStart:\n case OpKind.Namespace:\n case OpKind.Pipe:\n case OpKind.Projection:\n case OpKind.ProjectionDef:\n case OpKind.Template:\n case OpKind.Text:\n case OpKind.I18nAttributes:\n case OpKind.IcuPlaceholder:\n case OpKind.DeclareLet:\n case OpKind.SourceLocation:\n case OpKind.ConditionalCreate:\n case OpKind.ConditionalBranchCreate:\n // These operations contain no expressions.\n break;\n default:\n throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);\n }\n}\n/**\n * Transform all `Expression`s in the AST of `expr` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nfunction transformExpressionsInExpression(expr, transform, flags) {\n if (expr instanceof ExpressionBase) {\n expr.transformInternalExpressions(transform, flags);\n }\n else if (expr instanceof BinaryOperatorExpr) {\n expr.lhs = transformExpressionsInExpression(expr.lhs, transform, flags);\n expr.rhs = transformExpressionsInExpression(expr.rhs, transform, flags);\n }\n else if (expr instanceof UnaryOperatorExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n }\n else if (expr instanceof ReadPropExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n }\n else if (expr instanceof ReadKeyExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n expr.index = transformExpressionsInExpression(expr.index, transform, flags);\n }\n else if (expr instanceof InvokeFunctionExpr) {\n expr.fn = transformExpressionsInExpression(expr.fn, transform, flags);\n for (let i = 0; i < expr.args.length; i++) {\n expr.args[i] = transformExpressionsInExpression(expr.args[i], transform, flags);\n }\n }\n else if (expr instanceof LiteralArrayExpr) {\n for (let i = 0; i < expr.entries.length; i++) {\n expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform, flags);\n }\n }\n else if (expr instanceof LiteralMapExpr) {\n for (let i = 0; i < expr.entries.length; i++) {\n expr.entries[i].value = transformExpressionsInExpression(expr.entries[i].value, transform, flags);\n }\n }\n else if (expr instanceof ConditionalExpr) {\n expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);\n expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags);\n if (expr.falseCase !== null) {\n expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags);\n }\n }\n else if (expr instanceof TypeofExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n }\n else if (expr instanceof VoidExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n }\n else if (expr instanceof LocalizedString) {\n for (let i = 0; i < expr.expressions.length; i++) {\n expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);\n }\n }\n else if (expr instanceof NotExpr) {\n expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);\n }\n else if (expr instanceof TaggedTemplateLiteralExpr) {\n expr.tag = transformExpressionsInExpression(expr.tag, transform, flags);\n expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform, flags));\n }\n else if (expr instanceof ArrowFunctionExpr) {\n if (Array.isArray(expr.body)) {\n for (let i = 0; i < expr.body.length; i++) {\n transformExpressionsInStatement(expr.body[i], transform, flags);\n }\n }\n else {\n expr.body = transformExpressionsInExpression(expr.body, transform, flags);\n }\n }\n else if (expr instanceof WrappedNodeExpr) ;\n else if (expr instanceof TemplateLiteralExpr) {\n for (let i = 0; i < expr.expressions.length; i++) {\n expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);\n }\n }\n else if (expr instanceof ParenthesizedExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n }\n else if (expr instanceof ReadVarExpr ||\n expr instanceof ExternalExpr ||\n expr instanceof LiteralExpr) ;\n else {\n throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);\n }\n return transform(expr, flags);\n}\n/**\n * Transform all `Expression`s in the AST of `stmt` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nfunction transformExpressionsInStatement(stmt, transform, flags) {\n if (stmt instanceof ExpressionStatement) {\n stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags);\n }\n else if (stmt instanceof ReturnStatement) {\n stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);\n }\n else if (stmt instanceof DeclareVarStmt) {\n if (stmt.value !== undefined) {\n stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);\n }\n }\n else if (stmt instanceof IfStmt) {\n stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags);\n for (const caseStatement of stmt.trueCase) {\n transformExpressionsInStatement(caseStatement, transform, flags);\n }\n for (const caseStatement of stmt.falseCase) {\n transformExpressionsInStatement(caseStatement, transform, flags);\n }\n }\n else {\n throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);\n }\n}\n/**\n * Checks whether the given expression is a string literal.\n */\nfunction isStringLiteral(expr) {\n return expr instanceof LiteralExpr && typeof expr.value === 'string';\n}\n\n/**\n * A linked list of `Op` nodes of a given subtype.\n *\n * @param OpT specific subtype of `Op` nodes which this list contains.\n */\nclass OpList {\n static nextListId = 0;\n /**\n * Debug ID of this `OpList` instance.\n */\n debugListId = OpList.nextListId++;\n // OpList uses static head/tail nodes of a special `ListEnd` type.\n // This avoids the need for special casing of the first and last list\n // elements in all list operations.\n head = {\n kind: OpKind.ListEnd,\n next: null,\n prev: null,\n debugListId: this.debugListId,\n };\n tail = {\n kind: OpKind.ListEnd,\n next: null,\n prev: null,\n debugListId: this.debugListId,\n };\n constructor() {\n // Link `head` and `tail` together at the start (list is empty).\n this.head.next = this.tail;\n this.tail.prev = this.head;\n }\n /**\n * Push a new operation to the tail of the list.\n */\n push(op) {\n if (Array.isArray(op)) {\n for (const o of op) {\n this.push(o);\n }\n return;\n }\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n op.debugListId = this.debugListId;\n // The old \"previous\" node (which might be the head, if the list is empty).\n const oldLast = this.tail.prev;\n // Insert `op` following the old last node.\n op.prev = oldLast;\n oldLast.next = op;\n // Connect `op` with the list tail.\n op.next = this.tail;\n this.tail.prev = op;\n }\n /**\n * Prepend one or more nodes to the start of the list.\n */\n prepend(ops) {\n if (ops.length === 0) {\n return;\n }\n for (const op of ops) {\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n op.debugListId = this.debugListId;\n }\n const first = this.head.next;\n let prev = this.head;\n for (const op of ops) {\n prev.next = op;\n op.prev = prev;\n prev = op;\n }\n prev.next = first;\n first.prev = prev;\n }\n /**\n * `OpList` is iterable via the iteration protocol.\n *\n * It's safe to mutate the part of the list that has already been returned by the iterator, up to\n * and including the last operation returned. Mutations beyond that point _may_ be safe, but may\n * also corrupt the iteration position and should be avoided.\n */\n *[Symbol.iterator]() {\n let current = this.head.next;\n while (current !== this.tail) {\n // Guards against corruption of the iterator state by mutations to the tail of the list during\n // iteration.\n OpList.assertIsOwned(current, this.debugListId);\n const next = current.next;\n yield current;\n current = next;\n }\n }\n *reversed() {\n let current = this.tail.prev;\n while (current !== this.head) {\n OpList.assertIsOwned(current, this.debugListId);\n const prev = current.prev;\n yield current;\n current = prev;\n }\n }\n /**\n * Replace `oldOp` with `newOp` in the list.\n */\n static replace(oldOp, newOp) {\n OpList.assertIsNotEnd(oldOp);\n OpList.assertIsNotEnd(newOp);\n OpList.assertIsOwned(oldOp);\n OpList.assertIsUnowned(newOp);\n newOp.debugListId = oldOp.debugListId;\n if (oldOp.prev !== null) {\n oldOp.prev.next = newOp;\n newOp.prev = oldOp.prev;\n }\n if (oldOp.next !== null) {\n oldOp.next.prev = newOp;\n newOp.next = oldOp.next;\n }\n oldOp.debugListId = null;\n oldOp.prev = null;\n oldOp.next = null;\n }\n /**\n * Replace `oldOp` with some number of new operations in the list (which may include `oldOp`).\n */\n static replaceWithMany(oldOp, newOps) {\n if (newOps.length === 0) {\n // Replacing with an empty list -> pure removal.\n OpList.remove(oldOp);\n return;\n }\n OpList.assertIsNotEnd(oldOp);\n OpList.assertIsOwned(oldOp);\n const listId = oldOp.debugListId;\n oldOp.debugListId = null;\n for (const newOp of newOps) {\n OpList.assertIsNotEnd(newOp);\n // `newOp` might be `oldOp`, but at this point it's been marked as unowned.\n OpList.assertIsUnowned(newOp);\n }\n // It should be safe to reuse `oldOp` in the `newOps` list - maybe you want to sandwich an\n // operation between two new ops.\n const { prev: oldPrev, next: oldNext } = oldOp;\n oldOp.prev = null;\n oldOp.next = null;\n let prev = oldPrev;\n for (const newOp of newOps) {\n OpList.assertIsUnowned(newOp);\n newOp.debugListId = listId;\n prev.next = newOp;\n newOp.prev = prev;\n // This _should_ be the case, but set it just in case.\n newOp.next = null;\n prev = newOp;\n }\n // At the end of iteration, `prev` holds the last node in the list.\n const first = newOps[0];\n const last = prev;\n // Replace `oldOp` with the chain `first` -> `last`.\n if (oldPrev !== null) {\n oldPrev.next = first;\n first.prev = oldPrev;\n }\n if (oldNext !== null) {\n oldNext.prev = last;\n last.next = oldNext;\n }\n }\n /**\n * Remove the given node from the list which contains it.\n */\n static remove(op) {\n OpList.assertIsNotEnd(op);\n OpList.assertIsOwned(op);\n op.prev.next = op.next;\n op.next.prev = op.prev;\n // Break any link between the node and this list to safeguard against its usage in future\n // operations.\n op.debugListId = null;\n op.prev = null;\n op.next = null;\n }\n /**\n * Insert `op` before `target`.\n */\n static insertBefore(op, target) {\n if (Array.isArray(op)) {\n for (const o of op) {\n OpList.insertBefore(o, target);\n }\n return;\n }\n OpList.assertIsOwned(target);\n if (target.prev === null) {\n throw new Error(`AssertionError: illegal operation on list start`);\n }\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n op.debugListId = target.debugListId;\n // Just in case.\n op.prev = null;\n target.prev.next = op;\n op.prev = target.prev;\n op.next = target;\n target.prev = op;\n }\n /**\n * Insert `op` after `target`.\n */\n static insertAfter(op, target) {\n OpList.assertIsOwned(target);\n if (target.next === null) {\n throw new Error(`AssertionError: illegal operation on list end`);\n }\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n op.debugListId = target.debugListId;\n target.next.prev = op;\n op.next = target.next;\n op.prev = target;\n target.next = op;\n }\n /**\n * Asserts that `op` does not currently belong to a list.\n */\n static assertIsUnowned(op) {\n if (op.debugListId !== null) {\n throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);\n }\n }\n /**\n * Asserts that `op` currently belongs to a list. If `byList` is passed, `op` is asserted to\n * specifically belong to that list.\n */\n static assertIsOwned(op, byList) {\n if (op.debugListId === null) {\n throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);\n }\n else if (byList !== undefined && op.debugListId !== byList) {\n throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`);\n }\n }\n /**\n * Asserts that `op` is not a special `ListEnd` node.\n */\n static assertIsNotEnd(op) {\n if (op.kind === OpKind.ListEnd) {\n throw new Error(`AssertionError: illegal operation on list head or tail`);\n }\n }\n}\n\nclass SlotHandle {\n slot = null;\n}\n\n/**\n * The set of OpKinds that represent the creation of an element or container\n */\nconst elementContainerOpKinds = new Set([\n OpKind.Element,\n OpKind.ElementStart,\n OpKind.Container,\n OpKind.ContainerStart,\n OpKind.Template,\n OpKind.RepeaterCreate,\n OpKind.ConditionalCreate,\n OpKind.ConditionalBranchCreate,\n]);\n/**\n * Checks whether the given operation represents the creation of an element or container.\n */\nfunction isElementOrContainerOp(op) {\n return elementContainerOpKinds.has(op.kind);\n}\n/**\n * Create an `ElementStartOp`.\n */\nfunction createElementStartOp(tag, xref, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {\n return {\n kind: OpKind.ElementStart,\n xref,\n tag,\n handle: new SlotHandle(),\n attributes: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n/**\n * Create a `TemplateOp`.\n */\nfunction createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {\n return {\n kind: OpKind.Template,\n xref,\n templateKind,\n attributes: null,\n tag,\n handle: new SlotHandle(),\n functionNameSuffix,\n decls: null,\n vars: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\nfunction createConditionalCreateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {\n return {\n kind: OpKind.ConditionalCreate,\n xref,\n templateKind,\n attributes: null,\n tag,\n handle: new SlotHandle(),\n functionNameSuffix,\n decls: null,\n vars: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\nfunction createConditionalBranchCreateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {\n return {\n kind: OpKind.ConditionalBranchCreate,\n xref,\n templateKind,\n attributes: null,\n tag,\n handle: new SlotHandle(),\n functionNameSuffix,\n decls: null,\n vars: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\nfunction createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {\n return {\n kind: OpKind.RepeaterCreate,\n attributes: null,\n xref: primaryView,\n handle: new SlotHandle(),\n emptyView,\n track,\n trackByFn: null,\n trackByOps: null,\n tag,\n emptyTag,\n emptyAttributes: null,\n functionNameSuffix: 'For',\n namespace: Namespace.HTML,\n nonBindable: false,\n localRefs: [],\n decls: null,\n vars: null,\n varNames,\n usesComponentInstance: false,\n i18nPlaceholder,\n emptyI18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n ...TRAIT_CONSUMES_VARS,\n numSlotsUsed: emptyView === null ? 2 : 3,\n };\n}\n/**\n * Create an `ElementEndOp`.\n */\nfunction createElementEndOp(xref, sourceSpan) {\n return {\n kind: OpKind.ElementEnd,\n xref,\n sourceSpan,\n ...NEW_OP,\n };\n}\nfunction createDisableBindingsOp(xref) {\n return {\n kind: OpKind.DisableBindings,\n xref,\n ...NEW_OP,\n };\n}\nfunction createEnableBindingsOp(xref) {\n return {\n kind: OpKind.EnableBindings,\n xref,\n ...NEW_OP,\n };\n}\n/**\n * Create a `TextOp`.\n */\nfunction createTextOp(xref, initialValue, icuPlaceholder, sourceSpan) {\n return {\n kind: OpKind.Text,\n xref,\n handle: new SlotHandle(),\n initialValue,\n icuPlaceholder,\n sourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n/**\n * Create a `ListenerOp`. Host bindings reuse all the listener logic.\n */\nfunction createListenerOp(target, targetSlot, name, tag, handlerOps, legacyAnimationPhase, eventTarget, hostListener, sourceSpan) {\n const handlerList = new OpList();\n handlerList.push(handlerOps);\n return {\n kind: OpKind.Listener,\n target,\n targetSlot,\n tag,\n hostListener,\n name,\n handlerOps: handlerList,\n handlerFnName: null,\n consumesDollarEvent: false,\n isLegacyAnimationListener: legacyAnimationPhase !== null,\n legacyAnimationPhase: legacyAnimationPhase,\n eventTarget,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Create a `TwoWayListenerOp`.\n */\nfunction createTwoWayListenerOp(target, targetSlot, name, tag, handlerOps, sourceSpan) {\n const handlerList = new OpList();\n handlerList.push(handlerOps);\n return {\n kind: OpKind.TwoWayListener,\n target,\n targetSlot,\n tag,\n name,\n handlerOps: handlerList,\n handlerFnName: null,\n sourceSpan,\n ...NEW_OP,\n };\n}\nfunction createPipeOp(xref, slot, name) {\n return {\n kind: OpKind.Pipe,\n xref,\n handle: slot,\n name,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\nfunction createNamespaceOp(namespace) {\n return {\n kind: OpKind.Namespace,\n active: namespace,\n ...NEW_OP,\n };\n}\nfunction createProjectionDefOp(def) {\n return {\n kind: OpKind.ProjectionDef,\n def,\n ...NEW_OP,\n };\n}\nfunction createProjectionOp(xref, selector, i18nPlaceholder, fallbackView, sourceSpan) {\n return {\n kind: OpKind.Projection,\n xref,\n handle: new SlotHandle(),\n selector,\n i18nPlaceholder,\n fallbackView,\n projectionSlotIndex: 0,\n attributes: null,\n localRefs: [],\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n numSlotsUsed: fallbackView === null ? 1 : 2,\n };\n}\n/**\n * Create an `ExtractedAttributeOp`.\n */\nfunction createExtractedAttributeOp(target, bindingKind, namespace, name, expression, i18nContext, i18nMessage, securityContext) {\n return {\n kind: OpKind.ExtractedAttribute,\n target,\n bindingKind,\n namespace,\n name,\n expression,\n i18nContext,\n i18nMessage,\n securityContext,\n trustedValueFn: null,\n ...NEW_OP,\n };\n}\nfunction createDeferOp(xref, main, mainSlot, ownResolverFn, resolverFn, sourceSpan) {\n return {\n kind: OpKind.Defer,\n xref,\n handle: new SlotHandle(),\n mainView: main,\n mainSlot,\n loadingView: null,\n loadingSlot: null,\n loadingConfig: null,\n loadingMinimumTime: null,\n loadingAfterTime: null,\n placeholderView: null,\n placeholderSlot: null,\n placeholderConfig: null,\n placeholderMinimumTime: null,\n errorView: null,\n errorSlot: null,\n ownResolverFn,\n resolverFn,\n flags: null,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n numSlotsUsed: 2,\n };\n}\nfunction createDeferOnOp(defer, trigger, modifier, sourceSpan) {\n return {\n kind: OpKind.DeferOn,\n defer,\n trigger,\n modifier,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Creates a `DeclareLetOp`.\n */\nfunction createDeclareLetOp(xref, declaredName, sourceSpan) {\n return {\n kind: OpKind.DeclareLet,\n xref,\n declaredName,\n sourceSpan,\n handle: new SlotHandle(),\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n/**\n * Create an `ExtractedMessageOp`.\n */\nfunction createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {\n return {\n kind: OpKind.I18nMessage,\n xref,\n i18nContext,\n i18nBlock,\n message,\n messagePlaceholder,\n params,\n postprocessingParams,\n needsPostprocessing,\n subMessages: [],\n ...NEW_OP,\n };\n}\n/**\n * Create an `I18nStartOp`.\n */\nfunction createI18nStartOp(xref, message, root, sourceSpan) {\n return {\n kind: OpKind.I18nStart,\n xref,\n handle: new SlotHandle(),\n root: root ?? xref,\n message,\n messageIndex: null,\n subTemplateIndex: null,\n context: null,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\n/**\n * Create an `I18nEndOp`.\n */\nfunction createI18nEndOp(xref, sourceSpan) {\n return {\n kind: OpKind.I18nEnd,\n xref,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Creates an ICU start op.\n */\nfunction createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) {\n return {\n kind: OpKind.IcuStart,\n xref,\n message,\n messagePlaceholder,\n context: null,\n sourceSpan,\n ...NEW_OP,\n };\n}\n/**\n * Creates an ICU end op.\n */\nfunction createIcuEndOp(xref) {\n return {\n kind: OpKind.IcuEnd,\n xref,\n ...NEW_OP,\n };\n}\n/**\n * Creates an ICU placeholder op.\n */\nfunction createIcuPlaceholderOp(xref, name, strings) {\n return {\n kind: OpKind.IcuPlaceholder,\n xref,\n name,\n strings,\n expressionPlaceholders: [],\n ...NEW_OP,\n };\n}\nfunction createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {\n if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {\n throw new Error('AssertionError: i18nBlock must be provided for non-attribute contexts.');\n }\n return {\n kind: OpKind.I18nContext,\n contextKind,\n xref,\n i18nBlock,\n message,\n sourceSpan,\n params: new Map(),\n postprocessingParams: new Map(),\n ...NEW_OP,\n };\n}\nfunction createI18nAttributesOp(xref, handle, target) {\n return {\n kind: OpKind.I18nAttributes,\n xref,\n handle,\n target,\n i18nAttributesConfig: null,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\n/** Create a `SourceLocationOp`. */\nfunction createSourceLocationOp(templatePath, locations) {\n return {\n kind: OpKind.SourceLocation,\n templatePath,\n locations,\n ...NEW_OP,\n };\n}\n\nfunction createDomPropertyOp(name, expression, isLegacyAnimationTrigger, i18nContext, securityContext, sourceSpan) {\n return {\n kind: OpKind.DomProperty,\n name,\n expression,\n isLegacyAnimationTrigger,\n i18nContext,\n securityContext,\n sanitizer: null,\n sourceSpan,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * When referenced in the template's context parameters, this indicates a reference to the entire\n * context object, rather than a specific parameter.\n */\nconst CTX_REF = 'CTX_REF_MARKER';\n\nvar CompilationJobKind;\n(function (CompilationJobKind) {\n CompilationJobKind[CompilationJobKind[\"Tmpl\"] = 0] = \"Tmpl\";\n CompilationJobKind[CompilationJobKind[\"Host\"] = 1] = \"Host\";\n CompilationJobKind[CompilationJobKind[\"Both\"] = 2] = \"Both\";\n})(CompilationJobKind || (CompilationJobKind = {}));\n/** Possible modes in which a component's template can be compiled. */\nvar TemplateCompilationMode;\n(function (TemplateCompilationMode) {\n /** Supports the full instruction set, including directives. */\n TemplateCompilationMode[TemplateCompilationMode[\"Full\"] = 0] = \"Full\";\n /** Uses a narrower instruction set that doesn't support directives and allows optimizations. */\n TemplateCompilationMode[TemplateCompilationMode[\"DomOnly\"] = 1] = \"DomOnly\";\n})(TemplateCompilationMode || (TemplateCompilationMode = {}));\n/**\n * An entire ongoing compilation, which will result in one or more template functions when complete.\n * Contains one or more corresponding compilation units.\n */\nclass CompilationJob {\n componentName;\n pool;\n compatibility;\n mode;\n constructor(componentName, pool, compatibility, mode) {\n this.componentName = componentName;\n this.pool = pool;\n this.compatibility = compatibility;\n this.mode = mode;\n }\n kind = CompilationJobKind.Both;\n /**\n * Generate a new unique `ir.XrefId` in this job.\n */\n allocateXrefId() {\n return this.nextXrefId++;\n }\n /**\n * Tracks the next `ir.XrefId` which can be assigned as template structures are ingested.\n */\n nextXrefId = 0;\n}\n/**\n * Compilation-in-progress of a whole component's template, including the main template and any\n * embedded views or host bindings.\n */\nclass ComponentCompilationJob extends CompilationJob {\n relativeContextFilePath;\n i18nUseExternalIds;\n deferMeta;\n allDeferrableDepsFn;\n relativeTemplatePath;\n enableDebugLocations;\n constructor(componentName, pool, compatibility, mode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {\n super(componentName, pool, compatibility, mode);\n this.relativeContextFilePath = relativeContextFilePath;\n this.i18nUseExternalIds = i18nUseExternalIds;\n this.deferMeta = deferMeta;\n this.allDeferrableDepsFn = allDeferrableDepsFn;\n this.relativeTemplatePath = relativeTemplatePath;\n this.enableDebugLocations = enableDebugLocations;\n this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null);\n this.views.set(this.root.xref, this.root);\n }\n kind = CompilationJobKind.Tmpl;\n fnSuffix = 'Template';\n /**\n * The root view, representing the component's template.\n */\n root;\n views = new Map();\n /**\n * Causes ngContentSelectors to be emitted, for content projection slots in the view. Possibly a\n * reference into the constant pool.\n */\n contentSelectors = null;\n /**\n * Add a `ViewCompilation` for a new embedded view to this compilation.\n */\n allocateView(parent) {\n const view = new ViewCompilationUnit(this, this.allocateXrefId(), parent);\n this.views.set(view.xref, view);\n return view;\n }\n get units() {\n return this.views.values();\n }\n /**\n * Add a constant `o.Expression` to the compilation and return its index in the `consts` array.\n */\n addConst(newConst, initializers) {\n for (let idx = 0; idx < this.consts.length; idx++) {\n if (this.consts[idx].isEquivalent(newConst)) {\n return idx;\n }\n }\n const idx = this.consts.length;\n this.consts.push(newConst);\n if (initializers) {\n this.constsInitializers.push(...initializers);\n }\n return idx;\n }\n /**\n * Constant expressions used by operations within this component's compilation.\n *\n * This will eventually become the `consts` array in the component definition.\n */\n consts = [];\n /**\n * Initialization statements needed to set up the consts.\n */\n constsInitializers = [];\n}\n/**\n * A compilation unit is compiled into a template function. Some example units are views and host\n * bindings.\n */\nclass CompilationUnit {\n xref;\n constructor(xref) {\n this.xref = xref;\n }\n /**\n * List of creation operations for this view.\n *\n * Creation operations may internally contain other operations, including update operations.\n */\n create = new OpList();\n /**\n * List of update operations for this view.\n */\n update = new OpList();\n /**\n * Name of the function which will be generated for this unit.\n *\n * May be `null` if not yet determined.\n */\n fnName = null;\n /**\n * Number of variable slots used within this view, or `null` if variables have not yet been\n * counted.\n */\n vars = null;\n /**\n * Iterate over all `ir.Op`s within this view.\n *\n * Some operations may have child operations, which this iterator will visit.\n */\n *ops() {\n for (const op of this.create) {\n yield op;\n if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {\n for (const listenerOp of op.handlerOps) {\n yield listenerOp;\n }\n }\n else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {\n for (const trackOp of op.trackByOps) {\n yield trackOp;\n }\n }\n }\n for (const op of this.update) {\n yield op;\n }\n }\n}\n/**\n * Compilation-in-progress of an individual view within a template.\n */\nclass ViewCompilationUnit extends CompilationUnit {\n job;\n parent;\n constructor(job, xref, parent) {\n super(xref);\n this.job = job;\n this.parent = parent;\n }\n /**\n * Map of declared variables available within this view to the property on the context object\n * which they alias.\n */\n contextVariables = new Map();\n /**\n * Set of aliases available within this view. An alias is a variable whose provided expression is\n * inlined at every location it is used. It may also depend on context variables, by name.\n */\n aliases = new Set();\n /**\n * Number of declaration slots used within this view, or `null` if slots have not yet been\n * allocated.\n */\n decls = null;\n}\n/**\n * Compilation-in-progress of a host binding, which contains a single unit for that host binding.\n */\nclass HostBindingCompilationJob extends CompilationJob {\n constructor(componentName, pool, compatibility, mode) {\n super(componentName, pool, compatibility, mode);\n this.root = new HostBindingCompilationUnit(this);\n }\n kind = CompilationJobKind.Host;\n fnSuffix = 'HostBindings';\n root;\n get units() {\n return [this.root];\n }\n}\nclass HostBindingCompilationUnit extends CompilationUnit {\n job;\n constructor(job) {\n super(0);\n this.job = job;\n }\n /**\n * Much like an element can have attributes, so can a host binding function.\n */\n attributes = null;\n}\n\n/**\n * Find any function calls to `$any`, excluding `this.$any`, and delete them, since they have no\n * runtime effects.\n */\nfunction deleteAnyCasts(job) {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n transformExpressionsInOp(op, removeAnys, VisitorContextFlag.None);\n }\n }\n}\nfunction removeAnys(e) {\n if (e instanceof InvokeFunctionExpr &&\n e.fn instanceof LexicalReadExpr &&\n e.fn.name === '$any') {\n if (e.args.length !== 1) {\n throw new Error('The $any builtin function expects exactly one argument.');\n }\n return e.args[0];\n }\n return e;\n}\n\n/**\n * Adds apply operations after i18n expressions.\n */\nfunction applyI18nExpressions(job) {\n const i18nContexts = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === OpKind.I18nContext) {\n i18nContexts.set(op.xref, op);\n }\n }\n }\n for (const unit of job.units) {\n for (const op of unit.update) {\n // Only add apply after expressions that are not followed by more expressions.\n if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {\n // TODO: what should be the source span for the apply op?\n OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);\n }\n }\n }\n}\n/**\n * Checks whether the given expression op needs to be followed with an apply op.\n */\nfunction needsApplication(i18nContexts, op) {\n // If the next op is not another expression, we need to apply.\n if (op.next?.kind !== OpKind.I18nExpression) {\n return true;\n }\n const context = i18nContexts.get(op.context);\n const nextContext = i18nContexts.get(op.next.context);\n if (context === undefined) {\n throw new Error(\"AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context\");\n }\n if (nextContext === undefined) {\n throw new Error(\"AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context\");\n }\n // If the next op is an expression targeting a different i18n block (or different element, in the\n // case of i18n attributes), we need to apply.\n // First, handle the case of i18n blocks.\n if (context.i18nBlock !== null) {\n // This is a block context. Compare the blocks.\n if (context.i18nBlock !== nextContext.i18nBlock) {\n return true;\n }\n return false;\n }\n // Second, handle the case of i18n attributes.\n if (op.i18nOwner !== op.next.i18nOwner) {\n return true;\n }\n return false;\n}\n\n/**\n * Updates i18n expression ops to target the last slot in their owning i18n block, and moves them\n * after the last update instruction that depends on that slot.\n */\nfunction assignI18nSlotDependencies(job) {\n for (const unit of job.units) {\n // The first update op.\n let updateOp = unit.update.head;\n // I18n expressions currently being moved during the iteration.\n let i18nExpressionsInProgress = [];\n // Non-null while we are iterating through an i18nStart/i18nEnd pair\n let state = null;\n for (const createOp of unit.create) {\n if (createOp.kind === OpKind.I18nStart) {\n state = {\n blockXref: createOp.xref,\n lastSlotConsumer: createOp.xref,\n };\n }\n else if (createOp.kind === OpKind.I18nEnd) {\n for (const op of i18nExpressionsInProgress) {\n op.target = state.lastSlotConsumer;\n OpList.insertBefore(op, updateOp);\n }\n i18nExpressionsInProgress.length = 0;\n state = null;\n }\n if (hasConsumesSlotTrait(createOp)) {\n if (state !== null) {\n state.lastSlotConsumer = createOp.xref;\n }\n while (true) {\n if (updateOp.next === null) {\n break;\n }\n if (state !== null &&\n updateOp.kind === OpKind.I18nExpression &&\n updateOp.usage === I18nExpressionFor.I18nText &&\n updateOp.i18nOwner === state.blockXref) {\n const opToRemove = updateOp;\n updateOp = updateOp.next;\n OpList.remove(opToRemove);\n i18nExpressionsInProgress.push(opToRemove);\n continue;\n }\n let hasDifferentTarget = false;\n if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {\n hasDifferentTarget = true;\n }\n else if (\n // Some expressions may consume slots as well (e.g. `storeLet`).\n updateOp.kind === OpKind.Statement ||\n updateOp.kind === OpKind.Variable) {\n visitExpressionsInOp(updateOp, (expr) => {\n if (!hasDifferentTarget &&\n hasDependsOnSlotContextTrait(expr) &&\n expr.target !== createOp.xref) {\n hasDifferentTarget = true;\n }\n });\n }\n if (hasDifferentTarget) {\n break;\n }\n updateOp = updateOp.next;\n }\n }\n }\n }\n}\n\n/**\n * Locates all of the elements defined in a creation block and outputs an op\n * that will expose their definition location in the DOM.\n */\nfunction attachSourceLocations(job) {\n if (!job.enableDebugLocations || job.relativeTemplatePath === null) {\n return;\n }\n for (const unit of job.units) {\n const locations = [];\n for (const op of unit.create) {\n if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {\n const start = op.startSourceSpan.start;\n locations.push({\n targetSlot: op.handle,\n offset: start.offset,\n line: start.line,\n column: start.col,\n });\n }\n }\n if (locations.length > 0) {\n unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));\n }\n }\n}\n\n/**\n * Gets a map of all elements in the given view by their xref id.\n */\nfunction createOpXrefMap(unit) {\n const map = new Map();\n for (const op of unit.create) {\n if (!hasConsumesSlotTrait(op)) {\n continue;\n }\n map.set(op.xref, op);\n // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here,\n // because the slot consumer trait currently only supports one slot per consumer and we\n // need two. This should be revisited when making the refactors mentioned in:\n // https://github.com/angular/angular/pull/53620#discussion_r1430918822\n if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {\n map.set(op.emptyView, op);\n }\n }\n return map;\n}\n\n/**\n * Find all extractable attribute and binding ops, and create ExtractedAttributeOps for them.\n * In cases where no instruction needs to be generated for the attribute or binding, it is removed.\n */\nfunction extractAttributes(job) {\n for (const unit of job.units) {\n const elements = createOpXrefMap(unit);\n for (const op of unit.ops()) {\n switch (op.kind) {\n case OpKind.Attribute:\n extractAttributeOp(unit, op, elements);\n break;\n case OpKind.Property:\n if (!op.isLegacyAnimationTrigger) {\n let bindingKind;\n if (op.i18nMessage !== null && op.templateKind === null) {\n // If the binding has an i18n context, it is an i18n attribute, and should have that\n // kind in the consts array.\n bindingKind = BindingKind.I18n;\n }\n else if (op.isStructuralTemplateAttribute) {\n bindingKind = BindingKind.Template;\n }\n else {\n bindingKind = BindingKind.Property;\n }\n OpList.insertBefore(\n // Deliberately null i18nMessage value\n createExtractedAttributeOp(op.target, bindingKind, null, op.name, \n /* expression */ null, \n /* i18nContext */ null, \n /* i18nMessage */ null, op.securityContext), lookupElement$2(elements, op.target));\n }\n break;\n case OpKind.TwoWayProperty:\n OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.TwoWayProperty, null, op.name, \n /* expression */ null, \n /* i18nContext */ null, \n /* i18nMessage */ null, op.securityContext), lookupElement$2(elements, op.target));\n break;\n case OpKind.StyleProp:\n case OpKind.ClassProp:\n // TODO: Can style or class bindings be i18n attributes?\n // The old compiler treated empty style bindings as regular bindings for the purpose of\n // directive matching. That behavior is incorrect, but we emulate it in compatibility\n // mode.\n if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder &&\n op.expression instanceof EmptyExpr) {\n OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, \n /* expression */ null, \n /* i18nContext */ null, \n /* i18nMessage */ null, SecurityContext.STYLE), lookupElement$2(elements, op.target));\n }\n break;\n case OpKind.Listener:\n if (!op.isLegacyAnimationListener) {\n const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, \n /* expression */ null, \n /* i18nContext */ null, \n /* i18nMessage */ null, SecurityContext.NONE);\n if (job.kind === CompilationJobKind.Host) {\n if (job.compatibility) {\n // TemplateDefinitionBuilder does not extract listener bindings to the const array\n // (which is honestly pretty inconsistent).\n break;\n }\n // This attribute will apply to the enclosing host binding compilation unit, so order\n // doesn't matter.\n unit.create.push(extractedAttributeOp);\n }\n else {\n OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target));\n }\n }\n break;\n case OpKind.TwoWayListener:\n // Two-way listeners aren't supported in host bindings.\n if (job.kind !== CompilationJobKind.Host) {\n const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, \n /* expression */ null, \n /* i18nContext */ null, \n /* i18nMessage */ null, SecurityContext.NONE);\n OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target));\n }\n break;\n }\n }\n }\n}\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupElement$2(elements, xref) {\n const el = elements.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an element-like target.');\n }\n return el;\n}\n/**\n * Extracts an attribute binding.\n */\nfunction extractAttributeOp(unit, op, elements) {\n if (op.expression instanceof Interpolation) {\n return;\n }\n let extractable = op.isTextAttribute || op.expression.isConstant();\n if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {\n // TemplateDefinitionBuilder only extracts text attributes. It does not extract attriibute\n // bindings, even if they are constants.\n extractable &&= op.isTextAttribute;\n }\n if (extractable) {\n const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.namespace, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext);\n if (unit.job.kind === CompilationJobKind.Host) {\n // This attribute will apply to the enclosing host binding compilation unit, so order doesn't\n // matter.\n unit.create.push(extractedAttributeOp);\n }\n else {\n const ownerOp = lookupElement$2(elements, op.target);\n OpList.insertBefore(extractedAttributeOp, ownerOp);\n }\n OpList.remove(op);\n }\n}\n\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupElement$1(elements, xref) {\n const el = elements.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an element-like target.');\n }\n return el;\n}\nfunction specializeBindings(job) {\n const elements = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (!isElementOrContainerOp(op)) {\n continue;\n }\n elements.set(op.xref, op);\n }\n }\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind !== OpKind.Binding) {\n continue;\n }\n switch (op.bindingKind) {\n case BindingKind.Attribute:\n if (op.name === 'ngNonBindable') {\n OpList.remove(op);\n const target = lookupElement$1(elements, op.target);\n target.nonBindable = true;\n }\n else {\n const [namespace, name] = splitNsName(op.name);\n OpList.replace(op, createAttributeOp(op.target, namespace, name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));\n }\n break;\n case BindingKind.Property:\n case BindingKind.LegacyAnimation:\n if (job.kind === CompilationJobKind.Host) {\n OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.LegacyAnimation, op.i18nContext, op.securityContext, op.sourceSpan));\n }\n else {\n OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.LegacyAnimation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));\n }\n break;\n case BindingKind.TwoWayProperty:\n if (!(op.expression instanceof Expression)) {\n // We shouldn't be able to hit this code path since interpolations in two-way bindings\n // result in a parser error. We assert here so that downstream we can assume that\n // the value is always an expression.\n throw new Error(`Expected value of two-way property binding \"${op.name}\" to be an expression`);\n }\n OpList.replace(op, createTwoWayPropertyOp(op.target, op.name, op.expression, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));\n break;\n case BindingKind.I18n:\n case BindingKind.ClassName:\n case BindingKind.StyleProperty:\n throw new Error(`Unhandled binding of kind ${BindingKind[op.bindingKind]}`);\n }\n }\n }\n}\n\nconst CHAIN_COMPATIBILITY = new Map([\n [Identifiers.attribute, Identifiers.attribute],\n [Identifiers.classProp, Identifiers.classProp],\n [Identifiers.element, Identifiers.element],\n [Identifiers.elementContainer, Identifiers.elementContainer],\n [Identifiers.elementContainerEnd, Identifiers.elementContainerEnd],\n [Identifiers.elementContainerStart, Identifiers.elementContainerStart],\n [Identifiers.elementEnd, Identifiers.elementEnd],\n [Identifiers.elementStart, Identifiers.elementStart],\n [Identifiers.domProperty, Identifiers.domProperty],\n [Identifiers.i18nExp, Identifiers.i18nExp],\n [Identifiers.listener, Identifiers.listener],\n [Identifiers.listener, Identifiers.listener],\n [Identifiers.property, Identifiers.property],\n [Identifiers.styleProp, Identifiers.styleProp],\n [Identifiers.syntheticHostListener, Identifiers.syntheticHostListener],\n [Identifiers.syntheticHostProperty, Identifiers.syntheticHostProperty],\n [Identifiers.templateCreate, Identifiers.templateCreate],\n [Identifiers.twoWayProperty, Identifiers.twoWayProperty],\n [Identifiers.twoWayListener, Identifiers.twoWayListener],\n [Identifiers.declareLet, Identifiers.declareLet],\n [Identifiers.conditionalCreate, Identifiers.conditionalBranchCreate],\n [Identifiers.conditionalBranchCreate, Identifiers.conditionalBranchCreate],\n [Identifiers.domElement, Identifiers.domElement],\n [Identifiers.domElementStart, Identifiers.domElementStart],\n [Identifiers.domElementEnd, Identifiers.domElementEnd],\n [Identifiers.domElementContainer, Identifiers.domElementContainer],\n [Identifiers.domElementContainerStart, Identifiers.domElementContainerStart],\n [Identifiers.domElementContainerEnd, Identifiers.domElementContainerEnd],\n [Identifiers.domListener, Identifiers.domListener],\n [Identifiers.domTemplate, Identifiers.domTemplate],\n]);\n/**\n * Chaining results in repeated call expressions, causing a deep AST of receiver expressions. To prevent running out of\n * stack depth the maximum number of chained instructions is limited to this threshold, which has been selected\n * arbitrarily.\n */\nconst MAX_CHAIN_LENGTH = 256;\n/**\n * Post-process a reified view compilation and convert sequential calls to chainable instructions\n * into chain calls.\n *\n * For example, two `elementStart` operations in sequence:\n *\n * ```ts\n * elementStart(0, 'div');\n * elementStart(1, 'span');\n * ```\n *\n * Can be called as a chain instead:\n *\n * ```ts\n * elementStart(0, 'div')(1, 'span');\n * ```\n */\nfunction chain(job) {\n for (const unit of job.units) {\n chainOperationsInList(unit.create);\n chainOperationsInList(unit.update);\n }\n}\nfunction chainOperationsInList(opList) {\n let chain = null;\n for (const op of opList) {\n if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement)) {\n // This type of statement isn't chainable.\n chain = null;\n continue;\n }\n if (!(op.statement.expr instanceof InvokeFunctionExpr) ||\n !(op.statement.expr.fn instanceof ExternalExpr)) {\n // This is a statement, but not an instruction-type call, so not chainable.\n chain = null;\n continue;\n }\n const instruction = op.statement.expr.fn.value;\n if (!CHAIN_COMPATIBILITY.has(instruction)) {\n // This instruction isn't chainable.\n chain = null;\n continue;\n }\n // This instruction can be chained. It can either be added on to the previous chain (if\n // compatible) or it can be the start of a new chain.\n if (chain !== null &&\n CHAIN_COMPATIBILITY.get(chain.instruction) === instruction &&\n chain.length < MAX_CHAIN_LENGTH) {\n // This instruction can be added onto the previous chain.\n const expression = chain.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);\n chain.expression = expression;\n chain.op.statement = expression.toStmt();\n chain.length++;\n OpList.remove(op);\n }\n else {\n // Leave this instruction alone for now, but consider it the start of a new chain.\n chain = {\n op,\n instruction,\n expression: op.statement.expr,\n length: 1,\n };\n }\n }\n}\n\n/**\n * Attribute or style interpolations of the form `[attr.foo]=\"{{foo}}\"\"` should be \"collapsed\"\n * into a plain instruction, instead of an interpolated one.\n *\n * (We cannot do this for singleton property interpolations,\n * because they need to stringify their expressions)\n *\n * The reification step is also capable of performing this transformation, but doing it early in the\n * pipeline allows other phases to accurately know what instruction will be emitted.\n */\nfunction collapseSingletonInterpolations(job) {\n for (const unit of job.units) {\n for (const op of unit.update) {\n const eligibleOpKind = op.kind === OpKind.Attribute ||\n op.kind === OpKind.StyleProp ||\n op.kind == OpKind.StyleMap ||\n op.kind === OpKind.ClassMap;\n if (eligibleOpKind &&\n op.expression instanceof Interpolation &&\n op.expression.strings.length === 2 &&\n op.expression.strings.every((s) => s === '')) {\n op.expression = op.expression.expressions[0];\n }\n }\n }\n}\n\n/**\n * Collapse the various conditions of conditional ops (if, switch) into a single test expression.\n */\nfunction generateConditionalExpressions(job) {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind !== OpKind.Conditional) {\n continue;\n }\n let test;\n // Any case with a `null` condition is `default`. If one exists, default to it instead.\n const defaultCase = op.conditions.findIndex((cond) => cond.expr === null);\n if (defaultCase >= 0) {\n const slot = op.conditions.splice(defaultCase, 1)[0].targetSlot;\n test = new SlotLiteralExpr(slot);\n }\n else {\n // By default, a switch evaluates to `-1`, causing no template to be displayed.\n test = literal(-1);\n }\n // Switch expressions assign their main test to a temporary, to avoid re-executing it.\n let tmp = op.test == null ? null : new AssignTemporaryExpr(op.test, job.allocateXrefId());\n // For each remaining condition, test whether the temporary satifies the check. (If no temp is\n // present, just check each expression directly.)\n for (let i = op.conditions.length - 1; i >= 0; i--) {\n let conditionalCase = op.conditions[i];\n if (conditionalCase.expr === null) {\n continue;\n }\n if (tmp !== null) {\n const useTmp = i === 0 ? tmp : new ReadTemporaryExpr(tmp.xref);\n conditionalCase.expr = new BinaryOperatorExpr(BinaryOperator.Identical, useTmp, conditionalCase.expr);\n }\n else if (conditionalCase.alias !== null) {\n const caseExpressionTemporaryXref = job.allocateXrefId();\n conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref);\n op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref);\n }\n test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.targetSlot), test);\n }\n // Save the resulting aggregate Joost-expression.\n op.processed = test;\n // Clear the original conditions array, since we no longer need it, and don't want it to\n // affect subsequent phases (e.g. pipe creation).\n op.conditions = [];\n }\n }\n}\n\nconst BINARY_OPERATORS = new Map([\n ['&&', BinaryOperator.And],\n ['>', BinaryOperator.Bigger],\n ['>=', BinaryOperator.BiggerEquals],\n ['|', BinaryOperator.BitwiseOr],\n ['&', BinaryOperator.BitwiseAnd],\n ['/', BinaryOperator.Divide],\n ['=', BinaryOperator.Assign],\n ['==', BinaryOperator.Equals],\n ['===', BinaryOperator.Identical],\n ['<', BinaryOperator.Lower],\n ['<=', BinaryOperator.LowerEquals],\n ['-', BinaryOperator.Minus],\n ['%', BinaryOperator.Modulo],\n ['**', BinaryOperator.Exponentiation],\n ['*', BinaryOperator.Multiply],\n ['!=', BinaryOperator.NotEquals],\n ['!==', BinaryOperator.NotIdentical],\n ['??', BinaryOperator.NullishCoalesce],\n ['||', BinaryOperator.Or],\n ['+', BinaryOperator.Plus],\n ['in', BinaryOperator.In],\n ['+=', BinaryOperator.AdditionAssignment],\n ['-=', BinaryOperator.SubtractionAssignment],\n ['*=', BinaryOperator.MultiplicationAssignment],\n ['/=', BinaryOperator.DivisionAssignment],\n ['%=', BinaryOperator.RemainderAssignment],\n ['**=', BinaryOperator.ExponentiationAssignment],\n ['&&=', BinaryOperator.AndAssignment],\n ['||=', BinaryOperator.OrAssignment],\n ['??=', BinaryOperator.NullishCoalesceAssignment],\n]);\nfunction namespaceForKey(namespacePrefixKey) {\n const NAMESPACES = new Map([\n ['svg', Namespace.SVG],\n ['math', Namespace.Math],\n ]);\n if (namespacePrefixKey === null) {\n return Namespace.HTML;\n }\n return NAMESPACES.get(namespacePrefixKey) ?? Namespace.HTML;\n}\nfunction keyForNamespace(namespace) {\n const NAMESPACES = new Map([\n ['svg', Namespace.SVG],\n ['math', Namespace.Math],\n ]);\n for (const [k, n] of NAMESPACES.entries()) {\n if (n === namespace) {\n return k;\n }\n }\n return null; // No namespace prefix for HTML\n}\nfunction prefixWithNamespace(strippedTag, namespace) {\n if (namespace === Namespace.HTML) {\n return strippedTag;\n }\n return `:${keyForNamespace(namespace)}:${strippedTag}`;\n}\nfunction literalOrArrayLiteral(value) {\n if (Array.isArray(value)) {\n return literalArr(value.map(literalOrArrayLiteral));\n }\n return literal(value);\n}\n\n/**\n * Converts the semantic attributes of element-like operations (elements, templates) into constant\n * array expressions, and lifts them into the overall component `consts`.\n */\nfunction collectElementConsts(job) {\n // Collect all extracted attributes.\n const allElementAttributes = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === OpKind.ExtractedAttribute) {\n const attributes = allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility);\n allElementAttributes.set(op.target, attributes);\n attributes.add(op.bindingKind, op.name, op.expression, op.namespace, op.trustedValueFn);\n OpList.remove(op);\n }\n }\n }\n // Serialize the extracted attributes into the const array.\n if (job instanceof ComponentCompilationJob) {\n for (const unit of job.units) {\n for (const op of unit.create) {\n // TODO: Simplify and combine these cases.\n if (op.kind == OpKind.Projection) {\n const attributes = allElementAttributes.get(op.xref);\n if (attributes !== undefined) {\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n op.attributes = attrArray;\n }\n }\n }\n else if (isElementOrContainerOp(op)) {\n op.attributes = getConstIndex(job, allElementAttributes, op.xref);\n // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here,\n // because the slot consumer trait currently only supports one slot per consumer and we\n // need two. This should be revisited when making the refactors mentioned in:\n // https://github.com/angular/angular/pull/53620#discussion_r1430918822\n if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {\n op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView);\n }\n }\n }\n }\n }\n else if (job instanceof HostBindingCompilationJob) {\n // TODO: If the host binding case further diverges, we may want to split it into its own\n // phase.\n for (const [xref, attributes] of allElementAttributes.entries()) {\n if (xref !== job.root.xref) {\n throw new Error(`An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`);\n }\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n job.root.attributes = attrArray;\n }\n }\n }\n}\nfunction getConstIndex(job, allElementAttributes, xref) {\n const attributes = allElementAttributes.get(xref);\n if (attributes !== undefined) {\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n return job.addConst(attrArray);\n }\n }\n return null;\n}\n/**\n * Shared instance of an empty array to avoid unnecessary array allocations.\n */\nconst FLYWEIGHT_ARRAY = Object.freeze([]);\n/**\n * Container for all of the various kinds of attributes which are applied on an element.\n */\nclass ElementAttributes {\n compatibility;\n known = new Map();\n byKind = new Map();\n propertyBindings = null;\n projectAs = null;\n get attributes() {\n return this.byKind.get(BindingKind.Attribute) ?? FLYWEIGHT_ARRAY;\n }\n get classes() {\n return this.byKind.get(BindingKind.ClassName) ?? FLYWEIGHT_ARRAY;\n }\n get styles() {\n return this.byKind.get(BindingKind.StyleProperty) ?? FLYWEIGHT_ARRAY;\n }\n get bindings() {\n return this.propertyBindings ?? FLYWEIGHT_ARRAY;\n }\n get template() {\n return this.byKind.get(BindingKind.Template) ?? FLYWEIGHT_ARRAY;\n }\n get i18n() {\n return this.byKind.get(BindingKind.I18n) ?? FLYWEIGHT_ARRAY;\n }\n constructor(compatibility) {\n this.compatibility = compatibility;\n }\n isKnown(kind, name) {\n const nameToValue = this.known.get(kind) ?? new Set();\n this.known.set(kind, nameToValue);\n if (nameToValue.has(name)) {\n return true;\n }\n nameToValue.add(name);\n return false;\n }\n add(kind, name, value, namespace, trustedValueFn) {\n // TemplateDefinitionBuilder puts duplicate attribute, class, and style values into the consts\n // array. This seems inefficient, we can probably keep just the first one or the last value\n // (whichever actually gets applied when multiple values are listed for the same attribute).\n const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder &&\n (kind === BindingKind.Attribute ||\n kind === BindingKind.ClassName ||\n kind === BindingKind.StyleProperty);\n if (!allowDuplicates && this.isKnown(kind, name)) {\n return;\n }\n // TODO: Can this be its own phase\n if (name === 'ngProjectAs') {\n if (value === null ||\n !(value instanceof LiteralExpr) ||\n value.value == null ||\n typeof value.value?.toString() !== 'string') {\n throw Error('ngProjectAs must have a string literal value');\n }\n this.projectAs = value.value.toString();\n // TODO: TemplateDefinitionBuilder allows `ngProjectAs` to also be assigned as a literal\n // attribute. Is this sane?\n }\n const array = this.arrayFor(kind);\n array.push(...getAttributeNameLiterals(namespace, name));\n if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {\n if (value === null) {\n throw Error('Attribute, i18n attribute, & style element attributes must have a value');\n }\n if (trustedValueFn !== null) {\n if (!isStringLiteral(value)) {\n throw Error('AssertionError: extracted attribute value should be string literal');\n }\n array.push(taggedTemplate(trustedValueFn, new TemplateLiteralExpr([new TemplateLiteralElementExpr(value.value)], []), undefined, value.sourceSpan));\n }\n else {\n array.push(value);\n }\n }\n }\n arrayFor(kind) {\n if (kind === BindingKind.Property || kind === BindingKind.TwoWayProperty) {\n this.propertyBindings ??= [];\n return this.propertyBindings;\n }\n else {\n if (!this.byKind.has(kind)) {\n this.byKind.set(kind, []);\n }\n return this.byKind.get(kind);\n }\n }\n}\n/**\n * Gets an array of literal expressions representing the attribute's namespaced name.\n */\nfunction getAttributeNameLiterals(namespace, name) {\n const nameLiteral = literal(name);\n if (namespace) {\n return [literal(0 /* core.AttributeMarker.NamespaceURI */), literal(namespace), nameLiteral];\n }\n return [nameLiteral];\n}\n/**\n * Serializes an ElementAttributes object into an array expression.\n */\nfunction serializeAttributes({ attributes, bindings, classes, i18n, projectAs, styles, template, }) {\n const attrArray = [...attributes];\n if (projectAs !== null) {\n // Parse the attribute value into a CssSelectorList. Note that we only take the\n // first selector, because we don't support multiple selectors in ngProjectAs.\n const parsedR3Selector = parseSelectorToR3Selector(projectAs)[0];\n attrArray.push(literal(5 /* core.AttributeMarker.ProjectAs */), literalOrArrayLiteral(parsedR3Selector));\n }\n if (classes.length > 0) {\n attrArray.push(literal(1 /* core.AttributeMarker.Classes */), ...classes);\n }\n if (styles.length > 0) {\n attrArray.push(literal(2 /* core.AttributeMarker.Styles */), ...styles);\n }\n if (bindings.length > 0) {\n attrArray.push(literal(3 /* core.AttributeMarker.Bindings */), ...bindings);\n }\n if (template.length > 0) {\n attrArray.push(literal(4 /* core.AttributeMarker.Template */), ...template);\n }\n if (i18n.length > 0) {\n attrArray.push(literal(6 /* core.AttributeMarker.I18n */), ...i18n);\n }\n return literalArr(attrArray);\n}\n\n/**\n * Some binding instructions in the update block may actually correspond to i18n bindings. In that\n * case, they should be replaced with i18nExp instructions for the dynamic portions.\n */\nfunction convertI18nBindings(job) {\n const i18nAttributesByElem = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === OpKind.I18nAttributes) {\n i18nAttributesByElem.set(op.target, op);\n }\n }\n for (const op of unit.update) {\n switch (op.kind) {\n case OpKind.Property:\n case OpKind.Attribute:\n if (op.i18nContext === null) {\n continue;\n }\n if (!(op.expression instanceof Interpolation)) {\n continue;\n }\n const i18nAttributesForElem = i18nAttributesByElem.get(op.target);\n if (i18nAttributesForElem === undefined) {\n throw new Error('AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction');\n }\n if (i18nAttributesForElem.target !== op.target) {\n throw new Error('AssertionError: Expected i18nAttributes target element to match binding target element');\n }\n const ops = [];\n for (let i = 0; i < op.expression.expressions.length; i++) {\n const expr = op.expression.expressions[i];\n if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {\n throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);\n }\n ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, null, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));\n }\n OpList.replaceWithMany(op, ops);\n break;\n }\n }\n }\n}\n\n/**\n * Create one helper context op per i18n block (including generate descending blocks).\n *\n * Also, if an ICU exists inside an i18n block that also contains other localizable content (such as\n * string), create an additional helper context op for the ICU.\n *\n * These context ops are later used for generating i18n messages. (Although we generate at least one\n * context op per nested view, we will collect them up the tree later, to generate a top-level\n * message.)\n */\nfunction createI18nContexts(job) {\n // Create i18n context ops for i18n attrs.\n const attrContextByMessage = new Map();\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n switch (op.kind) {\n case OpKind.Binding:\n case OpKind.Property:\n case OpKind.Attribute:\n case OpKind.ExtractedAttribute:\n if (op.i18nMessage === null) {\n continue;\n }\n if (!attrContextByMessage.has(op.i18nMessage)) {\n const i18nContext = createI18nContextOp(I18nContextKind.Attr, job.allocateXrefId(), null, op.i18nMessage, null);\n unit.create.push(i18nContext);\n attrContextByMessage.set(op.i18nMessage, i18nContext.xref);\n }\n op.i18nContext = attrContextByMessage.get(op.i18nMessage);\n break;\n }\n }\n }\n // Create i18n context ops for root i18n blocks.\n const blockContextByI18nBlock = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case OpKind.I18nStart:\n if (op.xref === op.root) {\n const contextOp = createI18nContextOp(I18nContextKind.RootI18n, job.allocateXrefId(), op.xref, op.message, null);\n unit.create.push(contextOp);\n op.context = contextOp.xref;\n blockContextByI18nBlock.set(op.xref, contextOp);\n }\n break;\n }\n }\n }\n // Assign i18n contexts for child i18n blocks. These don't need their own conext, instead they\n // should inherit from their root i18n block.\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === OpKind.I18nStart && op.xref !== op.root) {\n const rootContext = blockContextByI18nBlock.get(op.root);\n if (rootContext === undefined) {\n throw Error('AssertionError: Root i18n block i18n context should have been created.');\n }\n op.context = rootContext.xref;\n blockContextByI18nBlock.set(op.xref, rootContext);\n }\n }\n }\n // Create or assign i18n contexts for ICUs.\n let currentI18nOp = null;\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case OpKind.I18nStart:\n currentI18nOp = op;\n break;\n case OpKind.I18nEnd:\n currentI18nOp = null;\n break;\n case OpKind.IcuStart:\n if (currentI18nOp === null) {\n throw Error('AssertionError: Unexpected ICU outside of an i18n block.');\n }\n if (op.message.id !== currentI18nOp.message.id) {\n // This ICU is a sub-message inside its parent i18n block message. We need to give it\n // its own context.\n const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.root, op.message, null);\n unit.create.push(contextOp);\n op.context = contextOp.xref;\n }\n else {\n // This ICU is the only translatable content in its parent i18n block. We need to\n // convert the parent's context into an ICU context.\n op.context = currentI18nOp.context;\n blockContextByI18nBlock.get(currentI18nOp.xref).contextKind = I18nContextKind.Icu;\n }\n break;\n }\n }\n }\n}\n\n/**\n * Deduplicate text bindings, e.g. \n */\nfunction deduplicateTextBindings(job) {\n const seen = new Map();\n for (const unit of job.units) {\n for (const op of unit.update.reversed()) {\n if (op.kind === OpKind.Binding && op.isTextAttribute) {\n const seenForElement = seen.get(op.target) || new Set();\n if (seenForElement.has(op.name)) {\n if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {\n // For most duplicated attributes, TemplateDefinitionBuilder lists all of the values in\n // the consts array. However, for style and class attributes it only keeps the last one.\n // We replicate that behavior here since it has actual consequences for apps with\n // duplicate class or style attrs.\n if (op.name === 'style' || op.name === 'class') {\n OpList.remove(op);\n }\n }\n }\n seenForElement.add(op.name);\n seen.set(op.target, seenForElement);\n }\n }\n }\n}\n\n/**\n * Defer instructions take a configuration array, which should be collected into the component\n * consts. This phase finds the config options, and creates the corresponding const array.\n */\nfunction configureDeferInstructions(job) {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind !== OpKind.Defer) {\n continue;\n }\n if (op.placeholderMinimumTime !== null) {\n op.placeholderConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime]));\n }\n if (op.loadingMinimumTime !== null || op.loadingAfterTime !== null) {\n op.loadingConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime, op.loadingAfterTime]));\n }\n }\n }\n}\n\n/**\n * Some `defer` conditions can reference other elements in the template, using their local reference\n * names. However, the semantics are quite different from the normal local reference system: in\n * particular, we need to look at local reference names in enclosing views. This phase resolves\n * all such references to actual xrefs.\n */\nfunction resolveDeferTargetNames(job) {\n const scopes = new Map();\n function getScopeForView(view) {\n if (scopes.has(view.xref)) {\n return scopes.get(view.xref);\n }\n const scope = new Scope$1();\n for (const op of view.create) {\n // add everything that can be referenced.\n if (!isElementOrContainerOp(op) || op.localRefs === null) {\n continue;\n }\n if (!Array.isArray(op.localRefs)) {\n throw new Error('LocalRefs were already processed, but were needed to resolve defer targets.');\n }\n for (const ref of op.localRefs) {\n if (ref.target !== '') {\n continue;\n }\n scope.targets.set(ref.name, { xref: op.xref, slot: op.handle });\n }\n }\n scopes.set(view.xref, scope);\n return scope;\n }\n function resolveTrigger(deferOwnerView, op, placeholderView) {\n switch (op.trigger.kind) {\n case DeferTriggerKind.Idle:\n case DeferTriggerKind.Never:\n case DeferTriggerKind.Immediate:\n case DeferTriggerKind.Timer:\n return;\n case DeferTriggerKind.Hover:\n case DeferTriggerKind.Interaction:\n case DeferTriggerKind.Viewport:\n if (op.trigger.targetName === null) {\n // A `null` target name indicates we should default to the first element in the\n // placeholder block.\n if (placeholderView === null) {\n throw new Error('defer on trigger with no target name must have a placeholder block');\n }\n const placeholder = job.views.get(placeholderView);\n if (placeholder == undefined) {\n throw new Error('AssertionError: could not find placeholder view for defer on trigger');\n }\n for (const placeholderOp of placeholder.create) {\n if (hasConsumesSlotTrait(placeholderOp) &&\n (isElementOrContainerOp(placeholderOp) ||\n placeholderOp.kind === OpKind.Projection)) {\n op.trigger.targetXref = placeholderOp.xref;\n op.trigger.targetView = placeholderView;\n op.trigger.targetSlotViewSteps = -1;\n op.trigger.targetSlot = placeholderOp.handle;\n return;\n }\n }\n return;\n }\n let view = placeholderView !== null ? job.views.get(placeholderView) : deferOwnerView;\n let step = placeholderView !== null ? -1 : 0;\n while (view !== null) {\n const scope = getScopeForView(view);\n if (scope.targets.has(op.trigger.targetName)) {\n const { xref, slot } = scope.targets.get(op.trigger.targetName);\n op.trigger.targetXref = xref;\n op.trigger.targetView = view.xref;\n op.trigger.targetSlotViewSteps = step;\n op.trigger.targetSlot = slot;\n return;\n }\n view = view.parent !== null ? job.views.get(view.parent) : null;\n step++;\n }\n break;\n default:\n throw new Error(`Trigger kind ${op.trigger.kind} not handled`);\n }\n }\n // Find the defer ops, and assign the data about their targets.\n for (const unit of job.units) {\n const defers = new Map();\n for (const op of unit.create) {\n switch (op.kind) {\n case OpKind.Defer:\n defers.set(op.xref, op);\n break;\n case OpKind.DeferOn:\n const deferOp = defers.get(op.defer);\n resolveTrigger(unit, op, op.modifier === \"hydrate\" /* ir.DeferOpModifierKind.HYDRATE */\n ? deferOp.mainView\n : deferOp.placeholderView);\n break;\n }\n }\n }\n}\nlet Scope$1 = class Scope {\n targets = new Map();\n};\n\nconst REPLACEMENTS = new Map([\n [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],\n [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],\n [OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]],\n]);\n/**\n * Op kinds that should not prevent merging of start/end ops.\n */\nconst IGNORED_OP_KINDS = new Set([OpKind.Pipe]);\n/**\n * Replace sequences of mergable instructions (e.g. `ElementStart` and `ElementEnd`) with a\n * consolidated instruction (e.g. `Element`).\n */\nfunction collapseEmptyInstructions(job) {\n for (const unit of job.units) {\n for (const op of unit.create) {\n // Find end ops that may be able to be merged.\n const opReplacements = REPLACEMENTS.get(op.kind);\n if (opReplacements === undefined) {\n continue;\n }\n const [startKind, mergedKind] = opReplacements;\n // Locate the previous (non-ignored) op.\n let prevOp = op.prev;\n while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {\n prevOp = prevOp.prev;\n }\n // If the previous op is the corresponding start op, we can megre.\n if (prevOp !== null && prevOp.kind === startKind) {\n // Transmute the start instruction to the merged version. This is safe as they're designed\n // to be identical apart from the `kind`.\n prevOp.kind = mergedKind;\n // Remove the end instruction.\n OpList.remove(op);\n }\n }\n }\n}\n\n/**\n * Safe read expressions such as `a?.b` have different semantics in Angular templates as\n * compared to JavaScript. In particular, they default to `null` instead of `undefined`. This phase\n * finds all unresolved safe read expressions, and converts them into the appropriate output AST\n * reads, guarded by null checks. We generate temporaries as needed, to avoid re-evaluating the same\n * sub-expression multiple times.\n */\nfunction expandSafeReads(job) {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n transformExpressionsInOp(op, (e) => safeTransform(e, { job }), VisitorContextFlag.None);\n transformExpressionsInOp(op, ternaryTransform, VisitorContextFlag.None);\n }\n }\n}\nfunction needsTemporaryInSafeAccess(e) {\n // TODO: We probably want to use an expression visitor to recursively visit all descendents.\n // However, that would potentially do a lot of extra work (because it cannot short circuit), so we\n // implement the logic ourselves for now.\n if (e instanceof UnaryOperatorExpr) {\n return needsTemporaryInSafeAccess(e.expr);\n }\n else if (e instanceof BinaryOperatorExpr) {\n return needsTemporaryInSafeAccess(e.lhs) || needsTemporaryInSafeAccess(e.rhs);\n }\n else if (e instanceof ConditionalExpr) {\n if (e.falseCase && needsTemporaryInSafeAccess(e.falseCase))\n return true;\n return needsTemporaryInSafeAccess(e.condition) || needsTemporaryInSafeAccess(e.trueCase);\n }\n else if (e instanceof NotExpr) {\n return needsTemporaryInSafeAccess(e.condition);\n }\n else if (e instanceof AssignTemporaryExpr) {\n return needsTemporaryInSafeAccess(e.expr);\n }\n else if (e instanceof ReadPropExpr) {\n return needsTemporaryInSafeAccess(e.receiver);\n }\n else if (e instanceof ReadKeyExpr) {\n return needsTemporaryInSafeAccess(e.receiver) || needsTemporaryInSafeAccess(e.index);\n }\n else if (e instanceof ParenthesizedExpr) {\n return needsTemporaryInSafeAccess(e.expr);\n }\n // TODO: Switch to a method which is exhaustive of newly added expression subtypes.\n return (e instanceof InvokeFunctionExpr ||\n e instanceof LiteralArrayExpr ||\n e instanceof LiteralMapExpr ||\n e instanceof SafeInvokeFunctionExpr ||\n e instanceof PipeBindingExpr);\n}\nfunction temporariesIn(e) {\n const temporaries = new Set();\n // TODO: Although it's not currently supported by the transform helper, we should be able to\n // short-circuit exploring the tree to do less work. In particular, we don't have to penetrate\n // into the subexpressions of temporary assignments.\n transformExpressionsInExpression(e, (e) => {\n if (e instanceof AssignTemporaryExpr) {\n temporaries.add(e.xref);\n }\n return e;\n }, VisitorContextFlag.None);\n return temporaries;\n}\nfunction eliminateTemporaryAssignments(e, tmps, ctx) {\n // TODO: We can be more efficient than the transform helper here. We don't need to visit any\n // descendents of temporary assignments.\n transformExpressionsInExpression(e, (e) => {\n if (e instanceof AssignTemporaryExpr && tmps.has(e.xref)) {\n const read = new ReadTemporaryExpr(e.xref);\n // `TemplateDefinitionBuilder` has the (accidental?) behavior of generating assignments of\n // temporary variables to themselves. This happens because some subexpression that the\n // temporary refers to, possibly through nested temporaries, has a function call. We copy that\n // behavior here.\n return ctx.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder\n ? new AssignTemporaryExpr(read, read.xref)\n : read;\n }\n return e;\n }, VisitorContextFlag.None);\n return e;\n}\n/**\n * Creates a safe ternary guarded by the input expression, and with a body generated by the provided\n * callback on the input expression. Generates a temporary variable assignment if needed, and\n * deduplicates nested temporary assignments if needed.\n */\nfunction safeTernaryWithTemporary(guard, body, ctx) {\n let result;\n if (needsTemporaryInSafeAccess(guard)) {\n const xref = ctx.job.allocateXrefId();\n result = [new AssignTemporaryExpr(guard, xref), new ReadTemporaryExpr(xref)];\n }\n else {\n result = [guard, guard.clone()];\n // Consider an expression like `a?.[b?.c()]?.d`. The `b?.c()` will be transformed first,\n // introducing a temporary assignment into the key. Then, as part of expanding the `?.d`. That\n // assignment will be duplicated into both the guard and expression sides. We de-duplicate it,\n // by transforming it from an assignment into a read on the expression side.\n eliminateTemporaryAssignments(result[1], temporariesIn(result[0]), ctx);\n }\n return new SafeTernaryExpr(result[0], body(result[1]));\n}\nfunction isSafeAccessExpression(e) {\n return (e instanceof SafePropertyReadExpr ||\n e instanceof SafeKeyedReadExpr ||\n e instanceof SafeInvokeFunctionExpr);\n}\nfunction isUnsafeAccessExpression(e) {\n return (e instanceof ReadPropExpr || e instanceof ReadKeyExpr || e instanceof InvokeFunctionExpr);\n}\nfunction isAccessExpression(e) {\n return isSafeAccessExpression(e) || isUnsafeAccessExpression(e);\n}\nfunction deepestSafeTernary(e) {\n if (isAccessExpression(e) && e.receiver instanceof SafeTernaryExpr) {\n let st = e.receiver;\n while (st.expr instanceof SafeTernaryExpr) {\n st = st.expr;\n }\n return st;\n }\n return null;\n}\n// TODO: When strict compatibility with TemplateDefinitionBuilder is not required, we can use `&&`\n// instead to save some code size.\nfunction safeTransform(e, ctx) {\n if (!isAccessExpression(e)) {\n return e;\n }\n const dst = deepestSafeTernary(e);\n if (dst) {\n if (e instanceof InvokeFunctionExpr) {\n dst.expr = dst.expr.callFn(e.args);\n return e.receiver;\n }\n if (e instanceof ReadPropExpr) {\n dst.expr = dst.expr.prop(e.name);\n return e.receiver;\n }\n if (e instanceof ReadKeyExpr) {\n dst.expr = dst.expr.key(e.index);\n return e.receiver;\n }\n if (e instanceof SafeInvokeFunctionExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.callFn(e.args), ctx);\n return e.receiver;\n }\n if (e instanceof SafePropertyReadExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.prop(e.name), ctx);\n return e.receiver;\n }\n if (e instanceof SafeKeyedReadExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r) => r.key(e.index), ctx);\n return e.receiver;\n }\n }\n else {\n if (e instanceof SafeInvokeFunctionExpr) {\n return safeTernaryWithTemporary(e.receiver, (r) => r.callFn(e.args), ctx);\n }\n if (e instanceof SafePropertyReadExpr) {\n return safeTernaryWithTemporary(e.receiver, (r) => r.prop(e.name), ctx);\n }\n if (e instanceof SafeKeyedReadExpr) {\n return safeTernaryWithTemporary(e.receiver, (r) => r.key(e.index), ctx);\n }\n }\n return e;\n}\nfunction ternaryTransform(e) {\n if (!(e instanceof SafeTernaryExpr)) {\n return e;\n }\n return new ParenthesizedExpr(new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr));\n}\n\n/**\n * The escape sequence used indicate message param values.\n */\nconst ESCAPE$1 = '\\uFFFD';\n/**\n * Marker used to indicate an element tag.\n */\nconst ELEMENT_MARKER = '#';\n/**\n * Marker used to indicate a template tag.\n */\nconst TEMPLATE_MARKER = '*';\n/**\n * Marker used to indicate closing of an element or template tag.\n */\nconst TAG_CLOSE_MARKER = '/';\n/**\n * Marker used to indicate the sub-template context.\n */\nconst CONTEXT_MARKER = ':';\n/**\n * Marker used to indicate the start of a list of values.\n */\nconst LIST_START_MARKER = '[';\n/**\n * Marker used to indicate the end of a list of values.\n */\nconst LIST_END_MARKER = ']';\n/**\n * Delimiter used to separate multiple values in a list.\n */\nconst LIST_DELIMITER = '|';\n/**\n * Formats the param maps on extracted message ops into a maps of `Expression` objects that can be\n * used in the final output.\n */\nfunction extractI18nMessages(job) {\n // Create an i18n message for each context.\n // TODO: Merge the context op with the message op since they're 1:1 anyways.\n const i18nMessagesByContext = new Map();\n const i18nBlocks = new Map();\n const i18nContexts = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case OpKind.I18nContext:\n const i18nMessageOp = createI18nMessage(job, op);\n unit.create.push(i18nMessageOp);\n i18nMessagesByContext.set(op.xref, i18nMessageOp);\n i18nContexts.set(op.xref, op);\n break;\n case OpKind.I18nStart:\n i18nBlocks.set(op.xref, op);\n break;\n }\n }\n }\n // Associate sub-messages for ICUs with their root message. At this point we can also remove the\n // ICU start/end ops, as they are no longer needed.\n let currentIcu = null;\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case OpKind.IcuStart:\n currentIcu = op;\n OpList.remove(op);\n // Skip any contexts not associated with an ICU.\n const icuContext = i18nContexts.get(op.context);\n if (icuContext.contextKind !== I18nContextKind.Icu) {\n continue;\n }\n // Skip ICUs that share a context with their i18n message. These represent root-level\n // ICUs, not sub-messages.\n const i18nBlock = i18nBlocks.get(icuContext.i18nBlock);\n if (i18nBlock.context === icuContext.xref) {\n continue;\n }\n // Find the root message and push this ICUs message as a sub-message.\n const rootI18nBlock = i18nBlocks.get(i18nBlock.root);\n const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context);\n if (rootMessage === undefined) {\n throw Error('AssertionError: ICU sub-message should belong to a root message.');\n }\n const subMessage = i18nMessagesByContext.get(icuContext.xref);\n subMessage.messagePlaceholder = op.messagePlaceholder;\n rootMessage.subMessages.push(subMessage.xref);\n break;\n case OpKind.IcuEnd:\n currentIcu = null;\n OpList.remove(op);\n break;\n case OpKind.IcuPlaceholder:\n // Add ICU placeholders to the message, then remove the ICU placeholder ops.\n if (currentIcu === null || currentIcu.context == null) {\n throw Error('AssertionError: Unexpected ICU placeholder outside of i18n context');\n }\n const msg = i18nMessagesByContext.get(currentIcu.context);\n msg.postprocessingParams.set(op.name, literal(formatIcuPlaceholder(op)));\n OpList.remove(op);\n break;\n }\n }\n }\n}\n/**\n * Create an i18n message op from an i18n context op.\n */\nfunction createI18nMessage(job, context, messagePlaceholder) {\n let formattedParams = formatParams(context.params);\n const formattedPostprocessingParams = formatParams(context.postprocessingParams);\n let needsPostprocessing = [...context.params.values()].some((v) => v.length > 1);\n return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, null, formattedParams, formattedPostprocessingParams, needsPostprocessing);\n}\n/**\n * Formats an ICU placeholder into a single string with expression placeholders.\n */\nfunction formatIcuPlaceholder(op) {\n if (op.strings.length !== op.expressionPlaceholders.length + 1) {\n throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);\n }\n const values = op.expressionPlaceholders.map(formatValue);\n return op.strings.flatMap((str, i) => [str, values[i] || '']).join('');\n}\n/**\n * Formats a map of `I18nParamValue[]` values into a map of `Expression` values.\n */\nfunction formatParams(params) {\n const formattedParams = new Map();\n for (const [placeholder, placeholderValues] of params) {\n const serializedValues = formatParamValues(placeholderValues);\n if (serializedValues !== null) {\n formattedParams.set(placeholder, literal(serializedValues));\n }\n }\n return formattedParams;\n}\n/**\n * Formats an `I18nParamValue[]` into a string (or null for empty array).\n */\nfunction formatParamValues(values) {\n if (values.length === 0) {\n return null;\n }\n const serializedValues = values.map((value) => formatValue(value));\n return serializedValues.length === 1\n ? serializedValues[0]\n : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;\n}\n/**\n * Formats a single `I18nParamValue` into a string\n */\nfunction formatValue(value) {\n // Element tags with a structural directive use a special form that concatenates the element and\n // template values.\n if (value.flags & I18nParamValueFlags.ElementTag &&\n value.flags & I18nParamValueFlags.TemplateTag) {\n if (typeof value.value !== 'object') {\n throw Error('AssertionError: Expected i18n param value to have an element and template slot');\n }\n const elementValue = formatValue({\n ...value,\n value: value.value.element,\n flags: value.flags & ~I18nParamValueFlags.TemplateTag,\n });\n const templateValue = formatValue({\n ...value,\n value: value.value.template,\n flags: value.flags & ~I18nParamValueFlags.ElementTag,\n });\n // TODO(mmalerba): This is likely a bug in TemplateDefinitionBuilder, we should not need to\n // record the template value twice. For now I'm re-implementing the behavior here to keep the\n // output consistent with TemplateDefinitionBuilder.\n if (value.flags & I18nParamValueFlags.OpenTag &&\n value.flags & I18nParamValueFlags.CloseTag) {\n return `${templateValue}${elementValue}${templateValue}`;\n }\n // To match the TemplateDefinitionBuilder output, flip the order depending on whether the\n // values represent a closing or opening tag (or both).\n // TODO(mmalerba): Figure out if this makes a difference in terms of either functionality,\n // or the resulting message ID. If not, we can remove the special-casing in the future.\n return value.flags & I18nParamValueFlags.CloseTag\n ? `${elementValue}${templateValue}`\n : `${templateValue}${elementValue}`;\n }\n // Self-closing tags use a special form that concatenates the start and close tag values.\n if (value.flags & I18nParamValueFlags.OpenTag &&\n value.flags & I18nParamValueFlags.CloseTag) {\n return `${formatValue({\n ...value,\n flags: value.flags & ~I18nParamValueFlags.CloseTag,\n })}${formatValue({ ...value, flags: value.flags & ~I18nParamValueFlags.OpenTag })}`;\n }\n // If there are no special flags, just return the raw value.\n if (value.flags === I18nParamValueFlags.None) {\n return `${value.value}`;\n }\n // Encode the remaining flags as part of the value.\n let tagMarker = '';\n let closeMarker = '';\n if (value.flags & I18nParamValueFlags.ElementTag) {\n tagMarker = ELEMENT_MARKER;\n }\n else if (value.flags & I18nParamValueFlags.TemplateTag) {\n tagMarker = TEMPLATE_MARKER;\n }\n if (tagMarker !== '') {\n closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : '';\n }\n const context = value.subTemplateIndex === null ? '' : `${CONTEXT_MARKER}${value.subTemplateIndex}`;\n return `${ESCAPE$1}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE$1}`;\n}\n\n/**\n * Generate `ir.AdvanceOp`s in between `ir.UpdateOp`s that ensure the runtime's implicit slot\n * context will be advanced correctly.\n */\nfunction generateAdvance(job) {\n for (const unit of job.units) {\n // First build a map of all of the declarations in the view that have assigned slots.\n const slotMap = new Map();\n for (const op of unit.create) {\n if (!hasConsumesSlotTrait(op)) {\n continue;\n }\n else if (op.handle.slot === null) {\n throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`);\n }\n slotMap.set(op.xref, op.handle.slot);\n }\n // Next, step through the update operations and generate `ir.AdvanceOp`s as required to ensure\n // the runtime's implicit slot counter will be set to the correct slot before executing each\n // update operation which depends on it.\n //\n // To do that, we track what the runtime's slot counter will be through the update operations.\n let slotContext = 0;\n for (const op of unit.update) {\n let consumer = null;\n if (hasDependsOnSlotContextTrait(op)) {\n consumer = op;\n }\n else {\n visitExpressionsInOp(op, (expr) => {\n if (consumer === null && hasDependsOnSlotContextTrait(expr)) {\n consumer = expr;\n }\n });\n }\n if (consumer === null) {\n continue;\n }\n if (!slotMap.has(consumer.target)) {\n // We expect ops that _do_ depend on the slot counter to point at declarations that exist in\n // the `slotMap`.\n throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`);\n }\n const slot = slotMap.get(consumer.target);\n // Does the slot counter need to be adjusted?\n if (slotContext !== slot) {\n // If so, generate an `ir.AdvanceOp` to advance the counter.\n const delta = slot - slotContext;\n if (delta < 0) {\n throw new Error(`AssertionError: slot counter should never need to move backwards`);\n }\n OpList.insertBefore(createAdvanceOp(delta, consumer.sourceSpan), op);\n slotContext = slot;\n }\n }\n }\n}\n\n/**\n * Replaces the `storeLet` ops with variables that can be\n * used to reference the value within the same view.\n */\nfunction generateLocalLetReferences(job) {\n for (const unit of job.units) {\n for (const op of unit.update) {\n if (op.kind !== OpKind.StoreLet) {\n continue;\n }\n const variable = {\n kind: SemanticVariableKind.Identifier,\n name: null,\n identifier: op.declaredName,\n local: true,\n };\n OpList.replace(op, createVariableOp(job.allocateXrefId(), variable, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));\n }\n }\n}\n\n/**\n * Locate projection slots, populate the each component's `ngContentSelectors` literal field,\n * populate `project` arguments, and generate the required `projectionDef` instruction for the job's\n * root view.\n */\nfunction generateProjectionDefs(job) {\n // TODO: Why does TemplateDefinitionBuilder force a shared constant?\n const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;\n // Collect all selectors from this component, and its nested views. Also, assign each projection a\n // unique ascending projection slot index.\n const selectors = [];\n let projectionSlotIndex = 0;\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === OpKind.Projection) {\n selectors.push(op.selector);\n op.projectionSlotIndex = projectionSlotIndex++;\n }\n }\n }\n if (selectors.length > 0) {\n // Create the projectionDef array. If we only found a single wildcard selector, then we use the\n // default behavior with no arguments instead.\n let defExpr = null;\n if (selectors.length > 1 || selectors[0] !== '*') {\n const def = selectors.map((s) => (s === '*' ? s : parseSelectorToR3Selector(s)));\n defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);\n }\n // Create the ngContentSelectors constant.\n job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);\n // The projection def instruction goes at the beginning of the root view, before any\n // `projection` instructions.\n job.root.create.prepend([createProjectionDefOp(defExpr)]);\n }\n}\n\n/**\n * Generate a preamble sequence for each view creation block and listener function which declares\n * any variables that be referenced in other operations in the block.\n *\n * Variables generated include:\n * * a saved view context to be used to restore the current view in event listeners.\n * * the context of the restored view within event listener handlers.\n * * context variables from the current view as well as all parent views (including the root\n * context if needed).\n * * local references from elements within the current view and any lexical parents.\n *\n * Variables are generated here unconditionally, and may optimized away in future operations if it\n * turns out their values (and any side effects) are unused.\n */\nfunction generateVariables(job) {\n recursivelyProcessView(job.root, /* there is no parent scope for the root view */ null);\n}\n/**\n * Process the given `ViewCompilation` and generate preambles for it and any listeners that it\n * declares.\n *\n * @param `parentScope` a scope extracted from the parent view which captures any variables which\n * should be inherited by this view. `null` if the current view is the root view.\n */\nfunction recursivelyProcessView(view, parentScope) {\n // Extract a `Scope` from this view.\n const scope = getScopeForView(view, parentScope);\n for (const op of view.create) {\n switch (op.kind) {\n case OpKind.ConditionalCreate:\n case OpKind.ConditionalBranchCreate:\n case OpKind.Template:\n // Descend into child embedded views.\n recursivelyProcessView(view.job.views.get(op.xref), scope);\n break;\n case OpKind.Projection:\n if (op.fallbackView !== null) {\n recursivelyProcessView(view.job.views.get(op.fallbackView), scope);\n }\n break;\n case OpKind.RepeaterCreate:\n // Descend into child embedded views.\n recursivelyProcessView(view.job.views.get(op.xref), scope);\n if (op.emptyView) {\n recursivelyProcessView(view.job.views.get(op.emptyView), scope);\n }\n if (op.trackByOps !== null) {\n op.trackByOps.prepend(generateVariablesInScopeForView(view, scope, false));\n }\n break;\n case OpKind.Listener:\n case OpKind.TwoWayListener:\n // Prepend variables to listener handler functions.\n op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true));\n break;\n }\n }\n view.update.prepend(generateVariablesInScopeForView(view, scope, false));\n}\n/**\n * Process a view and generate a `Scope` representing the variables available for reference within\n * that view.\n */\nfunction getScopeForView(view, parent) {\n const scope = {\n view: view.xref,\n viewContextVariable: {\n kind: SemanticVariableKind.Context,\n name: null,\n view: view.xref,\n },\n contextVariables: new Map(),\n aliases: view.aliases,\n references: [],\n letDeclarations: [],\n parent,\n };\n for (const identifier of view.contextVariables.keys()) {\n scope.contextVariables.set(identifier, {\n kind: SemanticVariableKind.Identifier,\n name: null,\n identifier,\n local: false,\n });\n }\n for (const op of view.create) {\n switch (op.kind) {\n case OpKind.ElementStart:\n case OpKind.ConditionalCreate:\n case OpKind.ConditionalBranchCreate:\n case OpKind.Template:\n if (!Array.isArray(op.localRefs)) {\n throw new Error(`AssertionError: expected localRefs to be an array`);\n }\n // Record available local references from this element.\n for (let offset = 0; offset < op.localRefs.length; offset++) {\n scope.references.push({\n name: op.localRefs[offset].name,\n targetId: op.xref,\n targetSlot: op.handle,\n offset,\n variable: {\n kind: SemanticVariableKind.Identifier,\n name: null,\n identifier: op.localRefs[offset].name,\n local: false,\n },\n });\n }\n break;\n case OpKind.DeclareLet:\n scope.letDeclarations.push({\n targetId: op.xref,\n targetSlot: op.handle,\n variable: {\n kind: SemanticVariableKind.Identifier,\n name: null,\n identifier: op.declaredName,\n local: false,\n },\n });\n break;\n }\n }\n return scope;\n}\n/**\n * Generate declarations for all variables that are in scope for a given view.\n *\n * This is a recursive process, as views inherit variables available from their parent view, which\n * itself may have inherited variables, etc.\n */\nfunction generateVariablesInScopeForView(view, scope, isListener) {\n const newOps = [];\n if (scope.view !== view.xref) {\n // Before generating variables for a parent view, we need to switch to the context of the parent\n // view with a `nextContext` expression. This context switching operation itself declares a\n // variable, because the context of the view may be referenced directly.\n newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));\n }\n // Add variables for all context variables available in this scope's view.\n const scopeView = view.job.views.get(scope.view);\n for (const [name, value] of scopeView.contextVariables) {\n const context = new ContextExpr(scope.view);\n // We either read the context, or, if the variable is CTX_REF, use the context directly.\n const variable = value === CTX_REF ? context : new ReadPropExpr(context, value);\n // Add the variable declaration.\n newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable, VariableFlags.None));\n }\n for (const alias of scopeView.aliases) {\n newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline));\n }\n // Add variables for all local references declared for elements in this scope.\n for (const ref of scope.references) {\n newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None));\n }\n if (scope.view !== view.xref || isListener) {\n for (const decl of scope.letDeclarations) {\n newOps.push(createVariableOp(view.job.allocateXrefId(), decl.variable, new ContextLetReferenceExpr(decl.targetId, decl.targetSlot), VariableFlags.None));\n }\n }\n if (scope.parent !== null) {\n // Recursively add variables from the parent scope.\n newOps.push(...generateVariablesInScopeForView(view, scope.parent, false));\n }\n return newOps;\n}\n\n/**\n * `ir.ConstCollectedExpr` may be present in any IR expression. This means that expression needs to\n * be lifted into the component const array, and replaced with a reference to the const array at its\n *\n * usage site. This phase walks the IR and performs this transformation.\n */\nfunction collectConstExpressions(job) {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n transformExpressionsInOp(op, (expr) => {\n if (!(expr instanceof ConstCollectedExpr)) {\n return expr;\n }\n return literal(job.addConst(expr.expr));\n }, VisitorContextFlag.None);\n }\n }\n}\n\nconst STYLE_DOT = 'style.';\nconst CLASS_DOT = 'class.';\nconst STYLE_BANG = 'style!';\nconst CLASS_BANG = 'class!';\nconst BANG_IMPORTANT = '!important';\n/**\n * Host bindings are compiled using a different parser entrypoint, and are parsed quite differently\n * as a result. Therefore, we need to do some extra parsing for host style properties, as compared\n * to non-host style properties.\n * TODO: Unify host bindings and non-host bindings in the parser.\n */\nfunction parseHostStyleProperties(job) {\n for (const op of job.root.update) {\n if (!(op.kind === OpKind.Binding && op.bindingKind === BindingKind.Property)) {\n continue;\n }\n if (op.name.endsWith(BANG_IMPORTANT)) {\n // Delete any `!important` suffixes from the binding name.\n op.name = op.name.substring(0, op.name.length - BANG_IMPORTANT.length);\n }\n if (op.name.startsWith(STYLE_DOT)) {\n op.bindingKind = BindingKind.StyleProperty;\n op.name = op.name.substring(STYLE_DOT.length);\n if (!isCssCustomProperty(op.name)) {\n op.name = hyphenate$1(op.name);\n }\n const { property, suffix } = parseProperty(op.name);\n op.name = property;\n op.unit = suffix;\n }\n else if (op.name.startsWith(STYLE_BANG)) {\n op.bindingKind = BindingKind.StyleProperty;\n op.name = 'style';\n }\n else if (op.name.startsWith(CLASS_DOT)) {\n op.bindingKind = BindingKind.ClassName;\n op.name = parseProperty(op.name.substring(CLASS_DOT.length)).property;\n }\n else if (op.name.startsWith(CLASS_BANG)) {\n op.bindingKind = BindingKind.ClassName;\n op.name = parseProperty(op.name.substring(CLASS_BANG.length)).property;\n }\n }\n}\n/**\n * Checks whether property name is a custom CSS property.\n * See: https://www.w3.org/TR/css-variables-1\n */\nfunction isCssCustomProperty(name) {\n return name.startsWith('--');\n}\nfunction hyphenate$1(value) {\n return value\n .replace(/[a-z][A-Z]/g, (v) => {\n return v.charAt(0) + '-' + v.charAt(1);\n })\n .toLowerCase();\n}\nfunction parseProperty(name) {\n const overrideIndex = name.indexOf('!important');\n if (overrideIndex !== -1) {\n name = overrideIndex > 0 ? name.substring(0, overrideIndex) : '';\n }\n let suffix = null;\n let property = name;\n const unitIndex = name.lastIndexOf('.');\n if (unitIndex > 0) {\n suffix = name.slice(unitIndex + 1);\n property = name.substring(0, unitIndex);\n }\n return { property, suffix };\n}\n\nfunction mapLiteral(obj, quoted = false) {\n return literalMap(Object.keys(obj).map((key) => ({\n key,\n quoted,\n value: obj[key],\n })));\n}\n\nclass IcuSerializerVisitor {\n visitText(text) {\n return text.value;\n }\n visitContainer(container) {\n return container.children.map((child) => child.visit(this)).join('');\n }\n visitIcu(icu) {\n const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n const result = `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`;\n return result;\n }\n visitTagPlaceholder(ph) {\n return ph.isVoid\n ? this.formatPh(ph.startName)\n : `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n visitPlaceholder(ph) {\n return this.formatPh(ph.name);\n }\n visitBlockPlaceholder(ph) {\n return `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n visitIcuPlaceholder(ph, context) {\n return this.formatPh(ph.name);\n }\n formatPh(value) {\n return `{${formatI18nPlaceholderName(value, /* useCamelCase */ false)}}`;\n }\n}\nconst serializer = new IcuSerializerVisitor();\nfunction serializeIcuNode(icu) {\n return icu.visit(serializer);\n}\n\nclass NodeWithI18n {\n sourceSpan;\n i18n;\n constructor(sourceSpan, i18n) {\n this.sourceSpan = sourceSpan;\n this.i18n = i18n;\n }\n}\nclass Text extends NodeWithI18n {\n value;\n tokens;\n constructor(value, sourceSpan, tokens, i18n) {\n super(sourceSpan, i18n);\n this.value = value;\n this.tokens = tokens;\n }\n visit(visitor, context) {\n return visitor.visitText(this, context);\n }\n}\nclass Expansion extends NodeWithI18n {\n switchValue;\n type;\n cases;\n switchValueSourceSpan;\n constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n) {\n super(sourceSpan, i18n);\n this.switchValue = switchValue;\n this.type = type;\n this.cases = cases;\n this.switchValueSourceSpan = switchValueSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitExpansion(this, context);\n }\n}\nclass ExpansionCase {\n value;\n expression;\n sourceSpan;\n valueSourceSpan;\n expSourceSpan;\n constructor(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {\n this.value = value;\n this.expression = expression;\n this.sourceSpan = sourceSpan;\n this.valueSourceSpan = valueSourceSpan;\n this.expSourceSpan = expSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitExpansionCase(this, context);\n }\n}\nclass Attribute extends NodeWithI18n {\n name;\n value;\n keySpan;\n valueSpan;\n valueTokens;\n constructor(name, value, sourceSpan, keySpan, valueSpan, valueTokens, i18n) {\n super(sourceSpan, i18n);\n this.name = name;\n this.value = value;\n this.keySpan = keySpan;\n this.valueSpan = valueSpan;\n this.valueTokens = valueTokens;\n }\n visit(visitor, context) {\n return visitor.visitAttribute(this, context);\n }\n}\nclass Element extends NodeWithI18n {\n name;\n attrs;\n directives;\n children;\n isSelfClosing;\n startSourceSpan;\n endSourceSpan;\n isVoid;\n constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, isVoid, i18n) {\n super(sourceSpan, i18n);\n this.name = name;\n this.attrs = attrs;\n this.directives = directives;\n this.children = children;\n this.isSelfClosing = isSelfClosing;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n this.isVoid = isVoid;\n }\n visit(visitor, context) {\n return visitor.visitElement(this, context);\n }\n}\nclass Comment {\n value;\n sourceSpan;\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitComment(this, context);\n }\n}\nclass Block extends NodeWithI18n {\n name;\n parameters;\n children;\n nameSpan;\n startSourceSpan;\n endSourceSpan;\n constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n) {\n super(sourceSpan, i18n);\n this.name = name;\n this.parameters = parameters;\n this.children = children;\n this.nameSpan = nameSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitBlock(this, context);\n }\n}\nclass Component extends NodeWithI18n {\n componentName;\n tagName;\n fullName;\n attrs;\n directives;\n children;\n isSelfClosing;\n startSourceSpan;\n endSourceSpan;\n constructor(componentName, tagName, fullName, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {\n super(sourceSpan, i18n);\n this.componentName = componentName;\n this.tagName = tagName;\n this.fullName = fullName;\n this.attrs = attrs;\n this.directives = directives;\n this.children = children;\n this.isSelfClosing = isSelfClosing;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitComponent(this, context);\n }\n}\nclass Directive {\n name;\n attrs;\n sourceSpan;\n startSourceSpan;\n endSourceSpan;\n constructor(name, attrs, sourceSpan, startSourceSpan, endSourceSpan = null) {\n this.name = name;\n this.attrs = attrs;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitDirective(this, context);\n }\n}\nclass BlockParameter {\n expression;\n sourceSpan;\n constructor(expression, sourceSpan) {\n this.expression = expression;\n this.sourceSpan = sourceSpan;\n }\n visit(visitor, context) {\n return visitor.visitBlockParameter(this, context);\n }\n}\nclass LetDeclaration {\n name;\n value;\n sourceSpan;\n nameSpan;\n valueSpan;\n constructor(name, value, sourceSpan, nameSpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.nameSpan = nameSpan;\n this.valueSpan = valueSpan;\n }\n visit(visitor, context) {\n return visitor.visitLetDeclaration(this, context);\n }\n}\nfunction visitAll(visitor, nodes, context = null) {\n const result = [];\n const visit = visitor.visit\n ? (ast) => visitor.visit(ast, context) || ast.visit(visitor, context)\n : (ast) => ast.visit(visitor, context);\n nodes.forEach((ast) => {\n const astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\nclass RecursiveVisitor {\n constructor() { }\n visitElement(ast, context) {\n this.visitChildren(context, (visit) => {\n visit(ast.attrs);\n visit(ast.directives);\n visit(ast.children);\n });\n }\n visitAttribute(ast, context) { }\n visitText(ast, context) { }\n visitComment(ast, context) { }\n visitExpansion(ast, context) {\n return this.visitChildren(context, (visit) => {\n visit(ast.cases);\n });\n }\n visitExpansionCase(ast, context) { }\n visitBlock(block, context) {\n this.visitChildren(context, (visit) => {\n visit(block.parameters);\n visit(block.children);\n });\n }\n visitBlockParameter(ast, context) { }\n visitLetDeclaration(decl, context) { }\n visitComponent(component, context) {\n this.visitChildren(context, (visit) => {\n visit(component.attrs);\n visit(component.children);\n });\n }\n visitDirective(directive, context) {\n this.visitChildren(context, (visit) => {\n visit(directive.attrs);\n });\n }\n visitChildren(context, cb) {\n let results = [];\n let t = this;\n function visit(children) {\n if (children)\n results.push(visitAll(t, children, context));\n }\n cb(visit);\n return Array.prototype.concat.apply([], results);\n }\n}\n\n// Mapping between all HTML entity names and their unicode representation.\n// Generated from https://html.spec.whatwg.org/multipage/entities.json by stripping\n// the `&` and `;` from the keys and removing the duplicates.\n// see https://www.w3.org/TR/html51/syntax.html#named-character-references\nconst NAMED_ENTITIES = {\n 'AElig': '\\u00C6',\n 'AMP': '\\u0026',\n 'amp': '\\u0026',\n 'Aacute': '\\u00C1',\n 'Abreve': '\\u0102',\n 'Acirc': '\\u00C2',\n 'Acy': '\\u0410',\n 'Afr': '\\uD835\\uDD04',\n 'Agrave': '\\u00C0',\n 'Alpha': '\\u0391',\n 'Amacr': '\\u0100',\n 'And': '\\u2A53',\n 'Aogon': '\\u0104',\n 'Aopf': '\\uD835\\uDD38',\n 'ApplyFunction': '\\u2061',\n 'af': '\\u2061',\n 'Aring': '\\u00C5',\n 'angst': '\\u00C5',\n 'Ascr': '\\uD835\\uDC9C',\n 'Assign': '\\u2254',\n 'colone': '\\u2254',\n 'coloneq': '\\u2254',\n 'Atilde': '\\u00C3',\n 'Auml': '\\u00C4',\n 'Backslash': '\\u2216',\n 'setminus': '\\u2216',\n 'setmn': '\\u2216',\n 'smallsetminus': '\\u2216',\n 'ssetmn': '\\u2216',\n 'Barv': '\\u2AE7',\n 'Barwed': '\\u2306',\n 'doublebarwedge': '\\u2306',\n 'Bcy': '\\u0411',\n 'Because': '\\u2235',\n 'becaus': '\\u2235',\n 'because': '\\u2235',\n 'Bernoullis': '\\u212C',\n 'Bscr': '\\u212C',\n 'bernou': '\\u212C',\n 'Beta': '\\u0392',\n 'Bfr': '\\uD835\\uDD05',\n 'Bopf': '\\uD835\\uDD39',\n 'Breve': '\\u02D8',\n 'breve': '\\u02D8',\n 'Bumpeq': '\\u224E',\n 'HumpDownHump': '\\u224E',\n 'bump': '\\u224E',\n 'CHcy': '\\u0427',\n 'COPY': '\\u00A9',\n 'copy': '\\u00A9',\n 'Cacute': '\\u0106',\n 'Cap': '\\u22D2',\n 'CapitalDifferentialD': '\\u2145',\n 'DD': '\\u2145',\n 'Cayleys': '\\u212D',\n 'Cfr': '\\u212D',\n 'Ccaron': '\\u010C',\n 'Ccedil': '\\u00C7',\n 'Ccirc': '\\u0108',\n 'Cconint': '\\u2230',\n 'Cdot': '\\u010A',\n 'Cedilla': '\\u00B8',\n 'cedil': '\\u00B8',\n 'CenterDot': '\\u00B7',\n 'centerdot': '\\u00B7',\n 'middot': '\\u00B7',\n 'Chi': '\\u03A7',\n 'CircleDot': '\\u2299',\n 'odot': '\\u2299',\n 'CircleMinus': '\\u2296',\n 'ominus': '\\u2296',\n 'CirclePlus': '\\u2295',\n 'oplus': '\\u2295',\n 'CircleTimes': '\\u2297',\n 'otimes': '\\u2297',\n 'ClockwiseContourIntegral': '\\u2232',\n 'cwconint': '\\u2232',\n 'CloseCurlyDoubleQuote': '\\u201D',\n 'rdquo': '\\u201D',\n 'rdquor': '\\u201D',\n 'CloseCurlyQuote': '\\u2019',\n 'rsquo': '\\u2019',\n 'rsquor': '\\u2019',\n 'Colon': '\\u2237',\n 'Proportion': '\\u2237',\n 'Colone': '\\u2A74',\n 'Congruent': '\\u2261',\n 'equiv': '\\u2261',\n 'Conint': '\\u222F',\n 'DoubleContourIntegral': '\\u222F',\n 'ContourIntegral': '\\u222E',\n 'conint': '\\u222E',\n 'oint': '\\u222E',\n 'Copf': '\\u2102',\n 'complexes': '\\u2102',\n 'Coproduct': '\\u2210',\n 'coprod': '\\u2210',\n 'CounterClockwiseContourIntegral': '\\u2233',\n 'awconint': '\\u2233',\n 'Cross': '\\u2A2F',\n 'Cscr': '\\uD835\\uDC9E',\n 'Cup': '\\u22D3',\n 'CupCap': '\\u224D',\n 'asympeq': '\\u224D',\n 'DDotrahd': '\\u2911',\n 'DJcy': '\\u0402',\n 'DScy': '\\u0405',\n 'DZcy': '\\u040F',\n 'Dagger': '\\u2021',\n 'ddagger': '\\u2021',\n 'Darr': '\\u21A1',\n 'Dashv': '\\u2AE4',\n 'DoubleLeftTee': '\\u2AE4',\n 'Dcaron': '\\u010E',\n 'Dcy': '\\u0414',\n 'Del': '\\u2207',\n 'nabla': '\\u2207',\n 'Delta': '\\u0394',\n 'Dfr': '\\uD835\\uDD07',\n 'DiacriticalAcute': '\\u00B4',\n 'acute': '\\u00B4',\n 'DiacriticalDot': '\\u02D9',\n 'dot': '\\u02D9',\n 'DiacriticalDoubleAcute': '\\u02DD',\n 'dblac': '\\u02DD',\n 'DiacriticalGrave': '\\u0060',\n 'grave': '\\u0060',\n 'DiacriticalTilde': '\\u02DC',\n 'tilde': '\\u02DC',\n 'Diamond': '\\u22C4',\n 'diam': '\\u22C4',\n 'diamond': '\\u22C4',\n 'DifferentialD': '\\u2146',\n 'dd': '\\u2146',\n 'Dopf': '\\uD835\\uDD3B',\n 'Dot': '\\u00A8',\n 'DoubleDot': '\\u00A8',\n 'die': '\\u00A8',\n 'uml': '\\u00A8',\n 'DotDot': '\\u20DC',\n 'DotEqual': '\\u2250',\n 'doteq': '\\u2250',\n 'esdot': '\\u2250',\n 'DoubleDownArrow': '\\u21D3',\n 'Downarrow': '\\u21D3',\n 'dArr': '\\u21D3',\n 'DoubleLeftArrow': '\\u21D0',\n 'Leftarrow': '\\u21D0',\n 'lArr': '\\u21D0',\n 'DoubleLeftRightArrow': '\\u21D4',\n 'Leftrightarrow': '\\u21D4',\n 'hArr': '\\u21D4',\n 'iff': '\\u21D4',\n 'DoubleLongLeftArrow': '\\u27F8',\n 'Longleftarrow': '\\u27F8',\n 'xlArr': '\\u27F8',\n 'DoubleLongLeftRightArrow': '\\u27FA',\n 'Longleftrightarrow': '\\u27FA',\n 'xhArr': '\\u27FA',\n 'DoubleLongRightArrow': '\\u27F9',\n 'Longrightarrow': '\\u27F9',\n 'xrArr': '\\u27F9',\n 'DoubleRightArrow': '\\u21D2',\n 'Implies': '\\u21D2',\n 'Rightarrow': '\\u21D2',\n 'rArr': '\\u21D2',\n 'DoubleRightTee': '\\u22A8',\n 'vDash': '\\u22A8',\n 'DoubleUpArrow': '\\u21D1',\n 'Uparrow': '\\u21D1',\n 'uArr': '\\u21D1',\n 'DoubleUpDownArrow': '\\u21D5',\n 'Updownarrow': '\\u21D5',\n 'vArr': '\\u21D5',\n 'DoubleVerticalBar': '\\u2225',\n 'par': '\\u2225',\n 'parallel': '\\u2225',\n 'shortparallel': '\\u2225',\n 'spar': '\\u2225',\n 'DownArrow': '\\u2193',\n 'ShortDownArrow': '\\u2193',\n 'darr': '\\u2193',\n 'downarrow': '\\u2193',\n 'DownArrowBar': '\\u2913',\n 'DownArrowUpArrow': '\\u21F5',\n 'duarr': '\\u21F5',\n 'DownBreve': '\\u0311',\n 'DownLeftRightVector': '\\u2950',\n 'DownLeftTeeVector': '\\u295E',\n 'DownLeftVector': '\\u21BD',\n 'leftharpoondown': '\\u21BD',\n 'lhard': '\\u21BD',\n 'DownLeftVectorBar': '\\u2956',\n 'DownRightTeeVector': '\\u295F',\n 'DownRightVector': '\\u21C1',\n 'rhard': '\\u21C1',\n 'rightharpoondown': '\\u21C1',\n 'DownRightVectorBar': '\\u2957',\n 'DownTee': '\\u22A4',\n 'top': '\\u22A4',\n 'DownTeeArrow': '\\u21A7',\n 'mapstodown': '\\u21A7',\n 'Dscr': '\\uD835\\uDC9F',\n 'Dstrok': '\\u0110',\n 'ENG': '\\u014A',\n 'ETH': '\\u00D0',\n 'Eacute': '\\u00C9',\n 'Ecaron': '\\u011A',\n 'Ecirc': '\\u00CA',\n 'Ecy': '\\u042D',\n 'Edot': '\\u0116',\n 'Efr': '\\uD835\\uDD08',\n 'Egrave': '\\u00C8',\n 'Element': '\\u2208',\n 'in': '\\u2208',\n 'isin': '\\u2208',\n 'isinv': '\\u2208',\n 'Emacr': '\\u0112',\n 'EmptySmallSquare': '\\u25FB',\n 'EmptyVerySmallSquare': '\\u25AB',\n 'Eogon': '\\u0118',\n 'Eopf': '\\uD835\\uDD3C',\n 'Epsilon': '\\u0395',\n 'Equal': '\\u2A75',\n 'EqualTilde': '\\u2242',\n 'eqsim': '\\u2242',\n 'esim': '\\u2242',\n 'Equilibrium': '\\u21CC',\n 'rightleftharpoons': '\\u21CC',\n 'rlhar': '\\u21CC',\n 'Escr': '\\u2130',\n 'expectation': '\\u2130',\n 'Esim': '\\u2A73',\n 'Eta': '\\u0397',\n 'Euml': '\\u00CB',\n 'Exists': '\\u2203',\n 'exist': '\\u2203',\n 'ExponentialE': '\\u2147',\n 'ee': '\\u2147',\n 'exponentiale': '\\u2147',\n 'Fcy': '\\u0424',\n 'Ffr': '\\uD835\\uDD09',\n 'FilledSmallSquare': '\\u25FC',\n 'FilledVerySmallSquare': '\\u25AA',\n 'blacksquare': '\\u25AA',\n 'squarf': '\\u25AA',\n 'squf': '\\u25AA',\n 'Fopf': '\\uD835\\uDD3D',\n 'ForAll': '\\u2200',\n 'forall': '\\u2200',\n 'Fouriertrf': '\\u2131',\n 'Fscr': '\\u2131',\n 'GJcy': '\\u0403',\n 'GT': '\\u003E',\n 'gt': '\\u003E',\n 'Gamma': '\\u0393',\n 'Gammad': '\\u03DC',\n 'Gbreve': '\\u011E',\n 'Gcedil': '\\u0122',\n 'Gcirc': '\\u011C',\n 'Gcy': '\\u0413',\n 'Gdot': '\\u0120',\n 'Gfr': '\\uD835\\uDD0A',\n 'Gg': '\\u22D9',\n 'ggg': '\\u22D9',\n 'Gopf': '\\uD835\\uDD3E',\n 'GreaterEqual': '\\u2265',\n 'ge': '\\u2265',\n 'geq': '\\u2265',\n 'GreaterEqualLess': '\\u22DB',\n 'gel': '\\u22DB',\n 'gtreqless': '\\u22DB',\n 'GreaterFullEqual': '\\u2267',\n 'gE': '\\u2267',\n 'geqq': '\\u2267',\n 'GreaterGreater': '\\u2AA2',\n 'GreaterLess': '\\u2277',\n 'gl': '\\u2277',\n 'gtrless': '\\u2277',\n 'GreaterSlantEqual': '\\u2A7E',\n 'geqslant': '\\u2A7E',\n 'ges': '\\u2A7E',\n 'GreaterTilde': '\\u2273',\n 'gsim': '\\u2273',\n 'gtrsim': '\\u2273',\n 'Gscr': '\\uD835\\uDCA2',\n 'Gt': '\\u226B',\n 'NestedGreaterGreater': '\\u226B',\n 'gg': '\\u226B',\n 'HARDcy': '\\u042A',\n 'Hacek': '\\u02C7',\n 'caron': '\\u02C7',\n 'Hat': '\\u005E',\n 'Hcirc': '\\u0124',\n 'Hfr': '\\u210C',\n 'Poincareplane': '\\u210C',\n 'HilbertSpace': '\\u210B',\n 'Hscr': '\\u210B',\n 'hamilt': '\\u210B',\n 'Hopf': '\\u210D',\n 'quaternions': '\\u210D',\n 'HorizontalLine': '\\u2500',\n 'boxh': '\\u2500',\n 'Hstrok': '\\u0126',\n 'HumpEqual': '\\u224F',\n 'bumpe': '\\u224F',\n 'bumpeq': '\\u224F',\n 'IEcy': '\\u0415',\n 'IJlig': '\\u0132',\n 'IOcy': '\\u0401',\n 'Iacute': '\\u00CD',\n 'Icirc': '\\u00CE',\n 'Icy': '\\u0418',\n 'Idot': '\\u0130',\n 'Ifr': '\\u2111',\n 'Im': '\\u2111',\n 'image': '\\u2111',\n 'imagpart': '\\u2111',\n 'Igrave': '\\u00CC',\n 'Imacr': '\\u012A',\n 'ImaginaryI': '\\u2148',\n 'ii': '\\u2148',\n 'Int': '\\u222C',\n 'Integral': '\\u222B',\n 'int': '\\u222B',\n 'Intersection': '\\u22C2',\n 'bigcap': '\\u22C2',\n 'xcap': '\\u22C2',\n 'InvisibleComma': '\\u2063',\n 'ic': '\\u2063',\n 'InvisibleTimes': '\\u2062',\n 'it': '\\u2062',\n 'Iogon': '\\u012E',\n 'Iopf': '\\uD835\\uDD40',\n 'Iota': '\\u0399',\n 'Iscr': '\\u2110',\n 'imagline': '\\u2110',\n 'Itilde': '\\u0128',\n 'Iukcy': '\\u0406',\n 'Iuml': '\\u00CF',\n 'Jcirc': '\\u0134',\n 'Jcy': '\\u0419',\n 'Jfr': '\\uD835\\uDD0D',\n 'Jopf': '\\uD835\\uDD41',\n 'Jscr': '\\uD835\\uDCA5',\n 'Jsercy': '\\u0408',\n 'Jukcy': '\\u0404',\n 'KHcy': '\\u0425',\n 'KJcy': '\\u040C',\n 'Kappa': '\\u039A',\n 'Kcedil': '\\u0136',\n 'Kcy': '\\u041A',\n 'Kfr': '\\uD835\\uDD0E',\n 'Kopf': '\\uD835\\uDD42',\n 'Kscr': '\\uD835\\uDCA6',\n 'LJcy': '\\u0409',\n 'LT': '\\u003C',\n 'lt': '\\u003C',\n 'Lacute': '\\u0139',\n 'Lambda': '\\u039B',\n 'Lang': '\\u27EA',\n 'Laplacetrf': '\\u2112',\n 'Lscr': '\\u2112',\n 'lagran': '\\u2112',\n 'Larr': '\\u219E',\n 'twoheadleftarrow': '\\u219E',\n 'Lcaron': '\\u013D',\n 'Lcedil': '\\u013B',\n 'Lcy': '\\u041B',\n 'LeftAngleBracket': '\\u27E8',\n 'lang': '\\u27E8',\n 'langle': '\\u27E8',\n 'LeftArrow': '\\u2190',\n 'ShortLeftArrow': '\\u2190',\n 'larr': '\\u2190',\n 'leftarrow': '\\u2190',\n 'slarr': '\\u2190',\n 'LeftArrowBar': '\\u21E4',\n 'larrb': '\\u21E4',\n 'LeftArrowRightArrow': '\\u21C6',\n 'leftrightarrows': '\\u21C6',\n 'lrarr': '\\u21C6',\n 'LeftCeiling': '\\u2308',\n 'lceil': '\\u2308',\n 'LeftDoubleBracket': '\\u27E6',\n 'lobrk': '\\u27E6',\n 'LeftDownTeeVector': '\\u2961',\n 'LeftDownVector': '\\u21C3',\n 'dharl': '\\u21C3',\n 'downharpoonleft': '\\u21C3',\n 'LeftDownVectorBar': '\\u2959',\n 'LeftFloor': '\\u230A',\n 'lfloor': '\\u230A',\n 'LeftRightArrow': '\\u2194',\n 'harr': '\\u2194',\n 'leftrightarrow': '\\u2194',\n 'LeftRightVector': '\\u294E',\n 'LeftTee': '\\u22A3',\n 'dashv': '\\u22A3',\n 'LeftTeeArrow': '\\u21A4',\n 'mapstoleft': '\\u21A4',\n 'LeftTeeVector': '\\u295A',\n 'LeftTriangle': '\\u22B2',\n 'vartriangleleft': '\\u22B2',\n 'vltri': '\\u22B2',\n 'LeftTriangleBar': '\\u29CF',\n 'LeftTriangleEqual': '\\u22B4',\n 'ltrie': '\\u22B4',\n 'trianglelefteq': '\\u22B4',\n 'LeftUpDownVector': '\\u2951',\n 'LeftUpTeeVector': '\\u2960',\n 'LeftUpVector': '\\u21BF',\n 'uharl': '\\u21BF',\n 'upharpoonleft': '\\u21BF',\n 'LeftUpVectorBar': '\\u2958',\n 'LeftVector': '\\u21BC',\n 'leftharpoonup': '\\u21BC',\n 'lharu': '\\u21BC',\n 'LeftVectorBar': '\\u2952',\n 'LessEqualGreater': '\\u22DA',\n 'leg': '\\u22DA',\n 'lesseqgtr': '\\u22DA',\n 'LessFullEqual': '\\u2266',\n 'lE': '\\u2266',\n 'leqq': '\\u2266',\n 'LessGreater': '\\u2276',\n 'lessgtr': '\\u2276',\n 'lg': '\\u2276',\n 'LessLess': '\\u2AA1',\n 'LessSlantEqual': '\\u2A7D',\n 'leqslant': '\\u2A7D',\n 'les': '\\u2A7D',\n 'LessTilde': '\\u2272',\n 'lesssim': '\\u2272',\n 'lsim': '\\u2272',\n 'Lfr': '\\uD835\\uDD0F',\n 'Ll': '\\u22D8',\n 'Lleftarrow': '\\u21DA',\n 'lAarr': '\\u21DA',\n 'Lmidot': '\\u013F',\n 'LongLeftArrow': '\\u27F5',\n 'longleftarrow': '\\u27F5',\n 'xlarr': '\\u27F5',\n 'LongLeftRightArrow': '\\u27F7',\n 'longleftrightarrow': '\\u27F7',\n 'xharr': '\\u27F7',\n 'LongRightArrow': '\\u27F6',\n 'longrightarrow': '\\u27F6',\n 'xrarr': '\\u27F6',\n 'Lopf': '\\uD835\\uDD43',\n 'LowerLeftArrow': '\\u2199',\n 'swarr': '\\u2199',\n 'swarrow': '\\u2199',\n 'LowerRightArrow': '\\u2198',\n 'searr': '\\u2198',\n 'searrow': '\\u2198',\n 'Lsh': '\\u21B0',\n 'lsh': '\\u21B0',\n 'Lstrok': '\\u0141',\n 'Lt': '\\u226A',\n 'NestedLessLess': '\\u226A',\n 'll': '\\u226A',\n 'Map': '\\u2905',\n 'Mcy': '\\u041C',\n 'MediumSpace': '\\u205F',\n 'Mellintrf': '\\u2133',\n 'Mscr': '\\u2133',\n 'phmmat': '\\u2133',\n 'Mfr': '\\uD835\\uDD10',\n 'MinusPlus': '\\u2213',\n 'mnplus': '\\u2213',\n 'mp': '\\u2213',\n 'Mopf': '\\uD835\\uDD44',\n 'Mu': '\\u039C',\n 'NJcy': '\\u040A',\n 'Nacute': '\\u0143',\n 'Ncaron': '\\u0147',\n 'Ncedil': '\\u0145',\n 'Ncy': '\\u041D',\n 'NegativeMediumSpace': '\\u200B',\n 'NegativeThickSpace': '\\u200B',\n 'NegativeThinSpace': '\\u200B',\n 'NegativeVeryThinSpace': '\\u200B',\n 'ZeroWidthSpace': '\\u200B',\n 'NewLine': '\\u000A',\n 'Nfr': '\\uD835\\uDD11',\n 'NoBreak': '\\u2060',\n 'NonBreakingSpace': '\\u00A0',\n 'nbsp': '\\u00A0',\n 'Nopf': '\\u2115',\n 'naturals': '\\u2115',\n 'Not': '\\u2AEC',\n 'NotCongruent': '\\u2262',\n 'nequiv': '\\u2262',\n 'NotCupCap': '\\u226D',\n 'NotDoubleVerticalBar': '\\u2226',\n 'npar': '\\u2226',\n 'nparallel': '\\u2226',\n 'nshortparallel': '\\u2226',\n 'nspar': '\\u2226',\n 'NotElement': '\\u2209',\n 'notin': '\\u2209',\n 'notinva': '\\u2209',\n 'NotEqual': '\\u2260',\n 'ne': '\\u2260',\n 'NotEqualTilde': '\\u2242\\u0338',\n 'nesim': '\\u2242\\u0338',\n 'NotExists': '\\u2204',\n 'nexist': '\\u2204',\n 'nexists': '\\u2204',\n 'NotGreater': '\\u226F',\n 'ngt': '\\u226F',\n 'ngtr': '\\u226F',\n 'NotGreaterEqual': '\\u2271',\n 'nge': '\\u2271',\n 'ngeq': '\\u2271',\n 'NotGreaterFullEqual': '\\u2267\\u0338',\n 'ngE': '\\u2267\\u0338',\n 'ngeqq': '\\u2267\\u0338',\n 'NotGreaterGreater': '\\u226B\\u0338',\n 'nGtv': '\\u226B\\u0338',\n 'NotGreaterLess': '\\u2279',\n 'ntgl': '\\u2279',\n 'NotGreaterSlantEqual': '\\u2A7E\\u0338',\n 'ngeqslant': '\\u2A7E\\u0338',\n 'nges': '\\u2A7E\\u0338',\n 'NotGreaterTilde': '\\u2275',\n 'ngsim': '\\u2275',\n 'NotHumpDownHump': '\\u224E\\u0338',\n 'nbump': '\\u224E\\u0338',\n 'NotHumpEqual': '\\u224F\\u0338',\n 'nbumpe': '\\u224F\\u0338',\n 'NotLeftTriangle': '\\u22EA',\n 'nltri': '\\u22EA',\n 'ntriangleleft': '\\u22EA',\n 'NotLeftTriangleBar': '\\u29CF\\u0338',\n 'NotLeftTriangleEqual': '\\u22EC',\n 'nltrie': '\\u22EC',\n 'ntrianglelefteq': '\\u22EC',\n 'NotLess': '\\u226E',\n 'nless': '\\u226E',\n 'nlt': '\\u226E',\n 'NotLessEqual': '\\u2270',\n 'nle': '\\u2270',\n 'nleq': '\\u2270',\n 'NotLessGreater': '\\u2278',\n 'ntlg': '\\u2278',\n 'NotLessLess': '\\u226A\\u0338',\n 'nLtv': '\\u226A\\u0338',\n 'NotLessSlantEqual': '\\u2A7D\\u0338',\n 'nleqslant': '\\u2A7D\\u0338',\n 'nles': '\\u2A7D\\u0338',\n 'NotLessTilde': '\\u2274',\n 'nlsim': '\\u2274',\n 'NotNestedGreaterGreater': '\\u2AA2\\u0338',\n 'NotNestedLessLess': '\\u2AA1\\u0338',\n 'NotPrecedes': '\\u2280',\n 'npr': '\\u2280',\n 'nprec': '\\u2280',\n 'NotPrecedesEqual': '\\u2AAF\\u0338',\n 'npre': '\\u2AAF\\u0338',\n 'npreceq': '\\u2AAF\\u0338',\n 'NotPrecedesSlantEqual': '\\u22E0',\n 'nprcue': '\\u22E0',\n 'NotReverseElement': '\\u220C',\n 'notni': '\\u220C',\n 'notniva': '\\u220C',\n 'NotRightTriangle': '\\u22EB',\n 'nrtri': '\\u22EB',\n 'ntriangleright': '\\u22EB',\n 'NotRightTriangleBar': '\\u29D0\\u0338',\n 'NotRightTriangleEqual': '\\u22ED',\n 'nrtrie': '\\u22ED',\n 'ntrianglerighteq': '\\u22ED',\n 'NotSquareSubset': '\\u228F\\u0338',\n 'NotSquareSubsetEqual': '\\u22E2',\n 'nsqsube': '\\u22E2',\n 'NotSquareSuperset': '\\u2290\\u0338',\n 'NotSquareSupersetEqual': '\\u22E3',\n 'nsqsupe': '\\u22E3',\n 'NotSubset': '\\u2282\\u20D2',\n 'nsubset': '\\u2282\\u20D2',\n 'vnsub': '\\u2282\\u20D2',\n 'NotSubsetEqual': '\\u2288',\n 'nsube': '\\u2288',\n 'nsubseteq': '\\u2288',\n 'NotSucceeds': '\\u2281',\n 'nsc': '\\u2281',\n 'nsucc': '\\u2281',\n 'NotSucceedsEqual': '\\u2AB0\\u0338',\n 'nsce': '\\u2AB0\\u0338',\n 'nsucceq': '\\u2AB0\\u0338',\n 'NotSucceedsSlantEqual': '\\u22E1',\n 'nsccue': '\\u22E1',\n 'NotSucceedsTilde': '\\u227F\\u0338',\n 'NotSuperset': '\\u2283\\u20D2',\n 'nsupset': '\\u2283\\u20D2',\n 'vnsup': '\\u2283\\u20D2',\n 'NotSupersetEqual': '\\u2289',\n 'nsupe': '\\u2289',\n 'nsupseteq': '\\u2289',\n 'NotTilde': '\\u2241',\n 'nsim': '\\u2241',\n 'NotTildeEqual': '\\u2244',\n 'nsime': '\\u2244',\n 'nsimeq': '\\u2244',\n 'NotTildeFullEqual': '\\u2247',\n 'ncong': '\\u2247',\n 'NotTildeTilde': '\\u2249',\n 'nap': '\\u2249',\n 'napprox': '\\u2249',\n 'NotVerticalBar': '\\u2224',\n 'nmid': '\\u2224',\n 'nshortmid': '\\u2224',\n 'nsmid': '\\u2224',\n 'Nscr': '\\uD835\\uDCA9',\n 'Ntilde': '\\u00D1',\n 'Nu': '\\u039D',\n 'OElig': '\\u0152',\n 'Oacute': '\\u00D3',\n 'Ocirc': '\\u00D4',\n 'Ocy': '\\u041E',\n 'Odblac': '\\u0150',\n 'Ofr': '\\uD835\\uDD12',\n 'Ograve': '\\u00D2',\n 'Omacr': '\\u014C',\n 'Omega': '\\u03A9',\n 'ohm': '\\u03A9',\n 'Omicron': '\\u039F',\n 'Oopf': '\\uD835\\uDD46',\n 'OpenCurlyDoubleQuote': '\\u201C',\n 'ldquo': '\\u201C',\n 'OpenCurlyQuote': '\\u2018',\n 'lsquo': '\\u2018',\n 'Or': '\\u2A54',\n 'Oscr': '\\uD835\\uDCAA',\n 'Oslash': '\\u00D8',\n 'Otilde': '\\u00D5',\n 'Otimes': '\\u2A37',\n 'Ouml': '\\u00D6',\n 'OverBar': '\\u203E',\n 'oline': '\\u203E',\n 'OverBrace': '\\u23DE',\n 'OverBracket': '\\u23B4',\n 'tbrk': '\\u23B4',\n 'OverParenthesis': '\\u23DC',\n 'PartialD': '\\u2202',\n 'part': '\\u2202',\n 'Pcy': '\\u041F',\n 'Pfr': '\\uD835\\uDD13',\n 'Phi': '\\u03A6',\n 'Pi': '\\u03A0',\n 'PlusMinus': '\\u00B1',\n 'plusmn': '\\u00B1',\n 'pm': '\\u00B1',\n 'Popf': '\\u2119',\n 'primes': '\\u2119',\n 'Pr': '\\u2ABB',\n 'Precedes': '\\u227A',\n 'pr': '\\u227A',\n 'prec': '\\u227A',\n 'PrecedesEqual': '\\u2AAF',\n 'pre': '\\u2AAF',\n 'preceq': '\\u2AAF',\n 'PrecedesSlantEqual': '\\u227C',\n 'prcue': '\\u227C',\n 'preccurlyeq': '\\u227C',\n 'PrecedesTilde': '\\u227E',\n 'precsim': '\\u227E',\n 'prsim': '\\u227E',\n 'Prime': '\\u2033',\n 'Product': '\\u220F',\n 'prod': '\\u220F',\n 'Proportional': '\\u221D',\n 'prop': '\\u221D',\n 'propto': '\\u221D',\n 'varpropto': '\\u221D',\n 'vprop': '\\u221D',\n 'Pscr': '\\uD835\\uDCAB',\n 'Psi': '\\u03A8',\n 'QUOT': '\\u0022',\n 'quot': '\\u0022',\n 'Qfr': '\\uD835\\uDD14',\n 'Qopf': '\\u211A',\n 'rationals': '\\u211A',\n 'Qscr': '\\uD835\\uDCAC',\n 'RBarr': '\\u2910',\n 'drbkarow': '\\u2910',\n 'REG': '\\u00AE',\n 'circledR': '\\u00AE',\n 'reg': '\\u00AE',\n 'Racute': '\\u0154',\n 'Rang': '\\u27EB',\n 'Rarr': '\\u21A0',\n 'twoheadrightarrow': '\\u21A0',\n 'Rarrtl': '\\u2916',\n 'Rcaron': '\\u0158',\n 'Rcedil': '\\u0156',\n 'Rcy': '\\u0420',\n 'Re': '\\u211C',\n 'Rfr': '\\u211C',\n 'real': '\\u211C',\n 'realpart': '\\u211C',\n 'ReverseElement': '\\u220B',\n 'SuchThat': '\\u220B',\n 'ni': '\\u220B',\n 'niv': '\\u220B',\n 'ReverseEquilibrium': '\\u21CB',\n 'leftrightharpoons': '\\u21CB',\n 'lrhar': '\\u21CB',\n 'ReverseUpEquilibrium': '\\u296F',\n 'duhar': '\\u296F',\n 'Rho': '\\u03A1',\n 'RightAngleBracket': '\\u27E9',\n 'rang': '\\u27E9',\n 'rangle': '\\u27E9',\n 'RightArrow': '\\u2192',\n 'ShortRightArrow': '\\u2192',\n 'rarr': '\\u2192',\n 'rightarrow': '\\u2192',\n 'srarr': '\\u2192',\n 'RightArrowBar': '\\u21E5',\n 'rarrb': '\\u21E5',\n 'RightArrowLeftArrow': '\\u21C4',\n 'rightleftarrows': '\\u21C4',\n 'rlarr': '\\u21C4',\n 'RightCeiling': '\\u2309',\n 'rceil': '\\u2309',\n 'RightDoubleBracket': '\\u27E7',\n 'robrk': '\\u27E7',\n 'RightDownTeeVector': '\\u295D',\n 'RightDownVector': '\\u21C2',\n 'dharr': '\\u21C2',\n 'downharpoonright': '\\u21C2',\n 'RightDownVectorBar': '\\u2955',\n 'RightFloor': '\\u230B',\n 'rfloor': '\\u230B',\n 'RightTee': '\\u22A2',\n 'vdash': '\\u22A2',\n 'RightTeeArrow': '\\u21A6',\n 'map': '\\u21A6',\n 'mapsto': '\\u21A6',\n 'RightTeeVector': '\\u295B',\n 'RightTriangle': '\\u22B3',\n 'vartriangleright': '\\u22B3',\n 'vrtri': '\\u22B3',\n 'RightTriangleBar': '\\u29D0',\n 'RightTriangleEqual': '\\u22B5',\n 'rtrie': '\\u22B5',\n 'trianglerighteq': '\\u22B5',\n 'RightUpDownVector': '\\u294F',\n 'RightUpTeeVector': '\\u295C',\n 'RightUpVector': '\\u21BE',\n 'uharr': '\\u21BE',\n 'upharpoonright': '\\u21BE',\n 'RightUpVectorBar': '\\u2954',\n 'RightVector': '\\u21C0',\n 'rharu': '\\u21C0',\n 'rightharpoonup': '\\u21C0',\n 'RightVectorBar': '\\u2953',\n 'Ropf': '\\u211D',\n 'reals': '\\u211D',\n 'RoundImplies': '\\u2970',\n 'Rrightarrow': '\\u21DB',\n 'rAarr': '\\u21DB',\n 'Rscr': '\\u211B',\n 'realine': '\\u211B',\n 'Rsh': '\\u21B1',\n 'rsh': '\\u21B1',\n 'RuleDelayed': '\\u29F4',\n 'SHCHcy': '\\u0429',\n 'SHcy': '\\u0428',\n 'SOFTcy': '\\u042C',\n 'Sacute': '\\u015A',\n 'Sc': '\\u2ABC',\n 'Scaron': '\\u0160',\n 'Scedil': '\\u015E',\n 'Scirc': '\\u015C',\n 'Scy': '\\u0421',\n 'Sfr': '\\uD835\\uDD16',\n 'ShortUpArrow': '\\u2191',\n 'UpArrow': '\\u2191',\n 'uarr': '\\u2191',\n 'uparrow': '\\u2191',\n 'Sigma': '\\u03A3',\n 'SmallCircle': '\\u2218',\n 'compfn': '\\u2218',\n 'Sopf': '\\uD835\\uDD4A',\n 'Sqrt': '\\u221A',\n 'radic': '\\u221A',\n 'Square': '\\u25A1',\n 'squ': '\\u25A1',\n 'square': '\\u25A1',\n 'SquareIntersection': '\\u2293',\n 'sqcap': '\\u2293',\n 'SquareSubset': '\\u228F',\n 'sqsub': '\\u228F',\n 'sqsubset': '\\u228F',\n 'SquareSubsetEqual': '\\u2291',\n 'sqsube': '\\u2291',\n 'sqsubseteq': '\\u2291',\n 'SquareSuperset': '\\u2290',\n 'sqsup': '\\u2290',\n 'sqsupset': '\\u2290',\n 'SquareSupersetEqual': '\\u2292',\n 'sqsupe': '\\u2292',\n 'sqsupseteq': '\\u2292',\n 'SquareUnion': '\\u2294',\n 'sqcup': '\\u2294',\n 'Sscr': '\\uD835\\uDCAE',\n 'Star': '\\u22C6',\n 'sstarf': '\\u22C6',\n 'Sub': '\\u22D0',\n 'Subset': '\\u22D0',\n 'SubsetEqual': '\\u2286',\n 'sube': '\\u2286',\n 'subseteq': '\\u2286',\n 'Succeeds': '\\u227B',\n 'sc': '\\u227B',\n 'succ': '\\u227B',\n 'SucceedsEqual': '\\u2AB0',\n 'sce': '\\u2AB0',\n 'succeq': '\\u2AB0',\n 'SucceedsSlantEqual': '\\u227D',\n 'sccue': '\\u227D',\n 'succcurlyeq': '\\u227D',\n 'SucceedsTilde': '\\u227F',\n 'scsim': '\\u227F',\n 'succsim': '\\u227F',\n 'Sum': '\\u2211',\n 'sum': '\\u2211',\n 'Sup': '\\u22D1',\n 'Supset': '\\u22D1',\n 'Superset': '\\u2283',\n 'sup': '\\u2283',\n 'supset': '\\u2283',\n 'SupersetEqual': '\\u2287',\n 'supe': '\\u2287',\n 'supseteq': '\\u2287',\n 'THORN': '\\u00DE',\n 'TRADE': '\\u2122',\n 'trade': '\\u2122',\n 'TSHcy': '\\u040B',\n 'TScy': '\\u0426',\n 'Tab': '\\u0009',\n 'Tau': '\\u03A4',\n 'Tcaron': '\\u0164',\n 'Tcedil': '\\u0162',\n 'Tcy': '\\u0422',\n 'Tfr': '\\uD835\\uDD17',\n 'Therefore': '\\u2234',\n 'there4': '\\u2234',\n 'therefore': '\\u2234',\n 'Theta': '\\u0398',\n 'ThickSpace': '\\u205F\\u200A',\n 'ThinSpace': '\\u2009',\n 'thinsp': '\\u2009',\n 'Tilde': '\\u223C',\n 'sim': '\\u223C',\n 'thicksim': '\\u223C',\n 'thksim': '\\u223C',\n 'TildeEqual': '\\u2243',\n 'sime': '\\u2243',\n 'simeq': '\\u2243',\n 'TildeFullEqual': '\\u2245',\n 'cong': '\\u2245',\n 'TildeTilde': '\\u2248',\n 'ap': '\\u2248',\n 'approx': '\\u2248',\n 'asymp': '\\u2248',\n 'thickapprox': '\\u2248',\n 'thkap': '\\u2248',\n 'Topf': '\\uD835\\uDD4B',\n 'TripleDot': '\\u20DB',\n 'tdot': '\\u20DB',\n 'Tscr': '\\uD835\\uDCAF',\n 'Tstrok': '\\u0166',\n 'Uacute': '\\u00DA',\n 'Uarr': '\\u219F',\n 'Uarrocir': '\\u2949',\n 'Ubrcy': '\\u040E',\n 'Ubreve': '\\u016C',\n 'Ucirc': '\\u00DB',\n 'Ucy': '\\u0423',\n 'Udblac': '\\u0170',\n 'Ufr': '\\uD835\\uDD18',\n 'Ugrave': '\\u00D9',\n 'Umacr': '\\u016A',\n 'UnderBar': '\\u005F',\n 'lowbar': '\\u005F',\n 'UnderBrace': '\\u23DF',\n 'UnderBracket': '\\u23B5',\n 'bbrk': '\\u23B5',\n 'UnderParenthesis': '\\u23DD',\n 'Union': '\\u22C3',\n 'bigcup': '\\u22C3',\n 'xcup': '\\u22C3',\n 'UnionPlus': '\\u228E',\n 'uplus': '\\u228E',\n 'Uogon': '\\u0172',\n 'Uopf': '\\uD835\\uDD4C',\n 'UpArrowBar': '\\u2912',\n 'UpArrowDownArrow': '\\u21C5',\n 'udarr': '\\u21C5',\n 'UpDownArrow': '\\u2195',\n 'updownarrow': '\\u2195',\n 'varr': '\\u2195',\n 'UpEquilibrium': '\\u296E',\n 'udhar': '\\u296E',\n 'UpTee': '\\u22A5',\n 'bot': '\\u22A5',\n 'bottom': '\\u22A5',\n 'perp': '\\u22A5',\n 'UpTeeArrow': '\\u21A5',\n 'mapstoup': '\\u21A5',\n 'UpperLeftArrow': '\\u2196',\n 'nwarr': '\\u2196',\n 'nwarrow': '\\u2196',\n 'UpperRightArrow': '\\u2197',\n 'nearr': '\\u2197',\n 'nearrow': '\\u2197',\n 'Upsi': '\\u03D2',\n 'upsih': '\\u03D2',\n 'Upsilon': '\\u03A5',\n 'Uring': '\\u016E',\n 'Uscr': '\\uD835\\uDCB0',\n 'Utilde': '\\u0168',\n 'Uuml': '\\u00DC',\n 'VDash': '\\u22AB',\n 'Vbar': '\\u2AEB',\n 'Vcy': '\\u0412',\n 'Vdash': '\\u22A9',\n 'Vdashl': '\\u2AE6',\n 'Vee': '\\u22C1',\n 'bigvee': '\\u22C1',\n 'xvee': '\\u22C1',\n 'Verbar': '\\u2016',\n 'Vert': '\\u2016',\n 'VerticalBar': '\\u2223',\n 'mid': '\\u2223',\n 'shortmid': '\\u2223',\n 'smid': '\\u2223',\n 'VerticalLine': '\\u007C',\n 'verbar': '\\u007C',\n 'vert': '\\u007C',\n 'VerticalSeparator': '\\u2758',\n 'VerticalTilde': '\\u2240',\n 'wr': '\\u2240',\n 'wreath': '\\u2240',\n 'VeryThinSpace': '\\u200A',\n 'hairsp': '\\u200A',\n 'Vfr': '\\uD835\\uDD19',\n 'Vopf': '\\uD835\\uDD4D',\n 'Vscr': '\\uD835\\uDCB1',\n 'Vvdash': '\\u22AA',\n 'Wcirc': '\\u0174',\n 'Wedge': '\\u22C0',\n 'bigwedge': '\\u22C0',\n 'xwedge': '\\u22C0',\n 'Wfr': '\\uD835\\uDD1A',\n 'Wopf': '\\uD835\\uDD4E',\n 'Wscr': '\\uD835\\uDCB2',\n 'Xfr': '\\uD835\\uDD1B',\n 'Xi': '\\u039E',\n 'Xopf': '\\uD835\\uDD4F',\n 'Xscr': '\\uD835\\uDCB3',\n 'YAcy': '\\u042F',\n 'YIcy': '\\u0407',\n 'YUcy': '\\u042E',\n 'Yacute': '\\u00DD',\n 'Ycirc': '\\u0176',\n 'Ycy': '\\u042B',\n 'Yfr': '\\uD835\\uDD1C',\n 'Yopf': '\\uD835\\uDD50',\n 'Yscr': '\\uD835\\uDCB4',\n 'Yuml': '\\u0178',\n 'ZHcy': '\\u0416',\n 'Zacute': '\\u0179',\n 'Zcaron': '\\u017D',\n 'Zcy': '\\u0417',\n 'Zdot': '\\u017B',\n 'Zeta': '\\u0396',\n 'Zfr': '\\u2128',\n 'zeetrf': '\\u2128',\n 'Zopf': '\\u2124',\n 'integers': '\\u2124',\n 'Zscr': '\\uD835\\uDCB5',\n 'aacute': '\\u00E1',\n 'abreve': '\\u0103',\n 'ac': '\\u223E',\n 'mstpos': '\\u223E',\n 'acE': '\\u223E\\u0333',\n 'acd': '\\u223F',\n 'acirc': '\\u00E2',\n 'acy': '\\u0430',\n 'aelig': '\\u00E6',\n 'afr': '\\uD835\\uDD1E',\n 'agrave': '\\u00E0',\n 'alefsym': '\\u2135',\n 'aleph': '\\u2135',\n 'alpha': '\\u03B1',\n 'amacr': '\\u0101',\n 'amalg': '\\u2A3F',\n 'and': '\\u2227',\n 'wedge': '\\u2227',\n 'andand': '\\u2A55',\n 'andd': '\\u2A5C',\n 'andslope': '\\u2A58',\n 'andv': '\\u2A5A',\n 'ang': '\\u2220',\n 'angle': '\\u2220',\n 'ange': '\\u29A4',\n 'angmsd': '\\u2221',\n 'measuredangle': '\\u2221',\n 'angmsdaa': '\\u29A8',\n 'angmsdab': '\\u29A9',\n 'angmsdac': '\\u29AA',\n 'angmsdad': '\\u29AB',\n 'angmsdae': '\\u29AC',\n 'angmsdaf': '\\u29AD',\n 'angmsdag': '\\u29AE',\n 'angmsdah': '\\u29AF',\n 'angrt': '\\u221F',\n 'angrtvb': '\\u22BE',\n 'angrtvbd': '\\u299D',\n 'angsph': '\\u2222',\n 'angzarr': '\\u237C',\n 'aogon': '\\u0105',\n 'aopf': '\\uD835\\uDD52',\n 'apE': '\\u2A70',\n 'apacir': '\\u2A6F',\n 'ape': '\\u224A',\n 'approxeq': '\\u224A',\n 'apid': '\\u224B',\n 'apos': '\\u0027',\n 'aring': '\\u00E5',\n 'ascr': '\\uD835\\uDCB6',\n 'ast': '\\u002A',\n 'midast': '\\u002A',\n 'atilde': '\\u00E3',\n 'auml': '\\u00E4',\n 'awint': '\\u2A11',\n 'bNot': '\\u2AED',\n 'backcong': '\\u224C',\n 'bcong': '\\u224C',\n 'backepsilon': '\\u03F6',\n 'bepsi': '\\u03F6',\n 'backprime': '\\u2035',\n 'bprime': '\\u2035',\n 'backsim': '\\u223D',\n 'bsim': '\\u223D',\n 'backsimeq': '\\u22CD',\n 'bsime': '\\u22CD',\n 'barvee': '\\u22BD',\n 'barwed': '\\u2305',\n 'barwedge': '\\u2305',\n 'bbrktbrk': '\\u23B6',\n 'bcy': '\\u0431',\n 'bdquo': '\\u201E',\n 'ldquor': '\\u201E',\n 'bemptyv': '\\u29B0',\n 'beta': '\\u03B2',\n 'beth': '\\u2136',\n 'between': '\\u226C',\n 'twixt': '\\u226C',\n 'bfr': '\\uD835\\uDD1F',\n 'bigcirc': '\\u25EF',\n 'xcirc': '\\u25EF',\n 'bigodot': '\\u2A00',\n 'xodot': '\\u2A00',\n 'bigoplus': '\\u2A01',\n 'xoplus': '\\u2A01',\n 'bigotimes': '\\u2A02',\n 'xotime': '\\u2A02',\n 'bigsqcup': '\\u2A06',\n 'xsqcup': '\\u2A06',\n 'bigstar': '\\u2605',\n 'starf': '\\u2605',\n 'bigtriangledown': '\\u25BD',\n 'xdtri': '\\u25BD',\n 'bigtriangleup': '\\u25B3',\n 'xutri': '\\u25B3',\n 'biguplus': '\\u2A04',\n 'xuplus': '\\u2A04',\n 'bkarow': '\\u290D',\n 'rbarr': '\\u290D',\n 'blacklozenge': '\\u29EB',\n 'lozf': '\\u29EB',\n 'blacktriangle': '\\u25B4',\n 'utrif': '\\u25B4',\n 'blacktriangledown': '\\u25BE',\n 'dtrif': '\\u25BE',\n 'blacktriangleleft': '\\u25C2',\n 'ltrif': '\\u25C2',\n 'blacktriangleright': '\\u25B8',\n 'rtrif': '\\u25B8',\n 'blank': '\\u2423',\n 'blk12': '\\u2592',\n 'blk14': '\\u2591',\n 'blk34': '\\u2593',\n 'block': '\\u2588',\n 'bne': '\\u003D\\u20E5',\n 'bnequiv': '\\u2261\\u20E5',\n 'bnot': '\\u2310',\n 'bopf': '\\uD835\\uDD53',\n 'bowtie': '\\u22C8',\n 'boxDL': '\\u2557',\n 'boxDR': '\\u2554',\n 'boxDl': '\\u2556',\n 'boxDr': '\\u2553',\n 'boxH': '\\u2550',\n 'boxHD': '\\u2566',\n 'boxHU': '\\u2569',\n 'boxHd': '\\u2564',\n 'boxHu': '\\u2567',\n 'boxUL': '\\u255D',\n 'boxUR': '\\u255A',\n 'boxUl': '\\u255C',\n 'boxUr': '\\u2559',\n 'boxV': '\\u2551',\n 'boxVH': '\\u256C',\n 'boxVL': '\\u2563',\n 'boxVR': '\\u2560',\n 'boxVh': '\\u256B',\n 'boxVl': '\\u2562',\n 'boxVr': '\\u255F',\n 'boxbox': '\\u29C9',\n 'boxdL': '\\u2555',\n 'boxdR': '\\u2552',\n 'boxdl': '\\u2510',\n 'boxdr': '\\u250C',\n 'boxhD': '\\u2565',\n 'boxhU': '\\u2568',\n 'boxhd': '\\u252C',\n 'boxhu': '\\u2534',\n 'boxminus': '\\u229F',\n 'minusb': '\\u229F',\n 'boxplus': '\\u229E',\n 'plusb': '\\u229E',\n 'boxtimes': '\\u22A0',\n 'timesb': '\\u22A0',\n 'boxuL': '\\u255B',\n 'boxuR': '\\u2558',\n 'boxul': '\\u2518',\n 'boxur': '\\u2514',\n 'boxv': '\\u2502',\n 'boxvH': '\\u256A',\n 'boxvL': '\\u2561',\n 'boxvR': '\\u255E',\n 'boxvh': '\\u253C',\n 'boxvl': '\\u2524',\n 'boxvr': '\\u251C',\n 'brvbar': '\\u00A6',\n 'bscr': '\\uD835\\uDCB7',\n 'bsemi': '\\u204F',\n 'bsol': '\\u005C',\n 'bsolb': '\\u29C5',\n 'bsolhsub': '\\u27C8',\n 'bull': '\\u2022',\n 'bullet': '\\u2022',\n 'bumpE': '\\u2AAE',\n 'cacute': '\\u0107',\n 'cap': '\\u2229',\n 'capand': '\\u2A44',\n 'capbrcup': '\\u2A49',\n 'capcap': '\\u2A4B',\n 'capcup': '\\u2A47',\n 'capdot': '\\u2A40',\n 'caps': '\\u2229\\uFE00',\n 'caret': '\\u2041',\n 'ccaps': '\\u2A4D',\n 'ccaron': '\\u010D',\n 'ccedil': '\\u00E7',\n 'ccirc': '\\u0109',\n 'ccups': '\\u2A4C',\n 'ccupssm': '\\u2A50',\n 'cdot': '\\u010B',\n 'cemptyv': '\\u29B2',\n 'cent': '\\u00A2',\n 'cfr': '\\uD835\\uDD20',\n 'chcy': '\\u0447',\n 'check': '\\u2713',\n 'checkmark': '\\u2713',\n 'chi': '\\u03C7',\n 'cir': '\\u25CB',\n 'cirE': '\\u29C3',\n 'circ': '\\u02C6',\n 'circeq': '\\u2257',\n 'cire': '\\u2257',\n 'circlearrowleft': '\\u21BA',\n 'olarr': '\\u21BA',\n 'circlearrowright': '\\u21BB',\n 'orarr': '\\u21BB',\n 'circledS': '\\u24C8',\n 'oS': '\\u24C8',\n 'circledast': '\\u229B',\n 'oast': '\\u229B',\n 'circledcirc': '\\u229A',\n 'ocir': '\\u229A',\n 'circleddash': '\\u229D',\n 'odash': '\\u229D',\n 'cirfnint': '\\u2A10',\n 'cirmid': '\\u2AEF',\n 'cirscir': '\\u29C2',\n 'clubs': '\\u2663',\n 'clubsuit': '\\u2663',\n 'colon': '\\u003A',\n 'comma': '\\u002C',\n 'commat': '\\u0040',\n 'comp': '\\u2201',\n 'complement': '\\u2201',\n 'congdot': '\\u2A6D',\n 'copf': '\\uD835\\uDD54',\n 'copysr': '\\u2117',\n 'crarr': '\\u21B5',\n 'cross': '\\u2717',\n 'cscr': '\\uD835\\uDCB8',\n 'csub': '\\u2ACF',\n 'csube': '\\u2AD1',\n 'csup': '\\u2AD0',\n 'csupe': '\\u2AD2',\n 'ctdot': '\\u22EF',\n 'cudarrl': '\\u2938',\n 'cudarrr': '\\u2935',\n 'cuepr': '\\u22DE',\n 'curlyeqprec': '\\u22DE',\n 'cuesc': '\\u22DF',\n 'curlyeqsucc': '\\u22DF',\n 'cularr': '\\u21B6',\n 'curvearrowleft': '\\u21B6',\n 'cularrp': '\\u293D',\n 'cup': '\\u222A',\n 'cupbrcap': '\\u2A48',\n 'cupcap': '\\u2A46',\n 'cupcup': '\\u2A4A',\n 'cupdot': '\\u228D',\n 'cupor': '\\u2A45',\n 'cups': '\\u222A\\uFE00',\n 'curarr': '\\u21B7',\n 'curvearrowright': '\\u21B7',\n 'curarrm': '\\u293C',\n 'curlyvee': '\\u22CE',\n 'cuvee': '\\u22CE',\n 'curlywedge': '\\u22CF',\n 'cuwed': '\\u22CF',\n 'curren': '\\u00A4',\n 'cwint': '\\u2231',\n 'cylcty': '\\u232D',\n 'dHar': '\\u2965',\n 'dagger': '\\u2020',\n 'daleth': '\\u2138',\n 'dash': '\\u2010',\n 'hyphen': '\\u2010',\n 'dbkarow': '\\u290F',\n 'rBarr': '\\u290F',\n 'dcaron': '\\u010F',\n 'dcy': '\\u0434',\n 'ddarr': '\\u21CA',\n 'downdownarrows': '\\u21CA',\n 'ddotseq': '\\u2A77',\n 'eDDot': '\\u2A77',\n 'deg': '\\u00B0',\n 'delta': '\\u03B4',\n 'demptyv': '\\u29B1',\n 'dfisht': '\\u297F',\n 'dfr': '\\uD835\\uDD21',\n 'diamondsuit': '\\u2666',\n 'diams': '\\u2666',\n 'digamma': '\\u03DD',\n 'gammad': '\\u03DD',\n 'disin': '\\u22F2',\n 'div': '\\u00F7',\n 'divide': '\\u00F7',\n 'divideontimes': '\\u22C7',\n 'divonx': '\\u22C7',\n 'djcy': '\\u0452',\n 'dlcorn': '\\u231E',\n 'llcorner': '\\u231E',\n 'dlcrop': '\\u230D',\n 'dollar': '\\u0024',\n 'dopf': '\\uD835\\uDD55',\n 'doteqdot': '\\u2251',\n 'eDot': '\\u2251',\n 'dotminus': '\\u2238',\n 'minusd': '\\u2238',\n 'dotplus': '\\u2214',\n 'plusdo': '\\u2214',\n 'dotsquare': '\\u22A1',\n 'sdotb': '\\u22A1',\n 'drcorn': '\\u231F',\n 'lrcorner': '\\u231F',\n 'drcrop': '\\u230C',\n 'dscr': '\\uD835\\uDCB9',\n 'dscy': '\\u0455',\n 'dsol': '\\u29F6',\n 'dstrok': '\\u0111',\n 'dtdot': '\\u22F1',\n 'dtri': '\\u25BF',\n 'triangledown': '\\u25BF',\n 'dwangle': '\\u29A6',\n 'dzcy': '\\u045F',\n 'dzigrarr': '\\u27FF',\n 'eacute': '\\u00E9',\n 'easter': '\\u2A6E',\n 'ecaron': '\\u011B',\n 'ecir': '\\u2256',\n 'eqcirc': '\\u2256',\n 'ecirc': '\\u00EA',\n 'ecolon': '\\u2255',\n 'eqcolon': '\\u2255',\n 'ecy': '\\u044D',\n 'edot': '\\u0117',\n 'efDot': '\\u2252',\n 'fallingdotseq': '\\u2252',\n 'efr': '\\uD835\\uDD22',\n 'eg': '\\u2A9A',\n 'egrave': '\\u00E8',\n 'egs': '\\u2A96',\n 'eqslantgtr': '\\u2A96',\n 'egsdot': '\\u2A98',\n 'el': '\\u2A99',\n 'elinters': '\\u23E7',\n 'ell': '\\u2113',\n 'els': '\\u2A95',\n 'eqslantless': '\\u2A95',\n 'elsdot': '\\u2A97',\n 'emacr': '\\u0113',\n 'empty': '\\u2205',\n 'emptyset': '\\u2205',\n 'emptyv': '\\u2205',\n 'varnothing': '\\u2205',\n 'emsp13': '\\u2004',\n 'emsp14': '\\u2005',\n 'emsp': '\\u2003',\n 'eng': '\\u014B',\n 'ensp': '\\u2002',\n 'eogon': '\\u0119',\n 'eopf': '\\uD835\\uDD56',\n 'epar': '\\u22D5',\n 'eparsl': '\\u29E3',\n 'eplus': '\\u2A71',\n 'epsi': '\\u03B5',\n 'epsilon': '\\u03B5',\n 'epsiv': '\\u03F5',\n 'straightepsilon': '\\u03F5',\n 'varepsilon': '\\u03F5',\n 'equals': '\\u003D',\n 'equest': '\\u225F',\n 'questeq': '\\u225F',\n 'equivDD': '\\u2A78',\n 'eqvparsl': '\\u29E5',\n 'erDot': '\\u2253',\n 'risingdotseq': '\\u2253',\n 'erarr': '\\u2971',\n 'escr': '\\u212F',\n 'eta': '\\u03B7',\n 'eth': '\\u00F0',\n 'euml': '\\u00EB',\n 'euro': '\\u20AC',\n 'excl': '\\u0021',\n 'fcy': '\\u0444',\n 'female': '\\u2640',\n 'ffilig': '\\uFB03',\n 'fflig': '\\uFB00',\n 'ffllig': '\\uFB04',\n 'ffr': '\\uD835\\uDD23',\n 'filig': '\\uFB01',\n 'fjlig': '\\u0066\\u006A',\n 'flat': '\\u266D',\n 'fllig': '\\uFB02',\n 'fltns': '\\u25B1',\n 'fnof': '\\u0192',\n 'fopf': '\\uD835\\uDD57',\n 'fork': '\\u22D4',\n 'pitchfork': '\\u22D4',\n 'forkv': '\\u2AD9',\n 'fpartint': '\\u2A0D',\n 'frac12': '\\u00BD',\n 'half': '\\u00BD',\n 'frac13': '\\u2153',\n 'frac14': '\\u00BC',\n 'frac15': '\\u2155',\n 'frac16': '\\u2159',\n 'frac18': '\\u215B',\n 'frac23': '\\u2154',\n 'frac25': '\\u2156',\n 'frac34': '\\u00BE',\n 'frac35': '\\u2157',\n 'frac38': '\\u215C',\n 'frac45': '\\u2158',\n 'frac56': '\\u215A',\n 'frac58': '\\u215D',\n 'frac78': '\\u215E',\n 'frasl': '\\u2044',\n 'frown': '\\u2322',\n 'sfrown': '\\u2322',\n 'fscr': '\\uD835\\uDCBB',\n 'gEl': '\\u2A8C',\n 'gtreqqless': '\\u2A8C',\n 'gacute': '\\u01F5',\n 'gamma': '\\u03B3',\n 'gap': '\\u2A86',\n 'gtrapprox': '\\u2A86',\n 'gbreve': '\\u011F',\n 'gcirc': '\\u011D',\n 'gcy': '\\u0433',\n 'gdot': '\\u0121',\n 'gescc': '\\u2AA9',\n 'gesdot': '\\u2A80',\n 'gesdoto': '\\u2A82',\n 'gesdotol': '\\u2A84',\n 'gesl': '\\u22DB\\uFE00',\n 'gesles': '\\u2A94',\n 'gfr': '\\uD835\\uDD24',\n 'gimel': '\\u2137',\n 'gjcy': '\\u0453',\n 'glE': '\\u2A92',\n 'gla': '\\u2AA5',\n 'glj': '\\u2AA4',\n 'gnE': '\\u2269',\n 'gneqq': '\\u2269',\n 'gnap': '\\u2A8A',\n 'gnapprox': '\\u2A8A',\n 'gne': '\\u2A88',\n 'gneq': '\\u2A88',\n 'gnsim': '\\u22E7',\n 'gopf': '\\uD835\\uDD58',\n 'gscr': '\\u210A',\n 'gsime': '\\u2A8E',\n 'gsiml': '\\u2A90',\n 'gtcc': '\\u2AA7',\n 'gtcir': '\\u2A7A',\n 'gtdot': '\\u22D7',\n 'gtrdot': '\\u22D7',\n 'gtlPar': '\\u2995',\n 'gtquest': '\\u2A7C',\n 'gtrarr': '\\u2978',\n 'gvertneqq': '\\u2269\\uFE00',\n 'gvnE': '\\u2269\\uFE00',\n 'hardcy': '\\u044A',\n 'harrcir': '\\u2948',\n 'harrw': '\\u21AD',\n 'leftrightsquigarrow': '\\u21AD',\n 'hbar': '\\u210F',\n 'hslash': '\\u210F',\n 'planck': '\\u210F',\n 'plankv': '\\u210F',\n 'hcirc': '\\u0125',\n 'hearts': '\\u2665',\n 'heartsuit': '\\u2665',\n 'hellip': '\\u2026',\n 'mldr': '\\u2026',\n 'hercon': '\\u22B9',\n 'hfr': '\\uD835\\uDD25',\n 'hksearow': '\\u2925',\n 'searhk': '\\u2925',\n 'hkswarow': '\\u2926',\n 'swarhk': '\\u2926',\n 'hoarr': '\\u21FF',\n 'homtht': '\\u223B',\n 'hookleftarrow': '\\u21A9',\n 'larrhk': '\\u21A9',\n 'hookrightarrow': '\\u21AA',\n 'rarrhk': '\\u21AA',\n 'hopf': '\\uD835\\uDD59',\n 'horbar': '\\u2015',\n 'hscr': '\\uD835\\uDCBD',\n 'hstrok': '\\u0127',\n 'hybull': '\\u2043',\n 'iacute': '\\u00ED',\n 'icirc': '\\u00EE',\n 'icy': '\\u0438',\n 'iecy': '\\u0435',\n 'iexcl': '\\u00A1',\n 'ifr': '\\uD835\\uDD26',\n 'igrave': '\\u00EC',\n 'iiiint': '\\u2A0C',\n 'qint': '\\u2A0C',\n 'iiint': '\\u222D',\n 'tint': '\\u222D',\n 'iinfin': '\\u29DC',\n 'iiota': '\\u2129',\n 'ijlig': '\\u0133',\n 'imacr': '\\u012B',\n 'imath': '\\u0131',\n 'inodot': '\\u0131',\n 'imof': '\\u22B7',\n 'imped': '\\u01B5',\n 'incare': '\\u2105',\n 'infin': '\\u221E',\n 'infintie': '\\u29DD',\n 'intcal': '\\u22BA',\n 'intercal': '\\u22BA',\n 'intlarhk': '\\u2A17',\n 'intprod': '\\u2A3C',\n 'iprod': '\\u2A3C',\n 'iocy': '\\u0451',\n 'iogon': '\\u012F',\n 'iopf': '\\uD835\\uDD5A',\n 'iota': '\\u03B9',\n 'iquest': '\\u00BF',\n 'iscr': '\\uD835\\uDCBE',\n 'isinE': '\\u22F9',\n 'isindot': '\\u22F5',\n 'isins': '\\u22F4',\n 'isinsv': '\\u22F3',\n 'itilde': '\\u0129',\n 'iukcy': '\\u0456',\n 'iuml': '\\u00EF',\n 'jcirc': '\\u0135',\n 'jcy': '\\u0439',\n 'jfr': '\\uD835\\uDD27',\n 'jmath': '\\u0237',\n 'jopf': '\\uD835\\uDD5B',\n 'jscr': '\\uD835\\uDCBF',\n 'jsercy': '\\u0458',\n 'jukcy': '\\u0454',\n 'kappa': '\\u03BA',\n 'kappav': '\\u03F0',\n 'varkappa': '\\u03F0',\n 'kcedil': '\\u0137',\n 'kcy': '\\u043A',\n 'kfr': '\\uD835\\uDD28',\n 'kgreen': '\\u0138',\n 'khcy': '\\u0445',\n 'kjcy': '\\u045C',\n 'kopf': '\\uD835\\uDD5C',\n 'kscr': '\\uD835\\uDCC0',\n 'lAtail': '\\u291B',\n 'lBarr': '\\u290E',\n 'lEg': '\\u2A8B',\n 'lesseqqgtr': '\\u2A8B',\n 'lHar': '\\u2962',\n 'lacute': '\\u013A',\n 'laemptyv': '\\u29B4',\n 'lambda': '\\u03BB',\n 'langd': '\\u2991',\n 'lap': '\\u2A85',\n 'lessapprox': '\\u2A85',\n 'laquo': '\\u00AB',\n 'larrbfs': '\\u291F',\n 'larrfs': '\\u291D',\n 'larrlp': '\\u21AB',\n 'looparrowleft': '\\u21AB',\n 'larrpl': '\\u2939',\n 'larrsim': '\\u2973',\n 'larrtl': '\\u21A2',\n 'leftarrowtail': '\\u21A2',\n 'lat': '\\u2AAB',\n 'latail': '\\u2919',\n 'late': '\\u2AAD',\n 'lates': '\\u2AAD\\uFE00',\n 'lbarr': '\\u290C',\n 'lbbrk': '\\u2772',\n 'lbrace': '\\u007B',\n 'lcub': '\\u007B',\n 'lbrack': '\\u005B',\n 'lsqb': '\\u005B',\n 'lbrke': '\\u298B',\n 'lbrksld': '\\u298F',\n 'lbrkslu': '\\u298D',\n 'lcaron': '\\u013E',\n 'lcedil': '\\u013C',\n 'lcy': '\\u043B',\n 'ldca': '\\u2936',\n 'ldrdhar': '\\u2967',\n 'ldrushar': '\\u294B',\n 'ldsh': '\\u21B2',\n 'le': '\\u2264',\n 'leq': '\\u2264',\n 'leftleftarrows': '\\u21C7',\n 'llarr': '\\u21C7',\n 'leftthreetimes': '\\u22CB',\n 'lthree': '\\u22CB',\n 'lescc': '\\u2AA8',\n 'lesdot': '\\u2A7F',\n 'lesdoto': '\\u2A81',\n 'lesdotor': '\\u2A83',\n 'lesg': '\\u22DA\\uFE00',\n 'lesges': '\\u2A93',\n 'lessdot': '\\u22D6',\n 'ltdot': '\\u22D6',\n 'lfisht': '\\u297C',\n 'lfr': '\\uD835\\uDD29',\n 'lgE': '\\u2A91',\n 'lharul': '\\u296A',\n 'lhblk': '\\u2584',\n 'ljcy': '\\u0459',\n 'llhard': '\\u296B',\n 'lltri': '\\u25FA',\n 'lmidot': '\\u0140',\n 'lmoust': '\\u23B0',\n 'lmoustache': '\\u23B0',\n 'lnE': '\\u2268',\n 'lneqq': '\\u2268',\n 'lnap': '\\u2A89',\n 'lnapprox': '\\u2A89',\n 'lne': '\\u2A87',\n 'lneq': '\\u2A87',\n 'lnsim': '\\u22E6',\n 'loang': '\\u27EC',\n 'loarr': '\\u21FD',\n 'longmapsto': '\\u27FC',\n 'xmap': '\\u27FC',\n 'looparrowright': '\\u21AC',\n 'rarrlp': '\\u21AC',\n 'lopar': '\\u2985',\n 'lopf': '\\uD835\\uDD5D',\n 'loplus': '\\u2A2D',\n 'lotimes': '\\u2A34',\n 'lowast': '\\u2217',\n 'loz': '\\u25CA',\n 'lozenge': '\\u25CA',\n 'lpar': '\\u0028',\n 'lparlt': '\\u2993',\n 'lrhard': '\\u296D',\n 'lrm': '\\u200E',\n 'lrtri': '\\u22BF',\n 'lsaquo': '\\u2039',\n 'lscr': '\\uD835\\uDCC1',\n 'lsime': '\\u2A8D',\n 'lsimg': '\\u2A8F',\n 'lsquor': '\\u201A',\n 'sbquo': '\\u201A',\n 'lstrok': '\\u0142',\n 'ltcc': '\\u2AA6',\n 'ltcir': '\\u2A79',\n 'ltimes': '\\u22C9',\n 'ltlarr': '\\u2976',\n 'ltquest': '\\u2A7B',\n 'ltrPar': '\\u2996',\n 'ltri': '\\u25C3',\n 'triangleleft': '\\u25C3',\n 'lurdshar': '\\u294A',\n 'luruhar': '\\u2966',\n 'lvertneqq': '\\u2268\\uFE00',\n 'lvnE': '\\u2268\\uFE00',\n 'mDDot': '\\u223A',\n 'macr': '\\u00AF',\n 'strns': '\\u00AF',\n 'male': '\\u2642',\n 'malt': '\\u2720',\n 'maltese': '\\u2720',\n 'marker': '\\u25AE',\n 'mcomma': '\\u2A29',\n 'mcy': '\\u043C',\n 'mdash': '\\u2014',\n 'mfr': '\\uD835\\uDD2A',\n 'mho': '\\u2127',\n 'micro': '\\u00B5',\n 'midcir': '\\u2AF0',\n 'minus': '\\u2212',\n 'minusdu': '\\u2A2A',\n 'mlcp': '\\u2ADB',\n 'models': '\\u22A7',\n 'mopf': '\\uD835\\uDD5E',\n 'mscr': '\\uD835\\uDCC2',\n 'mu': '\\u03BC',\n 'multimap': '\\u22B8',\n 'mumap': '\\u22B8',\n 'nGg': '\\u22D9\\u0338',\n 'nGt': '\\u226B\\u20D2',\n 'nLeftarrow': '\\u21CD',\n 'nlArr': '\\u21CD',\n 'nLeftrightarrow': '\\u21CE',\n 'nhArr': '\\u21CE',\n 'nLl': '\\u22D8\\u0338',\n 'nLt': '\\u226A\\u20D2',\n 'nRightarrow': '\\u21CF',\n 'nrArr': '\\u21CF',\n 'nVDash': '\\u22AF',\n 'nVdash': '\\u22AE',\n 'nacute': '\\u0144',\n 'nang': '\\u2220\\u20D2',\n 'napE': '\\u2A70\\u0338',\n 'napid': '\\u224B\\u0338',\n 'napos': '\\u0149',\n 'natur': '\\u266E',\n 'natural': '\\u266E',\n 'ncap': '\\u2A43',\n 'ncaron': '\\u0148',\n 'ncedil': '\\u0146',\n 'ncongdot': '\\u2A6D\\u0338',\n 'ncup': '\\u2A42',\n 'ncy': '\\u043D',\n 'ndash': '\\u2013',\n 'neArr': '\\u21D7',\n 'nearhk': '\\u2924',\n 'nedot': '\\u2250\\u0338',\n 'nesear': '\\u2928',\n 'toea': '\\u2928',\n 'nfr': '\\uD835\\uDD2B',\n 'nharr': '\\u21AE',\n 'nleftrightarrow': '\\u21AE',\n 'nhpar': '\\u2AF2',\n 'nis': '\\u22FC',\n 'nisd': '\\u22FA',\n 'njcy': '\\u045A',\n 'nlE': '\\u2266\\u0338',\n 'nleqq': '\\u2266\\u0338',\n 'nlarr': '\\u219A',\n 'nleftarrow': '\\u219A',\n 'nldr': '\\u2025',\n 'nopf': '\\uD835\\uDD5F',\n 'not': '\\u00AC',\n 'notinE': '\\u22F9\\u0338',\n 'notindot': '\\u22F5\\u0338',\n 'notinvb': '\\u22F7',\n 'notinvc': '\\u22F6',\n 'notnivb': '\\u22FE',\n 'notnivc': '\\u22FD',\n 'nparsl': '\\u2AFD\\u20E5',\n 'npart': '\\u2202\\u0338',\n 'npolint': '\\u2A14',\n 'nrarr': '\\u219B',\n 'nrightarrow': '\\u219B',\n 'nrarrc': '\\u2933\\u0338',\n 'nrarrw': '\\u219D\\u0338',\n 'nscr': '\\uD835\\uDCC3',\n 'nsub': '\\u2284',\n 'nsubE': '\\u2AC5\\u0338',\n 'nsubseteqq': '\\u2AC5\\u0338',\n 'nsup': '\\u2285',\n 'nsupE': '\\u2AC6\\u0338',\n 'nsupseteqq': '\\u2AC6\\u0338',\n 'ntilde': '\\u00F1',\n 'nu': '\\u03BD',\n 'num': '\\u0023',\n 'numero': '\\u2116',\n 'numsp': '\\u2007',\n 'nvDash': '\\u22AD',\n 'nvHarr': '\\u2904',\n 'nvap': '\\u224D\\u20D2',\n 'nvdash': '\\u22AC',\n 'nvge': '\\u2265\\u20D2',\n 'nvgt': '\\u003E\\u20D2',\n 'nvinfin': '\\u29DE',\n 'nvlArr': '\\u2902',\n 'nvle': '\\u2264\\u20D2',\n 'nvlt': '\\u003C\\u20D2',\n 'nvltrie': '\\u22B4\\u20D2',\n 'nvrArr': '\\u2903',\n 'nvrtrie': '\\u22B5\\u20D2',\n 'nvsim': '\\u223C\\u20D2',\n 'nwArr': '\\u21D6',\n 'nwarhk': '\\u2923',\n 'nwnear': '\\u2927',\n 'oacute': '\\u00F3',\n 'ocirc': '\\u00F4',\n 'ocy': '\\u043E',\n 'odblac': '\\u0151',\n 'odiv': '\\u2A38',\n 'odsold': '\\u29BC',\n 'oelig': '\\u0153',\n 'ofcir': '\\u29BF',\n 'ofr': '\\uD835\\uDD2C',\n 'ogon': '\\u02DB',\n 'ograve': '\\u00F2',\n 'ogt': '\\u29C1',\n 'ohbar': '\\u29B5',\n 'olcir': '\\u29BE',\n 'olcross': '\\u29BB',\n 'olt': '\\u29C0',\n 'omacr': '\\u014D',\n 'omega': '\\u03C9',\n 'omicron': '\\u03BF',\n 'omid': '\\u29B6',\n 'oopf': '\\uD835\\uDD60',\n 'opar': '\\u29B7',\n 'operp': '\\u29B9',\n 'or': '\\u2228',\n 'vee': '\\u2228',\n 'ord': '\\u2A5D',\n 'order': '\\u2134',\n 'orderof': '\\u2134',\n 'oscr': '\\u2134',\n 'ordf': '\\u00AA',\n 'ordm': '\\u00BA',\n 'origof': '\\u22B6',\n 'oror': '\\u2A56',\n 'orslope': '\\u2A57',\n 'orv': '\\u2A5B',\n 'oslash': '\\u00F8',\n 'osol': '\\u2298',\n 'otilde': '\\u00F5',\n 'otimesas': '\\u2A36',\n 'ouml': '\\u00F6',\n 'ovbar': '\\u233D',\n 'para': '\\u00B6',\n 'parsim': '\\u2AF3',\n 'parsl': '\\u2AFD',\n 'pcy': '\\u043F',\n 'percnt': '\\u0025',\n 'period': '\\u002E',\n 'permil': '\\u2030',\n 'pertenk': '\\u2031',\n 'pfr': '\\uD835\\uDD2D',\n 'phi': '\\u03C6',\n 'phiv': '\\u03D5',\n 'straightphi': '\\u03D5',\n 'varphi': '\\u03D5',\n 'phone': '\\u260E',\n 'pi': '\\u03C0',\n 'piv': '\\u03D6',\n 'varpi': '\\u03D6',\n 'planckh': '\\u210E',\n 'plus': '\\u002B',\n 'plusacir': '\\u2A23',\n 'pluscir': '\\u2A22',\n 'plusdu': '\\u2A25',\n 'pluse': '\\u2A72',\n 'plussim': '\\u2A26',\n 'plustwo': '\\u2A27',\n 'pointint': '\\u2A15',\n 'popf': '\\uD835\\uDD61',\n 'pound': '\\u00A3',\n 'prE': '\\u2AB3',\n 'prap': '\\u2AB7',\n 'precapprox': '\\u2AB7',\n 'precnapprox': '\\u2AB9',\n 'prnap': '\\u2AB9',\n 'precneqq': '\\u2AB5',\n 'prnE': '\\u2AB5',\n 'precnsim': '\\u22E8',\n 'prnsim': '\\u22E8',\n 'prime': '\\u2032',\n 'profalar': '\\u232E',\n 'profline': '\\u2312',\n 'profsurf': '\\u2313',\n 'prurel': '\\u22B0',\n 'pscr': '\\uD835\\uDCC5',\n 'psi': '\\u03C8',\n 'puncsp': '\\u2008',\n 'qfr': '\\uD835\\uDD2E',\n 'qopf': '\\uD835\\uDD62',\n 'qprime': '\\u2057',\n 'qscr': '\\uD835\\uDCC6',\n 'quatint': '\\u2A16',\n 'quest': '\\u003F',\n 'rAtail': '\\u291C',\n 'rHar': '\\u2964',\n 'race': '\\u223D\\u0331',\n 'racute': '\\u0155',\n 'raemptyv': '\\u29B3',\n 'rangd': '\\u2992',\n 'range': '\\u29A5',\n 'raquo': '\\u00BB',\n 'rarrap': '\\u2975',\n 'rarrbfs': '\\u2920',\n 'rarrc': '\\u2933',\n 'rarrfs': '\\u291E',\n 'rarrpl': '\\u2945',\n 'rarrsim': '\\u2974',\n 'rarrtl': '\\u21A3',\n 'rightarrowtail': '\\u21A3',\n 'rarrw': '\\u219D',\n 'rightsquigarrow': '\\u219D',\n 'ratail': '\\u291A',\n 'ratio': '\\u2236',\n 'rbbrk': '\\u2773',\n 'rbrace': '\\u007D',\n 'rcub': '\\u007D',\n 'rbrack': '\\u005D',\n 'rsqb': '\\u005D',\n 'rbrke': '\\u298C',\n 'rbrksld': '\\u298E',\n 'rbrkslu': '\\u2990',\n 'rcaron': '\\u0159',\n 'rcedil': '\\u0157',\n 'rcy': '\\u0440',\n 'rdca': '\\u2937',\n 'rdldhar': '\\u2969',\n 'rdsh': '\\u21B3',\n 'rect': '\\u25AD',\n 'rfisht': '\\u297D',\n 'rfr': '\\uD835\\uDD2F',\n 'rharul': '\\u296C',\n 'rho': '\\u03C1',\n 'rhov': '\\u03F1',\n 'varrho': '\\u03F1',\n 'rightrightarrows': '\\u21C9',\n 'rrarr': '\\u21C9',\n 'rightthreetimes': '\\u22CC',\n 'rthree': '\\u22CC',\n 'ring': '\\u02DA',\n 'rlm': '\\u200F',\n 'rmoust': '\\u23B1',\n 'rmoustache': '\\u23B1',\n 'rnmid': '\\u2AEE',\n 'roang': '\\u27ED',\n 'roarr': '\\u21FE',\n 'ropar': '\\u2986',\n 'ropf': '\\uD835\\uDD63',\n 'roplus': '\\u2A2E',\n 'rotimes': '\\u2A35',\n 'rpar': '\\u0029',\n 'rpargt': '\\u2994',\n 'rppolint': '\\u2A12',\n 'rsaquo': '\\u203A',\n 'rscr': '\\uD835\\uDCC7',\n 'rtimes': '\\u22CA',\n 'rtri': '\\u25B9',\n 'triangleright': '\\u25B9',\n 'rtriltri': '\\u29CE',\n 'ruluhar': '\\u2968',\n 'rx': '\\u211E',\n 'sacute': '\\u015B',\n 'scE': '\\u2AB4',\n 'scap': '\\u2AB8',\n 'succapprox': '\\u2AB8',\n 'scaron': '\\u0161',\n 'scedil': '\\u015F',\n 'scirc': '\\u015D',\n 'scnE': '\\u2AB6',\n 'succneqq': '\\u2AB6',\n 'scnap': '\\u2ABA',\n 'succnapprox': '\\u2ABA',\n 'scnsim': '\\u22E9',\n 'succnsim': '\\u22E9',\n 'scpolint': '\\u2A13',\n 'scy': '\\u0441',\n 'sdot': '\\u22C5',\n 'sdote': '\\u2A66',\n 'seArr': '\\u21D8',\n 'sect': '\\u00A7',\n 'semi': '\\u003B',\n 'seswar': '\\u2929',\n 'tosa': '\\u2929',\n 'sext': '\\u2736',\n 'sfr': '\\uD835\\uDD30',\n 'sharp': '\\u266F',\n 'shchcy': '\\u0449',\n 'shcy': '\\u0448',\n 'shy': '\\u00AD',\n 'sigma': '\\u03C3',\n 'sigmaf': '\\u03C2',\n 'sigmav': '\\u03C2',\n 'varsigma': '\\u03C2',\n 'simdot': '\\u2A6A',\n 'simg': '\\u2A9E',\n 'simgE': '\\u2AA0',\n 'siml': '\\u2A9D',\n 'simlE': '\\u2A9F',\n 'simne': '\\u2246',\n 'simplus': '\\u2A24',\n 'simrarr': '\\u2972',\n 'smashp': '\\u2A33',\n 'smeparsl': '\\u29E4',\n 'smile': '\\u2323',\n 'ssmile': '\\u2323',\n 'smt': '\\u2AAA',\n 'smte': '\\u2AAC',\n 'smtes': '\\u2AAC\\uFE00',\n 'softcy': '\\u044C',\n 'sol': '\\u002F',\n 'solb': '\\u29C4',\n 'solbar': '\\u233F',\n 'sopf': '\\uD835\\uDD64',\n 'spades': '\\u2660',\n 'spadesuit': '\\u2660',\n 'sqcaps': '\\u2293\\uFE00',\n 'sqcups': '\\u2294\\uFE00',\n 'sscr': '\\uD835\\uDCC8',\n 'star': '\\u2606',\n 'sub': '\\u2282',\n 'subset': '\\u2282',\n 'subE': '\\u2AC5',\n 'subseteqq': '\\u2AC5',\n 'subdot': '\\u2ABD',\n 'subedot': '\\u2AC3',\n 'submult': '\\u2AC1',\n 'subnE': '\\u2ACB',\n 'subsetneqq': '\\u2ACB',\n 'subne': '\\u228A',\n 'subsetneq': '\\u228A',\n 'subplus': '\\u2ABF',\n 'subrarr': '\\u2979',\n 'subsim': '\\u2AC7',\n 'subsub': '\\u2AD5',\n 'subsup': '\\u2AD3',\n 'sung': '\\u266A',\n 'sup1': '\\u00B9',\n 'sup2': '\\u00B2',\n 'sup3': '\\u00B3',\n 'supE': '\\u2AC6',\n 'supseteqq': '\\u2AC6',\n 'supdot': '\\u2ABE',\n 'supdsub': '\\u2AD8',\n 'supedot': '\\u2AC4',\n 'suphsol': '\\u27C9',\n 'suphsub': '\\u2AD7',\n 'suplarr': '\\u297B',\n 'supmult': '\\u2AC2',\n 'supnE': '\\u2ACC',\n 'supsetneqq': '\\u2ACC',\n 'supne': '\\u228B',\n 'supsetneq': '\\u228B',\n 'supplus': '\\u2AC0',\n 'supsim': '\\u2AC8',\n 'supsub': '\\u2AD4',\n 'supsup': '\\u2AD6',\n 'swArr': '\\u21D9',\n 'swnwar': '\\u292A',\n 'szlig': '\\u00DF',\n 'target': '\\u2316',\n 'tau': '\\u03C4',\n 'tcaron': '\\u0165',\n 'tcedil': '\\u0163',\n 'tcy': '\\u0442',\n 'telrec': '\\u2315',\n 'tfr': '\\uD835\\uDD31',\n 'theta': '\\u03B8',\n 'thetasym': '\\u03D1',\n 'thetav': '\\u03D1',\n 'vartheta': '\\u03D1',\n 'thorn': '\\u00FE',\n 'times': '\\u00D7',\n 'timesbar': '\\u2A31',\n 'timesd': '\\u2A30',\n 'topbot': '\\u2336',\n 'topcir': '\\u2AF1',\n 'topf': '\\uD835\\uDD65',\n 'topfork': '\\u2ADA',\n 'tprime': '\\u2034',\n 'triangle': '\\u25B5',\n 'utri': '\\u25B5',\n 'triangleq': '\\u225C',\n 'trie': '\\u225C',\n 'tridot': '\\u25EC',\n 'triminus': '\\u2A3A',\n 'triplus': '\\u2A39',\n 'trisb': '\\u29CD',\n 'tritime': '\\u2A3B',\n 'trpezium': '\\u23E2',\n 'tscr': '\\uD835\\uDCC9',\n 'tscy': '\\u0446',\n 'tshcy': '\\u045B',\n 'tstrok': '\\u0167',\n 'uHar': '\\u2963',\n 'uacute': '\\u00FA',\n 'ubrcy': '\\u045E',\n 'ubreve': '\\u016D',\n 'ucirc': '\\u00FB',\n 'ucy': '\\u0443',\n 'udblac': '\\u0171',\n 'ufisht': '\\u297E',\n 'ufr': '\\uD835\\uDD32',\n 'ugrave': '\\u00F9',\n 'uhblk': '\\u2580',\n 'ulcorn': '\\u231C',\n 'ulcorner': '\\u231C',\n 'ulcrop': '\\u230F',\n 'ultri': '\\u25F8',\n 'umacr': '\\u016B',\n 'uogon': '\\u0173',\n 'uopf': '\\uD835\\uDD66',\n 'upsi': '\\u03C5',\n 'upsilon': '\\u03C5',\n 'upuparrows': '\\u21C8',\n 'uuarr': '\\u21C8',\n 'urcorn': '\\u231D',\n 'urcorner': '\\u231D',\n 'urcrop': '\\u230E',\n 'uring': '\\u016F',\n 'urtri': '\\u25F9',\n 'uscr': '\\uD835\\uDCCA',\n 'utdot': '\\u22F0',\n 'utilde': '\\u0169',\n 'uuml': '\\u00FC',\n 'uwangle': '\\u29A7',\n 'vBar': '\\u2AE8',\n 'vBarv': '\\u2AE9',\n 'vangrt': '\\u299C',\n 'varsubsetneq': '\\u228A\\uFE00',\n 'vsubne': '\\u228A\\uFE00',\n 'varsubsetneqq': '\\u2ACB\\uFE00',\n 'vsubnE': '\\u2ACB\\uFE00',\n 'varsupsetneq': '\\u228B\\uFE00',\n 'vsupne': '\\u228B\\uFE00',\n 'varsupsetneqq': '\\u2ACC\\uFE00',\n 'vsupnE': '\\u2ACC\\uFE00',\n 'vcy': '\\u0432',\n 'veebar': '\\u22BB',\n 'veeeq': '\\u225A',\n 'vellip': '\\u22EE',\n 'vfr': '\\uD835\\uDD33',\n 'vopf': '\\uD835\\uDD67',\n 'vscr': '\\uD835\\uDCCB',\n 'vzigzag': '\\u299A',\n 'wcirc': '\\u0175',\n 'wedbar': '\\u2A5F',\n 'wedgeq': '\\u2259',\n 'weierp': '\\u2118',\n 'wp': '\\u2118',\n 'wfr': '\\uD835\\uDD34',\n 'wopf': '\\uD835\\uDD68',\n 'wscr': '\\uD835\\uDCCC',\n 'xfr': '\\uD835\\uDD35',\n 'xi': '\\u03BE',\n 'xnis': '\\u22FB',\n 'xopf': '\\uD835\\uDD69',\n 'xscr': '\\uD835\\uDCCD',\n 'yacute': '\\u00FD',\n 'yacy': '\\u044F',\n 'ycirc': '\\u0177',\n 'ycy': '\\u044B',\n 'yen': '\\u00A5',\n 'yfr': '\\uD835\\uDD36',\n 'yicy': '\\u0457',\n 'yopf': '\\uD835\\uDD6A',\n 'yscr': '\\uD835\\uDCCE',\n 'yucy': '\\u044E',\n 'yuml': '\\u00FF',\n 'zacute': '\\u017A',\n 'zcaron': '\\u017E',\n 'zcy': '\\u0437',\n 'zdot': '\\u017C',\n 'zeta': '\\u03B6',\n 'zfr': '\\uD835\\uDD37',\n 'zhcy': '\\u0436',\n 'zigrarr': '\\u21DD',\n 'zopf': '\\uD835\\uDD6B',\n 'zscr': '\\uD835\\uDCCF',\n 'zwj': '\\u200D',\n 'zwnj': '\\u200C',\n};\n// The &ngsp; pseudo-entity is denoting a space.\n// 0xE500 is a PUA (Private Use Areas) unicode character\n// This is inspired by the Angular Dart implementation.\nconst NGSP_UNICODE = '\\uE500';\nNAMED_ENTITIES['ngsp'] = NGSP_UNICODE;\n\nclass TokenizeResult {\n tokens;\n errors;\n nonNormalizedIcuExpressions;\n constructor(tokens, errors, nonNormalizedIcuExpressions) {\n this.tokens = tokens;\n this.errors = errors;\n this.nonNormalizedIcuExpressions = nonNormalizedIcuExpressions;\n }\n}\nfunction tokenize(source, url, getTagDefinition, options = {}) {\n const tokenizer = new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options);\n tokenizer.tokenize();\n return new TokenizeResult(mergeTextTokens(tokenizer.tokens), tokenizer.errors, tokenizer.nonNormalizedIcuExpressions);\n}\nconst _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\nfunction _unexpectedCharacterErrorMsg(charCode) {\n const char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode);\n return `Unexpected character \"${char}\"`;\n}\nfunction _unknownEntityErrorMsg(entitySrc) {\n return `Unknown entity \"${entitySrc}\" - use the \"
;\" or \";\" syntax`;\n}\nfunction _unparsableEntityErrorMsg(type, entityStr) {\n return `Unable to parse entity \"${entityStr}\" - ${type} character reference entities must end with \";\"`;\n}\nvar CharacterReferenceType;\n(function (CharacterReferenceType) {\n CharacterReferenceType[\"HEX\"] = \"hexadecimal\";\n CharacterReferenceType[\"DEC\"] = \"decimal\";\n})(CharacterReferenceType || (CharacterReferenceType = {}));\nconst SUPPORTED_BLOCKS = [\n '@if',\n '@else', // Covers `@else if` as well\n '@for',\n '@switch',\n '@case',\n '@default',\n '@empty',\n '@defer',\n '@placeholder',\n '@loading',\n '@error',\n];\n// See https://www.w3.org/TR/html51/syntax.html#writing-html-documents\nclass _Tokenizer {\n _getTagDefinition;\n _cursor;\n _tokenizeIcu;\n _interpolationConfig;\n _leadingTriviaCodePoints;\n _currentTokenStart = null;\n _currentTokenType = null;\n _expansionCaseStack = [];\n _openDirectiveCount = 0;\n _inInterpolation = false;\n _preserveLineEndings;\n _i18nNormalizeLineEndingsInICUs;\n _tokenizeBlocks;\n _tokenizeLet;\n _selectorlessEnabled;\n tokens = [];\n errors = [];\n nonNormalizedIcuExpressions = [];\n /**\n * @param _file The html source file being tokenized.\n * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name.\n * @param options Configuration of the tokenization.\n */\n constructor(_file, _getTagDefinition, options) {\n this._getTagDefinition = _getTagDefinition;\n this._tokenizeIcu = options.tokenizeExpansionForms || false;\n this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;\n this._leadingTriviaCodePoints =\n options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);\n const range = options.range || {\n endPos: _file.content.length,\n startPos: 0,\n startLine: 0,\n startCol: 0,\n };\n this._cursor = options.escapedString\n ? new EscapedCharacterCursor(_file, range)\n : new PlainCharacterCursor(_file, range);\n this._preserveLineEndings = options.preserveLineEndings || false;\n this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;\n this._tokenizeBlocks = options.tokenizeBlocks ?? true;\n this._tokenizeLet = options.tokenizeLet ?? true;\n this._selectorlessEnabled = options.selectorlessEnabled ?? false;\n try {\n this._cursor.init();\n }\n catch (e) {\n this.handleError(e);\n }\n }\n _processCarriageReturns(content) {\n if (this._preserveLineEndings) {\n return content;\n }\n // https://www.w3.org/TR/html51/syntax.html#preprocessing-the-input-stream\n // In order to keep the original position in the source, we can not\n // pre-process it.\n // Instead CRs are processed right before instantiating the tokens.\n return content.replace(_CR_OR_CRLF_REGEXP, '\\n');\n }\n tokenize() {\n while (this._cursor.peek() !== $EOF) {\n const start = this._cursor.clone();\n try {\n if (this._attemptCharCode($LT)) {\n if (this._attemptCharCode($BANG)) {\n if (this._attemptCharCode($LBRACKET)) {\n this._consumeCdata(start);\n }\n else if (this._attemptCharCode($MINUS)) {\n this._consumeComment(start);\n }\n else {\n this._consumeDocType(start);\n }\n }\n else if (this._attemptCharCode($SLASH)) {\n this._consumeTagClose(start);\n }\n else {\n this._consumeTagOpen(start);\n }\n }\n else if (this._tokenizeLet &&\n // Use `peek` instead of `attempCharCode` since we\n // don't want to advance in case it's not `@let`.\n this._cursor.peek() === $AT &&\n !this._inInterpolation &&\n this._isLetStart()) {\n this._consumeLetDeclaration(start);\n }\n else if (this._tokenizeBlocks && this._isBlockStart()) {\n this._consumeBlockStart(start);\n }\n else if (this._tokenizeBlocks &&\n !this._inInterpolation &&\n !this._isInExpansionCase() &&\n !this._isInExpansionForm() &&\n this._attemptCharCode($RBRACE)) {\n this._consumeBlockEnd(start);\n }\n else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {\n // In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while\n // the premature end of an interpolation is given by the start of a new HTML element.\n this._consumeWithInterpolation(5 /* TokenType.TEXT */, 8 /* TokenType.INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());\n }\n }\n catch (e) {\n this.handleError(e);\n }\n }\n this._beginToken(41 /* TokenType.EOF */);\n this._endToken([]);\n }\n _getBlockName() {\n // This allows us to capture up something like `@else if`, but not `@ if`.\n let spacesInNameAllowed = false;\n const nameCursor = this._cursor.clone();\n this._attemptCharCodeUntilFn((code) => {\n if (isWhitespace(code)) {\n return !spacesInNameAllowed;\n }\n if (isBlockNameChar(code)) {\n spacesInNameAllowed = true;\n return false;\n }\n return true;\n });\n return this._cursor.getChars(nameCursor).trim();\n }\n _consumeBlockStart(start) {\n this._requireCharCode($AT);\n this._beginToken(24 /* TokenType.BLOCK_OPEN_START */, start);\n const startToken = this._endToken([this._getBlockName()]);\n if (this._cursor.peek() === $LPAREN) {\n // Advance past the opening paren.\n this._cursor.advance();\n // Capture the parameters.\n this._consumeBlockParameters();\n // Allow spaces before the closing paren.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (this._attemptCharCode($RPAREN)) {\n // Allow spaces after the paren.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n else {\n startToken.type = 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */;\n return;\n }\n }\n if (this._attemptCharCode($LBRACE)) {\n this._beginToken(25 /* TokenType.BLOCK_OPEN_END */);\n this._endToken([]);\n }\n else {\n startToken.type = 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */;\n }\n }\n _consumeBlockEnd(start) {\n this._beginToken(26 /* TokenType.BLOCK_CLOSE */, start);\n this._endToken([]);\n }\n _consumeBlockParameters() {\n // Trim the whitespace until the first parameter.\n this._attemptCharCodeUntilFn(isBlockParameterChar);\n while (this._cursor.peek() !== $RPAREN && this._cursor.peek() !== $EOF) {\n this._beginToken(27 /* TokenType.BLOCK_PARAMETER */);\n const start = this._cursor.clone();\n let inQuote = null;\n let openParens = 0;\n // Consume the parameter until the next semicolon or brace.\n // Note that we skip over semicolons/braces inside of strings.\n while ((this._cursor.peek() !== $SEMICOLON && this._cursor.peek() !== $EOF) ||\n inQuote !== null) {\n const char = this._cursor.peek();\n // Skip to the next character if it was escaped.\n if (char === $BACKSLASH) {\n this._cursor.advance();\n }\n else if (char === inQuote) {\n inQuote = null;\n }\n else if (inQuote === null && isQuote(char)) {\n inQuote = char;\n }\n else if (char === $LPAREN && inQuote === null) {\n openParens++;\n }\n else if (char === $RPAREN && inQuote === null) {\n if (openParens === 0) {\n break;\n }\n else if (openParens > 0) {\n openParens--;\n }\n }\n this._cursor.advance();\n }\n this._endToken([this._cursor.getChars(start)]);\n // Skip to the next parameter.\n this._attemptCharCodeUntilFn(isBlockParameterChar);\n }\n }\n _consumeLetDeclaration(start) {\n this._requireStr('@let');\n this._beginToken(29 /* TokenType.LET_START */, start);\n // Require at least one white space after the `@let`.\n if (isWhitespace(this._cursor.peek())) {\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n else {\n const token = this._endToken([this._cursor.getChars(start)]);\n token.type = 32 /* TokenType.INCOMPLETE_LET */;\n return;\n }\n const startToken = this._endToken([this._getLetDeclarationName()]);\n // Skip over white space before the equals character.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n // Expect an equals sign.\n if (!this._attemptCharCode($EQ)) {\n startToken.type = 32 /* TokenType.INCOMPLETE_LET */;\n return;\n }\n // Skip spaces after the equals.\n this._attemptCharCodeUntilFn((code) => isNotWhitespace(code) && !isNewLine(code));\n this._consumeLetDeclarationValue();\n // Terminate the `@let` with a semicolon.\n const endChar = this._cursor.peek();\n if (endChar === $SEMICOLON) {\n this._beginToken(31 /* TokenType.LET_END */);\n this._endToken([]);\n this._cursor.advance();\n }\n else {\n startToken.type = 32 /* TokenType.INCOMPLETE_LET */;\n startToken.sourceSpan = this._cursor.getSpan(start);\n }\n }\n _getLetDeclarationName() {\n const nameCursor = this._cursor.clone();\n let allowDigit = false;\n this._attemptCharCodeUntilFn((code) => {\n if (isAsciiLetter(code) ||\n code === $$ ||\n code === $_ ||\n // `@let` names can't start with a digit, but digits are valid anywhere else in the name.\n (allowDigit && isDigit(code))) {\n allowDigit = true;\n return false;\n }\n return true;\n });\n return this._cursor.getChars(nameCursor).trim();\n }\n _consumeLetDeclarationValue() {\n const start = this._cursor.clone();\n this._beginToken(30 /* TokenType.LET_VALUE */, start);\n while (this._cursor.peek() !== $EOF) {\n const char = this._cursor.peek();\n // `@let` declarations terminate with a semicolon.\n if (char === $SEMICOLON) {\n break;\n }\n // If we hit a quote, skip over its content since we don't care what's inside.\n if (isQuote(char)) {\n this._cursor.advance();\n this._attemptCharCodeUntilFn((inner) => {\n if (inner === $BACKSLASH) {\n this._cursor.advance();\n return false;\n }\n return inner === char;\n });\n }\n this._cursor.advance();\n }\n this._endToken([this._cursor.getChars(start)]);\n }\n /**\n * @returns whether an ICU token has been created\n * @internal\n */\n _tokenizeExpansionForm() {\n if (this.isExpansionFormStart()) {\n this._consumeExpansionFormStart();\n return true;\n }\n if (isExpansionCaseStart(this._cursor.peek()) && this._isInExpansionForm()) {\n this._consumeExpansionCaseStart();\n return true;\n }\n if (this._cursor.peek() === $RBRACE) {\n if (this._isInExpansionCase()) {\n this._consumeExpansionCaseEnd();\n return true;\n }\n if (this._isInExpansionForm()) {\n this._consumeExpansionFormEnd();\n return true;\n }\n }\n return false;\n }\n _beginToken(type, start = this._cursor.clone()) {\n this._currentTokenStart = start;\n this._currentTokenType = type;\n }\n _endToken(parts, end) {\n if (this._currentTokenStart === null) {\n throw new ParseError(this._cursor.getSpan(end), 'Programming error - attempted to end a token when there was no start to the token');\n }\n if (this._currentTokenType === null) {\n throw new ParseError(this._cursor.getSpan(this._currentTokenStart), 'Programming error - attempted to end a token which has no token type');\n }\n const token = {\n type: this._currentTokenType,\n parts,\n sourceSpan: (end ?? this._cursor).getSpan(this._currentTokenStart, this._leadingTriviaCodePoints),\n };\n this.tokens.push(token);\n this._currentTokenStart = null;\n this._currentTokenType = null;\n return token;\n }\n _createError(msg, span) {\n if (this._isInExpansionForm()) {\n msg += ` (Do you have an unescaped \"{\" in your template? Use \"{{ '{' }}\") to escape it.)`;\n }\n const error = new ParseError(span, msg);\n this._currentTokenStart = null;\n this._currentTokenType = null;\n return error;\n }\n handleError(e) {\n if (e instanceof CursorError) {\n e = this._createError(e.msg, this._cursor.getSpan(e.cursor));\n }\n if (e instanceof ParseError) {\n this.errors.push(e);\n }\n else {\n throw e;\n }\n }\n _attemptCharCode(charCode) {\n if (this._cursor.peek() === charCode) {\n this._cursor.advance();\n return true;\n }\n return false;\n }\n _attemptCharCodeCaseInsensitive(charCode) {\n if (compareCharCodeCaseInsensitive(this._cursor.peek(), charCode)) {\n this._cursor.advance();\n return true;\n }\n return false;\n }\n _requireCharCode(charCode) {\n const location = this._cursor.clone();\n if (!this._attemptCharCode(charCode)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));\n }\n }\n _attemptStr(chars) {\n const len = chars.length;\n if (this._cursor.charsLeft() < len) {\n return false;\n }\n const initialPosition = this._cursor.clone();\n for (let i = 0; i < len; i++) {\n if (!this._attemptCharCode(chars.charCodeAt(i))) {\n // If attempting to parse the string fails, we want to reset the parser\n // to where it was before the attempt\n this._cursor = initialPosition;\n return false;\n }\n }\n return true;\n }\n _attemptStrCaseInsensitive(chars) {\n for (let i = 0; i < chars.length; i++) {\n if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {\n return false;\n }\n }\n return true;\n }\n _requireStr(chars) {\n const location = this._cursor.clone();\n if (!this._attemptStr(chars)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location));\n }\n }\n _attemptCharCodeUntilFn(predicate) {\n while (!predicate(this._cursor.peek())) {\n this._cursor.advance();\n }\n }\n _requireCharCodeUntilFn(predicate, len) {\n const start = this._cursor.clone();\n this._attemptCharCodeUntilFn(predicate);\n if (this._cursor.diff(start) < len) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));\n }\n }\n _attemptUntilChar(char) {\n while (this._cursor.peek() !== char) {\n this._cursor.advance();\n }\n }\n _readChar() {\n // Don't rely upon reading directly from `_input` as the actual char value\n // may have been generated from an escape sequence.\n const char = String.fromCodePoint(this._cursor.peek());\n this._cursor.advance();\n return char;\n }\n _peekStr(chars) {\n const len = chars.length;\n if (this._cursor.charsLeft() < len) {\n return false;\n }\n const cursor = this._cursor.clone();\n for (let i = 0; i < len; i++) {\n if (cursor.peek() !== chars.charCodeAt(i)) {\n return false;\n }\n cursor.advance();\n }\n return true;\n }\n _isBlockStart() {\n return (this._cursor.peek() === $AT &&\n SUPPORTED_BLOCKS.some((blockName) => this._peekStr(blockName)));\n }\n _isLetStart() {\n return this._cursor.peek() === $AT && this._peekStr('@let');\n }\n _consumeEntity(textTokenType) {\n this._beginToken(9 /* TokenType.ENCODED_ENTITY */);\n const start = this._cursor.clone();\n this._cursor.advance();\n if (this._attemptCharCode($HASH)) {\n const isHex = this._attemptCharCode($x) || this._attemptCharCode($X);\n const codeStart = this._cursor.clone();\n this._attemptCharCodeUntilFn(isDigitEntityEnd);\n if (this._cursor.peek() != $SEMICOLON) {\n // Advance cursor to include the peeked character in the string provided to the error\n // message.\n this._cursor.advance();\n const entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC;\n throw this._createError(_unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)), this._cursor.getSpan());\n }\n const strNum = this._cursor.getChars(codeStart);\n this._cursor.advance();\n try {\n const charCode = parseInt(strNum, isHex ? 16 : 10);\n this._endToken([String.fromCharCode(charCode), this._cursor.getChars(start)]);\n }\n catch {\n throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan());\n }\n }\n else {\n const nameStart = this._cursor.clone();\n this._attemptCharCodeUntilFn(isNamedEntityEnd);\n if (this._cursor.peek() != $SEMICOLON) {\n // No semicolon was found so abort the encoded entity token that was in progress, and treat\n // this as a text token\n this._beginToken(textTokenType, start);\n this._cursor = nameStart;\n this._endToken(['&']);\n }\n else {\n const name = this._cursor.getChars(nameStart);\n this._cursor.advance();\n const char = NAMED_ENTITIES.hasOwnProperty(name) && NAMED_ENTITIES[name];\n if (!char) {\n throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start));\n }\n this._endToken([char, `&${name};`]);\n }\n }\n }\n _consumeRawText(consumeEntities, endMarkerPredicate) {\n this._beginToken(consumeEntities ? 6 /* TokenType.ESCAPABLE_RAW_TEXT */ : 7 /* TokenType.RAW_TEXT */);\n const parts = [];\n while (true) {\n const tagCloseStart = this._cursor.clone();\n const foundEndMarker = endMarkerPredicate();\n this._cursor = tagCloseStart;\n if (foundEndMarker) {\n break;\n }\n if (consumeEntities && this._cursor.peek() === $AMPERSAND) {\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n parts.length = 0;\n this._consumeEntity(6 /* TokenType.ESCAPABLE_RAW_TEXT */);\n this._beginToken(6 /* TokenType.ESCAPABLE_RAW_TEXT */);\n }\n else {\n parts.push(this._readChar());\n }\n }\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n }\n _consumeComment(start) {\n this._beginToken(10 /* TokenType.COMMENT_START */, start);\n this._requireCharCode($MINUS);\n this._endToken([]);\n this._consumeRawText(false, () => this._attemptStr('-->'));\n this._beginToken(11 /* TokenType.COMMENT_END */);\n this._requireStr('-->');\n this._endToken([]);\n }\n _consumeCdata(start) {\n this._beginToken(12 /* TokenType.CDATA_START */, start);\n this._requireStr('CDATA[');\n this._endToken([]);\n this._consumeRawText(false, () => this._attemptStr(']]>'));\n this._beginToken(13 /* TokenType.CDATA_END */);\n this._requireStr(']]>');\n this._endToken([]);\n }\n _consumeDocType(start) {\n this._beginToken(18 /* TokenType.DOC_TYPE */, start);\n const contentStart = this._cursor.clone();\n this._attemptUntilChar($GT);\n const content = this._cursor.getChars(contentStart);\n this._cursor.advance();\n this._endToken([content]);\n }\n _consumePrefixAndName(endPredicate) {\n const nameOrPrefixStart = this._cursor.clone();\n let prefix = '';\n while (this._cursor.peek() !== $COLON && !isPrefixEnd(this._cursor.peek())) {\n this._cursor.advance();\n }\n let nameStart;\n if (this._cursor.peek() === $COLON) {\n prefix = this._cursor.getChars(nameOrPrefixStart);\n this._cursor.advance();\n nameStart = this._cursor.clone();\n }\n else {\n nameStart = nameOrPrefixStart;\n }\n this._requireCharCodeUntilFn(endPredicate, prefix === '' ? 0 : 1);\n const name = this._cursor.getChars(nameStart);\n return [prefix, name];\n }\n _consumeTagOpen(start) {\n let tagName;\n let prefix;\n let closingTagName;\n let openToken;\n try {\n if (this._selectorlessEnabled && isSelectorlessNameStart(this._cursor.peek())) {\n openToken = this._consumeComponentOpenStart(start);\n [closingTagName, prefix, tagName] = openToken.parts;\n if (prefix) {\n closingTagName += `:${prefix}`;\n }\n if (tagName) {\n closingTagName += `:${tagName}`;\n }\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n else {\n if (!isAsciiLetter(this._cursor.peek())) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));\n }\n openToken = this._consumeTagOpenStart(start);\n prefix = openToken.parts[0];\n tagName = closingTagName = openToken.parts[1];\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n while (!isAttributeTerminator(this._cursor.peek())) {\n if (this._selectorlessEnabled && this._cursor.peek() === $AT) {\n const start = this._cursor.clone();\n const nameStart = start.clone();\n nameStart.advance();\n if (isSelectorlessNameStart(nameStart.peek())) {\n this._consumeDirective(start, nameStart);\n }\n }\n else {\n this._consumeAttribute();\n }\n }\n if (openToken.type === 33 /* TokenType.COMPONENT_OPEN_START */) {\n this._consumeComponentOpenEnd();\n }\n else {\n this._consumeTagOpenEnd();\n }\n }\n catch (e) {\n if (e instanceof ParseError) {\n if (openToken) {\n // We errored before we could close the opening tag, so it is incomplete.\n openToken.type =\n openToken.type === 33 /* TokenType.COMPONENT_OPEN_START */\n ? 37 /* TokenType.INCOMPLETE_COMPONENT_OPEN */\n : 4 /* TokenType.INCOMPLETE_TAG_OPEN */;\n }\n else {\n // When the start tag is invalid, assume we want a \"<\" as text.\n // Back to back text tokens are merged at the end.\n this._beginToken(5 /* TokenType.TEXT */, start);\n this._endToken(['<']);\n }\n return;\n }\n throw e;\n }\n const contentTokenType = this._getTagDefinition(tagName).getContentType(prefix);\n if (contentTokenType === TagContentType.RAW_TEXT) {\n this._consumeRawTextWithTagClose(openToken, closingTagName, false);\n }\n else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {\n this._consumeRawTextWithTagClose(openToken, closingTagName, true);\n }\n }\n _consumeRawTextWithTagClose(openToken, tagName, consumeEntities) {\n this._consumeRawText(consumeEntities, () => {\n if (!this._attemptCharCode($LT))\n return false;\n if (!this._attemptCharCode($SLASH))\n return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (!this._attemptStrCaseInsensitive(tagName))\n return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n return this._attemptCharCode($GT);\n });\n this._beginToken(openToken.type === 33 /* TokenType.COMPONENT_OPEN_START */\n ? 36 /* TokenType.COMPONENT_CLOSE */\n : 3 /* TokenType.TAG_CLOSE */);\n this._requireCharCodeUntilFn((code) => code === $GT, 3);\n this._cursor.advance(); // Consume the `>`\n this._endToken(openToken.parts);\n }\n _consumeTagOpenStart(start) {\n this._beginToken(0 /* TokenType.TAG_OPEN_START */, start);\n const parts = this._consumePrefixAndName(isNameEnd);\n return this._endToken(parts);\n }\n _consumeComponentOpenStart(start) {\n this._beginToken(33 /* TokenType.COMPONENT_OPEN_START */, start);\n const parts = this._consumeComponentName();\n return this._endToken(parts);\n }\n _consumeComponentName() {\n const nameStart = this._cursor.clone();\n while (isSelectorlessNameChar(this._cursor.peek())) {\n this._cursor.advance();\n }\n const name = this._cursor.getChars(nameStart);\n let prefix = '';\n let tagName = '';\n if (this._cursor.peek() === $COLON) {\n this._cursor.advance();\n [prefix, tagName] = this._consumePrefixAndName(isNameEnd);\n }\n return [name, prefix, tagName];\n }\n _consumeAttribute() {\n this._consumeAttributeName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (this._attemptCharCode($EQ)) {\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._consumeAttributeValue();\n }\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n _consumeAttributeName() {\n const attrNameStart = this._cursor.peek();\n if (attrNameStart === $SQ || attrNameStart === $DQ) {\n throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());\n }\n this._beginToken(14 /* TokenType.ATTR_NAME */);\n let nameEndPredicate;\n if (this._openDirectiveCount > 0) {\n // If we're parsing attributes inside of directive syntax, we have to terminate the name\n // on the first non-matching closing paren. For example, if we have `@Dir(someAttr)`,\n // `@Dir` and `(` will have already been captured as `DIRECTIVE_NAME` and `DIRECTIVE_OPEN`\n // respectively, but the `)` will get captured as a part of the name for `someAttr`\n // because normally that would be an event binding.\n let openParens = 0;\n nameEndPredicate = (code) => {\n if (this._openDirectiveCount > 0) {\n if (code === $LPAREN) {\n openParens++;\n }\n else if (code === $RPAREN) {\n if (openParens === 0) {\n return true;\n }\n openParens--;\n }\n }\n return isNameEnd(code);\n };\n }\n else {\n nameEndPredicate = isNameEnd;\n }\n const prefixAndName = this._consumePrefixAndName(nameEndPredicate);\n this._endToken(prefixAndName);\n }\n _consumeAttributeValue() {\n if (this._cursor.peek() === $SQ || this._cursor.peek() === $DQ) {\n const quoteChar = this._cursor.peek();\n this._consumeQuote(quoteChar);\n // In an attribute then end of the attribute value and the premature end to an interpolation\n // are both triggered by the `quoteChar`.\n const endPredicate = () => this._cursor.peek() === quoteChar;\n this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);\n this._consumeQuote(quoteChar);\n }\n else {\n const endPredicate = () => isNameEnd(this._cursor.peek());\n this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);\n }\n }\n _consumeQuote(quoteChar) {\n this._beginToken(15 /* TokenType.ATTR_QUOTE */);\n this._requireCharCode(quoteChar);\n this._endToken([String.fromCodePoint(quoteChar)]);\n }\n _consumeTagOpenEnd() {\n const tokenType = this._attemptCharCode($SLASH)\n ? 2 /* TokenType.TAG_OPEN_END_VOID */\n : 1 /* TokenType.TAG_OPEN_END */;\n this._beginToken(tokenType);\n this._requireCharCode($GT);\n this._endToken([]);\n }\n _consumeComponentOpenEnd() {\n const tokenType = this._attemptCharCode($SLASH)\n ? 35 /* TokenType.COMPONENT_OPEN_END_VOID */\n : 34 /* TokenType.COMPONENT_OPEN_END */;\n this._beginToken(tokenType);\n this._requireCharCode($GT);\n this._endToken([]);\n }\n _consumeTagClose(start) {\n if (this._selectorlessEnabled) {\n const clone = start.clone();\n while (clone.peek() !== $GT && !isSelectorlessNameStart(clone.peek())) {\n clone.advance();\n }\n if (isSelectorlessNameStart(clone.peek())) {\n this._beginToken(36 /* TokenType.COMPONENT_CLOSE */, start);\n const parts = this._consumeComponentName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._requireCharCode($GT);\n this._endToken(parts);\n return;\n }\n }\n this._beginToken(3 /* TokenType.TAG_CLOSE */, start);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n const prefixAndName = this._consumePrefixAndName(isNameEnd);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._requireCharCode($GT);\n this._endToken(prefixAndName);\n }\n _consumeExpansionFormStart() {\n this._beginToken(19 /* TokenType.EXPANSION_FORM_START */);\n this._requireCharCode($LBRACE);\n this._endToken([]);\n this._expansionCaseStack.push(19 /* TokenType.EXPANSION_FORM_START */);\n this._beginToken(7 /* TokenType.RAW_TEXT */);\n const condition = this._readUntil($COMMA);\n const normalizedCondition = this._processCarriageReturns(condition);\n if (this._i18nNormalizeLineEndingsInICUs) {\n // We explicitly want to normalize line endings for this text.\n this._endToken([normalizedCondition]);\n }\n else {\n // We are not normalizing line endings.\n const conditionToken = this._endToken([condition]);\n if (normalizedCondition !== condition) {\n this.nonNormalizedIcuExpressions.push(conditionToken);\n }\n }\n this._requireCharCode($COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(7 /* TokenType.RAW_TEXT */);\n const type = this._readUntil($COMMA);\n this._endToken([type]);\n this._requireCharCode($COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n _consumeExpansionCaseStart() {\n this._beginToken(20 /* TokenType.EXPANSION_CASE_VALUE */);\n const value = this._readUntil($LBRACE).trim();\n this._endToken([value]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(21 /* TokenType.EXPANSION_CASE_EXP_START */);\n this._requireCharCode($LBRACE);\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.push(21 /* TokenType.EXPANSION_CASE_EXP_START */);\n }\n _consumeExpansionCaseEnd() {\n this._beginToken(22 /* TokenType.EXPANSION_CASE_EXP_END */);\n this._requireCharCode($RBRACE);\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.pop();\n }\n _consumeExpansionFormEnd() {\n this._beginToken(23 /* TokenType.EXPANSION_FORM_END */);\n this._requireCharCode($RBRACE);\n this._endToken([]);\n this._expansionCaseStack.pop();\n }\n /**\n * Consume a string that may contain interpolation expressions.\n *\n * The first token consumed will be of `tokenType` and then there will be alternating\n * `interpolationTokenType` and `tokenType` tokens until the `endPredicate()` returns true.\n *\n * If an interpolation token ends prematurely it will have no end marker in its `parts` array.\n *\n * @param textTokenType the kind of tokens to interleave around interpolation tokens.\n * @param interpolationTokenType the kind of tokens that contain interpolation.\n * @param endPredicate a function that should return true when we should stop consuming.\n * @param endInterpolation a function that should return true if there is a premature end to an\n * interpolation expression - i.e. before we get to the normal interpolation closing marker.\n */\n _consumeWithInterpolation(textTokenType, interpolationTokenType, endPredicate, endInterpolation) {\n this._beginToken(textTokenType);\n const parts = [];\n while (!endPredicate()) {\n const current = this._cursor.clone();\n if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {\n this._endToken([this._processCarriageReturns(parts.join(''))], current);\n parts.length = 0;\n this._consumeInterpolation(interpolationTokenType, current, endInterpolation);\n this._beginToken(textTokenType);\n }\n else if (this._cursor.peek() === $AMPERSAND) {\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n parts.length = 0;\n this._consumeEntity(textTokenType);\n this._beginToken(textTokenType);\n }\n else {\n parts.push(this._readChar());\n }\n }\n // It is possible that an interpolation was started but not ended inside this text token.\n // Make sure that we reset the state of the lexer correctly.\n this._inInterpolation = false;\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n }\n /**\n * Consume a block of text that has been interpreted as an Angular interpolation.\n *\n * @param interpolationTokenType the type of the interpolation token to generate.\n * @param interpolationStart a cursor that points to the start of this interpolation.\n * @param prematureEndPredicate a function that should return true if the next characters indicate\n * an end to the interpolation before its normal closing marker.\n */\n _consumeInterpolation(interpolationTokenType, interpolationStart, prematureEndPredicate) {\n const parts = [];\n this._beginToken(interpolationTokenType, interpolationStart);\n parts.push(this._interpolationConfig.start);\n // Find the end of the interpolation, ignoring content inside quotes.\n const expressionStart = this._cursor.clone();\n let inQuote = null;\n let inComment = false;\n while (this._cursor.peek() !== $EOF &&\n (prematureEndPredicate === null || !prematureEndPredicate())) {\n const current = this._cursor.clone();\n if (this._isTagStart()) {\n // We are starting what looks like an HTML element in the middle of this interpolation.\n // Reset the cursor to before the `<` character and end the interpolation token.\n // (This is actually wrong but here for backward compatibility).\n this._cursor = current;\n parts.push(this._getProcessedChars(expressionStart, current));\n this._endToken(parts);\n return;\n }\n if (inQuote === null) {\n if (this._attemptStr(this._interpolationConfig.end)) {\n // We are not in a string, and we hit the end interpolation marker\n parts.push(this._getProcessedChars(expressionStart, current));\n parts.push(this._interpolationConfig.end);\n this._endToken(parts);\n return;\n }\n else if (this._attemptStr('//')) {\n // Once we are in a comment we ignore any quotes\n inComment = true;\n }\n }\n const char = this._cursor.peek();\n this._cursor.advance();\n if (char === $BACKSLASH) {\n // Skip the next character because it was escaped.\n this._cursor.advance();\n }\n else if (char === inQuote) {\n // Exiting the current quoted string\n inQuote = null;\n }\n else if (!inComment && inQuote === null && isQuote(char)) {\n // Entering a new quoted string\n inQuote = char;\n }\n }\n // We hit EOF without finding a closing interpolation marker\n parts.push(this._getProcessedChars(expressionStart, this._cursor));\n this._endToken(parts);\n }\n _consumeDirective(start, nameStart) {\n this._requireCharCode($AT);\n // Skip over the @ since it's not part of the name.\n this._cursor.advance();\n // Capture the rest of the name.\n while (isSelectorlessNameChar(this._cursor.peek())) {\n this._cursor.advance();\n }\n // Capture the opening token.\n this._beginToken(38 /* TokenType.DIRECTIVE_NAME */, start);\n const name = this._cursor.getChars(nameStart);\n this._endToken([name]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n // Optionally there might be attributes bound to the specific directive.\n // Stop parsing if there's no opening character for them.\n if (this._cursor.peek() !== $LPAREN) {\n return;\n }\n this._openDirectiveCount++;\n this._beginToken(39 /* TokenType.DIRECTIVE_OPEN */);\n this._cursor.advance();\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n // Capture all the attributes until we hit a closing paren.\n while (!isAttributeTerminator(this._cursor.peek()) && this._cursor.peek() !== $RPAREN) {\n this._consumeAttribute();\n }\n // Trim any trailing whitespace.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._openDirectiveCount--;\n if (this._cursor.peek() !== $RPAREN) {\n // Stop parsing, instead of throwing, if we've hit the end of the tag.\n // This can be handled better later when turning the tokens into AST.\n if (this._cursor.peek() === $GT || this._cursor.peek() === $SLASH) {\n return;\n }\n throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));\n }\n // Capture the closing token.\n this._beginToken(40 /* TokenType.DIRECTIVE_CLOSE */);\n this._cursor.advance();\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n _getProcessedChars(start, end) {\n return this._processCarriageReturns(end.getChars(start));\n }\n _isTextEnd() {\n if (this._isTagStart() || this._cursor.peek() === $EOF) {\n return true;\n }\n if (this._tokenizeIcu && !this._inInterpolation) {\n if (this.isExpansionFormStart()) {\n // start of an expansion form\n return true;\n }\n if (this._cursor.peek() === $RBRACE && this._isInExpansionCase()) {\n // end of and expansion case\n return true;\n }\n }\n if (this._tokenizeBlocks &&\n !this._inInterpolation &&\n !this._isInExpansion() &&\n (this._isBlockStart() || this._isLetStart() || this._cursor.peek() === $RBRACE)) {\n return true;\n }\n return false;\n }\n /**\n * Returns true if the current cursor is pointing to the start of a tag\n * (opening/closing/comments/cdata/etc).\n */\n _isTagStart() {\n if (this._cursor.peek() === $LT) {\n // We assume that `<` followed by whitespace is not the start of an HTML element.\n const tmp = this._cursor.clone();\n tmp.advance();\n // If the next character is alphabetic, ! nor / then it is a tag start\n const code = tmp.peek();\n if (($a <= code && code <= $z) ||\n ($A <= code && code <= $Z) ||\n code === $SLASH ||\n code === $BANG) {\n return true;\n }\n }\n return false;\n }\n _readUntil(char) {\n const start = this._cursor.clone();\n this._attemptUntilChar(char);\n return this._cursor.getChars(start);\n }\n _isInExpansion() {\n return this._isInExpansionCase() || this._isInExpansionForm();\n }\n _isInExpansionCase() {\n return (this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n 21 /* TokenType.EXPANSION_CASE_EXP_START */);\n }\n _isInExpansionForm() {\n return (this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n 19 /* TokenType.EXPANSION_FORM_START */);\n }\n isExpansionFormStart() {\n if (this._cursor.peek() !== $LBRACE) {\n return false;\n }\n if (this._interpolationConfig) {\n const start = this._cursor.clone();\n const isInterpolation = this._attemptStr(this._interpolationConfig.start);\n this._cursor = start;\n return !isInterpolation;\n }\n return true;\n }\n}\nfunction isNotWhitespace(code) {\n return !isWhitespace(code) || code === $EOF;\n}\nfunction isNameEnd(code) {\n return (isWhitespace(code) ||\n code === $GT ||\n code === $LT ||\n code === $SLASH ||\n code === $SQ ||\n code === $DQ ||\n code === $EQ ||\n code === $EOF);\n}\nfunction isPrefixEnd(code) {\n return ((code < $a || $z < code) &&\n (code < $A || $Z < code) &&\n (code < $0 || code > $9));\n}\nfunction isDigitEntityEnd(code) {\n return code === $SEMICOLON || code === $EOF || !isAsciiHexDigit(code);\n}\nfunction isNamedEntityEnd(code) {\n return code === $SEMICOLON || code === $EOF || !isAsciiLetter(code);\n}\nfunction isExpansionCaseStart(peek) {\n return peek !== $RBRACE;\n}\nfunction compareCharCodeCaseInsensitive(code1, code2) {\n return toUpperCaseCharCode(code1) === toUpperCaseCharCode(code2);\n}\nfunction toUpperCaseCharCode(code) {\n return code >= $a && code <= $z ? code - $a + $A : code;\n}\nfunction isBlockNameChar(code) {\n return isAsciiLetter(code) || isDigit(code) || code === $_;\n}\nfunction isBlockParameterChar(code) {\n return code !== $SEMICOLON && isNotWhitespace(code);\n}\nfunction isSelectorlessNameStart(code) {\n return code === $_ || (code >= $A && code <= $Z);\n}\nfunction isSelectorlessNameChar(code) {\n return isAsciiLetter(code) || isDigit(code) || code === $_;\n}\nfunction isAttributeTerminator(code) {\n return code === $SLASH || code === $GT || code === $LT || code === $EOF;\n}\nfunction mergeTextTokens(srcTokens) {\n const dstTokens = [];\n let lastDstToken = undefined;\n for (let i = 0; i < srcTokens.length; i++) {\n const token = srcTokens[i];\n if ((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */) ||\n (lastDstToken &&\n lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ &&\n token.type === 16 /* TokenType.ATTR_VALUE_TEXT */)) {\n lastDstToken.parts[0] += token.parts[0];\n lastDstToken.sourceSpan.end = token.sourceSpan.end;\n }\n else {\n lastDstToken = token;\n dstTokens.push(lastDstToken);\n }\n }\n return dstTokens;\n}\nclass PlainCharacterCursor {\n state;\n file;\n input;\n end;\n constructor(fileOrCursor, range) {\n if (fileOrCursor instanceof PlainCharacterCursor) {\n this.file = fileOrCursor.file;\n this.input = fileOrCursor.input;\n this.end = fileOrCursor.end;\n const state = fileOrCursor.state;\n // Note: avoid using `{...fileOrCursor.state}` here as that has a severe performance penalty.\n // In ES5 bundles the object spread operator is translated into the `__assign` helper, which\n // is not optimized by VMs as efficiently as a raw object literal. Since this constructor is\n // called in tight loops, this difference matters.\n this.state = {\n peek: state.peek,\n offset: state.offset,\n line: state.line,\n column: state.column,\n };\n }\n else {\n if (!range) {\n throw new Error('Programming error: the range argument must be provided with a file argument.');\n }\n this.file = fileOrCursor;\n this.input = fileOrCursor.content;\n this.end = range.endPos;\n this.state = {\n peek: -1,\n offset: range.startPos,\n line: range.startLine,\n column: range.startCol,\n };\n }\n }\n clone() {\n return new PlainCharacterCursor(this);\n }\n peek() {\n return this.state.peek;\n }\n charsLeft() {\n return this.end - this.state.offset;\n }\n diff(other) {\n return this.state.offset - other.state.offset;\n }\n advance() {\n this.advanceState(this.state);\n }\n init() {\n this.updatePeek(this.state);\n }\n getSpan(start, leadingTriviaCodePoints) {\n start = start || this;\n let fullStart = start;\n if (leadingTriviaCodePoints) {\n while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {\n if (fullStart === start) {\n start = start.clone();\n }\n start.advance();\n }\n }\n const startLocation = this.locationFromCursor(start);\n const endLocation = this.locationFromCursor(this);\n const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;\n return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);\n }\n getChars(start) {\n return this.input.substring(start.state.offset, this.state.offset);\n }\n charAt(pos) {\n return this.input.charCodeAt(pos);\n }\n advanceState(state) {\n if (state.offset >= this.end) {\n this.state = state;\n throw new CursorError('Unexpected character \"EOF\"', this);\n }\n const currentChar = this.charAt(state.offset);\n if (currentChar === $LF) {\n state.line++;\n state.column = 0;\n }\n else if (!isNewLine(currentChar)) {\n state.column++;\n }\n state.offset++;\n this.updatePeek(state);\n }\n updatePeek(state) {\n state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);\n }\n locationFromCursor(cursor) {\n return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);\n }\n}\nclass EscapedCharacterCursor extends PlainCharacterCursor {\n internalState;\n constructor(fileOrCursor, range) {\n if (fileOrCursor instanceof EscapedCharacterCursor) {\n super(fileOrCursor);\n this.internalState = { ...fileOrCursor.internalState };\n }\n else {\n super(fileOrCursor, range);\n this.internalState = this.state;\n }\n }\n advance() {\n this.state = this.internalState;\n super.advance();\n this.processEscapeSequence();\n }\n init() {\n super.init();\n this.processEscapeSequence();\n }\n clone() {\n return new EscapedCharacterCursor(this);\n }\n getChars(start) {\n const cursor = start.clone();\n let chars = '';\n while (cursor.internalState.offset < this.internalState.offset) {\n chars += String.fromCodePoint(cursor.peek());\n cursor.advance();\n }\n return chars;\n }\n /**\n * Process the escape sequence that starts at the current position in the text.\n *\n * This method is called to ensure that `peek` has the unescaped value of escape sequences.\n */\n processEscapeSequence() {\n const peek = () => this.internalState.peek;\n if (peek() === $BACKSLASH) {\n // We have hit an escape sequence so we need the internal state to become independent\n // of the external state.\n this.internalState = { ...this.state };\n // Move past the backslash\n this.advanceState(this.internalState);\n // First check for standard control char sequences\n if (peek() === $n) {\n this.state.peek = $LF;\n }\n else if (peek() === $r) {\n this.state.peek = $CR;\n }\n else if (peek() === $v) {\n this.state.peek = $VTAB;\n }\n else if (peek() === $t) {\n this.state.peek = $TAB;\n }\n else if (peek() === $b) {\n this.state.peek = $BSPACE;\n }\n else if (peek() === $f) {\n this.state.peek = $FF;\n }\n // Now consider more complex sequences\n else if (peek() === $u) {\n // Unicode code-point sequence\n this.advanceState(this.internalState); // advance past the `u` char\n if (peek() === $LBRACE) {\n // Variable length Unicode, e.g. `\\x{123}`\n this.advanceState(this.internalState); // advance past the `{` char\n // Advance past the variable number of hex digits until we hit a `}` char\n const digitStart = this.clone();\n let length = 0;\n while (peek() !== $RBRACE) {\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = this.decodeHexDigits(digitStart, length);\n }\n else {\n // Fixed length Unicode, e.g. `\\u1234`\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 4);\n }\n }\n else if (peek() === $x) {\n // Hex char code, e.g. `\\x2F`\n this.advanceState(this.internalState); // advance past the `x` char\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 2);\n }\n else if (isOctalDigit(peek())) {\n // Octal char code, e.g. `\\012`,\n let octal = '';\n let length = 0;\n let previous = this.clone();\n while (isOctalDigit(peek()) && length < 3) {\n previous = this.clone();\n octal += String.fromCodePoint(peek());\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = parseInt(octal, 8);\n // Backup one char\n this.internalState = previous.internalState;\n }\n else if (isNewLine(this.internalState.peek)) {\n // Line continuation `\\` followed by a new line\n this.advanceState(this.internalState); // advance over the newline\n this.state = this.internalState;\n }\n else {\n // If none of the `if` blocks were executed then we just have an escaped normal character.\n // In that case we just, effectively, skip the backslash from the character.\n this.state.peek = this.internalState.peek;\n }\n }\n }\n decodeHexDigits(start, length) {\n const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);\n const charCode = parseInt(hex, 16);\n if (!isNaN(charCode)) {\n return charCode;\n }\n else {\n start.state = start.internalState;\n throw new CursorError('Invalid hexadecimal escape sequence', start);\n }\n }\n}\nclass CursorError extends Error {\n msg;\n cursor;\n constructor(msg, cursor) {\n super(msg);\n this.msg = msg;\n this.cursor = cursor;\n // Extending `Error` does not always work when code is transpiled. See:\n // https://stackoverflow.com/questions/41102060/typescript-extending-error-class\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nclass TreeError extends ParseError {\n elementName;\n static create(elementName, span, msg) {\n return new TreeError(elementName, span, msg);\n }\n constructor(elementName, span, msg) {\n super(span, msg);\n this.elementName = elementName;\n }\n}\nclass ParseTreeResult {\n rootNodes;\n errors;\n constructor(rootNodes, errors) {\n this.rootNodes = rootNodes;\n this.errors = errors;\n }\n}\nlet Parser$1 = class Parser {\n getTagDefinition;\n constructor(getTagDefinition) {\n this.getTagDefinition = getTagDefinition;\n }\n parse(source, url, options) {\n const tokenizeResult = tokenize(source, url, this.getTagDefinition, options);\n const parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition);\n parser.build();\n return new ParseTreeResult(parser.rootNodes, [...tokenizeResult.errors, ...parser.errors]);\n }\n};\nclass _TreeBuilder {\n tokens;\n tagDefinitionResolver;\n _index = -1;\n // `_peek` will be initialized by the call to `_advance()` in the constructor.\n _peek;\n _containerStack = [];\n rootNodes = [];\n errors = [];\n constructor(tokens, tagDefinitionResolver) {\n this.tokens = tokens;\n this.tagDefinitionResolver = tagDefinitionResolver;\n this._advance();\n }\n build() {\n while (this._peek.type !== 41 /* TokenType.EOF */) {\n if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ ||\n this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {\n this._consumeElementStartTag(this._advance());\n }\n else if (this._peek.type === 3 /* TokenType.TAG_CLOSE */) {\n this._consumeElementEndTag(this._advance());\n }\n else if (this._peek.type === 12 /* TokenType.CDATA_START */) {\n this._closeVoidElement();\n this._consumeCdata(this._advance());\n }\n else if (this._peek.type === 10 /* TokenType.COMMENT_START */) {\n this._closeVoidElement();\n this._consumeComment(this._advance());\n }\n else if (this._peek.type === 5 /* TokenType.TEXT */ ||\n this._peek.type === 7 /* TokenType.RAW_TEXT */ ||\n this._peek.type === 6 /* TokenType.ESCAPABLE_RAW_TEXT */) {\n this._closeVoidElement();\n this._consumeText(this._advance());\n }\n else if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */) {\n this._consumeExpansion(this._advance());\n }\n else if (this._peek.type === 24 /* TokenType.BLOCK_OPEN_START */) {\n this._closeVoidElement();\n this._consumeBlockOpen(this._advance());\n }\n else if (this._peek.type === 26 /* TokenType.BLOCK_CLOSE */) {\n this._closeVoidElement();\n this._consumeBlockClose(this._advance());\n }\n else if (this._peek.type === 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */) {\n this._closeVoidElement();\n this._consumeIncompleteBlock(this._advance());\n }\n else if (this._peek.type === 29 /* TokenType.LET_START */) {\n this._closeVoidElement();\n this._consumeLet(this._advance());\n }\n else if (this._peek.type === 32 /* TokenType.INCOMPLETE_LET */) {\n this._closeVoidElement();\n this._consumeIncompleteLet(this._advance());\n }\n else if (this._peek.type === 33 /* TokenType.COMPONENT_OPEN_START */ ||\n this._peek.type === 37 /* TokenType.INCOMPLETE_COMPONENT_OPEN */) {\n this._consumeComponentStartTag(this._advance());\n }\n else if (this._peek.type === 36 /* TokenType.COMPONENT_CLOSE */) {\n this._consumeComponentEndTag(this._advance());\n }\n else {\n // Skip all other tokens...\n this._advance();\n }\n }\n for (const leftoverContainer of this._containerStack) {\n // Unlike HTML elements, blocks aren't closed implicitly by the end of the file.\n if (leftoverContainer instanceof Block) {\n this.errors.push(TreeError.create(leftoverContainer.name, leftoverContainer.sourceSpan, `Unclosed block \"${leftoverContainer.name}\"`));\n }\n }\n }\n _advance() {\n const prev = this._peek;\n if (this._index < this.tokens.length - 1) {\n // Note: there is always an EOF token at the end\n this._index++;\n }\n this._peek = this.tokens[this._index];\n return prev;\n }\n _advanceIf(type) {\n if (this._peek.type === type) {\n return this._advance();\n }\n return null;\n }\n _consumeCdata(_startToken) {\n this._consumeText(this._advance());\n this._advanceIf(13 /* TokenType.CDATA_END */);\n }\n _consumeComment(token) {\n const text = this._advanceIf(7 /* TokenType.RAW_TEXT */);\n const endToken = this._advanceIf(11 /* TokenType.COMMENT_END */);\n const value = text != null ? text.parts[0].trim() : null;\n const sourceSpan = endToken == null\n ? token.sourceSpan\n : new ParseSourceSpan(token.sourceSpan.start, endToken.sourceSpan.end, token.sourceSpan.fullStart);\n this._addToParent(new Comment(value, sourceSpan));\n }\n _consumeExpansion(token) {\n const switchValue = this._advance();\n const type = this._advance();\n const cases = [];\n // read =\n while (this._peek.type === 20 /* TokenType.EXPANSION_CASE_VALUE */) {\n const expCase = this._parseExpansionCase();\n if (!expCase)\n return; // error\n cases.push(expCase);\n }\n // read the final }\n if (this._peek.type !== 23 /* TokenType.EXPANSION_FORM_END */) {\n this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return;\n }\n const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);\n this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));\n this._advance();\n }\n _parseExpansionCase() {\n const value = this._advance();\n // read {\n if (this._peek.type !== 21 /* TokenType.EXPANSION_CASE_EXP_START */) {\n this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));\n return null;\n }\n // read until }\n const start = this._advance();\n const exp = this._collectExpansionExpTokens(start);\n if (!exp)\n return null;\n const end = this._advance();\n exp.push({ type: 41 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });\n // parse everything in between { and }\n const expansionCaseParser = new _TreeBuilder(exp, this.tagDefinitionResolver);\n expansionCaseParser.build();\n if (expansionCaseParser.errors.length > 0) {\n this.errors = this.errors.concat(expansionCaseParser.errors);\n return null;\n }\n const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);\n const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);\n return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);\n }\n _collectExpansionExpTokens(start) {\n const exp = [];\n const expansionFormStack = [21 /* TokenType.EXPANSION_CASE_EXP_START */];\n while (true) {\n if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */ ||\n this._peek.type === 21 /* TokenType.EXPANSION_CASE_EXP_START */) {\n expansionFormStack.push(this._peek.type);\n }\n if (this._peek.type === 22 /* TokenType.EXPANSION_CASE_EXP_END */) {\n if (lastOnStack(expansionFormStack, 21 /* TokenType.EXPANSION_CASE_EXP_START */)) {\n expansionFormStack.pop();\n if (expansionFormStack.length === 0)\n return exp;\n }\n else {\n this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n }\n if (this._peek.type === 23 /* TokenType.EXPANSION_FORM_END */) {\n if (lastOnStack(expansionFormStack, 19 /* TokenType.EXPANSION_FORM_START */)) {\n expansionFormStack.pop();\n }\n else {\n this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n }\n if (this._peek.type === 41 /* TokenType.EOF */) {\n this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n exp.push(this._advance());\n }\n }\n _consumeText(token) {\n const tokens = [token];\n const startSpan = token.sourceSpan;\n let text = token.parts[0];\n if (text.length > 0 && text[0] === '\\n') {\n const parent = this._getContainer();\n if (parent != null &&\n parent.children.length === 0 &&\n this._getTagDefinition(parent)?.ignoreFirstLf) {\n text = text.substring(1);\n tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text] };\n }\n }\n while (this._peek.type === 8 /* TokenType.INTERPOLATION */ ||\n this._peek.type === 5 /* TokenType.TEXT */ ||\n this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {\n token = this._advance();\n tokens.push(token);\n if (token.type === 8 /* TokenType.INTERPOLATION */) {\n // For backward compatibility we decode HTML entities that appear in interpolation\n // expressions. This is arguably a bug, but it could be a considerable breaking change to\n // fix it. It should be addressed in a larger project to refactor the entire parser/lexer\n // chain after View Engine has been removed.\n text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity);\n }\n else if (token.type === 9 /* TokenType.ENCODED_ENTITY */) {\n text += token.parts[0];\n }\n else {\n text += token.parts.join('');\n }\n }\n if (text.length > 0) {\n const endSpan = token.sourceSpan;\n this._addToParent(new Text(text, new ParseSourceSpan(startSpan.start, endSpan.end, startSpan.fullStart, startSpan.details), tokens));\n }\n }\n _closeVoidElement() {\n const el = this._getContainer();\n if (el !== null && this._getTagDefinition(el)?.isVoid) {\n this._containerStack.pop();\n }\n }\n _consumeElementStartTag(startTagToken) {\n const attrs = [];\n const directives = [];\n this._consumeAttributesAndDirectives(attrs, directives);\n const fullName = this._getElementFullName(startTagToken, this._getClosestElementLikeParent());\n const tagDef = this._getTagDefinition(fullName);\n let selfClosing = false;\n // Note: There could have been a tokenizer error\n // so that we don't get a token for the end tag...\n if (this._peek.type === 2 /* TokenType.TAG_OPEN_END_VOID */) {\n this._advance();\n selfClosing = true;\n if (!(tagDef?.canSelfClose || getNsPrefix(fullName) !== null || tagDef?.isVoid)) {\n this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed \"${startTagToken.parts[1]}\"`));\n }\n }\n else if (this._peek.type === 1 /* TokenType.TAG_OPEN_END */) {\n this._advance();\n selfClosing = false;\n }\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);\n const el = new Element(fullName, attrs, directives, [], selfClosing, span, startSpan, undefined, tagDef?.isVoid ?? false);\n const parent = this._getContainer();\n const isClosedByChild = parent !== null && !!this._getTagDefinition(parent)?.isClosedByChild(el.name);\n this._pushContainer(el, isClosedByChild);\n if (selfClosing) {\n // Elements that are self-closed have their `endSourceSpan` set to the full span, as the\n // element start tag also represents the end tag.\n this._popContainer(fullName, Element, span);\n }\n else if (startTagToken.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {\n // We already know the opening tag is not complete, so it is unlikely it has a corresponding\n // close tag. Let's optimistically parse it as a full element and emit an error.\n this._popContainer(fullName, Element, null);\n this.errors.push(TreeError.create(fullName, span, `Opening tag \"${fullName}\" not terminated.`));\n }\n }\n _consumeComponentStartTag(startToken) {\n const componentName = startToken.parts[0];\n const attrs = [];\n const directives = [];\n this._consumeAttributesAndDirectives(attrs, directives);\n const closestElement = this._getClosestElementLikeParent();\n const tagName = this._getComponentTagName(startToken, closestElement);\n const fullName = this._getComponentFullName(startToken, closestElement);\n const selfClosing = this._peek.type === 35 /* TokenType.COMPONENT_OPEN_END_VOID */;\n this._advance();\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);\n const startSpan = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);\n const node = new Component(componentName, tagName, fullName, attrs, directives, [], selfClosing, span, startSpan, undefined);\n const parent = this._getContainer();\n const isClosedByChild = parent !== null &&\n node.tagName !== null &&\n !!this._getTagDefinition(parent)?.isClosedByChild(node.tagName);\n this._pushContainer(node, isClosedByChild);\n if (selfClosing) {\n this._popContainer(fullName, Component, span);\n }\n else if (startToken.type === 37 /* TokenType.INCOMPLETE_COMPONENT_OPEN */) {\n this._popContainer(fullName, Component, null);\n this.errors.push(TreeError.create(fullName, span, `Opening tag \"${fullName}\" not terminated.`));\n }\n }\n _consumeAttributesAndDirectives(attributesResult, directivesResult) {\n while (this._peek.type === 14 /* TokenType.ATTR_NAME */ ||\n this._peek.type === 38 /* TokenType.DIRECTIVE_NAME */) {\n if (this._peek.type === 38 /* TokenType.DIRECTIVE_NAME */) {\n directivesResult.push(this._consumeDirective(this._peek));\n }\n else {\n attributesResult.push(this._consumeAttr(this._advance()));\n }\n }\n }\n _consumeComponentEndTag(endToken) {\n const fullName = this._getComponentFullName(endToken, this._getClosestElementLikeParent());\n if (!this._popContainer(fullName, Component, endToken.sourceSpan)) {\n const container = this._containerStack[this._containerStack.length - 1];\n let suffix;\n if (container instanceof Component && container.componentName === endToken.parts[0]) {\n suffix = `, did you mean \"${container.fullName}\"?`;\n }\n else {\n suffix = '. It may happen when the tag has already been closed by another tag.';\n }\n const errMsg = `Unexpected closing tag \"${fullName}\"${suffix}`;\n this.errors.push(TreeError.create(fullName, endToken.sourceSpan, errMsg));\n }\n }\n _getTagDefinition(nodeOrName) {\n if (typeof nodeOrName === 'string') {\n return this.tagDefinitionResolver(nodeOrName);\n }\n else if (nodeOrName instanceof Element) {\n return this.tagDefinitionResolver(nodeOrName.name);\n }\n else if (nodeOrName instanceof Component && nodeOrName.tagName !== null) {\n return this.tagDefinitionResolver(nodeOrName.tagName);\n }\n else {\n return null;\n }\n }\n _pushContainer(node, isClosedByChild) {\n if (isClosedByChild) {\n this._containerStack.pop();\n }\n this._addToParent(node);\n this._containerStack.push(node);\n }\n _consumeElementEndTag(endTagToken) {\n const fullName = this._getElementFullName(endTagToken, this._getClosestElementLikeParent());\n if (this._getTagDefinition(fullName)?.isVoid) {\n this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, `Void elements do not have end tags \"${endTagToken.parts[1]}\"`));\n }\n else if (!this._popContainer(fullName, Element, endTagToken.sourceSpan)) {\n const errMsg = `Unexpected closing tag \"${fullName}\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;\n this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));\n }\n }\n /**\n * Closes the nearest element with the tag name `fullName` in the parse tree.\n * `endSourceSpan` is the span of the closing tag, or null if the element does\n * not have a closing tag (for example, this happens when an incomplete\n * opening tag is recovered).\n */\n _popContainer(expectedName, expectedType, endSourceSpan) {\n let unexpectedCloseTagDetected = false;\n for (let stackIndex = this._containerStack.length - 1; stackIndex >= 0; stackIndex--) {\n const node = this._containerStack[stackIndex];\n const nodeName = node instanceof Component ? node.fullName : node.name;\n if ((nodeName === expectedName || expectedName === null) && node instanceof expectedType) {\n // Record the parse span with the element that is being closed. Any elements that are\n // removed from the element stack at this point are closed implicitly, so they won't get\n // an end source span (as there is no explicit closing element).\n node.endSourceSpan = endSourceSpan;\n node.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : node.sourceSpan.end;\n this._containerStack.splice(stackIndex, this._containerStack.length - stackIndex);\n return !unexpectedCloseTagDetected;\n }\n // Blocks and most elements are not self closing.\n if (node instanceof Block || !this._getTagDefinition(node)?.closedByParent) {\n // Note that we encountered an unexpected close tag but continue processing the element\n // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this\n // end tag in the stack.\n unexpectedCloseTagDetected = true;\n }\n }\n return false;\n }\n _consumeAttr(attrName) {\n const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n let attrEnd = attrName.sourceSpan.end;\n // Consume any quote\n if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {\n this._advance();\n }\n // Consume the attribute value\n let value = '';\n const valueTokens = [];\n let valueStartSpan = undefined;\n let valueEnd = undefined;\n // NOTE: We need to use a new variable `nextTokenType` here to hide the actual type of\n // `_peek.type` from TS. Otherwise TS will narrow the type of `_peek.type` preventing it from\n // being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not\n // able to see that `_advance()` will actually mutate `_peek`.\n const nextTokenType = this._peek.type;\n if (nextTokenType === 16 /* TokenType.ATTR_VALUE_TEXT */) {\n valueStartSpan = this._peek.sourceSpan;\n valueEnd = this._peek.sourceSpan.end;\n while (this._peek.type === 16 /* TokenType.ATTR_VALUE_TEXT */ ||\n this._peek.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */ ||\n this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {\n const valueToken = this._advance();\n valueTokens.push(valueToken);\n if (valueToken.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */) {\n // For backward compatibility we decode HTML entities that appear in interpolation\n // expressions. This is arguably a bug, but it could be a considerable breaking change to\n // fix it. It should be addressed in a larger project to refactor the entire parser/lexer\n // chain after View Engine has been removed.\n value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity);\n }\n else if (valueToken.type === 9 /* TokenType.ENCODED_ENTITY */) {\n value += valueToken.parts[0];\n }\n else {\n value += valueToken.parts.join('');\n }\n valueEnd = attrEnd = valueToken.sourceSpan.end;\n }\n }\n // Consume any quote\n if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {\n const quoteToken = this._advance();\n attrEnd = quoteToken.sourceSpan.end;\n }\n const valueSpan = valueStartSpan &&\n valueEnd &&\n new ParseSourceSpan(valueStartSpan.start, valueEnd, valueStartSpan.fullStart);\n return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart), attrName.sourceSpan, valueSpan, valueTokens.length > 0 ? valueTokens : undefined, undefined);\n }\n _consumeDirective(nameToken) {\n const attributes = [];\n let startSourceSpanEnd = nameToken.sourceSpan.end;\n let endSourceSpan = null;\n this._advance();\n if (this._peek.type === 39 /* TokenType.DIRECTIVE_OPEN */) {\n // Capture the opening token in the start span.\n startSourceSpanEnd = this._peek.sourceSpan.end;\n this._advance();\n // Cast here is necessary, because TS doesn't know that `_advance` changed `_peek`.\n while (this._peek.type === 14 /* TokenType.ATTR_NAME */) {\n attributes.push(this._consumeAttr(this._advance()));\n }\n if (this._peek.type === 40 /* TokenType.DIRECTIVE_CLOSE */) {\n endSourceSpan = this._peek.sourceSpan;\n this._advance();\n }\n else {\n this.errors.push(TreeError.create(null, nameToken.sourceSpan, 'Unterminated directive definition'));\n }\n }\n const startSourceSpan = new ParseSourceSpan(nameToken.sourceSpan.start, startSourceSpanEnd, nameToken.sourceSpan.fullStart);\n const sourceSpan = new ParseSourceSpan(startSourceSpan.start, endSourceSpan === null ? nameToken.sourceSpan.end : endSourceSpan.end, startSourceSpan.fullStart);\n return new Directive(nameToken.parts[0], attributes, sourceSpan, startSourceSpan, endSourceSpan);\n }\n _consumeBlockOpen(token) {\n const parameters = [];\n while (this._peek.type === 27 /* TokenType.BLOCK_PARAMETER */) {\n const paramToken = this._advance();\n parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));\n }\n if (this._peek.type === 25 /* TokenType.BLOCK_OPEN_END */) {\n this._advance();\n }\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);\n this._pushContainer(block, false);\n }\n _consumeBlockClose(token) {\n if (!this._popContainer(null, Block, token.sourceSpan)) {\n this.errors.push(TreeError.create(null, token.sourceSpan, `Unexpected closing block. The block may have been closed earlier. ` +\n `If you meant to write the } character, you should use the \"}\" ` +\n `HTML entity instead.`));\n }\n }\n _consumeIncompleteBlock(token) {\n const parameters = [];\n while (this._peek.type === 27 /* TokenType.BLOCK_PARAMETER */) {\n const paramToken = this._advance();\n parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));\n }\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);\n this._pushContainer(block, false);\n // Incomplete blocks don't have children so we close them immediately and report an error.\n this._popContainer(null, Block, null);\n this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block \"${token.parts[0]}\". If you meant to write the @ character, ` +\n `you should use the \"@\" HTML entity instead.`));\n }\n _consumeLet(startToken) {\n const name = startToken.parts[0];\n let valueToken;\n let endToken;\n if (this._peek.type !== 30 /* TokenType.LET_VALUE */) {\n this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Invalid @let declaration \"${name}\". Declaration must have a value.`));\n return;\n }\n else {\n valueToken = this._advance();\n }\n // Type cast is necessary here since TS narrowed the type of `peek` above.\n if (this._peek.type !== 31 /* TokenType.LET_END */) {\n this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Unterminated @let declaration \"${name}\". Declaration must be terminated with a semicolon.`));\n return;\n }\n else {\n endToken = this._advance();\n }\n const end = endToken.sourceSpan.fullStart;\n const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);\n // The start token usually captures the `@let`. Construct a name span by\n // offsetting the start by the length of any text before the name.\n const startOffset = startToken.sourceSpan.toString().lastIndexOf(name);\n const nameStart = startToken.sourceSpan.start.moveBy(startOffset);\n const nameSpan = new ParseSourceSpan(nameStart, startToken.sourceSpan.end);\n const node = new LetDeclaration(name, valueToken.parts[0], span, nameSpan, valueToken.sourceSpan);\n this._addToParent(node);\n }\n _consumeIncompleteLet(token) {\n // Incomplete `@let` declaration may end up with an empty name.\n const name = token.parts[0] ?? '';\n const nameString = name ? ` \"${name}\"` : '';\n // If there's at least a name, we can salvage an AST node that can be used for completions.\n if (name.length > 0) {\n const startOffset = token.sourceSpan.toString().lastIndexOf(name);\n const nameStart = token.sourceSpan.start.moveBy(startOffset);\n const nameSpan = new ParseSourceSpan(nameStart, token.sourceSpan.end);\n const valueSpan = new ParseSourceSpan(token.sourceSpan.start, token.sourceSpan.start.moveBy(0));\n const node = new LetDeclaration(name, '', token.sourceSpan, nameSpan, valueSpan);\n this._addToParent(node);\n }\n this.errors.push(TreeError.create(token.parts[0], token.sourceSpan, `Incomplete @let declaration${nameString}. ` +\n `@let declarations must be written as \\`@let = ;\\``));\n }\n _getContainer() {\n return this._containerStack.length > 0\n ? this._containerStack[this._containerStack.length - 1]\n : null;\n }\n _getClosestElementLikeParent() {\n for (let i = this._containerStack.length - 1; i > -1; i--) {\n const current = this._containerStack[i];\n if (current instanceof Element || current instanceof Component) {\n return current;\n }\n }\n return null;\n }\n _addToParent(node) {\n const parent = this._getContainer();\n if (parent === null) {\n this.rootNodes.push(node);\n }\n else {\n parent.children.push(node);\n }\n }\n _getElementFullName(token, parent) {\n const prefix = this._getPrefix(token, parent);\n return mergeNsAndName(prefix, token.parts[1]);\n }\n _getComponentFullName(token, parent) {\n const componentName = token.parts[0];\n const tagName = this._getComponentTagName(token, parent);\n if (tagName === null) {\n return componentName;\n }\n return tagName.startsWith(':') ? componentName + tagName : `${componentName}:${tagName}`;\n }\n _getComponentTagName(token, parent) {\n const prefix = this._getPrefix(token, parent);\n const tagName = token.parts[2];\n if (!prefix && !tagName) {\n return null;\n }\n else if (!prefix && tagName) {\n return tagName;\n }\n else {\n // TODO(crisbeto): re-evaluate this fallback. Maybe base it off the class name?\n return mergeNsAndName(prefix, tagName || 'ng-component');\n }\n }\n _getPrefix(token, parent) {\n let prefix;\n let tagName;\n if (token.type === 33 /* TokenType.COMPONENT_OPEN_START */ ||\n token.type === 37 /* TokenType.INCOMPLETE_COMPONENT_OPEN */ ||\n token.type === 36 /* TokenType.COMPONENT_CLOSE */) {\n prefix = token.parts[1];\n tagName = token.parts[2];\n }\n else {\n prefix = token.parts[0];\n tagName = token.parts[1];\n }\n prefix = prefix || this._getTagDefinition(tagName)?.implicitNamespacePrefix || '';\n if (!prefix && parent) {\n const parentName = parent instanceof Element ? parent.name : parent.tagName;\n if (parentName !== null) {\n const parentTagName = splitNsName(parentName)[1];\n const parentTagDefinition = this._getTagDefinition(parentTagName);\n if (parentTagDefinition !== null && !parentTagDefinition.preventNamespaceInheritance) {\n prefix = getNsPrefix(parentName);\n }\n }\n }\n return prefix;\n }\n}\nfunction lastOnStack(stack, element) {\n return stack.length > 0 && stack[stack.length - 1] === element;\n}\n/**\n * Decode the `entity` string, which we believe is the contents of an HTML entity.\n *\n * If the string is not actually a valid/known entity then just return the original `match` string.\n */\nfunction decodeEntity(match, entity) {\n if (NAMED_ENTITIES[entity] !== undefined) {\n return NAMED_ENTITIES[entity] || match;\n }\n if (/^#x[a-f0-9]+$/i.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(2), 16));\n }\n if (/^#\\d+$/.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(1), 10));\n }\n return match;\n}\n\nconst PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\nconst SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);\n// Equivalent to \\s with \\u00a0 (non-breaking space) excluded.\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\nconst WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\nconst NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);\nconst WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, 'g');\nfunction hasPreserveWhitespacesAttr(attrs) {\n return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);\n}\n/**\n * &ngsp; is a placeholder for non-removable space\n * &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n * and later on replaced by a space.\n */\nfunction replaceNgsp(value) {\n // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n}\n/**\n * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:\n * - consider spaces, tabs and new lines as whitespace characters;\n * - drop text nodes consisting of whitespace characters only;\n * - for all other text nodes replace consecutive whitespace characters with one space;\n * - convert &ngsp; pseudo-entity to a single space;\n *\n * Removal and trimming of whitespaces have positive performance impact (less code to generate\n * while compiling templates, faster view creation). At the same time it can be \"destructive\"\n * in some cases (whitespaces can influence layout). Because of the potential of breaking layout\n * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for\n * whitespace removal. The default option for whitespace removal will be revisited in Angular 6\n * and might be changed to \"on\" by default.\n *\n * If `originalNodeMap` is provided, the transformed nodes will be mapped back to their original\n * inputs. Any output nodes not in the map were not transformed. This supports correlating and\n * porting information between the trimmed nodes and original nodes (such as `i18n` properties)\n * such that trimming whitespace does not does not drop required information from the node.\n */\nclass WhitespaceVisitor {\n preserveSignificantWhitespace;\n originalNodeMap;\n requireContext;\n // How many ICU expansions which are currently being visited. ICUs can be nested, so this\n // tracks the current depth of nesting. If this depth is greater than 0, then this visitor is\n // currently processing content inside an ICU expansion.\n icuExpansionDepth = 0;\n constructor(preserveSignificantWhitespace, originalNodeMap, requireContext = true) {\n this.preserveSignificantWhitespace = preserveSignificantWhitespace;\n this.originalNodeMap = originalNodeMap;\n this.requireContext = requireContext;\n }\n visitElement(element, context) {\n if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {\n // don't descent into elements where we need to preserve whitespaces\n // but still visit all attributes to eliminate one used as a market to preserve WS\n const newElement = new Element(element.name, visitAllWithSiblings(this, element.attrs), visitAllWithSiblings(this, element.directives), element.children, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.isVoid, element.i18n);\n this.originalNodeMap?.set(newElement, element);\n return newElement;\n }\n const newElement = new Element(element.name, element.attrs, element.directives, visitAllWithSiblings(this, element.children), element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.isVoid, element.i18n);\n this.originalNodeMap?.set(newElement, element);\n return newElement;\n }\n visitAttribute(attribute, context) {\n return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n }\n visitText(text, context) {\n const isNotBlank = text.value.match(NO_WS_REGEXP);\n const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion);\n // Do not trim whitespace within ICU expansions when preserving significant whitespace.\n // Historically, ICU whitespace was never trimmed and this is really a bug. However fixing it\n // would change message IDs which we can't easily do. Instead we only trim ICU whitespace within\n // ICU expansions when not preserving significant whitespace, which is the new behavior where it\n // most matters.\n const inIcuExpansion = this.icuExpansionDepth > 0;\n if (inIcuExpansion && this.preserveSignificantWhitespace)\n return text;\n if (isNotBlank || hasExpansionSibling) {\n // Process the whitespace in the tokens of this Text node\n const tokens = text.tokens.map((token) => token.type === 5 /* TokenType.TEXT */ ? createWhitespaceProcessedTextToken(token) : token);\n // Fully trim message when significant whitespace is not preserved.\n if (!this.preserveSignificantWhitespace && tokens.length > 0) {\n // The first token should only call `.trimStart()` and the last token\n // should only call `.trimEnd()`, but there might be only one token which\n // needs to call both.\n const firstToken = tokens[0];\n tokens.splice(0, 1, trimLeadingWhitespace(firstToken, context));\n const lastToken = tokens[tokens.length - 1]; // Could be the same as the first token.\n tokens.splice(tokens.length - 1, 1, trimTrailingWhitespace(lastToken, context));\n }\n // Process the whitespace of the value of this Text node. Also trim the leading/trailing\n // whitespace when we don't need to preserve significant whitespace.\n const processed = processWhitespace(text.value);\n const value = this.preserveSignificantWhitespace\n ? processed\n : trimLeadingAndTrailingWhitespace(processed, context);\n const result = new Text(value, text.sourceSpan, tokens, text.i18n);\n this.originalNodeMap?.set(result, text);\n return result;\n }\n return null;\n }\n visitComment(comment, context) {\n return comment;\n }\n visitExpansion(expansion, context) {\n this.icuExpansionDepth++;\n let newExpansion;\n try {\n newExpansion = new Expansion(expansion.switchValue, expansion.type, visitAllWithSiblings(this, expansion.cases), expansion.sourceSpan, expansion.switchValueSourceSpan, expansion.i18n);\n }\n finally {\n this.icuExpansionDepth--;\n }\n this.originalNodeMap?.set(newExpansion, expansion);\n return newExpansion;\n }\n visitExpansionCase(expansionCase, context) {\n const newExpansionCase = new ExpansionCase(expansionCase.value, visitAllWithSiblings(this, expansionCase.expression), expansionCase.sourceSpan, expansionCase.valueSourceSpan, expansionCase.expSourceSpan);\n this.originalNodeMap?.set(newExpansionCase, expansionCase);\n return newExpansionCase;\n }\n visitBlock(block, context) {\n const newBlock = new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);\n this.originalNodeMap?.set(newBlock, block);\n return newBlock;\n }\n visitBlockParameter(parameter, context) {\n return parameter;\n }\n visitLetDeclaration(decl, context) {\n return decl;\n }\n visitComponent(node, context) {\n if ((node.tagName && SKIP_WS_TRIM_TAGS.has(node.tagName)) ||\n hasPreserveWhitespacesAttr(node.attrs)) {\n // don't descent into elements where we need to preserve whitespaces\n // but still visit all attributes to eliminate one used as a market to preserve WS\n const newElement = new Component(node.componentName, node.tagName, node.fullName, visitAllWithSiblings(this, node.attrs), visitAllWithSiblings(this, node.directives), node.children, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);\n this.originalNodeMap?.set(newElement, node);\n return newElement;\n }\n const newElement = new Component(node.componentName, node.tagName, node.fullName, node.attrs, node.directives, visitAllWithSiblings(this, node.children), node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);\n this.originalNodeMap?.set(newElement, node);\n return newElement;\n }\n visitDirective(directive, context) {\n return directive;\n }\n visit(_node, context) {\n // `visitAllWithSiblings` provides context necessary for ICU messages to be handled correctly.\n // Prefer that over calling `html.visitAll` directly on this visitor.\n if (this.requireContext && !context) {\n throw new Error(`WhitespaceVisitor requires context. Visit via \\`visitAllWithSiblings\\` to get this context.`);\n }\n return false;\n }\n}\nfunction trimLeadingWhitespace(token, context) {\n if (token.type !== 5 /* TokenType.TEXT */)\n return token;\n const isFirstTokenInTag = !context?.prev;\n if (!isFirstTokenInTag)\n return token;\n return transformTextToken(token, (text) => text.trimStart());\n}\nfunction trimTrailingWhitespace(token, context) {\n if (token.type !== 5 /* TokenType.TEXT */)\n return token;\n const isLastTokenInTag = !context?.next;\n if (!isLastTokenInTag)\n return token;\n return transformTextToken(token, (text) => text.trimEnd());\n}\nfunction trimLeadingAndTrailingWhitespace(text, context) {\n const isFirstTokenInTag = !context?.prev;\n const isLastTokenInTag = !context?.next;\n const maybeTrimmedStart = isFirstTokenInTag ? text.trimStart() : text;\n const maybeTrimmed = isLastTokenInTag ? maybeTrimmedStart.trimEnd() : maybeTrimmedStart;\n return maybeTrimmed;\n}\nfunction createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {\n return { type, parts: [processWhitespace(parts[0])], sourceSpan };\n}\nfunction transformTextToken({ type, parts, sourceSpan }, transform) {\n // `TextToken` only ever has one part as defined in its type, so we just transform the first element.\n return { type, parts: [transform(parts[0])], sourceSpan };\n}\nfunction processWhitespace(text) {\n return replaceNgsp(text).replace(WS_REPLACE_REGEXP, ' ');\n}\nfunction visitAllWithSiblings(visitor, nodes) {\n const result = [];\n nodes.forEach((ast, i) => {\n const context = { prev: nodes[i - 1], next: nodes[i + 1] };\n const astResult = ast.visit(visitor, context);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\n\nvar TokenType;\n(function (TokenType) {\n TokenType[TokenType[\"Character\"] = 0] = \"Character\";\n TokenType[TokenType[\"Identifier\"] = 1] = \"Identifier\";\n TokenType[TokenType[\"PrivateIdentifier\"] = 2] = \"PrivateIdentifier\";\n TokenType[TokenType[\"Keyword\"] = 3] = \"Keyword\";\n TokenType[TokenType[\"String\"] = 4] = \"String\";\n TokenType[TokenType[\"Operator\"] = 5] = \"Operator\";\n TokenType[TokenType[\"Number\"] = 6] = \"Number\";\n TokenType[TokenType[\"Error\"] = 7] = \"Error\";\n})(TokenType || (TokenType = {}));\nvar StringTokenKind;\n(function (StringTokenKind) {\n StringTokenKind[StringTokenKind[\"Plain\"] = 0] = \"Plain\";\n StringTokenKind[StringTokenKind[\"TemplateLiteralPart\"] = 1] = \"TemplateLiteralPart\";\n StringTokenKind[StringTokenKind[\"TemplateLiteralEnd\"] = 2] = \"TemplateLiteralEnd\";\n})(StringTokenKind || (StringTokenKind = {}));\nconst KEYWORDS = [\n 'var',\n 'let',\n 'as',\n 'null',\n 'undefined',\n 'true',\n 'false',\n 'if',\n 'else',\n 'this',\n 'typeof',\n 'void',\n 'in',\n];\nclass Lexer {\n tokenize(text) {\n return new _Scanner(text).scan();\n }\n}\nclass Token {\n index;\n end;\n type;\n numValue;\n strValue;\n constructor(index, end, type, numValue, strValue) {\n this.index = index;\n this.end = end;\n this.type = type;\n this.numValue = numValue;\n this.strValue = strValue;\n }\n isCharacter(code) {\n return this.type === TokenType.Character && this.numValue === code;\n }\n isNumber() {\n return this.type === TokenType.Number;\n }\n isString() {\n return this.type === TokenType.String;\n }\n isOperator(operator) {\n return this.type === TokenType.Operator && this.strValue === operator;\n }\n isIdentifier() {\n return this.type === TokenType.Identifier;\n }\n isPrivateIdentifier() {\n return this.type === TokenType.PrivateIdentifier;\n }\n isKeyword() {\n return this.type === TokenType.Keyword;\n }\n isKeywordLet() {\n return this.type === TokenType.Keyword && this.strValue === 'let';\n }\n isKeywordAs() {\n return this.type === TokenType.Keyword && this.strValue === 'as';\n }\n isKeywordNull() {\n return this.type === TokenType.Keyword && this.strValue === 'null';\n }\n isKeywordUndefined() {\n return this.type === TokenType.Keyword && this.strValue === 'undefined';\n }\n isKeywordTrue() {\n return this.type === TokenType.Keyword && this.strValue === 'true';\n }\n isKeywordFalse() {\n return this.type === TokenType.Keyword && this.strValue === 'false';\n }\n isKeywordThis() {\n return this.type === TokenType.Keyword && this.strValue === 'this';\n }\n isKeywordTypeof() {\n return this.type === TokenType.Keyword && this.strValue === 'typeof';\n }\n isKeywordVoid() {\n return this.type === TokenType.Keyword && this.strValue === 'void';\n }\n isKeywordIn() {\n return this.type === TokenType.Keyword && this.strValue === 'in';\n }\n isError() {\n return this.type === TokenType.Error;\n }\n toNumber() {\n return this.type === TokenType.Number ? this.numValue : -1;\n }\n isTemplateLiteralPart() {\n // Note: Explicit type is needed for Closure.\n return this.isString() && this.kind === StringTokenKind.TemplateLiteralPart;\n }\n isTemplateLiteralEnd() {\n // Note: Explicit type is needed for Closure.\n return this.isString() && this.kind === StringTokenKind.TemplateLiteralEnd;\n }\n isTemplateLiteralInterpolationStart() {\n return this.isOperator('${');\n }\n isTemplateLiteralInterpolationEnd() {\n return this.isOperator('}');\n }\n toString() {\n switch (this.type) {\n case TokenType.Character:\n case TokenType.Identifier:\n case TokenType.Keyword:\n case TokenType.Operator:\n case TokenType.PrivateIdentifier:\n case TokenType.String:\n case TokenType.Error:\n return this.strValue;\n case TokenType.Number:\n return this.numValue.toString();\n default:\n return null;\n }\n }\n}\nclass StringToken extends Token {\n kind;\n constructor(index, end, strValue, kind) {\n super(index, end, TokenType.String, 0, strValue);\n this.kind = kind;\n }\n}\nfunction newCharacterToken(index, end, code) {\n return new Token(index, end, TokenType.Character, code, String.fromCharCode(code));\n}\nfunction newIdentifierToken(index, end, text) {\n return new Token(index, end, TokenType.Identifier, 0, text);\n}\nfunction newPrivateIdentifierToken(index, end, text) {\n return new Token(index, end, TokenType.PrivateIdentifier, 0, text);\n}\nfunction newKeywordToken(index, end, text) {\n return new Token(index, end, TokenType.Keyword, 0, text);\n}\nfunction newOperatorToken(index, end, text) {\n return new Token(index, end, TokenType.Operator, 0, text);\n}\nfunction newNumberToken(index, end, n) {\n return new Token(index, end, TokenType.Number, n, '');\n}\nfunction newErrorToken(index, end, message) {\n return new Token(index, end, TokenType.Error, 0, message);\n}\nconst EOF = new Token(-1, -1, TokenType.Character, 0, '');\nclass _Scanner {\n input;\n tokens = [];\n length;\n peek = 0;\n index = -1;\n braceStack = [];\n constructor(input) {\n this.input = input;\n this.length = input.length;\n this.advance();\n }\n scan() {\n let token = this.scanToken();\n while (token !== null) {\n this.tokens.push(token);\n token = this.scanToken();\n }\n return this.tokens;\n }\n advance() {\n this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);\n }\n scanToken() {\n const input = this.input;\n const length = this.length;\n let peek = this.peek;\n let index = this.index;\n // Skip whitespace.\n while (peek <= $SPACE) {\n if (++index >= length) {\n peek = $EOF;\n break;\n }\n else {\n peek = input.charCodeAt(index);\n }\n }\n this.peek = peek;\n this.index = index;\n if (index >= length) {\n return null;\n }\n // Handle identifiers and numbers.\n if (isIdentifierStart(peek)) {\n return this.scanIdentifier();\n }\n if (isDigit(peek)) {\n return this.scanNumber(index);\n }\n const start = index;\n switch (peek) {\n case $PERIOD:\n this.advance();\n return isDigit(this.peek)\n ? this.scanNumber(start)\n : newCharacterToken(start, this.index, $PERIOD);\n case $LPAREN:\n case $RPAREN:\n case $LBRACKET:\n case $RBRACKET:\n case $COMMA:\n case $COLON:\n case $SEMICOLON:\n return this.scanCharacter(start, peek);\n case $LBRACE:\n return this.scanOpenBrace(start, peek);\n case $RBRACE:\n return this.scanCloseBrace(start, peek);\n case $SQ:\n case $DQ:\n return this.scanString();\n case $BT:\n this.advance();\n return this.scanTemplateLiteralPart(start);\n case $HASH:\n return this.scanPrivateIdentifier();\n case $PLUS:\n return this.scanComplexOperator(start, '+', $EQ, '=');\n case $MINUS:\n return this.scanComplexOperator(start, '-', $EQ, '=');\n case $SLASH:\n return this.scanComplexOperator(start, '/', $EQ, '=');\n case $PERCENT:\n return this.scanComplexOperator(start, '%', $EQ, '=');\n case $CARET:\n return this.scanOperator(start, '^');\n case $STAR:\n return this.scanStar(start);\n case $QUESTION:\n return this.scanQuestion(start);\n case $LT:\n case $GT:\n return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');\n case $BANG:\n case $EQ:\n return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');\n case $AMPERSAND:\n return this.scanComplexOperator(start, '&', $AMPERSAND, '&', $EQ, '=');\n case $BAR:\n return this.scanComplexOperator(start, '|', $BAR, '|', $EQ, '=');\n case $NBSP:\n while (isWhitespace(this.peek))\n this.advance();\n return this.scanToken();\n }\n this.advance();\n return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);\n }\n scanCharacter(start, code) {\n this.advance();\n return newCharacterToken(start, this.index, code);\n }\n scanOperator(start, str) {\n this.advance();\n return newOperatorToken(start, this.index, str);\n }\n scanOpenBrace(start, code) {\n this.braceStack.push('expression');\n this.advance();\n return newCharacterToken(start, this.index, code);\n }\n scanCloseBrace(start, code) {\n this.advance();\n const currentBrace = this.braceStack.pop();\n if (currentBrace === 'interpolation') {\n this.tokens.push(newOperatorToken(start, this.index, '}'));\n return this.scanTemplateLiteralPart(this.index);\n }\n return newCharacterToken(start, this.index, code);\n }\n /**\n * Tokenize a 2/3 char long operator\n *\n * @param start start index in the expression\n * @param one first symbol (always part of the operator)\n * @param twoCode code point for the second symbol\n * @param two second symbol (part of the operator when the second code point matches)\n * @param threeCode code point for the third symbol\n * @param three third symbol (part of the operator when provided and matches source expression)\n */\n scanComplexOperator(start, one, twoCode, two, threeCode, three) {\n this.advance();\n let str = one;\n if (this.peek == twoCode) {\n this.advance();\n str += two;\n }\n if (threeCode != null && this.peek == threeCode) {\n this.advance();\n str += three;\n }\n return newOperatorToken(start, this.index, str);\n }\n scanIdentifier() {\n const start = this.index;\n this.advance();\n while (isIdentifierPart(this.peek))\n this.advance();\n const str = this.input.substring(start, this.index);\n return KEYWORDS.indexOf(str) > -1\n ? newKeywordToken(start, this.index, str)\n : newIdentifierToken(start, this.index, str);\n }\n /** Scans an ECMAScript private identifier. */\n scanPrivateIdentifier() {\n const start = this.index;\n this.advance();\n if (!isIdentifierStart(this.peek)) {\n return this.error('Invalid character [#]', -1);\n }\n while (isIdentifierPart(this.peek))\n this.advance();\n const identifierName = this.input.substring(start, this.index);\n return newPrivateIdentifierToken(start, this.index, identifierName);\n }\n scanNumber(start) {\n let simple = this.index === start;\n let hasSeparators = false;\n this.advance(); // Skip initial digit.\n while (true) {\n if (isDigit(this.peek)) ;\n else if (this.peek === $_) {\n // Separators are only valid when they're surrounded by digits. E.g. `1_0_1` is\n // valid while `_101` and `101_` are not. The separator can't be next to the decimal\n // point or another separator either. Note that it's unlikely that we'll hit a case where\n // the underscore is at the start, because that's a valid identifier and it will be picked\n // up earlier in the parsing. We validate for it anyway just in case.\n if (!isDigit(this.input.charCodeAt(this.index - 1)) ||\n !isDigit(this.input.charCodeAt(this.index + 1))) {\n return this.error('Invalid numeric separator', 0);\n }\n hasSeparators = true;\n }\n else if (this.peek === $PERIOD) {\n simple = false;\n }\n else if (isExponentStart(this.peek)) {\n this.advance();\n if (isExponentSign(this.peek))\n this.advance();\n if (!isDigit(this.peek))\n return this.error('Invalid exponent', -1);\n simple = false;\n }\n else {\n break;\n }\n this.advance();\n }\n let str = this.input.substring(start, this.index);\n if (hasSeparators) {\n str = str.replace(/_/g, '');\n }\n const value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n return newNumberToken(start, this.index, value);\n }\n scanString() {\n const start = this.index;\n const quote = this.peek;\n this.advance(); // Skip initial quote.\n let buffer = '';\n let marker = this.index;\n const input = this.input;\n while (this.peek != quote) {\n if (this.peek == $BACKSLASH) {\n const result = this.scanStringBackslash(buffer, marker);\n if (typeof result !== 'string') {\n return result; // Error\n }\n buffer = result;\n marker = this.index;\n }\n else if (this.peek == $EOF) {\n return this.error('Unterminated quote', 0);\n }\n else {\n this.advance();\n }\n }\n const last = input.substring(marker, this.index);\n this.advance(); // Skip terminating quote.\n return new StringToken(start, this.index, buffer + last, StringTokenKind.Plain);\n }\n scanQuestion(start) {\n this.advance();\n let operator = '?';\n // `a ?? b` or `a ??= b`.\n if (this.peek === $QUESTION) {\n operator += '?';\n this.advance();\n // @ts-expect-error\n if (this.peek === $EQ) {\n operator += '=';\n this.advance();\n }\n }\n else if (this.peek === $PERIOD) {\n // `a?.b`\n operator += '.';\n this.advance();\n }\n return newOperatorToken(start, this.index, operator);\n }\n scanTemplateLiteralPart(start) {\n let buffer = '';\n let marker = this.index;\n while (this.peek !== $BT) {\n if (this.peek === $BACKSLASH) {\n const result = this.scanStringBackslash(buffer, marker);\n if (typeof result !== 'string') {\n return result; // Error\n }\n buffer = result;\n marker = this.index;\n }\n else if (this.peek === $$) {\n const dollar = this.index;\n this.advance();\n // @ts-expect-error\n if (this.peek === $LBRACE) {\n this.braceStack.push('interpolation');\n this.tokens.push(new StringToken(start, dollar, buffer + this.input.substring(marker, dollar), StringTokenKind.TemplateLiteralPart));\n this.advance();\n return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index));\n }\n }\n else if (this.peek === $EOF) {\n return this.error('Unterminated template literal', 0);\n }\n else {\n this.advance();\n }\n }\n const last = this.input.substring(marker, this.index);\n this.advance();\n return new StringToken(start, this.index, buffer + last, StringTokenKind.TemplateLiteralEnd);\n }\n error(message, offset) {\n const position = this.index + offset;\n return newErrorToken(position, this.index, `Lexer Error: ${message} at column ${position} in expression [${this.input}]`);\n }\n scanStringBackslash(buffer, marker) {\n buffer += this.input.substring(marker, this.index);\n let unescapedCode;\n this.advance();\n if (this.peek === $u) {\n // 4 character hex code for unicode character.\n const hex = this.input.substring(this.index + 1, this.index + 5);\n if (/^[0-9a-f]+$/i.test(hex)) {\n unescapedCode = parseInt(hex, 16);\n }\n else {\n return this.error(`Invalid unicode escape [\\\\u${hex}]`, 0);\n }\n for (let i = 0; i < 5; i++) {\n this.advance();\n }\n }\n else {\n unescapedCode = unescape(this.peek);\n this.advance();\n }\n buffer += String.fromCharCode(unescapedCode);\n return buffer;\n }\n scanStar(start) {\n this.advance();\n // `*`, `**`, `**=` or `*=`\n let operator = '*';\n if (this.peek === $STAR) {\n operator += '*';\n this.advance();\n // @ts-expect-error\n if (this.peek === $EQ) {\n operator += '=';\n this.advance();\n }\n }\n else if (this.peek === $EQ) {\n operator += '=';\n this.advance();\n }\n return newOperatorToken(start, this.index, operator);\n }\n}\nfunction isIdentifierStart(code) {\n return (($a <= code && code <= $z) ||\n ($A <= code && code <= $Z) ||\n code == $_ ||\n code == $$);\n}\nfunction isIdentifierPart(code) {\n return isAsciiLetter(code) || isDigit(code) || code == $_ || code == $$;\n}\nfunction isExponentStart(code) {\n return code == $e || code == $E;\n}\nfunction isExponentSign(code) {\n return code == $MINUS || code == $PLUS;\n}\nfunction unescape(code) {\n switch (code) {\n case $n:\n return $LF;\n case $f:\n return $FF;\n case $r:\n return $CR;\n case $t:\n return $TAB;\n case $v:\n return $VTAB;\n default:\n return code;\n }\n}\nfunction parseIntAutoRadix(text) {\n const result = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n\nclass SplitInterpolation {\n strings;\n expressions;\n offsets;\n constructor(strings, expressions, offsets) {\n this.strings = strings;\n this.expressions = expressions;\n this.offsets = offsets;\n }\n}\nclass TemplateBindingParseResult {\n templateBindings;\n warnings;\n errors;\n constructor(templateBindings, warnings, errors) {\n this.templateBindings = templateBindings;\n this.warnings = warnings;\n this.errors = errors;\n }\n}\nfunction getLocation(span) {\n return span.start.toString() || '(unknown)';\n}\nclass Parser {\n _lexer;\n _supportsDirectPipeReferences;\n constructor(_lexer, _supportsDirectPipeReferences = false) {\n this._lexer = _lexer;\n this._supportsDirectPipeReferences = _supportsDirectPipeReferences;\n }\n parseAction(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const errors = [];\n this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);\n const { stripped: sourceToLex } = this._stripComments(input);\n const tokens = this._lexer.tokenize(sourceToLex);\n const ast = new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 1 /* ParseFlags.Action */, errors, 0, this._supportsDirectPipeReferences).parseChain();\n return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);\n }\n parseBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const errors = [];\n const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);\n return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);\n }\n checkSimpleExpression(ast) {\n const checker = new SimpleExpressionChecker();\n ast.visit(checker);\n return checker.errors;\n }\n // Host bindings parsed here\n parseSimpleBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const errors = [];\n const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);\n const simplExpressionErrors = this.checkSimpleExpression(ast);\n if (simplExpressionErrors.length > 0) {\n errors.push(getParseError(`Host binding expression cannot contain ${simplExpressionErrors.join(' ')}`, input, '', parseSourceSpan));\n }\n return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);\n }\n _parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors) {\n this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);\n const { stripped: sourceToLex } = this._stripComments(input);\n const tokens = this._lexer.tokenize(sourceToLex);\n return new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();\n }\n /**\n * Parse microsyntax template expression and return a list of bindings or\n * parsing errors in case the given expression is invalid.\n *\n * For example,\n * ```html\n * \n * ^ ^ absoluteValueOffset for `templateValue`\n * absoluteKeyOffset for `templateKey`\n * ```\n * contains three bindings:\n * 1. ngFor -> null\n * 2. item -> NgForOfContext.$implicit\n * 3. ngForOf -> items\n *\n * This is apparent from the de-sugared template:\n * ```html\n *
\n * ```\n *\n * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor\n * @param templateValue RHS of the microsyntax attribute\n * @param templateUrl template filename if it's external, component filename if it's inline\n * @param absoluteKeyOffset start of the `templateKey`\n * @param absoluteValueOffset start of the `templateValue`\n */\n parseTemplateBindings(templateKey, templateValue, parseSourceSpan, absoluteKeyOffset, absoluteValueOffset) {\n const tokens = this._lexer.tokenize(templateValue);\n const errors = [];\n const parser = new _ParseAST(templateValue, parseSourceSpan, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, errors, 0 /* relative offset */, this._supportsDirectPipeReferences);\n return parser.parseTemplateBindings({\n source: templateKey,\n span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),\n });\n }\n parseInterpolation(input, parseSourceSpan, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const errors = [];\n const { strings, expressions, offsets } = this.splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig);\n if (expressions.length === 0)\n return null;\n const expressionNodes = [];\n for (let i = 0; i < expressions.length; ++i) {\n // If we have a token for the specific expression, it's preferrable to use it because it\n // allows us to produce more accurate error messages. The expressions are always at the odd\n // indexes inside the tokens.\n const expressionSpan = interpolatedTokens?.[i * 2 + 1]?.sourceSpan;\n const expressionText = expressions[i].text;\n const { stripped: sourceToLex, hasComments } = this._stripComments(expressionText);\n const tokens = this._lexer.tokenize(sourceToLex);\n if (hasComments && sourceToLex.trim().length === 0 && tokens.length === 0) {\n // Empty expressions error are handled futher down, here we only take care of the comment case\n errors.push(getParseError('Interpolation expression cannot only contain a comment', input, `at column ${expressions[i].start} in`, parseSourceSpan));\n continue;\n }\n const ast = new _ParseAST(expressionSpan ? expressionText : input, expressionSpan || parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, offsets[i], this._supportsDirectPipeReferences).parseChain();\n expressionNodes.push(ast);\n }\n return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input, getLocation(parseSourceSpan), absoluteOffset, errors);\n }\n /**\n * Similar to `parseInterpolation`, but treats the provided string as a single expression\n * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).\n * This is used for parsing the switch expression in ICUs.\n */\n parseInterpolationExpression(expression, parseSourceSpan, absoluteOffset) {\n const { stripped: sourceToLex } = this._stripComments(expression);\n const tokens = this._lexer.tokenize(sourceToLex);\n const errors = [];\n const ast = new _ParseAST(expression, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();\n const strings = ['', '']; // The prefix and suffix strings are both empty\n return this.createInterpolationAst(strings, [ast], expression, getLocation(parseSourceSpan), absoluteOffset, errors);\n }\n createInterpolationAst(strings, expressions, input, location, absoluteOffset, errors) {\n const span = new ParseSpan(0, input.length);\n const interpolation = new Interpolation$1(span, span.toAbsolute(absoluteOffset), strings, expressions);\n return new ASTWithSource(interpolation, input, location, absoluteOffset, errors);\n }\n /**\n * Splits a string of text into \"raw\" text segments and expressions present in interpolations in\n * the string.\n * Returns `null` if there are no interpolations, otherwise a\n * `SplitInterpolation` with splits that look like\n * ... \n */\n splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const strings = [];\n const expressions = [];\n const offsets = [];\n const inputToTemplateIndexMap = interpolatedTokens\n ? getIndexMapForOriginalTemplate(interpolatedTokens)\n : null;\n let i = 0;\n let atInterpolation = false;\n let extendLastString = false;\n let { start: interpStart, end: interpEnd } = interpolationConfig;\n while (i < input.length) {\n if (!atInterpolation) {\n // parse until starting {{\n const start = i;\n i = input.indexOf(interpStart, i);\n if (i === -1) {\n i = input.length;\n }\n const text = input.substring(start, i);\n strings.push({ text, start, end: i });\n atInterpolation = true;\n }\n else {\n // parse from starting {{ to ending }} while ignoring content inside quotes.\n const fullStart = i;\n const exprStart = fullStart + interpStart.length;\n const exprEnd = this._getInterpolationEndIndex(input, interpEnd, exprStart);\n if (exprEnd === -1) {\n // Could not find the end of the interpolation; do not parse an expression.\n // Instead we should extend the content on the last raw string.\n atInterpolation = false;\n extendLastString = true;\n break;\n }\n const fullEnd = exprEnd + interpEnd.length;\n const text = input.substring(exprStart, exprEnd);\n if (text.trim().length === 0) {\n errors.push(getParseError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, parseSourceSpan));\n }\n expressions.push({ text, start: fullStart, end: fullEnd });\n const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;\n const offset = startInOriginalTemplate + interpStart.length;\n offsets.push(offset);\n i = fullEnd;\n atInterpolation = false;\n }\n }\n if (!atInterpolation) {\n // If we are now at a text section, add the remaining content as a raw string.\n if (extendLastString) {\n const piece = strings[strings.length - 1];\n piece.text += input.substring(i);\n piece.end = input.length;\n }\n else {\n strings.push({ text: input.substring(i), start: i, end: input.length });\n }\n }\n return new SplitInterpolation(strings, expressions, offsets);\n }\n wrapLiteralPrimitive(input, sourceSpanOrLocation, absoluteOffset) {\n const span = new ParseSpan(0, input == null ? 0 : input.length);\n return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, typeof sourceSpanOrLocation === 'string'\n ? sourceSpanOrLocation\n : getLocation(sourceSpanOrLocation), absoluteOffset, []);\n }\n _stripComments(input) {\n const i = this._commentStart(input);\n return i != null\n ? { stripped: input.substring(0, i), hasComments: true }\n : { stripped: input, hasComments: false };\n }\n _commentStart(input) {\n let outerQuote = null;\n for (let i = 0; i < input.length - 1; i++) {\n const char = input.charCodeAt(i);\n const nextChar = input.charCodeAt(i + 1);\n if (char === $SLASH && nextChar == $SLASH && outerQuote == null)\n return i;\n if (outerQuote === char) {\n outerQuote = null;\n }\n else if (outerQuote == null && isQuote(char)) {\n outerQuote = char;\n }\n }\n return null;\n }\n _checkNoInterpolation(errors, input, parseSourceSpan, { start, end }) {\n let startIndex = -1;\n let endIndex = -1;\n for (const charIndex of this._forEachUnquotedChar(input, 0)) {\n if (startIndex === -1) {\n if (input.startsWith(start)) {\n startIndex = charIndex;\n }\n }\n else {\n endIndex = this._getInterpolationEndIndex(input, end, charIndex);\n if (endIndex > -1) {\n break;\n }\n }\n }\n if (startIndex > -1 && endIndex > -1) {\n errors.push(getParseError(`Got interpolation (${start}${end}) where expression was expected`, input, `at column ${startIndex} in`, parseSourceSpan));\n }\n }\n /**\n * Finds the index of the end of an interpolation expression\n * while ignoring comments and quoted content.\n */\n _getInterpolationEndIndex(input, expressionEnd, start) {\n for (const charIndex of this._forEachUnquotedChar(input, start)) {\n if (input.startsWith(expressionEnd, charIndex)) {\n return charIndex;\n }\n // Nothing else in the expression matters after we've\n // hit a comment so look directly for the end token.\n if (input.startsWith('//', charIndex)) {\n return input.indexOf(expressionEnd, charIndex);\n }\n }\n return -1;\n }\n /**\n * Generator used to iterate over the character indexes of a string that are outside of quotes.\n * @param input String to loop through.\n * @param start Index within the string at which to start.\n */\n *_forEachUnquotedChar(input, start) {\n let currentQuote = null;\n let escapeCount = 0;\n for (let i = start; i < input.length; i++) {\n const char = input[i];\n // Skip the characters inside quotes. Note that we only care about the outer-most\n // quotes matching up and we need to account for escape characters.\n if (isQuote(input.charCodeAt(i)) &&\n (currentQuote === null || currentQuote === char) &&\n escapeCount % 2 === 0) {\n currentQuote = currentQuote === null ? char : null;\n }\n else if (currentQuote === null) {\n yield i;\n }\n escapeCount = char === '\\\\' ? escapeCount + 1 : 0;\n }\n }\n}\n/** Describes a stateful context an expression parser is in. */\nvar ParseContextFlags;\n(function (ParseContextFlags) {\n ParseContextFlags[ParseContextFlags[\"None\"] = 0] = \"None\";\n /**\n * A Writable context is one in which a value may be written to an lvalue.\n * For example, after we see a property access, we may expect a write to the\n * property via the \"=\" operator.\n * prop\n * ^ possible \"=\" after\n */\n ParseContextFlags[ParseContextFlags[\"Writable\"] = 1] = \"Writable\";\n})(ParseContextFlags || (ParseContextFlags = {}));\nclass _ParseAST {\n input;\n parseSourceSpan;\n absoluteOffset;\n tokens;\n parseFlags;\n errors;\n offset;\n supportsDirectPipeReferences;\n rparensExpected = 0;\n rbracketsExpected = 0;\n rbracesExpected = 0;\n context = ParseContextFlags.None;\n // Cache of expression start and input indeces to the absolute source span they map to, used to\n // prevent creating superfluous source spans in `sourceSpan`.\n // A serial of the expression start and input index is used for mapping because both are stateful\n // and may change for subsequent expressions visited by the parser.\n sourceSpanCache = new Map();\n index = 0;\n constructor(input, parseSourceSpan, absoluteOffset, tokens, parseFlags, errors, offset, supportsDirectPipeReferences) {\n this.input = input;\n this.parseSourceSpan = parseSourceSpan;\n this.absoluteOffset = absoluteOffset;\n this.tokens = tokens;\n this.parseFlags = parseFlags;\n this.errors = errors;\n this.offset = offset;\n this.supportsDirectPipeReferences = supportsDirectPipeReferences;\n }\n peek(offset) {\n const i = this.index + offset;\n return i < this.tokens.length ? this.tokens[i] : EOF;\n }\n get next() {\n return this.peek(0);\n }\n /** Whether all the parser input has been processed. */\n get atEOF() {\n return this.index >= this.tokens.length;\n }\n /**\n * Index of the next token to be processed, or the end of the last token if all have been\n * processed.\n */\n get inputIndex() {\n return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;\n }\n /**\n * End index of the last processed token, or the start of the first token if none have been\n * processed.\n */\n get currentEndIndex() {\n if (this.index > 0) {\n const curToken = this.peek(-1);\n return curToken.end + this.offset;\n }\n // No tokens have been processed yet; return the next token's start or the length of the input\n // if there is no token.\n if (this.tokens.length === 0) {\n return this.input.length + this.offset;\n }\n return this.next.index + this.offset;\n }\n /**\n * Returns the absolute offset of the start of the current token.\n */\n get currentAbsoluteOffset() {\n return this.absoluteOffset + this.inputIndex;\n }\n /**\n * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if\n * provided).\n *\n * @param start Position from which the `ParseSpan` will start.\n * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the\n * natural ending index)\n */\n span(start, artificialEndIndex) {\n let endIndex = this.currentEndIndex;\n if (artificialEndIndex !== undefined && artificialEndIndex > this.currentEndIndex) {\n endIndex = artificialEndIndex;\n }\n // In some unusual parsing scenarios (like when certain tokens are missing and an `EmptyExpr` is\n // being created), the current token may already be advanced beyond the `currentEndIndex`. This\n // appears to be a deep-seated parser bug.\n //\n // As a workaround for now, swap the start and end indices to ensure a valid `ParseSpan`.\n // TODO(alxhub): fix the bug upstream in the parser state, and remove this workaround.\n if (start > endIndex) {\n const tmp = endIndex;\n endIndex = start;\n start = tmp;\n }\n return new ParseSpan(start, endIndex);\n }\n sourceSpan(start, artificialEndIndex) {\n const serial = `${start}@${this.inputIndex}:${artificialEndIndex}`;\n if (!this.sourceSpanCache.has(serial)) {\n this.sourceSpanCache.set(serial, this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset));\n }\n return this.sourceSpanCache.get(serial);\n }\n advance() {\n this.index++;\n }\n /**\n * Executes a callback in the provided context.\n */\n withContext(context, cb) {\n this.context |= context;\n const ret = cb();\n this.context ^= context;\n return ret;\n }\n consumeOptionalCharacter(code) {\n if (this.next.isCharacter(code)) {\n this.advance();\n return true;\n }\n else {\n return false;\n }\n }\n peekKeywordLet() {\n return this.next.isKeywordLet();\n }\n peekKeywordAs() {\n return this.next.isKeywordAs();\n }\n /**\n * Consumes an expected character, otherwise emits an error about the missing expected character\n * and skips over the token stream until reaching a recoverable point.\n *\n * See `this.error` and `this.skip` for more details.\n */\n expectCharacter(code) {\n if (this.consumeOptionalCharacter(code))\n return;\n this.error(`Missing expected ${String.fromCharCode(code)}`);\n }\n consumeOptionalOperator(op) {\n if (this.next.isOperator(op)) {\n this.advance();\n return true;\n }\n else {\n return false;\n }\n }\n isAssignmentOperator(token) {\n return token.type === TokenType.Operator && Binary.isAssignmentOperation(token.strValue);\n }\n expectOperator(operator) {\n if (this.consumeOptionalOperator(operator))\n return;\n this.error(`Missing expected operator ${operator}`);\n }\n prettyPrintToken(tok) {\n return tok === EOF ? 'end of input' : `token ${tok}`;\n }\n expectIdentifierOrKeyword() {\n const n = this.next;\n if (!n.isIdentifier() && !n.isKeyword()) {\n if (n.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword');\n }\n else {\n this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);\n }\n return null;\n }\n this.advance();\n return n.toString();\n }\n expectIdentifierOrKeywordOrString() {\n const n = this.next;\n if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {\n if (n.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string');\n }\n else {\n this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);\n }\n return '';\n }\n this.advance();\n return n.toString();\n }\n parseChain() {\n const exprs = [];\n const start = this.inputIndex;\n while (this.index < this.tokens.length) {\n const expr = this.parsePipe();\n exprs.push(expr);\n if (this.consumeOptionalCharacter($SEMICOLON)) {\n if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {\n this.error('Binding expression cannot contain chained expression');\n }\n while (this.consumeOptionalCharacter($SEMICOLON)) { } // read all semicolons\n }\n else if (this.index < this.tokens.length) {\n const errorIndex = this.index;\n this.error(`Unexpected token '${this.next}'`);\n // The `error` call above will skip ahead to the next recovery point in an attempt to\n // recover part of the expression, but that might be the token we started from which will\n // lead to an infinite loop. If that's the case, break the loop assuming that we can't\n // parse further.\n if (this.index === errorIndex) {\n break;\n }\n }\n }\n if (exprs.length === 0) {\n // We have no expressions so create an empty expression that spans the entire input length\n const artificialStart = this.offset;\n const artificialEnd = this.offset + this.input.length;\n return new EmptyExpr$1(this.span(artificialStart, artificialEnd), this.sourceSpan(artificialStart, artificialEnd));\n }\n if (exprs.length == 1)\n return exprs[0];\n return new Chain(this.span(start), this.sourceSpan(start), exprs);\n }\n parsePipe() {\n const start = this.inputIndex;\n let result = this.parseExpression();\n if (this.consumeOptionalOperator('|')) {\n if (this.parseFlags & 1 /* ParseFlags.Action */) {\n this.error(`Cannot have a pipe in an action expression`);\n }\n do {\n const nameStart = this.inputIndex;\n let nameId = this.expectIdentifierOrKeyword();\n let nameSpan;\n let fullSpanEnd = undefined;\n if (nameId !== null) {\n nameSpan = this.sourceSpan(nameStart);\n }\n else {\n // No valid identifier was found, so we'll assume an empty pipe name ('').\n nameId = '';\n // However, there may have been whitespace present between the pipe character and the next\n // token in the sequence (or the end of input). We want to track this whitespace so that\n // the `BindingPipe` we produce covers not just the pipe character, but any trailing\n // whitespace beyond it. Another way of thinking about this is that the zero-length name\n // is assumed to be at the end of any whitespace beyond the pipe character.\n //\n // Therefore, we push the end of the `ParseSpan` for this pipe all the way up to the\n // beginning of the next token, or until the end of input if the next token is EOF.\n fullSpanEnd = this.next.index !== -1 ? this.next.index : this.input.length + this.offset;\n // The `nameSpan` for an empty pipe name is zero-length at the end of any whitespace\n // beyond the pipe character.\n nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset);\n }\n const args = [];\n while (this.consumeOptionalCharacter($COLON)) {\n args.push(this.parseExpression());\n // If there are additional expressions beyond the name, then the artificial end for the\n // name is no longer relevant.\n }\n let type;\n if (this.supportsDirectPipeReferences) {\n const charCode = nameId.charCodeAt(0);\n type =\n charCode === $_ || (charCode >= $A && charCode <= $Z)\n ? BindingPipeType.ReferencedDirectly\n : BindingPipeType.ReferencedByName;\n }\n else {\n type = BindingPipeType.ReferencedByName;\n }\n result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, type, nameSpan);\n } while (this.consumeOptionalOperator('|'));\n }\n return result;\n }\n parseExpression() {\n return this.parseConditional();\n }\n parseConditional() {\n const start = this.inputIndex;\n const result = this.parseLogicalOr();\n if (this.consumeOptionalOperator('?')) {\n const yes = this.parsePipe();\n let no;\n if (!this.consumeOptionalCharacter($COLON)) {\n const end = this.inputIndex;\n const expression = this.input.substring(start, end);\n this.error(`Conditional expression ${expression} requires all 3 expressions`);\n no = new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n else {\n no = this.parsePipe();\n }\n return new Conditional(this.span(start), this.sourceSpan(start), result, yes, no);\n }\n else {\n return result;\n }\n }\n parseLogicalOr() {\n // '||'\n const start = this.inputIndex;\n let result = this.parseLogicalAnd();\n while (this.consumeOptionalOperator('||')) {\n const right = this.parseLogicalAnd();\n result = new Binary(this.span(start), this.sourceSpan(start), '||', result, right);\n }\n return result;\n }\n parseLogicalAnd() {\n // '&&'\n const start = this.inputIndex;\n let result = this.parseNullishCoalescing();\n while (this.consumeOptionalOperator('&&')) {\n const right = this.parseNullishCoalescing();\n result = new Binary(this.span(start), this.sourceSpan(start), '&&', result, right);\n }\n return result;\n }\n parseNullishCoalescing() {\n // '??'\n const start = this.inputIndex;\n let result = this.parseEquality();\n while (this.consumeOptionalOperator('??')) {\n const right = this.parseEquality();\n result = new Binary(this.span(start), this.sourceSpan(start), '??', result, right);\n }\n return result;\n }\n parseEquality() {\n // '==','!=','===','!=='\n const start = this.inputIndex;\n let result = this.parseRelational();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '==':\n case '===':\n case '!=':\n case '!==':\n this.advance();\n const right = this.parseRelational();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n parseRelational() {\n // '<', '>', '<=', '>=', 'in'\n const start = this.inputIndex;\n let result = this.parseAdditive();\n while (this.next.type == TokenType.Operator || this.next.isKeywordIn) {\n const operator = this.next.strValue;\n switch (operator) {\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'in':\n this.advance();\n const right = this.parseAdditive();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n parseAdditive() {\n // '+', '-'\n const start = this.inputIndex;\n let result = this.parseMultiplicative();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '+':\n case '-':\n this.advance();\n let right = this.parseMultiplicative();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n parseMultiplicative() {\n // '*', '%', '/'\n const start = this.inputIndex;\n let result = this.parseExponentiation();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '*':\n case '%':\n case '/':\n this.advance();\n const right = this.parseExponentiation();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n parseExponentiation() {\n // '**'\n const start = this.inputIndex;\n let result = this.parsePrefix();\n while (this.next.type == TokenType.Operator && this.next.strValue === '**') {\n // This aligns with Javascript semantics which require any unary operator preceeding the\n // exponentiation operation to be explicitly grouped as either applying to the base or result\n // of the exponentiation operation.\n if (result instanceof Unary ||\n result instanceof PrefixNot ||\n result instanceof TypeofExpression ||\n result instanceof VoidExpression) {\n this.error('Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence');\n }\n this.advance();\n const right = this.parseExponentiation();\n result = new Binary(this.span(start), this.sourceSpan(start), '**', result, right);\n }\n return result;\n }\n parsePrefix() {\n if (this.next.type == TokenType.Operator) {\n const start = this.inputIndex;\n const operator = this.next.strValue;\n let result;\n switch (operator) {\n case '+':\n this.advance();\n result = this.parsePrefix();\n return Unary.createPlus(this.span(start), this.sourceSpan(start), result);\n case '-':\n this.advance();\n result = this.parsePrefix();\n return Unary.createMinus(this.span(start), this.sourceSpan(start), result);\n case '!':\n this.advance();\n result = this.parsePrefix();\n return new PrefixNot(this.span(start), this.sourceSpan(start), result);\n }\n }\n else if (this.next.isKeywordTypeof()) {\n this.advance();\n const start = this.inputIndex;\n let result = this.parsePrefix();\n return new TypeofExpression(this.span(start), this.sourceSpan(start), result);\n }\n else if (this.next.isKeywordVoid()) {\n this.advance();\n const start = this.inputIndex;\n let result = this.parsePrefix();\n return new VoidExpression(this.span(start), this.sourceSpan(start), result);\n }\n return this.parseCallChain();\n }\n parseCallChain() {\n const start = this.inputIndex;\n let result = this.parsePrimary();\n while (true) {\n if (this.consumeOptionalCharacter($PERIOD)) {\n result = this.parseAccessMember(result, start, false);\n }\n else if (this.consumeOptionalOperator('?.')) {\n if (this.consumeOptionalCharacter($LPAREN)) {\n result = this.parseCall(result, start, true);\n }\n else {\n result = this.consumeOptionalCharacter($LBRACKET)\n ? this.parseKeyedReadOrWrite(result, start, true)\n : this.parseAccessMember(result, start, true);\n }\n }\n else if (this.consumeOptionalCharacter($LBRACKET)) {\n result = this.parseKeyedReadOrWrite(result, start, false);\n }\n else if (this.consumeOptionalCharacter($LPAREN)) {\n result = this.parseCall(result, start, false);\n }\n else if (this.consumeOptionalOperator('!')) {\n result = new NonNullAssert(this.span(start), this.sourceSpan(start), result);\n }\n else if (this.next.isTemplateLiteralEnd()) {\n result = this.parseNoInterpolationTaggedTemplateLiteral(result, start);\n }\n else if (this.next.isTemplateLiteralPart()) {\n result = this.parseTaggedTemplateLiteral(result, start);\n }\n else {\n return result;\n }\n }\n }\n parsePrimary() {\n const start = this.inputIndex;\n if (this.consumeOptionalCharacter($LPAREN)) {\n this.rparensExpected++;\n const result = this.parsePipe();\n if (!this.consumeOptionalCharacter($RPAREN)) {\n this.error('Missing closing parentheses');\n // Calling into `error` above will attempt to recover up until the next closing paren.\n // If that's the case, consume it so we can partially recover the expression.\n this.consumeOptionalCharacter($RPAREN);\n }\n this.rparensExpected--;\n return new ParenthesizedExpression(this.span(start), this.sourceSpan(start), result);\n }\n else if (this.next.isKeywordNull()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);\n }\n else if (this.next.isKeywordUndefined()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0);\n }\n else if (this.next.isKeywordTrue()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);\n }\n else if (this.next.isKeywordFalse()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);\n }\n else if (this.next.isKeywordIn()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), 'in');\n }\n else if (this.next.isKeywordThis()) {\n this.advance();\n return new ThisReceiver(this.span(start), this.sourceSpan(start));\n }\n else if (this.consumeOptionalCharacter($LBRACKET)) {\n this.rbracketsExpected++;\n const elements = this.parseExpressionList($RBRACKET);\n this.rbracketsExpected--;\n this.expectCharacter($RBRACKET);\n return new LiteralArray(this.span(start), this.sourceSpan(start), elements);\n }\n else if (this.next.isCharacter($LBRACE)) {\n return this.parseLiteralMap();\n }\n else if (this.next.isIdentifier()) {\n return this.parseAccessMember(new ImplicitReceiver(this.span(start), this.sourceSpan(start)), start, false);\n }\n else if (this.next.isNumber()) {\n const value = this.next.toNumber();\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value);\n }\n else if (this.next.isTemplateLiteralEnd()) {\n return this.parseNoInterpolationTemplateLiteral();\n }\n else if (this.next.isTemplateLiteralPart()) {\n return this.parseTemplateLiteral();\n }\n else if (this.next.isString() && this.next.kind === StringTokenKind.Plain) {\n const literalValue = this.next.toString();\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);\n }\n else if (this.next.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(this.next, null);\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n else if (this.index >= this.tokens.length) {\n this.error(`Unexpected end of expression: ${this.input}`);\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n else {\n this.error(`Unexpected token ${this.next}`);\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n }\n parseExpressionList(terminator) {\n const result = [];\n do {\n if (!this.next.isCharacter(terminator)) {\n result.push(this.parsePipe());\n }\n else {\n break;\n }\n } while (this.consumeOptionalCharacter($COMMA));\n return result;\n }\n parseLiteralMap() {\n const keys = [];\n const values = [];\n const start = this.inputIndex;\n this.expectCharacter($LBRACE);\n if (!this.consumeOptionalCharacter($RBRACE)) {\n this.rbracesExpected++;\n do {\n const keyStart = this.inputIndex;\n const quoted = this.next.isString();\n const key = this.expectIdentifierOrKeywordOrString();\n const literalMapKey = { key, quoted };\n keys.push(literalMapKey);\n // Properties with quoted keys can't use the shorthand syntax.\n if (quoted) {\n this.expectCharacter($COLON);\n values.push(this.parsePipe());\n }\n else if (this.consumeOptionalCharacter($COLON)) {\n values.push(this.parsePipe());\n }\n else {\n literalMapKey.isShorthandInitialized = true;\n const span = this.span(keyStart);\n const sourceSpan = this.sourceSpan(keyStart);\n values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));\n }\n } while (this.consumeOptionalCharacter($COMMA) &&\n !this.next.isCharacter($RBRACE));\n this.rbracesExpected--;\n this.expectCharacter($RBRACE);\n }\n return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values);\n }\n parseAccessMember(readReceiver, start, isSafe) {\n const nameStart = this.inputIndex;\n const id = this.withContext(ParseContextFlags.Writable, () => {\n const id = this.expectIdentifierOrKeyword() ?? '';\n if (id.length === 0) {\n this.error(`Expected identifier for property access`, readReceiver.span.end);\n }\n return id;\n });\n const nameSpan = this.sourceSpan(nameStart);\n if (isSafe) {\n if (this.isAssignmentOperator(this.next)) {\n this.advance();\n this.error(\"The '?.' operator cannot be used in the assignment\");\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n else {\n return new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);\n }\n }\n else {\n if (this.isAssignmentOperator(this.next)) {\n const operation = this.next.strValue;\n if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {\n this.advance();\n this.error('Bindings cannot contain assignments');\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n }\n const receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);\n this.advance();\n const value = this.parseConditional();\n return new Binary(this.span(start), this.sourceSpan(start), operation, receiver, value);\n }\n else {\n return new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);\n }\n }\n }\n parseCall(receiver, start, isSafe) {\n const argumentStart = this.inputIndex;\n this.rparensExpected++;\n const args = this.parseCallArguments();\n const argumentSpan = this.span(argumentStart, this.inputIndex).toAbsolute(this.absoluteOffset);\n this.expectCharacter($RPAREN);\n this.rparensExpected--;\n const span = this.span(start);\n const sourceSpan = this.sourceSpan(start);\n return isSafe\n ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan)\n : new Call(span, sourceSpan, receiver, args, argumentSpan);\n }\n parseCallArguments() {\n if (this.next.isCharacter($RPAREN))\n return [];\n const positionals = [];\n do {\n positionals.push(this.parsePipe());\n } while (this.consumeOptionalCharacter($COMMA));\n return positionals;\n }\n /**\n * Parses an identifier, a keyword, a string with an optional `-` in between,\n * and returns the string along with its absolute source span.\n */\n expectTemplateBindingKey() {\n let result = '';\n let operatorFound = false;\n const start = this.currentAbsoluteOffset;\n do {\n result += this.expectIdentifierOrKeywordOrString();\n operatorFound = this.consumeOptionalOperator('-');\n if (operatorFound) {\n result += '-';\n }\n } while (operatorFound);\n return {\n source: result,\n span: new AbsoluteSourceSpan(start, start + result.length),\n };\n }\n /**\n * Parse microsyntax template expression and return a list of bindings or\n * parsing errors in case the given expression is invalid.\n *\n * For example,\n * ```html\n * \n * ```\n * contains five bindings:\n * 1. ngFor -> null\n * 2. item -> NgForOfContext.$implicit\n * 3. ngForOf -> items\n * 4. i -> NgForOfContext.index\n * 5. ngForTrackBy -> func\n *\n * For a full description of the microsyntax grammar, see\n * https://gist.github.com/mhevery/d3530294cff2e4a1b3fe15ff75d08855\n *\n * @param templateKey name of the microsyntax directive, like ngIf, ngFor,\n * without the *, along with its absolute span.\n */\n parseTemplateBindings(templateKey) {\n const bindings = [];\n // The first binding is for the template key itself\n // In *ngFor=\"let item of items\", key = \"ngFor\", value = null\n // In *ngIf=\"cond | pipe\", key = \"ngIf\", value = \"cond | pipe\"\n bindings.push(...this.parseDirectiveKeywordBindings(templateKey));\n while (this.index < this.tokens.length) {\n // If it starts with 'let', then this must be variable declaration\n const letBinding = this.parseLetBinding();\n if (letBinding) {\n bindings.push(letBinding);\n }\n else {\n // Two possible cases here, either `value \"as\" key` or\n // \"directive-keyword expression\". We don't know which case, but both\n // \"value\" and \"directive-keyword\" are template binding key, so consume\n // the key first.\n const key = this.expectTemplateBindingKey();\n // Peek at the next token, if it is \"as\" then this must be variable\n // declaration.\n const binding = this.parseAsBinding(key);\n if (binding) {\n bindings.push(binding);\n }\n else {\n // Otherwise the key must be a directive keyword, like \"of\". Transform\n // the key to actual key. Eg. of -> ngForOf, trackBy -> ngForTrackBy\n key.source =\n templateKey.source + key.source.charAt(0).toUpperCase() + key.source.substring(1);\n bindings.push(...this.parseDirectiveKeywordBindings(key));\n }\n }\n this.consumeStatementTerminator();\n }\n return new TemplateBindingParseResult(bindings, [] /* warnings */, this.errors);\n }\n parseKeyedReadOrWrite(receiver, start, isSafe) {\n return this.withContext(ParseContextFlags.Writable, () => {\n this.rbracketsExpected++;\n const key = this.parsePipe();\n if (key instanceof EmptyExpr$1) {\n this.error(`Key access cannot be empty`);\n }\n this.rbracketsExpected--;\n this.expectCharacter($RBRACKET);\n if (this.isAssignmentOperator(this.next)) {\n const operation = this.next.strValue;\n if (isSafe) {\n this.advance();\n this.error(\"The '?.' operator cannot be used in the assignment\");\n }\n else {\n const binaryReceiver = new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);\n this.advance();\n const value = this.parseConditional();\n return new Binary(this.span(start), this.sourceSpan(start), operation, binaryReceiver, value);\n }\n }\n else {\n return isSafe\n ? new SafeKeyedRead(this.span(start), this.sourceSpan(start), receiver, key)\n : new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);\n }\n return new EmptyExpr$1(this.span(start), this.sourceSpan(start));\n });\n }\n /**\n * Parse a directive keyword, followed by a mandatory expression.\n * For example, \"of items\", \"trackBy: func\".\n * The bindings are: ngForOf -> items, ngForTrackBy -> func\n * There could be an optional \"as\" binding that follows the expression.\n * For example,\n * ```\n * *ngFor=\"let item of items | slice:0:1 as collection\".\n * ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^\n * keyword bound target optional 'as' binding\n * ```\n *\n * @param key binding key, for example, ngFor, ngIf, ngForOf, along with its\n * absolute span.\n */\n parseDirectiveKeywordBindings(key) {\n const bindings = [];\n this.consumeOptionalCharacter($COLON); // trackBy: trackByFunction\n const value = this.getDirectiveBoundTarget();\n let spanEnd = this.currentAbsoluteOffset;\n // The binding could optionally be followed by \"as\". For example,\n // *ngIf=\"cond | pipe as x\". In this case, the key in the \"as\" binding\n // is \"x\" and the value is the template key itself (\"ngIf\"). Note that the\n // 'key' in the current context now becomes the \"value\" in the next binding.\n const asBinding = this.parseAsBinding(key);\n if (!asBinding) {\n this.consumeStatementTerminator();\n spanEnd = this.currentAbsoluteOffset;\n }\n const sourceSpan = new AbsoluteSourceSpan(key.span.start, spanEnd);\n bindings.push(new ExpressionBinding(sourceSpan, key, value));\n if (asBinding) {\n bindings.push(asBinding);\n }\n return bindings;\n }\n /**\n * Return the expression AST for the bound target of a directive keyword\n * binding. For example,\n * ```\n * *ngIf=\"condition | pipe\"\n * ^^^^^^^^^^^^^^^^ bound target for \"ngIf\"\n * *ngFor=\"let item of items\"\n * ^^^^^ bound target for \"ngForOf\"\n * ```\n */\n getDirectiveBoundTarget() {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const { start, end } = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, getLocation(this.parseSourceSpan), this.absoluteOffset + start, this.errors);\n }\n /**\n * Return the binding for a variable declared using `as`. Note that the order\n * of the key-value pair in this declaration is reversed. For example,\n * ```\n * *ngFor=\"let item of items; index as i\"\n * ^^^^^ ^\n * value key\n * ```\n *\n * @param value name of the value in the declaration, \"ngIf\" in the example\n * above, along with its absolute span.\n */\n parseAsBinding(value) {\n if (!this.peekKeywordAs()) {\n return null;\n }\n this.advance(); // consume the 'as' keyword\n const key = this.expectTemplateBindingKey();\n this.consumeStatementTerminator();\n const sourceSpan = new AbsoluteSourceSpan(value.span.start, this.currentAbsoluteOffset);\n return new VariableBinding(sourceSpan, key, value);\n }\n /**\n * Return the binding for a variable declared using `let`. For example,\n * ```\n * *ngFor=\"let item of items; let i=index;\"\n * ^^^^^^^^ ^^^^^^^^^^^\n * ```\n * In the first binding, `item` is bound to `NgForOfContext.$implicit`.\n * In the second binding, `i` is bound to `NgForOfContext.index`.\n */\n parseLetBinding() {\n if (!this.peekKeywordLet()) {\n return null;\n }\n const spanStart = this.currentAbsoluteOffset;\n this.advance(); // consume the 'let' keyword\n const key = this.expectTemplateBindingKey();\n let value = null;\n if (this.consumeOptionalOperator('=')) {\n value = this.expectTemplateBindingKey();\n }\n this.consumeStatementTerminator();\n const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);\n return new VariableBinding(sourceSpan, key, value);\n }\n parseNoInterpolationTaggedTemplateLiteral(tag, start) {\n const template = this.parseNoInterpolationTemplateLiteral();\n return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template);\n }\n parseNoInterpolationTemplateLiteral() {\n const text = this.next.strValue;\n const start = this.inputIndex;\n this.advance();\n const span = this.span(start);\n const sourceSpan = this.sourceSpan(start);\n return new TemplateLiteral(span, sourceSpan, [new TemplateLiteralElement(span, sourceSpan, text)], []);\n }\n parseTaggedTemplateLiteral(tag, start) {\n const template = this.parseTemplateLiteral();\n return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template);\n }\n parseTemplateLiteral() {\n const elements = [];\n const expressions = [];\n const start = this.inputIndex;\n while (this.next !== EOF) {\n const token = this.next;\n if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) {\n const partStart = this.inputIndex;\n this.advance();\n elements.push(new TemplateLiteralElement(this.span(partStart), this.sourceSpan(partStart), token.strValue));\n if (token.isTemplateLiteralEnd()) {\n break;\n }\n }\n else if (token.isTemplateLiteralInterpolationStart()) {\n this.advance();\n const expression = this.parsePipe();\n if (expression instanceof EmptyExpr$1) {\n this.error('Template literal interpolation cannot be empty');\n }\n else {\n expressions.push(expression);\n }\n }\n else {\n this.advance();\n }\n }\n return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions);\n }\n /**\n * Consume the optional statement terminator: semicolon or comma.\n */\n consumeStatementTerminator() {\n this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA);\n }\n /**\n * Records an error and skips over the token stream until reaching a recoverable point. See\n * `this.skip` for more details on token skipping.\n */\n error(message, index = this.index) {\n this.errors.push(getParseError(message, this.input, this.getErrorLocationText(index), this.parseSourceSpan));\n this.skip();\n }\n getErrorLocationText(index) {\n return index < this.tokens.length\n ? `at column ${this.tokens[index].index + 1} in`\n : `at the end of the expression`;\n }\n /**\n * Records an error for an unexpected private identifier being discovered.\n * @param token Token representing a private identifier.\n * @param extraMessage Optional additional message being appended to the error.\n */\n _reportErrorForPrivateIdentifier(token, extraMessage) {\n let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`;\n if (extraMessage !== null) {\n errorMessage += `, ${extraMessage}`;\n }\n this.error(errorMessage);\n }\n /**\n * Error recovery should skip tokens until it encounters a recovery point.\n *\n * The following are treated as unconditional recovery points:\n * - end of input\n * - ';' (parseChain() is always the root production, and it expects a ';')\n * - '|' (since pipes may be chained and each pipe expression may be treated independently)\n *\n * The following are conditional recovery points:\n * - ')', '}', ']' if one of calling productions is expecting one of these symbols\n * - This allows skip() to recover from errors such as '(a.) + 1' allowing more of the AST to\n * be retained (it doesn't skip any tokens as the ')' is retained because of the '(' begins\n * an '('
')' production).\n * The recovery points of grouping symbols must be conditional as they must be skipped if\n * none of the calling productions are not expecting the closing token else we will never\n * make progress in the case of an extraneous group closing symbol (such as a stray ')').\n * That is, we skip a closing symbol if we are not in a grouping production.\n * - Assignment in a `Writable` context\n * - In this context, we are able to recover after seeing the `=` operator, which\n * signals the presence of an independent rvalue expression following the `=` operator.\n *\n * If a production expects one of these token it increments the corresponding nesting count,\n * and then decrements it just prior to checking if the token is in the input.\n */\n skip() {\n let n = this.next;\n while (this.index < this.tokens.length &&\n !n.isCharacter($SEMICOLON) &&\n !n.isOperator('|') &&\n (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&\n (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&\n (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET)) &&\n (!(this.context & ParseContextFlags.Writable) || !this.isAssignmentOperator(n))) {\n if (this.next.isError()) {\n this.errors.push(getParseError(this.next.toString(), this.input, this.getErrorLocationText(this.next.index), this.parseSourceSpan));\n }\n this.advance();\n n = this.next;\n }\n }\n}\nfunction getParseError(message, input, locationText, parseSourceSpan) {\n if (locationText.length > 0) {\n locationText = ` ${locationText} `;\n }\n const location = getLocation(parseSourceSpan);\n const error = `Parser Error: ${message}${locationText}[${input}] in ${location}`;\n return new ParseError(parseSourceSpan, error);\n}\nclass SimpleExpressionChecker extends RecursiveAstVisitor {\n errors = [];\n visitPipe() {\n this.errors.push('pipes');\n }\n}\n/**\n * Computes the real offset in the original template for indexes in an interpolation.\n *\n * Because templates can have encoded HTML entities and the input passed to the parser at this stage\n * of the compiler is the _decoded_ value, we need to compute the real offset using the original\n * encoded values in the interpolated tokens. Note that this is only a special case handling for\n * `MlParserTokenType.ENCODED_ENTITY` token types. All other interpolated tokens are expected to\n * have parts which exactly match the input string for parsing the interpolation.\n *\n * @param interpolatedTokens The tokens for the interpolated value.\n *\n * @returns A map of index locations in the decoded template to indexes in the original template\n */\nfunction getIndexMapForOriginalTemplate(interpolatedTokens) {\n let offsetMap = new Map();\n let consumedInOriginalTemplate = 0;\n let consumedInInput = 0;\n let tokenIndex = 0;\n while (tokenIndex < interpolatedTokens.length) {\n const currentToken = interpolatedTokens[tokenIndex];\n if (currentToken.type === 9 /* MlParserTokenType.ENCODED_ENTITY */) {\n const [decoded, encoded] = currentToken.parts;\n consumedInOriginalTemplate += encoded.length;\n consumedInInput += decoded.length;\n }\n else {\n const lengthOfParts = currentToken.parts.reduce((sum, current) => sum + current.length, 0);\n consumedInInput += lengthOfParts;\n consumedInOriginalTemplate += lengthOfParts;\n }\n offsetMap.set(consumedInInput, consumedInOriginalTemplate);\n tokenIndex++;\n }\n return offsetMap;\n}\n\n/** Serializes the given AST into a normalized string format. */\nfunction serialize(expression) {\n return expression.visit(new SerializeExpressionVisitor());\n}\nclass SerializeExpressionVisitor {\n visitUnary(ast, context) {\n return `${ast.operator}${ast.expr.visit(this, context)}`;\n }\n visitBinary(ast, context) {\n return `${ast.left.visit(this, context)} ${ast.operation} ${ast.right.visit(this, context)}`;\n }\n visitChain(ast, context) {\n return ast.expressions.map((e) => e.visit(this, context)).join('; ');\n }\n visitConditional(ast, context) {\n return `${ast.condition.visit(this, context)} ? ${ast.trueExp.visit(this, context)} : ${ast.falseExp.visit(this, context)}`;\n }\n visitThisReceiver() {\n return 'this';\n }\n visitImplicitReceiver() {\n return '';\n }\n visitInterpolation(ast, context) {\n return interleave(ast.strings, ast.expressions.map((e) => e.visit(this, context))).join('');\n }\n visitKeyedRead(ast, context) {\n return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}]`;\n }\n visitLiteralArray(ast, context) {\n return `[${ast.expressions.map((e) => e.visit(this, context)).join(', ')}]`;\n }\n visitLiteralMap(ast, context) {\n return `{${zip(ast.keys.map((literal) => (literal.quoted ? `'${literal.key}'` : literal.key)), ast.values.map((value) => value.visit(this, context)))\n .map(([key, value]) => `${key}: ${value}`)\n .join(', ')}}`;\n }\n visitLiteralPrimitive(ast) {\n if (ast.value === null)\n return 'null';\n switch (typeof ast.value) {\n case 'number':\n case 'boolean':\n return ast.value.toString();\n case 'undefined':\n return 'undefined';\n case 'string':\n return `'${ast.value.replace(/'/g, `\\\\'`)}'`;\n default:\n throw new Error(`Unsupported primitive type: ${ast.value}`);\n }\n }\n visitPipe(ast, context) {\n return `${ast.exp.visit(this, context)} | ${ast.name}`;\n }\n visitPrefixNot(ast, context) {\n return `!${ast.expression.visit(this, context)}`;\n }\n visitNonNullAssert(ast, context) {\n return `${ast.expression.visit(this, context)}!`;\n }\n visitPropertyRead(ast, context) {\n if (ast.receiver instanceof ImplicitReceiver) {\n return ast.name;\n }\n else {\n return `${ast.receiver.visit(this, context)}.${ast.name}`;\n }\n }\n visitSafePropertyRead(ast, context) {\n return `${ast.receiver.visit(this, context)}?.${ast.name}`;\n }\n visitSafeKeyedRead(ast, context) {\n return `${ast.receiver.visit(this, context)}?.[${ast.key.visit(this, context)}]`;\n }\n visitCall(ast, context) {\n return `${ast.receiver.visit(this, context)}(${ast.args\n .map((e) => e.visit(this, context))\n .join(', ')})`;\n }\n visitSafeCall(ast, context) {\n return `${ast.receiver.visit(this, context)}?.(${ast.args\n .map((e) => e.visit(this, context))\n .join(', ')})`;\n }\n visitTypeofExpression(ast, context) {\n return `typeof ${ast.expression.visit(this, context)}`;\n }\n visitVoidExpression(ast, context) {\n return `void ${ast.expression.visit(this, context)}`;\n }\n visitASTWithSource(ast, context) {\n return ast.ast.visit(this, context);\n }\n visitTemplateLiteral(ast, context) {\n let result = '';\n for (let i = 0; i < ast.elements.length; i++) {\n result += ast.elements[i].visit(this, context);\n const expression = i < ast.expressions.length ? ast.expressions[i] : null;\n if (expression !== null) {\n result += '${' + expression.visit(this, context) + '}';\n }\n }\n return '`' + result + '`';\n }\n visitTemplateLiteralElement(ast, context) {\n return ast.text;\n }\n visitTaggedTemplateLiteral(ast, context) {\n return ast.tag.visit(this, context) + ast.template.visit(this, context);\n }\n visitParenthesizedExpression(ast, context) {\n return '(' + ast.expression.visit(this, context) + ')';\n }\n}\n/** Zips the two input arrays into a single array of pairs of elements at the same index. */\nfunction zip(left, right) {\n if (left.length !== right.length)\n throw new Error('Array lengths must match');\n return left.map((l, i) => [l, right[i]]);\n}\n/**\n * Interleaves the two arrays, starting with the first item on the left, then the first item\n * on the right, second item from the left, and so on. When the first array's items are exhausted,\n * the remaining items from the other array are included with no interleaving.\n */\nfunction interleave(left, right) {\n const result = [];\n for (let index = 0; index < Math.max(left.length, right.length); index++) {\n if (index < left.length)\n result.push(left[index]);\n if (index < right.length)\n result.push(right[index]);\n }\n return result;\n}\n\n// =================================================================================================\n// =================================================================================================\n// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========\n// =================================================================================================\n// =================================================================================================\n//\n// DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!\n// Reach out to mprobst for details.\n//\n// =================================================================================================\n/** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */\nlet _SECURITY_SCHEMA;\nfunction SECURITY_SCHEMA() {\n if (!_SECURITY_SCHEMA) {\n _SECURITY_SCHEMA = {};\n // Case is insignificant below, all element and attribute names are lower-cased for lookup.\n registerContext(SecurityContext.HTML, ['iframe|srcdoc', '*|innerHTML', '*|outerHTML']);\n registerContext(SecurityContext.STYLE, ['*|style']);\n // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.\n registerContext(SecurityContext.URL, [\n '*|formAction',\n 'area|href',\n 'area|ping',\n 'audio|src',\n 'a|href',\n 'a|ping',\n 'blockquote|cite',\n 'body|background',\n 'del|cite',\n 'form|action',\n 'img|src',\n 'input|src',\n 'ins|cite',\n 'q|cite',\n 'source|src',\n 'track|src',\n 'video|poster',\n 'video|src',\n ]);\n registerContext(SecurityContext.RESOURCE_URL, [\n 'applet|code',\n 'applet|codebase',\n 'base|href',\n 'embed|src',\n 'frame|src',\n 'head|profile',\n 'html|manifest',\n 'iframe|src',\n 'link|href',\n 'media|src',\n 'object|codebase',\n 'object|data',\n 'script|src',\n ]);\n }\n return _SECURITY_SCHEMA;\n}\nfunction registerContext(ctx, specs) {\n for (const spec of specs)\n _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;\n}\n/**\n * The set of security-sensitive attributes of an `