{"version":3,"file":"_router-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/shared.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/first_value_from.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/collection.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/url_tree.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/create_url_tree.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/events.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/router_outlet_context.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/tree.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/router_state.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/directives/router_outlet.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/components/empty_outlet.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/create_router_state.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/models.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/navigation_canceling_error.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/activate_routes.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/preactivation.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/type_guards.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/prioritized_guard_value.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/abort_signal_to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/check_guards.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/apply_redirects.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/config.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/config_matching.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/recognize.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/recognize.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/resolve_data.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/operators/switch_tap.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/page_title_strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/router_config.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/router_config_loader.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/url_handling_strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/view_transition.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/navigation_transition.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/route_injector_cleanup.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/route_reuse_strategy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/statemanager/state_manager.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/navigations.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/router.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport type {Route, UrlMatchResult} from './models';\nimport type {UrlSegment, UrlSegmentGroup} from './url_tree';\n\n/**\n * The primary routing outlet.\n *\n * @publicApi\n */\nexport const PRIMARY_OUTLET = 'primary';\n\n/**\n * A private symbol used to store the value of `Route.title` inside the `Route.data` if it is a\n * static string or `Route.resolve` if anything else. This allows us to reuse the existing route\n * data/resolvers to support the title feature without new instrumentation in the `Router` pipeline.\n */\nexport const RouteTitleKey: unique symbol = /* @__PURE__ */ Symbol('RouteTitle');\n\n/**\n * A collection of matrix and query URL parameters.\n * @see {@link convertToParamMap}\n * @see {@link ParamMap}\n *\n * @publicApi\n */\nexport type Params = {\n  [key: string]: any;\n};\n\n/**\n * A map that provides access to the required and optional parameters\n * specific to a route.\n * The map supports retrieving a single value with `get()`\n * or multiple values with `getAll()`.\n *\n * @see [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)\n *\n * @publicApi\n */\nexport interface ParamMap {\n  /**\n   * Reports whether the map contains a given parameter.\n   * @param name The parameter name.\n   * @returns True if the map contains the given parameter, false otherwise.\n   */\n  has(name: string): boolean;\n  /**\n   * Retrieves a single value for a parameter.\n   * @param name The parameter name.\n   * @return The parameter's single value,\n   * or the first value if the parameter has multiple values,\n   * or `null` when there is no such parameter.\n   */\n  get(name: string): string | null;\n  /**\n   * Retrieves multiple values for a parameter.\n   * @param name The parameter name.\n   * @return An array containing one or more values,\n   * or an empty array if there is no such parameter.\n   *\n   */\n  getAll(name: string): string[];\n\n  /** Names of the parameters in the map. */\n  readonly keys: string[];\n}\n\nclass ParamsAsMap implements ParamMap {\n  private params: Params;\n\n  constructor(params: Params) {\n    this.params = params || {};\n  }\n\n  has(name: string): boolean {\n    return Object.prototype.hasOwnProperty.call(this.params, name);\n  }\n\n  get(name: string): string | null {\n    if (this.has(name)) {\n      const v = this.params[name];\n      return Array.isArray(v) ? v[0] : v;\n    }\n\n    return null;\n  }\n\n  getAll(name: string): string[] {\n    if (this.has(name)) {\n      const v = this.params[name];\n      return Array.isArray(v) ? v : [v];\n    }\n\n    return [];\n  }\n\n  get keys(): string[] {\n    return Object.keys(this.params);\n  }\n}\n\n/**\n * Converts a `Params` instance to a `ParamMap`.\n * @param params The instance to convert.\n * @returns The new map instance.\n *\n * @publicApi\n */\nexport function convertToParamMap(params: Params): ParamMap {\n  return new ParamsAsMap(params);\n}\n\nfunction matchParts(\n  routeParts: string[],\n  urlSegments: UrlSegment[],\n  posParams: {[key: string]: UrlSegment},\n): boolean {\n  for (let i = 0; i < routeParts.length; i++) {\n    const part = routeParts[i];\n    const segment = urlSegments[i];\n    const isParameter = part[0] === ':';\n    if (isParameter) {\n      posParams[part.substring(1)] = segment;\n    } else if (part !== segment.path) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Matches the route configuration (`route`) against the actual URL (`segments`).\n *\n * When no matcher is defined on a `Route`, this is the matcher used by the Router by default.\n *\n * @param segments The remaining unmatched segments in the current navigation\n * @param segmentGroup The current segment group being matched\n * @param route The `Route` to match against.\n *\n * @see {@link UrlMatchResult}\n * @see {@link Route}\n *\n * @returns The resulting match information or `null` if the `route` should not match.\n * @publicApi\n */\nexport function defaultUrlMatcher(\n  segments: UrlSegment[],\n  segmentGroup: UrlSegmentGroup,\n  route: Route,\n): UrlMatchResult | null {\n  const parts = route.path!.split('/');\n  const wildcardIndex = parts.indexOf('**');\n  if (wildcardIndex === -1) {\n    // No wildcard, use original logic\n    if (parts.length > segments.length) {\n      // The actual URL is shorter than the config, no match\n      return null;\n    }\n\n    if (\n      route.pathMatch === 'full' &&\n      (segmentGroup.hasChildren() || parts.length < segments.length)\n    ) {\n      // The config is longer than the actual URL but we are looking for a full match, return null\n      return null;\n    }\n\n    const posParams: {[key: string]: UrlSegment} = {};\n    const consumed = segments.slice(0, parts.length);\n    if (!matchParts(parts, consumed, posParams)) {\n      return null;\n    }\n    return {consumed, posParams};\n  }\n\n  // Path has a wildcard.\n  if (wildcardIndex !== parts.lastIndexOf('**')) {\n    // We do not support more than one wildcard segment in the path\n    return null;\n  }\n\n  const pre = parts.slice(0, wildcardIndex);\n  const post = parts.slice(wildcardIndex + 1);\n\n  if (pre.length + post.length > segments.length) {\n    // The actual URL is shorter than the config, no match\n    return null;\n  }\n\n  if (route.pathMatch === 'full' && segmentGroup.hasChildren() && route.path !== '**') {\n    // The config is longer than the actual URL but we are looking for a full match, return null\n    return null;\n  }\n\n  const posParams: {[key: string]: UrlSegment} = {};\n\n  // Match the segments before the wildcard\n  if (!matchParts(pre, segments.slice(0, pre.length), posParams)) {\n    return null;\n  }\n  // Match the segments after the wildcard\n  if (!matchParts(post, segments.slice(segments.length - post.length), posParams)) {\n    return null;\n  }\n\n  // TODO(atscott): put the wildcard segments into a _splat param.\n  // this would require a breaking change to the UrlMatchResult to allow UrlSegment[]\n  // since the splat could be multiple segments.\n\n  return {consumed: segments, posParams};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Observable} from 'rxjs';\nimport {first} from 'rxjs/operators';\n\n/** replacement for firstValueFrom in rxjs 7. We must support rxjs v6 so we cannot use it */\nexport function firstValueFrom<T>(source: Observable<T>): Promise<T> {\n  return new Promise<T>((resolve, reject) => {\n    source.pipe(first()).subscribe({\n      next: (value) => resolve(value),\n      error: (err) => reject(err),\n    });\n  });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ɵisPromise as isPromise} from '@angular/core';\nimport {from, isObservable, Observable, of} from 'rxjs';\nimport {firstValueFrom} from './first_value_from';\n\nexport function shallowEqualArrays(a: readonly any[], b: readonly any[]): boolean {\n  if (a.length !== b.length) return false;\n  for (let i = 0; i < a.length; ++i) {\n    if (!shallowEqual(a[i], b[i])) return false;\n  }\n  return true;\n}\n\nexport function shallowEqual(\n  a: {[key: string | symbol]: any},\n  b: {[key: string | symbol]: any},\n): boolean {\n  // While `undefined` should never be possible, it would sometimes be the case in IE 11\n  // and pre-chromium Edge. The check below accounts for this edge case.\n  const k1 = a ? getDataKeys(a) : undefined;\n  const k2 = b ? getDataKeys(b) : undefined;\n  if (!k1 || !k2 || k1.length != k2.length) {\n    return false;\n  }\n  let key: string | symbol;\n  for (let i = 0; i < k1.length; i++) {\n    key = k1[i];\n    if (!equalArraysOrString(a[key], b[key])) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Gets the keys of an object, including `symbol` keys.\n */\nexport function getDataKeys(obj: Object): Array<string | symbol> {\n  return [...Object.keys(obj), ...Object.getOwnPropertySymbols(obj)];\n}\n\n/**\n * Test equality for arrays of strings or a string.\n */\nexport function equalArraysOrString(\n  a: string | readonly string[],\n  b: string | readonly string[],\n): boolean {\n  if (Array.isArray(a) && Array.isArray(b)) {\n    if (a.length !== b.length) return false;\n    const aSorted = [...a].sort();\n    const bSorted = [...b].sort();\n    return aSorted.every((val, index) => bSorted[index] === val);\n  } else {\n    return a === b;\n  }\n}\n\n/**\n * Return the last element of an array.\n */\nexport function last<T>(a: readonly T[]): T | null {\n  return a.length > 0 ? a[a.length - 1] : null;\n}\n\nexport function wrapIntoObservable<T>(value: T | Promise<T> | Observable<T>): Observable<T> {\n  if (isObservable(value)) {\n    return value;\n  }\n\n  if (isPromise(value)) {\n    // Use `Promise.resolve()` to wrap promise-like instances.\n    // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n    // change detection.\n    return from(Promise.resolve(value));\n  }\n\n  return of(value);\n}\n\nexport function wrapIntoPromise<T>(value: T | Promise<T> | Observable<T>): Promise<T> {\n  if (isObservable(value)) {\n    return firstValueFrom(value);\n  }\n  return Promise.resolve(value);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, ɵRuntimeError as RuntimeError, Service, Signal} from '@angular/core';\n\nimport {RuntimeErrorCode} from './errors';\nimport type {Router} from './router';\nimport {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET} from './shared';\nimport {equalArraysOrString, shallowEqual} from './utils/collection';\n\n/**\n * A set of options which specify how to determine if a `UrlTree` is active, given the `UrlTree`\n * for the current router state.\n *\n * @publicApi\n * @see {@link isActive}\n */\nexport interface IsActiveMatchOptions {\n  /**\n   * Defines the strategy for comparing the matrix parameters of two `UrlTree`s.\n   *\n   * The matrix parameter matching is dependent on the strategy for matching the\n   * segments. That is, if the `paths` option is set to `'subset'`, only\n   * the matrix parameters of the matching segments will be compared.\n   *\n   * - `'exact'`: Requires that matching segments also have exact matrix parameter\n   * matches.\n   * - `'subset'`: The matching segments in the router's active `UrlTree` may contain\n   * extra matrix parameters, but those that exist in the `UrlTree` in question must match.\n   * - `'ignored'`: When comparing `UrlTree`s, matrix params will be ignored.\n   */\n  matrixParams: 'exact' | 'subset' | 'ignored';\n  /**\n   * Defines the strategy for comparing the query parameters of two `UrlTree`s.\n   *\n   * - `'exact'`: the query parameters must match exactly.\n   * - `'subset'`: the active `UrlTree` may contain extra parameters,\n   * but must match the key and value of any that exist in the `UrlTree` in question.\n   * - `'ignored'`: When comparing `UrlTree`s, query params will be ignored.\n   */\n  queryParams: 'exact' | 'subset' | 'ignored';\n  /**\n   * Defines the strategy for comparing the `UrlSegment`s of the `UrlTree`s.\n   *\n   * - `'exact'`: all segments in each `UrlTree` must match.\n   * - `'subset'`: a `UrlTree` will be determined to be active if it\n   * is a subtree of the active route. That is, the active route may contain extra\n   * segments, but must at least have all the segments of the `UrlTree` in question.\n   */\n  paths: 'exact' | 'subset';\n  /**\n   * - `'exact'`: indicates that the `UrlTree` fragments must be equal.\n   * - `'ignored'`: the fragments will not be compared when determining if a\n   * `UrlTree` is active.\n   */\n  fragment: 'exact' | 'ignored';\n}\n\ntype ParamMatchOptions = 'exact' | 'subset' | 'ignored';\n\ntype PathCompareFn = (\n  container: UrlSegmentGroup,\n  containee: UrlSegmentGroup,\n  matrixParams: ParamMatchOptions,\n) => boolean;\ntype ParamCompareFn = (container: Params, containee: Params) => boolean;\n\nconst pathCompareMap: Record<IsActiveMatchOptions['paths'], PathCompareFn> = {\n  'exact': equalSegmentGroups,\n  'subset': containsSegmentGroup,\n};\nconst paramCompareMap: Record<ParamMatchOptions, ParamCompareFn> = {\n  'exact': equalParams,\n  'subset': containsParams,\n  'ignored': () => true,\n};\n\n/**\n * The equivalent `IsActiveMatchOptions` options for `isActive` is called with `true`\n * (exact = true).\n */\nexport const exactMatchOptions: IsActiveMatchOptions = {\n  paths: 'exact',\n  fragment: 'ignored',\n  matrixParams: 'ignored',\n  queryParams: 'exact',\n};\n\n/**\n * The equivalent `IsActiveMatchOptions` options for `isActive` is called with `false`\n * (exact = false).\n */\nexport const subsetMatchOptions: IsActiveMatchOptions = {\n  paths: 'subset',\n  fragment: 'ignored',\n  matrixParams: 'ignored',\n  queryParams: 'subset',\n};\n\n/**\n * Returns a computed signal of whether the given url is activated in the Router.\n *\n * As the router state changes, the signal will update to reflect whether the url is active.\n *\n * When using the `matchOptions` argument, any missing properties fall back to the following defaults:\n * - `paths`: 'subset'\n * - `queryParams`: 'subset'\n * - `matrixParams`: 'ignored'\n * - `fragment`: 'ignored'\n *\n * @see [Check if a URL is active](guide/routing/read-route-state#check-if-a-url-is-active)\n * @publicApi 21.1\n */\nexport function isActive(\n  url: string | UrlTree,\n  router: Router,\n  matchOptions?: Partial<IsActiveMatchOptions>,\n): Signal<boolean> {\n  const urlTree = url instanceof UrlTree ? url : router.parseUrl(url);\n  return computed(() =>\n    containsTree(router.lastSuccessfulNavigation()?.finalUrl ?? new UrlTree(), urlTree, {\n      ...subsetMatchOptions,\n      ...matchOptions,\n    }),\n  );\n}\n\nexport function containsTree(\n  container: UrlTree,\n  containee: UrlTree,\n  options: IsActiveMatchOptions,\n): boolean {\n  return (\n    pathCompareMap[options.paths](container.root, containee.root, options.matrixParams) &&\n    paramCompareMap[options.queryParams](container.queryParams, containee.queryParams) &&\n    !(options.fragment === 'exact' && container.fragment !== containee.fragment)\n  );\n}\n\nfunction equalParams(container: Params, containee: Params): boolean {\n  // TODO: This does not handle array params correctly.\n  return shallowEqual(container, containee);\n}\n\nfunction equalSegmentGroups(\n  container: UrlSegmentGroup,\n  containee: UrlSegmentGroup,\n  matrixParams: ParamMatchOptions,\n): boolean {\n  if (!equalPath(container.segments, containee.segments)) return false;\n  if (!matrixParamsMatch(container.segments, containee.segments, matrixParams)) {\n    return false;\n  }\n  if (container.numberOfChildren !== containee.numberOfChildren) return false;\n  for (const c in containee.children) {\n    if (!container.children[c]) return false;\n    if (!equalSegmentGroups(container.children[c], containee.children[c], matrixParams))\n      return false;\n  }\n  return true;\n}\n\nfunction containsParams(container: Params, containee: Params): boolean {\n  return (\n    Object.keys(containee).length <= Object.keys(container).length &&\n    Object.keys(containee).every((key) => equalArraysOrString(container[key], containee[key]))\n  );\n}\n\nfunction containsSegmentGroup(\n  container: UrlSegmentGroup,\n  containee: UrlSegmentGroup,\n  matrixParams: ParamMatchOptions,\n): boolean {\n  return containsSegmentGroupHelper(container, containee, containee.segments, matrixParams);\n}\n\nfunction containsSegmentGroupHelper(\n  container: UrlSegmentGroup,\n  containee: UrlSegmentGroup,\n  containeePaths: UrlSegment[],\n  matrixParams: ParamMatchOptions,\n): boolean {\n  if (container.segments.length > containeePaths.length) {\n    const current = container.segments.slice(0, containeePaths.length);\n    if (!equalPath(current, containeePaths)) return false;\n    if (containee.hasChildren()) return false;\n    if (!matrixParamsMatch(current, containeePaths, matrixParams)) return false;\n    return true;\n  } else if (container.segments.length === containeePaths.length) {\n    if (!equalPath(container.segments, containeePaths)) return false;\n    if (!matrixParamsMatch(container.segments, containeePaths, matrixParams)) return false;\n    for (const c in containee.children) {\n      if (!container.children[c]) return false;\n      if (!containsSegmentGroup(container.children[c], containee.children[c], matrixParams)) {\n        return false;\n      }\n    }\n    return true;\n  } else {\n    const current = containeePaths.slice(0, container.segments.length);\n    const next = containeePaths.slice(container.segments.length);\n    if (!equalPath(container.segments, current)) return false;\n    if (!matrixParamsMatch(container.segments, current, matrixParams)) return false;\n    if (!container.children[PRIMARY_OUTLET]) return false;\n    return containsSegmentGroupHelper(\n      container.children[PRIMARY_OUTLET],\n      containee,\n      next,\n      matrixParams,\n    );\n  }\n}\n\nfunction matrixParamsMatch(\n  containerPaths: UrlSegment[],\n  containeePaths: UrlSegment[],\n  options: ParamMatchOptions,\n) {\n  return containeePaths.every((containeeSegment, i) => {\n    return paramCompareMap[options](containerPaths[i].parameters, containeeSegment.parameters);\n  });\n}\n\n/**\n * @description\n *\n * Represents the parsed URL.\n *\n * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a\n * serialized tree.\n * UrlTree is a data structure that provides a lot of affordances in dealing with URLs\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const tree: UrlTree =\n *       router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');\n *     const f = tree.fragment; // return 'fragment'\n *     const q = tree.queryParams; // returns {debug: 'true'}\n *     const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n *     const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'\n *     g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'\n *     g.children['support'].segments; // return 1 segment 'help'\n *   }\n * }\n * ```\n *\n * @publicApi\n */\nexport class UrlTree {\n  /** @internal */\n  _queryParamMap?: ParamMap;\n\n  constructor(\n    /** The root segment group of the URL tree */\n    public root: UrlSegmentGroup = new UrlSegmentGroup([], {}),\n    /** The query params of the URL */\n    public queryParams: Params = {},\n    /** The fragment of the URL */\n    public fragment: string | null = null,\n  ) {\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      if (root.segments.length > 0) {\n        throw new RuntimeError(\n          RuntimeErrorCode.INVALID_ROOT_URL_SEGMENT,\n          'The root `UrlSegmentGroup` should not contain `segments`. ' +\n            'Instead, these segments belong in the `children` so they can be associated with a named outlet.',\n        );\n      }\n    }\n  }\n\n  get queryParamMap(): ParamMap {\n    this._queryParamMap ??= convertToParamMap(this.queryParams);\n    return this._queryParamMap;\n  }\n\n  /** @docs-private */\n  toString(): string {\n    return DEFAULT_SERIALIZER.serialize(this);\n  }\n}\n\n/**\n * @description\n *\n * Represents the parsed URL segment group.\n *\n * See `UrlTree` for more information.\n *\n * @publicApi\n */\nexport class UrlSegmentGroup {\n  /** The parent node in the url tree */\n  parent: UrlSegmentGroup | null = null;\n\n  constructor(\n    /** The URL segments of this group. See `UrlSegment` for more information */\n    public segments: UrlSegment[],\n    /** The list of children of this group */\n    public children: {[key: string]: UrlSegmentGroup},\n  ) {\n    Object.values(children).forEach((v) => (v.parent = this));\n  }\n\n  /** Whether the segment has child segments */\n  hasChildren(): boolean {\n    return this.numberOfChildren > 0;\n  }\n\n  /** Number of child segments */\n  get numberOfChildren(): number {\n    return Object.keys(this.children).length;\n  }\n\n  /** @docs-private */\n  toString(): string {\n    return serializePaths(this);\n  }\n}\n\n/**\n * @description\n *\n * Represents a single URL segment.\n *\n * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix\n * parameters associated with the segment.\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const tree: UrlTree = router.parseUrl('/team;id=33');\n *     const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];\n *     const s: UrlSegment[] = g.segments;\n *     s[0].path; // returns 'team'\n *     s[0].parameters; // returns {id: 33}\n *   }\n * }\n * ```\n *\n * @publicApi\n */\nexport class UrlSegment {\n  /** @internal */\n  _parameterMap?: ParamMap;\n\n  constructor(\n    /** The path part of a URL segment */\n    public path: string,\n\n    /** The matrix parameters associated with a segment */\n    public parameters: {[name: string]: string},\n  ) {}\n\n  get parameterMap(): ParamMap {\n    this._parameterMap ??= convertToParamMap(this.parameters);\n    return this._parameterMap;\n  }\n\n  /** @docs-private */\n  toString(): string {\n    return serializePath(this);\n  }\n}\n\nexport function equalSegments(as: UrlSegment[], bs: UrlSegment[]): boolean {\n  return equalPath(as, bs) && as.every((a, i) => shallowEqual(a.parameters, bs[i].parameters));\n}\n\nexport function equalPath(as: UrlSegment[], bs: UrlSegment[]): boolean {\n  if (as.length !== bs.length) return false;\n  return as.every((a, i) => a.path === bs[i].path);\n}\n\nexport function mapChildrenIntoArray<T>(\n  segment: UrlSegmentGroup,\n  fn: (v: UrlSegmentGroup, k: string) => T[],\n): T[] {\n  let res: T[] = [];\n  Object.entries(segment.children).forEach(([childOutlet, child]) => {\n    if (childOutlet === PRIMARY_OUTLET) {\n      res = res.concat(fn(child, childOutlet));\n    }\n  });\n  Object.entries(segment.children).forEach(([childOutlet, child]) => {\n    if (childOutlet !== PRIMARY_OUTLET) {\n      res = res.concat(fn(child, childOutlet));\n    }\n  });\n  return res;\n}\n\n/**\n * @description\n *\n * Serializes and deserializes a URL string into a URL tree.\n *\n * The url serialization strategy is customizable. You can\n * make all URLs case insensitive by providing a custom UrlSerializer.\n *\n * See `DefaultUrlSerializer` for an example of a URL serializer.\n *\n * @publicApi\n */\n@Service({factory: () => new DefaultUrlSerializer()})\nexport abstract class UrlSerializer {\n  /** Parse a url into a `UrlTree` */\n  abstract parse(url: string): UrlTree;\n\n  /** Converts a `UrlTree` into a url */\n  abstract serialize(tree: UrlTree): string;\n}\n\n/**\n * @description\n *\n * A default implementation of the `UrlSerializer`.\n *\n * Example URLs:\n *\n * ```\n * /inbox/33(popup:compose)\n * /inbox/33;open=true/messages/44\n * ```\n *\n * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the\n * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to\n * specify route specific parameters.\n *\n * @publicApi\n */\nexport class DefaultUrlSerializer implements UrlSerializer {\n  /** Parses a url into a `UrlTree` */\n  parse(url: string): UrlTree {\n    const p = new UrlParser(url);\n    return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());\n  }\n\n  /** Converts a `UrlTree` into a url */\n  serialize(tree: UrlTree): string {\n    const segment = `/${serializeSegment(tree.root, true)}`;\n    const query = serializeQueryParams(tree.queryParams);\n    const fragment =\n      typeof tree.fragment === `string` ? `#${encodeUriFragment(tree.fragment)}` : '';\n\n    return `${segment}${query}${fragment}`;\n  }\n}\n\nconst DEFAULT_SERIALIZER = new DefaultUrlSerializer();\n\nexport function serializePaths(segment: UrlSegmentGroup): string {\n  return segment.segments.map((p) => serializePath(p)).join('/');\n}\n\nfunction serializeSegment(segment: UrlSegmentGroup, root: boolean): string {\n  if (!segment.hasChildren()) {\n    return serializePaths(segment);\n  }\n\n  if (root) {\n    const primary = segment.children[PRIMARY_OUTLET]\n      ? serializeSegment(segment.children[PRIMARY_OUTLET], false)\n      : '';\n    const children: string[] = [];\n\n    Object.entries(segment.children).forEach(([k, v]) => {\n      if (k !== PRIMARY_OUTLET) {\n        children.push(`${k}:${serializeSegment(v, false)}`);\n      }\n    });\n\n    return children.length > 0 ? `${primary}(${children.join('//')})` : primary;\n  } else {\n    const children = mapChildrenIntoArray(segment, (v: UrlSegmentGroup, k: string) => {\n      if (k === PRIMARY_OUTLET) {\n        return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];\n      }\n\n      return [`${k}:${serializeSegment(v, false)}`];\n    });\n\n    // use no parenthesis if the only child is a primary outlet route\n    if (Object.keys(segment.children).length === 1 && segment.children[PRIMARY_OUTLET] != null) {\n      return `${serializePaths(segment)}/${children[0]}`;\n    }\n\n    return `${serializePaths(segment)}/(${children.join('//')})`;\n  }\n}\n\n/**\n * Encodes a URI string with the default encoding. This function will only ever be called from\n * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need\n * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't\n * have to be encoded per https://url.spec.whatwg.org.\n */\nfunction encodeUriString(s: string): string {\n  return encodeURIComponent(s)\n    .replace(/%40/g, '@')\n    .replace(/%3A/gi, ':')\n    .replace(/%24/g, '$')\n    .replace(/%2C/gi, ',');\n}\n\n/**\n * This function should be used to encode both keys and values in a query string key/value. In\n * the following URL, you need to call encodeUriQuery on \"k\" and \"v\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriQuery(s: string): string {\n  return encodeUriString(s).replace(/%3B/gi, ';');\n}\n\n/**\n * This function should be used to encode a URL fragment. In the following URL, you need to call\n * encodeUriFragment on \"f\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriFragment(s: string): string {\n  return encodeURI(s);\n}\n\n/**\n * This function should be run on any URI segment as well as the key and value in a key/value\n * pair for matrix params. In the following URL, you need to call encodeUriSegment on \"html\",\n * \"mk\", and \"mv\":\n *\n * http://www.site.org/html;mk=mv?k=v#f\n */\nexport function encodeUriSegment(s: string): string {\n  return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n}\n\nexport function decode(s: string): string {\n  return decodeURIComponent(s);\n}\n\n// Query keys/values should have the \"+\" replaced first, as \"+\" in a query string is \" \".\n// decodeURIComponent function will not decode \"+\" as a space.\nexport function decodeQuery(s: string): string {\n  return decode(s.replace(/\\+/g, '%20'));\n}\n\nexport function serializePath(path: UrlSegment): string {\n  return `${encodeUriSegment(path.path)}${serializeMatrixParams(path.parameters)}`;\n}\n\nfunction serializeMatrixParams(params: {[key: string]: string}): string {\n  return Object.entries(params)\n    .map(([key, value]) => `;${encodeUriSegment(key)}=${encodeUriSegment(value)}`)\n    .join('');\n}\n\nfunction serializeQueryParams(params: {[key: string]: any}): string {\n  const strParams: string[] = Object.entries(params)\n    .map(([name, value]) => {\n      return Array.isArray(value)\n        ? value.map((v) => `${encodeUriQuery(name)}=${encodeUriQuery(v)}`).join('&')\n        : `${encodeUriQuery(name)}=${encodeUriQuery(value)}`;\n    })\n    .filter((s) => s);\n\n  return strParams.length ? `?${strParams.join('&')}` : '';\n}\n\nconst SEGMENT_RE = /^[^\\/()?;#]+/;\nfunction matchSegments(str: string): string {\n  const match = str.match(SEGMENT_RE);\n  return match ? match[0] : '';\n}\n\nconst MATRIX_PARAM_SEGMENT_RE = /^[^\\/()?;=#]+/;\nfunction matchMatrixKeySegments(str: string): string {\n  const match = str.match(MATRIX_PARAM_SEGMENT_RE);\n  return match ? match[0] : '';\n}\n\nconst QUERY_PARAM_RE = /^[^=?&#]+/;\n// Return the name of the query param at the start of the string or an empty string\nfunction matchQueryParams(str: string): string {\n  const match = str.match(QUERY_PARAM_RE);\n  return match ? match[0] : '';\n}\n\nconst QUERY_PARAM_VALUE_RE = /^[^&#]+/;\n// Return the value of the query param at the start of the string or an empty string\nfunction matchUrlQueryParamValue(str: string): string {\n  const match = str.match(QUERY_PARAM_VALUE_RE);\n  return match ? match[0] : '';\n}\n\nclass UrlParser {\n  private remaining: string;\n\n  constructor(private url: string) {\n    this.remaining = url;\n  }\n\n  parseRootSegment(): UrlSegmentGroup {\n    // Consume all leading slashes. Multiple consecutive leading slashes (e.g. `///path`)\n    // are not meaningful and would otherwise produce a `//path`-style serialized URL,\n    // which browsers interpret as protocol-relative (resolving to a different origin)\n    // and reject with a SecurityError when passed to `history.pushState`/`replaceState`.\n    while (this.consumeOptional('/')) {}\n\n    if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {\n      return new UrlSegmentGroup([], {});\n    }\n\n    // The root segment group never has segments\n    return new UrlSegmentGroup([], this.parseChildren());\n  }\n\n  parseQueryParams(): Params {\n    const params: Params = {};\n    if (this.consumeOptional('?')) {\n      do {\n        this.parseQueryParam(params);\n      } while (this.consumeOptional('&'));\n    }\n    return params;\n  }\n\n  parseFragment(): string | null {\n    return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;\n  }\n\n  private parseChildren(depth = 0): {[outlet: string]: UrlSegmentGroup} {\n    if (depth > 50) {\n      throw new RuntimeError(\n        RuntimeErrorCode.UNPARSABLE_URL,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && 'URL is too deep',\n      );\n    }\n    if (this.remaining === '') {\n      return {};\n    }\n\n    this.consumeOptional('/');\n\n    const segments: UrlSegment[] = [];\n    if (!this.peekStartsWith('(')) {\n      segments.push(this.parseSegment());\n    }\n\n    while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {\n      this.capture('/');\n      segments.push(this.parseSegment());\n    }\n\n    let children: {[outlet: string]: UrlSegmentGroup} = {};\n    if (this.peekStartsWith('/(')) {\n      this.capture('/');\n      children = this.parseParens(true, depth);\n    }\n\n    let res: {[outlet: string]: UrlSegmentGroup} = {};\n    if (this.peekStartsWith('(')) {\n      res = this.parseParens(false, depth);\n    }\n\n    if (segments.length > 0 || Object.keys(children).length > 0) {\n      res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);\n    }\n\n    return res;\n  }\n\n  // parse a segment with its matrix parameters\n  // ie `name;k1=v1;k2`\n  private parseSegment(): UrlSegment {\n    const path = matchSegments(this.remaining);\n    if (path === '' && this.peekStartsWith(';')) {\n      throw new RuntimeError(\n        RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          `Empty path url segment cannot have parameters: '${this.remaining}'.`,\n      );\n    }\n\n    this.capture(path);\n    return new UrlSegment(decode(path), this.parseMatrixParams());\n  }\n\n  private parseMatrixParams(): {[key: string]: string} {\n    const params: {[key: string]: string} = {};\n    while (this.consumeOptional(';')) {\n      this.parseParam(params);\n    }\n    return params;\n  }\n\n  private parseParam(params: {[key: string]: string}): void {\n    const key = matchMatrixKeySegments(this.remaining);\n    if (!key) {\n      return;\n    }\n    this.capture(key);\n    let value: any = '';\n    if (this.consumeOptional('=')) {\n      const valueMatch = matchSegments(this.remaining);\n      if (valueMatch) {\n        value = valueMatch;\n        this.capture(value);\n      }\n    }\n\n    params[decode(key)] = decode(value);\n  }\n\n  // Parse a single query parameter `name[=value]`\n  private parseQueryParam(params: Params): void {\n    const key = matchQueryParams(this.remaining);\n    if (!key) {\n      return;\n    }\n    this.capture(key);\n    let value: any = '';\n    if (this.consumeOptional('=')) {\n      const valueMatch = matchUrlQueryParamValue(this.remaining);\n      if (valueMatch) {\n        value = valueMatch;\n        this.capture(value);\n      }\n    }\n\n    const decodedKey = decodeQuery(key);\n    const decodedVal = decodeQuery(value);\n\n    if (params.hasOwnProperty(decodedKey)) {\n      // Append to existing values\n      let currentVal = params[decodedKey];\n      if (!Array.isArray(currentVal)) {\n        currentVal = [currentVal];\n        params[decodedKey] = currentVal;\n      }\n      currentVal.push(decodedVal);\n    } else {\n      // Create a new value\n      params[decodedKey] = decodedVal;\n    }\n  }\n\n  // parse `(a/b//outlet_name:c/d)`\n  private parseParens(allowPrimary: boolean, depth: number): {[outlet: string]: UrlSegmentGroup} {\n    const segments: {[key: string]: UrlSegmentGroup} = {};\n    this.capture('(');\n\n    while (!this.consumeOptional(')') && this.remaining.length > 0) {\n      const path = matchSegments(this.remaining);\n\n      const next = this.remaining[path.length];\n\n      // if is is not one of these characters, then the segment was unescaped\n      // or the group was not closed\n      if (next !== '/' && next !== ')' && next !== ';') {\n        throw new RuntimeError(\n          RuntimeErrorCode.UNPARSABLE_URL,\n          (typeof ngDevMode === 'undefined' || ngDevMode) && `Cannot parse url '${this.url}'`,\n        );\n      }\n\n      let outletName: string | undefined;\n      if (path.indexOf(':') > -1) {\n        outletName = path.slice(0, path.indexOf(':'));\n        this.capture(outletName);\n        this.capture(':');\n      } else if (allowPrimary) {\n        outletName = PRIMARY_OUTLET;\n      }\n\n      const children = this.parseChildren(depth + 1);\n      segments[outletName ?? PRIMARY_OUTLET] =\n        Object.keys(children).length === 1 && children[PRIMARY_OUTLET]\n          ? children[PRIMARY_OUTLET]\n          : new UrlSegmentGroup([], children);\n      this.consumeOptional('//');\n    }\n\n    return segments;\n  }\n\n  private peekStartsWith(str: string): boolean {\n    return this.remaining.startsWith(str);\n  }\n\n  // Consumes the prefix when it is present and returns whether it has been consumed\n  private consumeOptional(str: string): boolean {\n    if (this.peekStartsWith(str)) {\n      this.remaining = this.remaining.substring(str.length);\n      return true;\n    }\n    return false;\n  }\n\n  private capture(str: string): void {\n    if (!this.consumeOptional(str)) {\n      throw new RuntimeError(\n        RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && `Expected \"${str}\".`,\n      );\n    }\n  }\n}\n\nexport function createRoot(rootCandidate: UrlSegmentGroup): UrlSegmentGroup {\n  return rootCandidate.segments.length > 0\n    ? new UrlSegmentGroup([], {[PRIMARY_OUTLET]: rootCandidate})\n    : rootCandidate;\n}\n\n/**\n * Recursively\n * - merges primary segment children into their parents\n * - drops empty children (those which have no segments and no children themselves). This latter\n * prevents serializing a group into something like `/a(aux:)`, where `aux` is an empty child\n * segment.\n * - merges named outlets without a primary segment sibling into the children. This prevents\n * serializing a URL like `//(a:a)(b:b) instead of `/(a:a//b:b)` when the aux b route lives on the\n * root but the `a` route lives under an empty path primary route.\n */\nexport function squashSegmentGroup(segmentGroup: UrlSegmentGroup): UrlSegmentGroup {\n  const newChildren: Record<string, UrlSegmentGroup> = {};\n  for (const [childOutlet, child] of Object.entries(segmentGroup.children)) {\n    const childCandidate = squashSegmentGroup(child);\n    // moves named children in an empty path primary child into this group\n    if (\n      childOutlet === PRIMARY_OUTLET &&\n      childCandidate.segments.length === 0 &&\n      childCandidate.hasChildren()\n    ) {\n      for (const [grandChildOutlet, grandChild] of Object.entries(childCandidate.children)) {\n        newChildren[grandChildOutlet] = grandChild;\n      }\n    } // don't add empty children\n    else if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {\n      newChildren[childOutlet] = childCandidate;\n    }\n  }\n  const s = new UrlSegmentGroup(segmentGroup.segments, newChildren);\n  return mergeTrivialChildren(s);\n}\n\n/**\n * When possible, merges the primary outlet child into the parent `UrlSegmentGroup`.\n *\n * When a segment group has only one child which is a primary outlet, merges that child into the\n * parent. That is, the child segment group's segments are merged into the `s` and the child's\n * children become the children of `s`. Think of this like a 'squash', merging the child segment\n * group into the parent.\n */\nfunction mergeTrivialChildren(s: UrlSegmentGroup): UrlSegmentGroup {\n  if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {\n    const c = s.children[PRIMARY_OUTLET];\n    return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);\n  }\n\n  return s;\n}\n\nexport function isUrlTree(v: any): v is UrlTree {\n  return v instanceof UrlTree;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from './errors';\nimport {ActivatedRouteSnapshot} from './router_state';\nimport {Params, PRIMARY_OUTLET} from './shared';\nimport {\n  createRoot,\n  DefaultUrlSerializer,\n  squashSegmentGroup,\n  UrlSegment,\n  UrlSegmentGroup,\n  UrlSerializer,\n  UrlTree,\n} from './url_tree';\nimport {last, shallowEqual} from './utils/collection';\n\n/**\n * Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`.\n *\n * @publicApi\n *\n *\n * @param relativeTo The `ActivatedRouteSnapshot` to apply the commands to\n * @param commands An array of URL fragments with which to construct the new URL tree.\n * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n * segments, followed by the parameters for each segment.\n * The fragments are applied to the one provided in the `relativeTo` parameter.\n * @param queryParams The query parameters for the `UrlTree`. `null` if the `UrlTree` does not have\n *     any query parameters.\n * @param fragment The fragment for the `UrlTree`. `null` if the `UrlTree` does not have a fragment.\n * @param urlSerializer The `UrlSerializer` to use for handling query parameter normalization.\n * You should provide your application's custom `UrlSerializer` if one is configured to parse and\n * serialize query parameter values to and from objects other than strings/string arrays.\n *\n * @usageNotes\n *\n * ```ts\n * // create /team/33/user/11\n * createUrlTreeFromSnapshot(snapshot, ['/team', 33, 'user', 11]);\n *\n * // create /team/33;expand=true/user/11\n * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {expand: true}, 'user', 11]);\n *\n * // you can collapse static segments like this (this works only with the first passed-in value):\n * createUrlTreeFromSnapshot(snapshot, ['/team/33/user', userId]);\n *\n * // If the first segment can contain slashes, and you do not want the router to split it,\n * // you can do the following:\n * createUrlTreeFromSnapshot(snapshot, [{segmentPath: '/one/two'}]);\n *\n * // create /team/33/(user/11//right:chat)\n * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right:\n * 'chat'}}], null, null);\n *\n * // remove the right secondary node\n * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n *\n * // For the examples below, assume the current URL is for the `/team/33/user/11` and the\n * `ActivatedRouteSnapshot` points to `user/11`:\n *\n * // navigate to /team/33/user/11/details\n * createUrlTreeFromSnapshot(snapshot, ['details']);\n *\n * // navigate to /team/33/user/22\n * createUrlTreeFromSnapshot(snapshot, ['../22']);\n *\n * // navigate to /team/44/user/22\n * createUrlTreeFromSnapshot(snapshot, ['../../team/44/user/22']);\n * ```\n */\nexport function createUrlTreeFromSnapshot(\n  relativeTo: ActivatedRouteSnapshot,\n  commands: readonly any[],\n  queryParams: Params | null = null,\n  fragment: string | null = null,\n  urlSerializer = new DefaultUrlSerializer(),\n): UrlTree {\n  const relativeToUrlSegmentGroup = createSegmentGroupFromRoute(relativeTo);\n  return createUrlTreeFromSegmentGroup(\n    relativeToUrlSegmentGroup,\n    commands,\n    queryParams,\n    fragment,\n    urlSerializer,\n  );\n}\n\nexport function createSegmentGroupFromRoute(route: ActivatedRouteSnapshot): UrlSegmentGroup {\n  let targetGroup: UrlSegmentGroup | undefined;\n\n  function createSegmentGroupFromRouteRecursive(\n    currentRoute: ActivatedRouteSnapshot,\n  ): UrlSegmentGroup {\n    const childOutlets: {[outlet: string]: UrlSegmentGroup} = {};\n    for (const childSnapshot of currentRoute.children) {\n      const root = createSegmentGroupFromRouteRecursive(childSnapshot);\n      childOutlets[childSnapshot.outlet] = root;\n    }\n    const segmentGroup = new UrlSegmentGroup(currentRoute.url, childOutlets);\n    if (currentRoute === route) {\n      targetGroup = segmentGroup;\n    }\n    return segmentGroup;\n  }\n  const rootCandidate = createSegmentGroupFromRouteRecursive(route.root);\n  const rootSegmentGroup = createRoot(rootCandidate);\n\n  return targetGroup ?? rootSegmentGroup;\n}\n\nexport function createUrlTreeFromSegmentGroup(\n  relativeTo: UrlSegmentGroup,\n  commands: readonly any[],\n  queryParams: Params | null,\n  fragment: string | null,\n  urlSerializer: UrlSerializer,\n): UrlTree {\n  let root = relativeTo;\n  while (root.parent) {\n    root = root.parent;\n  }\n  // There are no commands so the `UrlTree` goes to the same path as the one created from the\n  // `UrlSegmentGroup`. All we need to do is update the `queryParams` and `fragment` without\n  // applying any other logic.\n  if (commands.length === 0) {\n    return tree(root, root, root, queryParams, fragment, urlSerializer);\n  }\n\n  const nav = computeNavigation(commands);\n\n  if (nav.toRoot()) {\n    return tree(root, root, new UrlSegmentGroup([], {}), queryParams, fragment, urlSerializer);\n  }\n\n  const position = findStartingPositionForTargetGroup(nav, root, relativeTo);\n  const newSegmentGroup = position.processChildren\n    ? updateSegmentGroupChildren(position.segmentGroup, position.index, nav.commands)\n    : updateSegmentGroup(position.segmentGroup, position.index, nav.commands);\n  return tree(root, position.segmentGroup, newSegmentGroup, queryParams, fragment, urlSerializer);\n}\n\nfunction isMatrixParams(command: any): boolean {\n  return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;\n}\n\n/**\n * Determines if a given command has an `outlets` map. When we encounter a command\n * with an outlets k/v map, we need to apply each outlet individually to the existing segment.\n */\nfunction isCommandWithOutlets(command: any): command is {outlets: {[key: string]: any}} {\n  return typeof command === 'object' && command != null && command.outlets;\n}\n\n/**\n * Normalizes a query parameter value by using the `UrlSerializer` to serialize then parse the value.\n *\n * This ensures that the value is consistent between parsing a URL in the browser on a fresh page load (or page refresh)\n * and a navigation where the query parameter value is passed directly to the router.\n *\n * This also allows custom `UrlSerializer` implementations to define how query parameter values are represented\n * in a `UrlTree`. Since `UrlSerializer` already has a `parse` that takes a string, it already has control\n * over how a browser URL is parsed into a `UrlTree` on initial load/page refresh.\n */\nfunction normalizeQueryParams(k: string, v: unknown, urlSerializer: UrlSerializer): unknown {\n  // Hack for empty string query param, which, for whatever reason, happens\n  // in a test. Parsing drops empty key params (which might not really be necessary).\n  // It's probably really a test issue but I don't have the time to fix it...\n  k ||= 'ɵ';\n  const tree = new UrlTree();\n  tree.queryParams = {[k]: v};\n  return urlSerializer.parse(urlSerializer.serialize(tree)).queryParams[k];\n}\n\nfunction tree(\n  oldRoot: UrlSegmentGroup,\n  oldSegmentGroup: UrlSegmentGroup,\n  newSegmentGroup: UrlSegmentGroup,\n  queryParams: Params | null,\n  fragment: string | null,\n  urlSerializer: UrlSerializer,\n): UrlTree {\n  const qp: Params = {};\n  for (const [key, value] of Object.entries(queryParams ?? {})) {\n    // This retains old behavior where each item in the array was stringified individually This\n    // helps remove special-case handling for empty and single-item arrays where the default\n    // serializer removes empty arrays when serialized then parsed or converts them to non-arrays\n    // for single-item arrays. Changing this could have breaking change implications. Prior code\n    // always returned arrays of strings for array inputs so tests, applications, serializers,\n    // etc. may only be set up to handle string arrays. We could consider changing this in the\n    // future to serialize the entire array as a single value. For now, this feels safer and is\n    // at least a step in the right direction.\n    qp[key] = Array.isArray(value)\n      ? value.map((v) => normalizeQueryParams(key, v, urlSerializer))\n      : normalizeQueryParams(key, value, urlSerializer);\n  }\n\n  let rootCandidate: UrlSegmentGroup;\n  if (oldRoot === oldSegmentGroup) {\n    rootCandidate = newSegmentGroup;\n  } else {\n    rootCandidate = replaceSegment(oldRoot, oldSegmentGroup, newSegmentGroup);\n  }\n\n  const newRoot = createRoot(squashSegmentGroup(rootCandidate));\n  return new UrlTree(newRoot, qp, fragment);\n}\n\n/**\n * Replaces the `oldSegment` which is located in some child of the `current` with the `newSegment`.\n * This also has the effect of creating new `UrlSegmentGroup` copies to update references. This\n * shouldn't be necessary but the fallback logic for an invalid ActivatedRoute in the creation uses\n * the Router's current url tree. If we don't create new segment groups, we end up modifying that\n * value.\n */\nfunction replaceSegment(\n  current: UrlSegmentGroup,\n  oldSegment: UrlSegmentGroup,\n  newSegment: UrlSegmentGroup,\n): UrlSegmentGroup {\n  const children: {[key: string]: UrlSegmentGroup} = {};\n  Object.entries(current.children).forEach(([outletName, c]) => {\n    if (c === oldSegment) {\n      children[outletName] = newSegment;\n    } else {\n      children[outletName] = replaceSegment(c, oldSegment, newSegment);\n    }\n  });\n  return new UrlSegmentGroup(current.segments, children);\n}\n\nclass Navigation {\n  constructor(\n    public isAbsolute: boolean,\n    public numberOfDoubleDots: number,\n    public commands: readonly any[],\n  ) {\n    if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {\n      throw new RuntimeError(\n        RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          'Root segment cannot have matrix parameters',\n      );\n    }\n\n    const cmdWithOutlet = commands.find(isCommandWithOutlets);\n    if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {\n      throw new RuntimeError(\n        RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          '{outlets:{}} has to be the last command',\n      );\n    }\n  }\n\n  public toRoot(): boolean {\n    return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';\n  }\n}\n\n/** Transforms commands to a normalized `Navigation` */\nfunction computeNavigation(commands: readonly any[]): Navigation {\n  if (typeof commands[0] === 'string' && commands.length === 1 && commands[0] === '/') {\n    return new Navigation(true, 0, commands);\n  }\n\n  let numberOfDoubleDots = 0;\n  let isAbsolute = false;\n\n  const res: any[] = commands.reduce((res, cmd, cmdIdx) => {\n    if (typeof cmd === 'object' && cmd != null) {\n      if (cmd.outlets) {\n        const outlets: {[k: string]: any} = {};\n        Object.entries(cmd.outlets).forEach(([name, commands]) => {\n          outlets[name] = typeof commands === 'string' ? commands.split('/') : commands;\n        });\n        return [...res, {outlets}];\n      }\n\n      if (cmd.segmentPath) {\n        return [...res, cmd.segmentPath];\n      }\n    }\n\n    if (!(typeof cmd === 'string')) {\n      return [...res, cmd];\n    }\n\n    if (cmdIdx === 0) {\n      cmd.split('/').forEach((urlPart, partIndex) => {\n        if (partIndex == 0 && urlPart === '.') {\n          // skip './a'\n        } else if (partIndex == 0 && urlPart === '') {\n          //  '/a'\n          isAbsolute = true;\n        } else if (urlPart === '..') {\n          //  '../a'\n          numberOfDoubleDots++;\n        } else if (urlPart != '') {\n          res.push(urlPart);\n        }\n      });\n\n      return res;\n    }\n\n    return [...res, cmd];\n  }, []);\n\n  return new Navigation(isAbsolute, numberOfDoubleDots, res);\n}\n\nclass Position {\n  constructor(\n    public segmentGroup: UrlSegmentGroup,\n    public processChildren: boolean,\n    public index: number,\n  ) {}\n}\n\nfunction findStartingPositionForTargetGroup(\n  nav: Navigation,\n  root: UrlSegmentGroup,\n  target: UrlSegmentGroup,\n): Position {\n  if (nav.isAbsolute) {\n    return new Position(root, true, 0);\n  }\n\n  if (!target) {\n    // `NaN` is used only to maintain backwards compatibility with incorrectly mocked\n    // `ActivatedRouteSnapshot` in tests. In prior versions of this code, the position here was\n    // determined based on an internal property that was rarely mocked, resulting in `NaN`. In\n    // reality, this code path should _never_ be touched since `target` is not allowed to be falsey.\n    return new Position(root, false, NaN);\n  }\n  if (target.parent === null) {\n    return new Position(target, true, 0);\n  }\n\n  const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;\n  const index = target.segments.length - 1 + modifier;\n  return createPositionApplyingDoubleDots(target, index, nav.numberOfDoubleDots);\n}\n\nfunction createPositionApplyingDoubleDots(\n  group: UrlSegmentGroup,\n  index: number,\n  numberOfDoubleDots: number,\n): Position {\n  let g = group;\n  let ci = index;\n  let dd = numberOfDoubleDots;\n  while (dd > ci) {\n    dd -= ci;\n    g = g.parent!;\n    if (!g) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_DOUBLE_DOTS,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && \"Invalid number of '../'\",\n      );\n    }\n    ci = g.segments.length;\n  }\n  return new Position(g, false, ci - dd);\n}\n\nfunction getOutlets(commands: readonly unknown[]): {[k: string]: readonly unknown[] | string} {\n  if (isCommandWithOutlets(commands[0])) {\n    return commands[0].outlets;\n  }\n\n  return {[PRIMARY_OUTLET]: commands};\n}\n\nfunction updateSegmentGroup(\n  segmentGroup: UrlSegmentGroup | undefined,\n  startIndex: number,\n  commands: readonly any[],\n): UrlSegmentGroup {\n  segmentGroup ??= new UrlSegmentGroup([], {});\n  if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n    return updateSegmentGroupChildren(segmentGroup, startIndex, commands);\n  }\n\n  const m = prefixedWith(segmentGroup, startIndex, commands);\n  const slicedCommands = commands.slice(m.commandIndex);\n  if (m.match && m.pathIndex < segmentGroup.segments.length) {\n    const g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});\n    g.children[PRIMARY_OUTLET] = new UrlSegmentGroup(\n      segmentGroup.segments.slice(m.pathIndex),\n      segmentGroup.children,\n    );\n    return updateSegmentGroupChildren(g, 0, slicedCommands);\n  } else if (m.match && slicedCommands.length === 0) {\n    return new UrlSegmentGroup(segmentGroup.segments, {});\n  } else if (m.match && !segmentGroup.hasChildren()) {\n    return createNewSegmentGroup(segmentGroup, startIndex, commands);\n  } else if (m.match) {\n    return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);\n  } else {\n    return createNewSegmentGroup(segmentGroup, startIndex, commands);\n  }\n}\n\nfunction updateSegmentGroupChildren(\n  segmentGroup: UrlSegmentGroup,\n  startIndex: number,\n  commands: readonly any[],\n): UrlSegmentGroup {\n  if (commands.length === 0) {\n    return new UrlSegmentGroup(segmentGroup.segments, {});\n  } else {\n    const outlets = getOutlets(commands);\n    const children: {[key: string]: UrlSegmentGroup} = {};\n    // If the set of commands applies to anything other than the primary outlet and the child\n    // segment is an empty path primary segment on its own, we want to apply the commands to the\n    // empty child path rather than here. The outcome is that the empty primary child is effectively\n    // removed from the final output UrlTree. Imagine the following config:\n    //\n    // {path: '', children: [{path: '**', outlet: 'popup'}]}.\n    //\n    // Navigation to /(popup:a) will activate the child outlet correctly Given a follow-up\n    // navigation with commands\n    // ['/', {outlets: {'popup': 'b'}}], we _would not_ want to apply the outlet commands to the\n    // root segment because that would result in\n    // //(popup:a)(popup:b) since the outlet command got applied one level above where it appears in\n    // the `ActivatedRoute` rather than updating the existing one.\n    //\n    // Because empty paths do not appear in the URL segments and the fact that the segments used in\n    // the output `UrlTree` are squashed to eliminate these empty paths where possible\n    // https://github.com/angular/angular/blob/13f10de40e25c6900ca55bd83b36bd533dacfa9e/packages/router/src/url_tree.ts#L755\n    // it can be hard to determine what is the right thing to do when applying commands to a\n    // `UrlSegmentGroup` that is created from an \"unsquashed\"/expanded `ActivatedRoute` tree.\n    // This code effectively \"squashes\" empty path primary routes when they have no siblings on\n    // the same level of the tree.\n    if (\n      Object.keys(outlets).some((o) => o !== PRIMARY_OUTLET) &&\n      segmentGroup.children[PRIMARY_OUTLET] &&\n      segmentGroup.numberOfChildren === 1 &&\n      segmentGroup.children[PRIMARY_OUTLET].segments.length === 0\n    ) {\n      const childrenOfEmptyChild = updateSegmentGroupChildren(\n        segmentGroup.children[PRIMARY_OUTLET],\n        startIndex,\n        commands,\n      );\n      return new UrlSegmentGroup(segmentGroup.segments, childrenOfEmptyChild.children);\n    }\n\n    Object.entries(outlets).forEach(([outlet, commands]) => {\n      if (typeof commands === 'string') {\n        commands = [commands];\n      }\n      if (commands !== null) {\n        children[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);\n      }\n    });\n\n    Object.entries(segmentGroup.children).forEach(([childOutlet, child]) => {\n      if (outlets[childOutlet] === undefined) {\n        children[childOutlet] = child;\n      }\n    });\n    return new UrlSegmentGroup(segmentGroup.segments, children);\n  }\n}\n\nfunction prefixedWith(segmentGroup: UrlSegmentGroup, startIndex: number, commands: readonly any[]) {\n  let currentCommandIndex = 0;\n  let currentPathIndex = startIndex;\n\n  const noMatch = {match: false, pathIndex: 0, commandIndex: 0};\n  while (currentPathIndex < segmentGroup.segments.length) {\n    if (currentCommandIndex >= commands.length) return noMatch;\n    const path = segmentGroup.segments[currentPathIndex];\n    const command = commands[currentCommandIndex];\n    // Do not try to consume command as part of the prefixing if it has outlets because it can\n    // contain outlets other than the one being processed. Consuming the outlets command would\n    // result in other outlets being ignored.\n    if (isCommandWithOutlets(command)) {\n      break;\n    }\n    const curr = `${command}`;\n    const next =\n      currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;\n\n    if (currentPathIndex > 0 && curr === undefined) break;\n\n    if (curr && next && typeof next === 'object' && next.outlets === undefined) {\n      if (!compare(curr, next, path)) return noMatch;\n      currentCommandIndex += 2;\n    } else {\n      if (!compare(curr, {}, path)) return noMatch;\n      currentCommandIndex++;\n    }\n    currentPathIndex++;\n  }\n\n  return {match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex};\n}\n\nfunction createNewSegmentGroup(\n  segmentGroup: UrlSegmentGroup,\n  startIndex: number,\n  commands: readonly any[],\n): UrlSegmentGroup {\n  const paths = segmentGroup.segments.slice(0, startIndex);\n\n  let i = 0;\n  while (i < commands.length) {\n    const command = commands[i];\n    if (isCommandWithOutlets(command)) {\n      const children = createNewSegmentChildren(command.outlets);\n      return new UrlSegmentGroup(paths, children);\n    }\n\n    // if we start with an object literal, we need to reuse the path part from the segment\n    if (i === 0 && isMatrixParams(commands[0])) {\n      const p = segmentGroup.segments[startIndex];\n      paths.push(new UrlSegment(p.path, stringify(commands[0])));\n      i++;\n      continue;\n    }\n\n    const curr = isCommandWithOutlets(command) ? command.outlets[PRIMARY_OUTLET] : `${command}`;\n    const next = i < commands.length - 1 ? commands[i + 1] : null;\n    if (curr && next && isMatrixParams(next)) {\n      paths.push(new UrlSegment(curr, stringify(next)));\n      i += 2;\n    } else {\n      paths.push(new UrlSegment(curr, {}));\n      i++;\n    }\n  }\n  return new UrlSegmentGroup(paths, {});\n}\n\nfunction createNewSegmentChildren(outlets: {[name: string]: readonly unknown[] | string}): {\n  [outlet: string]: UrlSegmentGroup;\n} {\n  const children: {[outlet: string]: UrlSegmentGroup} = {};\n  Object.entries(outlets).forEach(([outlet, commands]) => {\n    if (typeof commands === 'string') {\n      commands = [commands];\n    }\n    if (commands !== null) {\n      children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);\n    }\n  });\n  return children;\n}\n\nfunction stringify(params: {[key: string]: any}): {[key: string]: string} {\n  const res: {[key: string]: string} = {};\n  Object.entries(params).forEach(([k, v]) => (res[k] = `${v}`));\n  return res;\n}\n\nfunction compare(path: string, params: {[key: string]: any}, segment: UrlSegment): boolean {\n  return path == segment.path && shallowEqual(params, segment.parameters);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NavigationBehaviorOptions, Route} from './models';\nimport type {Navigation} from './navigation_transition';\nimport {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';\nimport {UrlTree} from './url_tree';\n\n/**\n * Identifies the call or event that triggered a navigation.\n *\n * * 'imperative': Triggered by `router.navigateByUrl()` or `router.navigate()`.\n * * 'popstate' : Triggered by a `popstate` event.\n * * 'hashchange'-: Triggered by a `hashchange` event.\n *\n * @publicApi\n */\nexport type NavigationTrigger = 'imperative' | 'popstate' | 'hashchange';\nexport const IMPERATIVE_NAVIGATION = 'imperative';\n\n/**\n * Identifies the type of a router event.\n *\n * @see [Router Lifecycle and Events](guide/routing/lifecycle-and-events)\n *\n * @publicApi\n */\nexport enum EventType {\n  NavigationStart,\n  NavigationEnd,\n  NavigationCancel,\n  NavigationError,\n  RoutesRecognized,\n  ResolveStart,\n  ResolveEnd,\n  GuardsCheckStart,\n  GuardsCheckEnd,\n  RouteConfigLoadStart,\n  RouteConfigLoadEnd,\n  ChildActivationStart,\n  ChildActivationEnd,\n  ActivationStart,\n  ActivationEnd,\n  Scroll,\n  NavigationSkipped,\n}\n\n/**\n * Base for events the router goes through, as opposed to events tied to a specific\n * route. Fired one time for any given navigation.\n *\n * The following code shows how a class subscribes to router events.\n *\n * ```ts\n * import {Event, RouterEvent, Router} from '@angular/router';\n *\n * class MyService {\n *   constructor(public router: Router) {\n *     router.events.pipe(\n *        filter((e: Event | RouterEvent): e is RouterEvent => e instanceof RouterEvent)\n *     ).subscribe((e: RouterEvent) => {\n *       // Do something\n *     });\n *   }\n * }\n * ```\n *\n * @see {@link Event}\n * @see [Router events summary](guide/routing/router-reference#router-events)\n * @publicApi\n */\nexport class RouterEvent {\n  constructor(\n    /** A unique ID that the router assigns to every router navigation. */\n    public id: number,\n    /** The URL that is the destination for this navigation. */\n    public url: string,\n  ) {}\n}\n\n/**\n * An event triggered when a navigation starts.\n *\n * @publicApi\n */\nexport class NavigationStart extends RouterEvent {\n  readonly type = EventType.NavigationStart;\n\n  /**\n   * Identifies the call or event that triggered the navigation.\n   * An `imperative` trigger is a call to `router.navigateByUrl()` or `router.navigate()`.\n   *\n   * @see {@link NavigationEnd}\n   * @see {@link NavigationCancel}\n   * @see {@link NavigationError}\n   */\n  navigationTrigger?: NavigationTrigger;\n\n  /**\n   * The navigation state that was previously supplied to the `pushState` call,\n   * when the navigation is triggered by a `popstate` event. Otherwise null.\n   *\n   * The state object is defined by `NavigationExtras`, and contains any\n   * developer-defined state value, as well as a unique ID that\n   * the router assigns to every router transition/navigation.\n   *\n   * From the perspective of the router, the router never \"goes back\".\n   * When the user clicks on the back button in the browser,\n   * a new navigation ID is created.\n   *\n   * Use the ID in this previous-state object to differentiate between a newly created\n   * state and one returned to by a `popstate` event, so that you can restore some\n   * remembered state, such as scroll position.\n   *\n   */\n  restoredState?: {[k: string]: any; navigationId: number} | null;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    navigationTrigger: NavigationTrigger = 'imperative',\n    /** @docsNotRequired */\n    restoredState: {[k: string]: any; navigationId: number} | null = null,\n  ) {\n    super(id, url);\n    this.navigationTrigger = navigationTrigger;\n    this.restoredState = restoredState;\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `NavigationStart(id: ${this.id}, url: '${this.url}')`;\n  }\n}\n\n/**\n * An event triggered when a navigation ends successfully.\n *\n * @see {@link NavigationStart}\n * @see {@link NavigationCancel}\n * @see {@link NavigationError}\n *\n * @publicApi\n */\nexport class NavigationEnd extends RouterEvent {\n  readonly type = EventType.NavigationEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`;\n  }\n}\n\n/**\n * A code for the `NavigationCancel` event of the `Router` to indicate the\n * reason a navigation failed.\n *\n * @publicApi\n */\nexport enum NavigationCancellationCode {\n  /**\n   * A navigation failed because a guard returned a `UrlTree` to redirect.\n   */\n  Redirect,\n  /**\n   * A navigation failed because a more recent navigation started.\n   */\n  SupersededByNewNavigation,\n  /**\n   * A navigation failed because one of the resolvers completed without emitting a value.\n   */\n  NoDataFromResolver,\n  /**\n   * A navigation failed because a guard returned `false`.\n   */\n  GuardRejected,\n  /**\n   * A navigation was aborted by the `Navigation.abort` function.\n   *\n   * @see {@link Navigation}\n   */\n  Aborted,\n}\n\n/**\n * A code for the `NavigationSkipped` event of the `Router` to indicate the\n * reason a navigation was skipped.\n *\n * @publicApi\n */\nexport enum NavigationSkippedCode {\n  /**\n   * A navigation was skipped because the navigation URL was the same as the current Router URL.\n   */\n  IgnoredSameUrlNavigation,\n  /**\n   * A navigation was skipped because the configured `UrlHandlingStrategy` return `false` for both\n   * the current Router URL and the target of the navigation.\n   *\n   * @see {@link UrlHandlingStrategy}\n   */\n  IgnoredByUrlHandlingStrategy,\n}\n\n/**\n * An event triggered when a navigation is canceled, directly or indirectly.\n * This can happen for several reasons including when a route guard\n * returns `false` or initiates a redirect by returning a `UrlTree`.\n *\n * @see {@link NavigationStart}\n * @see {@link NavigationEnd}\n * @see {@link NavigationError}\n *\n * @publicApi\n */\nexport class NavigationCancel extends RouterEvent {\n  readonly type = EventType.NavigationCancel;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /**\n     * A description of why the navigation was cancelled. For debug purposes only. Use `code`\n     * instead for a stable cancellation reason that can be used in production.\n     */\n    public reason: string,\n    /**\n     * A code to indicate why the navigation was canceled. This cancellation code is stable for\n     * the reason and can be relied on whereas the `reason` string could change and should not be\n     * used in production.\n     */\n    readonly code?: NavigationCancellationCode,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `NavigationCancel(id: ${this.id}, url: '${this.url}')`;\n  }\n}\n\nexport function isRedirectingEvent(event: Event): boolean {\n  return (\n    event instanceof NavigationCancel &&\n    (event.code === NavigationCancellationCode.Redirect ||\n      event.code === NavigationCancellationCode.SupersededByNewNavigation)\n  );\n}\n\n/**\n * An event triggered when a navigation is skipped.\n * This can happen for a couple reasons including onSameUrlHandling\n * is set to `ignore` and the navigation URL is not different than the\n * current state.\n *\n * @publicApi\n */\nexport class NavigationSkipped extends RouterEvent {\n  readonly type = EventType.NavigationSkipped;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /**\n     * A description of why the navigation was skipped. For debug purposes only. Use `code`\n     * instead for a stable skipped reason that can be used in production.\n     */\n    public reason: string,\n    /**\n     * A code to indicate why the navigation was skipped. This code is stable for\n     * the reason and can be relied on whereas the `reason` string could change and should not be\n     * used in production.\n     */\n    readonly code?: NavigationSkippedCode,\n  ) {\n    super(id, url);\n  }\n}\n\n/**\n * An event triggered when a navigation fails due to an unexpected error.\n *\n * @see {@link NavigationStart}\n * @see {@link NavigationEnd}\n * @see {@link NavigationCancel}\n *\n * @publicApi\n */\nexport class NavigationError extends RouterEvent {\n  readonly type = EventType.NavigationError;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public error: any,\n    /**\n     * The target of the navigation when the error occurred.\n     *\n     * Note that this can be `undefined` because an error could have occurred before the\n     * `RouterStateSnapshot` was created for the navigation.\n     */\n    readonly target?: RouterStateSnapshot,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`;\n  }\n}\n\n/**\n * An event triggered when routes are recognized.\n *\n * @publicApi\n */\nexport class RoutesRecognized extends RouterEvent {\n  readonly type = EventType.RoutesRecognized;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n    /** @docsNotRequired */\n    public state: RouterStateSnapshot,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n  }\n}\n\n/**\n * An event triggered at the start of the Guard phase of routing.\n *\n * @see {@link GuardsCheckEnd}\n *\n * @publicApi\n */\nexport class GuardsCheckStart extends RouterEvent {\n  readonly type = EventType.GuardsCheckStart;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n    /** @docsNotRequired */\n    public state: RouterStateSnapshot,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n  }\n}\n\n/**\n * An event triggered at the end of the Guard phase of routing.\n *\n * @see {@link GuardsCheckStart}\n *\n * @publicApi\n */\nexport class GuardsCheckEnd extends RouterEvent {\n  readonly type = EventType.GuardsCheckEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n    /** @docsNotRequired */\n    public state: RouterStateSnapshot,\n    /** @docsNotRequired */\n    public shouldActivate: boolean,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`;\n  }\n}\n\n/**\n * An event triggered at the start of the Resolve phase of routing.\n *\n * Runs in the \"resolve\" phase whether or not there is anything to resolve.\n * In future, may change to only run when there are things to be resolved.\n *\n * @see {@link ResolveEnd}\n *\n * @publicApi\n */\nexport class ResolveStart extends RouterEvent {\n  readonly type = EventType.ResolveStart;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n    /** @docsNotRequired */\n    public state: RouterStateSnapshot,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n  }\n}\n\n/**\n * An event triggered at the end of the Resolve phase of routing.\n * @see {@link ResolveStart}\n *\n * @publicApi\n */\nexport class ResolveEnd extends RouterEvent {\n  readonly type = EventType.ResolveEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    id: number,\n    /** @docsNotRequired */\n    url: string,\n    /** @docsNotRequired */\n    public urlAfterRedirects: string,\n    /** @docsNotRequired */\n    public state: RouterStateSnapshot,\n  ) {\n    super(id, url);\n  }\n\n  /** @docs-private */\n  override toString(): string {\n    return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;\n  }\n}\n\n/**\n * An event triggered before lazy loading a route configuration.\n *\n * @see {@link RouteConfigLoadEnd}\n *\n * @publicApi\n */\nexport class RouteConfigLoadStart {\n  readonly type = EventType.RouteConfigLoadStart;\n\n  constructor(\n    /** @docsNotRequired */\n    public route: Route,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    return `RouteConfigLoadStart(path: ${this.route.path})`;\n  }\n}\n\n/**\n * An event triggered when a route has been lazy loaded.\n *\n * @see {@link RouteConfigLoadStart}\n *\n * @publicApi\n */\nexport class RouteConfigLoadEnd {\n  readonly type = EventType.RouteConfigLoadEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    public route: Route,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    return `RouteConfigLoadEnd(path: ${this.route.path})`;\n  }\n}\n\n/**\n * An event triggered at the start of the child-activation\n * part of the Resolve phase of routing.\n * @see {@link ChildActivationEnd}\n * @see {@link ResolveStart}\n *\n * @publicApi\n */\nexport class ChildActivationStart {\n  readonly type = EventType.ChildActivationStart;\n\n  constructor(\n    /** @docsNotRequired */\n    public snapshot: ActivatedRouteSnapshot,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';\n    return `ChildActivationStart(path: '${path}')`;\n  }\n}\n\n/**\n * An event triggered at the end of the child-activation part\n * of the Resolve phase of routing.\n * @see {@link ChildActivationStart}\n * @see {@link ResolveStart}\n * @publicApi\n */\nexport class ChildActivationEnd {\n  readonly type = EventType.ChildActivationEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    public snapshot: ActivatedRouteSnapshot,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';\n    return `ChildActivationEnd(path: '${path}')`;\n  }\n}\n\n/**\n * An event triggered at the start of the activation part\n * of the Resolve phase of routing.\n * @see {@link ActivationEnd}\n * @see {@link ResolveStart}\n *\n * @publicApi\n */\nexport class ActivationStart {\n  readonly type = EventType.ActivationStart;\n\n  constructor(\n    /** @docsNotRequired */\n    public snapshot: ActivatedRouteSnapshot,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';\n    return `ActivationStart(path: '${path}')`;\n  }\n}\n\n/**\n * An event triggered at the end of the activation part\n * of the Resolve phase of routing.\n * @see {@link ActivationStart}\n * @see {@link ResolveStart}\n *\n * @publicApi\n */\nexport class ActivationEnd {\n  readonly type = EventType.ActivationEnd;\n\n  constructor(\n    /** @docsNotRequired */\n    public snapshot: ActivatedRouteSnapshot,\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';\n    return `ActivationEnd(path: '${path}')`;\n  }\n}\n\n/**\n * An event triggered by scrolling.\n *\n * @publicApi\n */\nexport class Scroll {\n  readonly type = EventType.Scroll;\n\n  constructor(\n    /** @docsNotRequired */\n    readonly routerEvent: NavigationEnd | NavigationSkipped,\n\n    /** @docsNotRequired */\n    readonly position: [number, number] | null,\n\n    /** @docsNotRequired */\n    readonly anchor: string | null,\n\n    /** @docsNotRequired */\n    readonly scrollBehavior?: 'manual' | 'after-transition',\n  ) {}\n\n  /** @docs-private */\n  toString(): string {\n    const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null;\n    return `Scroll(anchor: '${this.anchor}', position: '${pos}')`;\n  }\n}\n\nexport class BeforeActivateRoutes {}\nexport class BeforeRoutesRecognized {}\nexport class RedirectRequest {\n  constructor(\n    readonly url: UrlTree,\n    readonly navigationBehaviorOptions: NavigationBehaviorOptions | undefined,\n  ) {}\n}\nexport type PrivateRouterEvents = BeforeActivateRoutes | RedirectRequest | BeforeRoutesRecognized;\nexport function isPublicRouterEvent(e: Event | PrivateRouterEvents): e is Event {\n  return (\n    !(e instanceof BeforeActivateRoutes) &&\n    !(e instanceof RedirectRequest) &&\n    !(e instanceof BeforeRoutesRecognized)\n  );\n}\n\n/**\n * Router events that allow you to track the lifecycle of the router.\n *\n * The events occur in the following sequence:\n *\n * * [NavigationStart](api/router/NavigationStart): Navigation starts.\n * * [RouteConfigLoadStart](api/router/RouteConfigLoadStart): Before\n * the router [lazy loads](guide/routing/common-router-tasks#lazy-loading) a route configuration.\n * * [RouteConfigLoadEnd](api/router/RouteConfigLoadEnd): After a route has been lazy loaded.\n * * [RoutesRecognized](api/router/RoutesRecognized): When the router parses the URL\n * and the routes are recognized.\n * * [GuardsCheckStart](api/router/GuardsCheckStart): When the router begins the *guards*\n * phase of routing.\n * * [ChildActivationStart](api/router/ChildActivationStart): When the router\n * begins activating a route's children.\n * * [ActivationStart](api/router/ActivationStart): When the router begins activating a route.\n * * [GuardsCheckEnd](api/router/GuardsCheckEnd): When the router finishes the *guards*\n * phase of routing successfully.\n * * [ResolveStart](api/router/ResolveStart): When the router begins the *resolve*\n * phase of routing.\n * * [ResolveEnd](api/router/ResolveEnd): When the router finishes the *resolve*\n * phase of routing successfully.\n * * [ChildActivationEnd](api/router/ChildActivationEnd): When the router finishes\n * activating a route's children.\n * * [ActivationEnd](api/router/ActivationEnd): When the router finishes activating a route.\n * * [NavigationEnd](api/router/NavigationEnd): When navigation ends successfully.\n * * [NavigationCancel](api/router/NavigationCancel): When navigation is canceled.\n * * [NavigationError](api/router/NavigationError): When navigation fails\n * due to an unexpected error.\n * * [Scroll](api/router/Scroll): When the user scrolls.\n *\n * @publicApi\n */\nexport type Event =\n  | NavigationStart\n  | NavigationEnd\n  | NavigationCancel\n  | NavigationError\n  | RoutesRecognized\n  | GuardsCheckStart\n  | GuardsCheckEnd\n  | RouteConfigLoadStart\n  | RouteConfigLoadEnd\n  | ChildActivationStart\n  | ChildActivationEnd\n  | ActivationStart\n  | ActivationEnd\n  | Scroll\n  | ResolveStart\n  | ResolveEnd\n  | NavigationSkipped;\n\nexport function stringifyEvent(routerEvent: Event): string {\n  switch (routerEvent.type) {\n    case EventType.ActivationEnd:\n      return `ActivationEnd(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`;\n    case EventType.ActivationStart:\n      return `ActivationStart(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`;\n    case EventType.ChildActivationEnd:\n      return `ChildActivationEnd(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`;\n    case EventType.ChildActivationStart:\n      return `ChildActivationStart(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`;\n    case EventType.GuardsCheckEnd:\n      return `GuardsCheckEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state}, shouldActivate: ${routerEvent.shouldActivate})`;\n    case EventType.GuardsCheckStart:\n      return `GuardsCheckStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`;\n    case EventType.NavigationCancel:\n      return `NavigationCancel(id: ${routerEvent.id}, url: '${routerEvent.url}')`;\n    case EventType.NavigationSkipped:\n      return `NavigationSkipped(id: ${routerEvent.id}, url: '${routerEvent.url}')`;\n    case EventType.NavigationEnd:\n      return `NavigationEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}')`;\n    case EventType.NavigationError:\n      return `NavigationError(id: ${routerEvent.id}, url: '${routerEvent.url}', error: ${routerEvent.error})`;\n    case EventType.NavigationStart:\n      return `NavigationStart(id: ${routerEvent.id}, url: '${routerEvent.url}')`;\n    case EventType.ResolveEnd:\n      return `ResolveEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`;\n    case EventType.ResolveStart:\n      return `ResolveStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`;\n    case EventType.RouteConfigLoadEnd:\n      return `RouteConfigLoadEnd(path: ${routerEvent.route.path})`;\n    case EventType.RouteConfigLoadStart:\n      return `RouteConfigLoadStart(path: ${routerEvent.route.path})`;\n    case EventType.RoutesRecognized:\n      return `RoutesRecognized(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`;\n    case EventType.Scroll:\n      const pos = routerEvent.position\n        ? `${routerEvent.position[0]}, ${routerEvent.position[1]}`\n        : null;\n      return `Scroll(anchor: '${routerEvent.anchor}', position: '${pos}')`;\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentRef, EnvironmentInjector, Injectable} from '@angular/core';\n\nimport type {RouterOutletContract} from './directives/router_outlet';\nimport {ActivatedRoute} from './router_state';\n\n/**\n * Store contextual information about a `RouterOutlet`\n *\n * @publicApi\n */\nexport class OutletContext {\n  outlet: RouterOutletContract | null = null;\n  route: ActivatedRoute | null = null;\n  children: ChildrenOutletContexts;\n  attachRef: ComponentRef<any> | null = null;\n  get injector(): EnvironmentInjector {\n    return this.route?.snapshot._environmentInjector ?? this.rootInjector;\n  }\n\n  constructor(private readonly rootInjector: EnvironmentInjector) {\n    this.children = new ChildrenOutletContexts(this.rootInjector);\n  }\n}\n\n/**\n * Store contextual information about the children (= nested) `RouterOutlet`\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class ChildrenOutletContexts {\n  // contexts for child outlets, by name.\n  private contexts = new Map<string, OutletContext>();\n\n  /** @docs-private */\n  constructor(private rootInjector: EnvironmentInjector) {}\n\n  /** Called when a `RouterOutlet` directive is instantiated */\n  onChildOutletCreated(childName: string, outlet: RouterOutletContract): void {\n    const context = this.getOrCreateContext(childName);\n    context.outlet = outlet;\n    this.contexts.set(childName, context);\n  }\n\n  /**\n   * Called when a `RouterOutlet` directive is destroyed.\n   * We need to keep the context as the outlet could be destroyed inside a NgIf and might be\n   * re-created later.\n   */\n  onChildOutletDestroyed(childName: string): void {\n    const context = this.getContext(childName);\n    if (context) {\n      context.outlet = null;\n      context.attachRef = null;\n    }\n  }\n\n  /**\n   * Called when the corresponding route is deactivated during navigation.\n   * Because the component get destroyed, all children outlet are destroyed.\n   */\n  onOutletDeactivated(): Map<string, OutletContext> {\n    const contexts = this.contexts;\n    this.contexts = new Map();\n    return contexts;\n  }\n\n  onOutletReAttached(contexts: Map<string, OutletContext>): void {\n    this.contexts = contexts;\n  }\n\n  getOrCreateContext(childName: string): OutletContext {\n    let context = this.getContext(childName);\n\n    if (!context) {\n      context = new OutletContext(this.rootInjector);\n      this.contexts.set(childName, context);\n    }\n\n    return context;\n  }\n\n  getContext(childName: string): OutletContext | null {\n    return this.contexts.get(childName) || null;\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport class Tree<T> {\n  /** @internal */\n  _root: TreeNode<T>;\n\n  constructor(root: TreeNode<T>) {\n    this._root = root;\n  }\n\n  get root(): T {\n    return this._root.value;\n  }\n\n  /**\n   * @internal\n   */\n  parent(t: T): T | null {\n    const p = this.pathFromRoot(t);\n    return p.length > 1 ? p[p.length - 2] : null;\n  }\n\n  /**\n   * @internal\n   */\n  children(t: T): T[] {\n    const n = findNode(t, this._root);\n    return n ? n.children.map((t) => t.value) : [];\n  }\n\n  /**\n   * @internal\n   */\n  firstChild(t: T): T | null {\n    const n = findNode(t, this._root);\n    return n && n.children.length > 0 ? n.children[0].value : null;\n  }\n\n  /**\n   * @internal\n   */\n  siblings(t: T): T[] {\n    const p = findPath(t, this._root);\n    if (p.length < 2) return [];\n\n    const c = p[p.length - 2].children.map((c) => c.value);\n    return c.filter((cc) => cc !== t);\n  }\n\n  /**\n   * @internal\n   */\n  pathFromRoot(t: T): T[] {\n    return findPath(t, this._root).map((s) => s.value);\n  }\n}\n\n// DFS for the node matching the value\nfunction findNode<T>(value: T, node: TreeNode<T>): TreeNode<T> | null {\n  if (value === node.value) return node;\n\n  for (const child of node.children) {\n    const node = findNode(value, child);\n    if (node) return node;\n  }\n\n  return null;\n}\n\n// Return the path to the node with the given value using DFS\nfunction findPath<T>(value: T, node: TreeNode<T>): TreeNode<T>[] {\n  if (value === node.value) return [node];\n\n  for (const child of node.children) {\n    const path = findPath(value, child);\n    if (path.length) {\n      path.unshift(node);\n      return path;\n    }\n  }\n\n  return [];\n}\n\nexport class TreeNode<T> {\n  constructor(\n    public value: T,\n    public children: TreeNode<T>[],\n  ) {}\n\n  toString(): string {\n    return `TreeNode(${this.value})`;\n  }\n}\n\n// Return the list of T indexed by outlet name\nexport function nodeChildrenAsMap<T extends {outlet: string}>(\n  node: TreeNode<T> | null,\n): {\n  [outlet: string]: TreeNode<T>;\n} {\n  const map: {[outlet: string]: TreeNode<T>} = {};\n\n  if (node) {\n    node.children.forEach((child) => (map[child.value.outlet] = child));\n  }\n\n  return map;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector, Type} from '@angular/core';\nimport {BehaviorSubject, Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {Data, ResolveData, Route} from './models';\nimport {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET, RouteTitleKey} from './shared';\nimport {equalSegments, UrlSegment} from './url_tree';\nimport {shallowEqual, shallowEqualArrays} from './utils/collection';\nimport {Tree, TreeNode} from './utils/tree';\n\n/**\n * Represents the state of the router as a tree of activated routes.\n *\n * @usageNotes\n *\n * Every node in the route tree is an `ActivatedRoute` instance\n * that knows about the \"consumed\" URL segments, the extracted parameters,\n * and the resolved data.\n * Use the `ActivatedRoute` properties to traverse the tree from any node.\n *\n * The following fragment shows how a component gets the root node\n * of the current state to establish its own route tree:\n *\n * ```ts\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const state: RouterState = router.routerState;\n *     const root: ActivatedRoute = state.root;\n *     const child = root.firstChild;\n *     const id: Observable<string> = child.params.map(p => p.id);\n *     //...\n *   }\n * }\n * ```\n *\n * @see {@link ActivatedRoute}\n * @see [Getting route information](guide/routing/common-router-tasks#getting-route-information)\n *\n * @publicApi\n */\nexport class RouterState extends Tree<ActivatedRoute> {\n  /** @internal */\n  constructor(\n    root: TreeNode<ActivatedRoute>,\n    /** The current snapshot of the router state */\n    public snapshot: RouterStateSnapshot,\n  ) {\n    super(root);\n    setRouterState(<RouterState>this, root);\n  }\n\n  override toString(): string {\n    return this.snapshot.toString();\n  }\n}\n\nexport function createEmptyState(\n  rootComponent: Type<any> | null,\n  injector: EnvironmentInjector,\n): RouterState {\n  const snapshot = createEmptyStateSnapshot(rootComponent, injector);\n  const emptyUrl = new BehaviorSubject([new UrlSegment('', {})]);\n  const emptyParams = new BehaviorSubject({});\n  const emptyData = new BehaviorSubject({});\n  const emptyQueryParams = new BehaviorSubject({});\n  const fragment = new BehaviorSubject<string | null>('');\n  const activated = new ActivatedRoute(\n    emptyUrl,\n    emptyParams,\n    emptyQueryParams,\n    fragment,\n    emptyData,\n    PRIMARY_OUTLET,\n    rootComponent,\n    snapshot.root,\n  );\n  activated.snapshot = snapshot.root;\n  return new RouterState(new TreeNode<ActivatedRoute>(activated, []), snapshot);\n}\n\nexport function createEmptyStateSnapshot(\n  rootComponent: Type<any> | null,\n  injector: EnvironmentInjector,\n): RouterStateSnapshot {\n  const emptyParams = {};\n  const emptyData = {};\n  const emptyQueryParams = {};\n  const fragment = '';\n  const activated = new ActivatedRouteSnapshot(\n    [],\n    emptyParams,\n    emptyQueryParams,\n    fragment,\n    emptyData,\n    PRIMARY_OUTLET,\n    rootComponent,\n    null,\n    {},\n    injector,\n  );\n  return new RouterStateSnapshot('', new TreeNode<ActivatedRouteSnapshot>(activated, []));\n}\n\n/**\n * Provides access to information about a route associated with a component\n * that is loaded in an outlet.\n * Use to traverse the `RouterState` tree and extract information from nodes.\n *\n * The following example shows how to construct a component using information from a\n * currently activated route.\n *\n * Note: the observables in this class only emit when the current and previous values differ based\n * on shallow equality. For example, changing deeply nested properties in resolved `data` will not\n * cause the `ActivatedRoute.data` `Observable` to emit a new value.\n *\n * {@example router/activated-route/activated_route_component.ts region=\"activated-route\"}\n *\n * @see [Getting route information](guide/routing/common-router-tasks#getting-route-information)\n *\n * @publicApi\n */\nexport class ActivatedRoute {\n  /** The current snapshot of this route */\n  snapshot!: ActivatedRouteSnapshot;\n  /** @internal */\n  _futureSnapshot: ActivatedRouteSnapshot;\n  /** @internal */\n  _routerState!: RouterState;\n  /** @internal */\n  _paramMap?: Observable<ParamMap>;\n  /** @internal */\n  _queryParamMap?: Observable<ParamMap>;\n\n  /** An Observable of the resolved route title */\n  readonly title: Observable<string | undefined>;\n\n  /** An observable of the URL segments matched by this route. */\n  public url: Observable<UrlSegment[]>;\n  /** An observable of the matrix parameters scoped to this route. */\n  public params: Observable<Params>;\n  /** An observable of the query parameters shared by all the routes. */\n  public queryParams: Observable<Params>;\n  /** An observable of the URL fragment shared by all the routes. */\n  public fragment: Observable<string | null>;\n  /** An observable of the static and resolved data of this route. */\n  public data: Observable<Data>;\n\n  /** @internal */\n  constructor(\n    /** @internal */\n    public urlSubject: BehaviorSubject<UrlSegment[]>,\n    /** @internal */\n    public paramsSubject: BehaviorSubject<Params>,\n    /** @internal */\n    public queryParamsSubject: BehaviorSubject<Params>,\n    /** @internal */\n    public fragmentSubject: BehaviorSubject<string | null>,\n    /** @internal */\n    public dataSubject: BehaviorSubject<Data>,\n    /** The outlet name of the route, a constant. */\n    public outlet: string,\n    /** The component of the route, a constant. */\n    public component: Type<any> | null,\n    futureSnapshot: ActivatedRouteSnapshot,\n  ) {\n    this._futureSnapshot = futureSnapshot;\n    this.title = this.dataSubject?.pipe(map((d: Data) => d[RouteTitleKey])) ?? of(undefined);\n    // TODO(atscott): Verify that these can be changed to `.asObservable()` with TGP.\n    this.url = urlSubject;\n    this.params = paramsSubject;\n    this.queryParams = queryParamsSubject;\n    this.fragment = fragmentSubject;\n    this.data = dataSubject;\n  }\n\n  /** The configuration used to match this route. */\n  get routeConfig(): Route | null {\n    return this._futureSnapshot.routeConfig;\n  }\n\n  /** The root of the router state. */\n  get root(): ActivatedRoute {\n    return this._routerState.root;\n  }\n\n  /** The parent of this route in the router state tree. */\n  get parent(): ActivatedRoute | null {\n    return this._routerState.parent(this);\n  }\n\n  /** The first child of this route in the router state tree. */\n  get firstChild(): ActivatedRoute | null {\n    return this._routerState.firstChild(this);\n  }\n\n  /** The children of this route in the router state tree. */\n  get children(): ActivatedRoute[] {\n    return this._routerState.children(this);\n  }\n\n  /** The path from the root of the router state tree to this route. */\n  get pathFromRoot(): ActivatedRoute[] {\n    return this._routerState.pathFromRoot(this);\n  }\n\n  /**\n   * An Observable that contains a map of the required and optional parameters\n   * specific to the route.\n   * The map supports retrieving single and multiple values from the same parameter.\n   */\n  get paramMap(): Observable<ParamMap> {\n    this._paramMap ??= this.params.pipe(map((p: Params): ParamMap => convertToParamMap(p)));\n    return this._paramMap;\n  }\n\n  /**\n   * An Observable that contains a map of the query parameters available to all routes.\n   * The map supports retrieving single and multiple values from the query parameter.\n   */\n  get queryParamMap(): Observable<ParamMap> {\n    this._queryParamMap ??= this.queryParams.pipe(\n      map((p: Params): ParamMap => convertToParamMap(p)),\n    );\n    return this._queryParamMap;\n  }\n\n  toString(): string {\n    return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`;\n  }\n}\n\nexport type ParamsInheritanceStrategy = 'emptyOnly' | 'always';\n\nexport const DEFAULT_PARAMS_INHERITANCE_STRATEGY: ParamsInheritanceStrategy = 'always';\n\n/** @internal */\nexport type Inherited = {\n  params: Params;\n  data: Data;\n  resolve: Data;\n};\n\n/**\n * Returns the inherited params, data, and resolve for a given route.\n *\n * By default, we do not inherit parent data unless the current route is path-less or the parent\n * route is component-less.\n */\nexport function getInherited(\n  route: ActivatedRouteSnapshot,\n  parent: ActivatedRouteSnapshot | null,\n  paramsInheritanceStrategy: ParamsInheritanceStrategy,\n): Inherited {\n  let inherited: Inherited;\n  const {routeConfig} = route;\n  if (\n    parent !== null &&\n    (paramsInheritanceStrategy === 'always' ||\n      // inherit parent data if route is empty path\n      routeConfig?.path === '' ||\n      // inherit parent data if parent was componentless\n      (!parent.component && !parent.routeConfig?.loadComponent))\n  ) {\n    inherited = {\n      params: {...parent.params, ...route.params},\n      data: {...parent.data, ...route.data},\n      resolve: {\n        // Snapshots are created with data inherited from parent and guards (i.e. canActivate) can\n        // change data because it's not frozen...\n        // This first line could be deleted chose to break/disallow mutating the `data` object in\n        // guards.\n        // Note that data from parents still override this mutated data so anyone relying on this\n        // might be surprised that it doesn't work if parent data is inherited but otherwise does.\n        ...route.data,\n        // Ensure inherited resolved data overrides inherited static data\n        ...parent.data,\n        // static data from the current route overrides any inherited data\n        ...routeConfig?.data,\n        // resolved data from current route overrides everything\n        ...route._resolvedData,\n      },\n    };\n  } else {\n    inherited = {\n      params: {...route.params},\n      data: {...route.data},\n      resolve: {...route.data, ...(route._resolvedData ?? {})},\n    };\n  }\n\n  if (routeConfig && hasStaticTitle(routeConfig)) {\n    inherited.resolve[RouteTitleKey] = routeConfig.title;\n  }\n  return inherited;\n}\n\n/**\n * @description\n *\n * Contains the information about a route associated with a component loaded in an\n * outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to\n * traverse the router state tree.\n *\n * The following example initializes a component with route information extracted\n * from the snapshot of the root node at the time of creation.\n *\n * ```ts\n * @Component({templateUrl:'./my-component.html'})\n * class MyComponent {\n *   constructor(route: ActivatedRoute) {\n *     const id: string = route.snapshot.params.id;\n *     const url: string = route.snapshot.url.join('');\n *     const user = route.snapshot.data.user;\n *   }\n * }\n * ```\n *\n * @see [Understanding route snapshots](guide/routing/read-route-state#understanding-route-snapshots)\n *\n * @publicApi\n */\nexport class ActivatedRouteSnapshot {\n  /** The configuration used to match this route **/\n  public readonly routeConfig: Route | null;\n  /** @internal */\n  _resolve: ResolveData;\n  /** @internal */\n  _resolvedData?: Data;\n  /** @internal */\n  _routerState!: RouterStateSnapshot;\n  /** @internal */\n  _paramMap?: ParamMap;\n  /** @internal */\n  _queryParamMap?: ParamMap;\n  /** @internal */\n  readonly _environmentInjector: EnvironmentInjector;\n\n  /** The resolved route title */\n  get title(): string | undefined {\n    // Note: This _must_ be a getter because the data is mutated in the resolvers. Title will not be\n    // available at the time of class instantiation.\n    return this.data?.[RouteTitleKey];\n  }\n\n  /** @internal */\n  constructor(\n    /** The URL segments matched by this route */\n    public url: UrlSegment[],\n    /**\n     *  The matrix parameters scoped to this route.\n     *\n     *  You can compute all params (or data) in the router state or to get params outside\n     *  of an activated component by traversing the `RouterState` tree as in the following\n     *  example:\n     *  ```ts\n     *  collectRouteParams(router: Router) {\n     *    let params = {};\n     *    let stack: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];\n     *    while (stack.length > 0) {\n     *      const route = stack.pop()!;\n     *      params = {...params, ...route.params};\n     *      stack.push(...route.children);\n     *    }\n     *    return params;\n     *  }\n     *  ```\n     */\n    public params: Params,\n    /** The query parameters shared by all the routes */\n    public queryParams: Params,\n    /** The URL fragment shared by all the routes */\n    public fragment: string | null,\n    /** The static and resolved data of this route */\n    public data: Data,\n    /** The outlet name of the route */\n    public outlet: string,\n    /** The component of the route */\n    public component: Type<any> | null,\n    routeConfig: Route | null,\n    resolve: ResolveData,\n    environmentInjector: EnvironmentInjector,\n  ) {\n    this.routeConfig = routeConfig;\n    this._resolve = resolve;\n    this._environmentInjector = environmentInjector;\n  }\n\n  /** The root of the router state */\n  get root(): ActivatedRouteSnapshot {\n    return this._routerState.root;\n  }\n\n  /** The parent of this route in the router state tree */\n  get parent(): ActivatedRouteSnapshot | null {\n    return this._routerState.parent(this);\n  }\n\n  /** The first child of this route in the router state tree */\n  get firstChild(): ActivatedRouteSnapshot | null {\n    return this._routerState.firstChild(this);\n  }\n\n  /** The children of this route in the router state tree */\n  get children(): ActivatedRouteSnapshot[] {\n    return this._routerState.children(this);\n  }\n\n  /** The path from the root of the router state tree to this route */\n  get pathFromRoot(): ActivatedRouteSnapshot[] {\n    return this._routerState.pathFromRoot(this);\n  }\n\n  get paramMap(): ParamMap {\n    this._paramMap ??= convertToParamMap(this.params);\n    return this._paramMap;\n  }\n\n  get queryParamMap(): ParamMap {\n    this._queryParamMap ??= convertToParamMap(this.queryParams);\n    return this._queryParamMap;\n  }\n\n  toString(): string {\n    const url = this.url.map((segment) => segment.toString()).join('/');\n    const matched = this.routeConfig ? this.routeConfig.path : '';\n    return `Route(url:'${url}', path:'${matched}')`;\n  }\n}\n\n/**\n * @description\n *\n * Represents the state of the router at a moment in time.\n *\n * This is a tree of activated route snapshots. Every node in this tree knows about\n * the \"consumed\" URL segments, the extracted parameters, and the resolved data.\n *\n * The following example shows how a component is initialized with information\n * from the snapshot of the root node's state at the time of creation.\n *\n * ```ts\n * @Component({templateUrl:'template.html'})\n * class MyComponent {\n *   constructor(router: Router) {\n *     const state: RouterState = router.routerState;\n *     const snapshot: RouterStateSnapshot = state.snapshot;\n *     const root: ActivatedRouteSnapshot = snapshot.root;\n *     const child = root.firstChild;\n *     const id: Observable<string> = child.params.map(p => p.id);\n *     //...\n *   }\n * }\n * ```\n *\n * @publicApi\n */\nexport class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {\n  /** @internal */\n  constructor(\n    /** The url from which this snapshot was created */\n    public url: string,\n    root: TreeNode<ActivatedRouteSnapshot>,\n  ) {\n    super(root);\n    setRouterState(<RouterStateSnapshot>this, root);\n  }\n\n  override toString(): string {\n    return serializeNode(this._root);\n  }\n}\n\nfunction setRouterState<U, T extends {_routerState: U}>(state: U, node: TreeNode<T>): void {\n  node.value._routerState = state;\n  node.children.forEach((c) => setRouterState(state, c));\n}\n\nfunction serializeNode(node: TreeNode<ActivatedRouteSnapshot>): string {\n  const c = node.children.length > 0 ? ` { ${node.children.map(serializeNode).join(', ')} } ` : '';\n  return `${node.value}${c}`;\n}\n\n/**\n * The expectation is that the activate route is created with the right set of parameters.\n * So we push new values into the observables only when they are not the initial values.\n * And we detect that by checking if the snapshot field is set.\n */\nexport function advanceActivatedRoute(route: ActivatedRoute): void {\n  if (route.snapshot) {\n    const currentSnapshot = route.snapshot;\n    const nextSnapshot = route._futureSnapshot;\n    route.snapshot = nextSnapshot;\n    if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {\n      route.queryParamsSubject.next(nextSnapshot.queryParams);\n    }\n    if (currentSnapshot.fragment !== nextSnapshot.fragment) {\n      route.fragmentSubject.next(nextSnapshot.fragment);\n    }\n    if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {\n      route.paramsSubject.next(nextSnapshot.params);\n    }\n    if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {\n      route.urlSubject.next(nextSnapshot.url);\n    }\n    if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {\n      route.dataSubject.next(nextSnapshot.data);\n    }\n  } else {\n    route.snapshot = route._futureSnapshot;\n\n    // this is for resolved data\n    route.dataSubject.next(route._futureSnapshot.data);\n  }\n}\n\nexport function equalParamsAndUrlSegments(\n  a: ActivatedRouteSnapshot,\n  b: ActivatedRouteSnapshot,\n): boolean {\n  const equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);\n  const parentsMismatch = !a.parent !== !b.parent;\n\n  return (\n    equalUrlParams &&\n    !parentsMismatch &&\n    (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent!))\n  );\n}\n\nexport function hasStaticTitle(config: Route) {\n  return typeof config.title === 'string' || config.title === null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  ChangeDetectorRef,\n  ComponentRef,\n  Directive,\n  EnvironmentInjector,\n  EventEmitter,\n  inject,\n  Injectable,\n  InjectionToken,\n  Injector,\n  Input,\n  input,\n  OnDestroy,\n  OnInit,\n  Output,\n  reflectComponentType,\n  ɵRuntimeError as RuntimeError,\n  Signal,\n  SimpleChanges,\n  ViewContainerRef,\n} from '@angular/core';\nimport {combineLatest, Observable, of, Subscription} from 'rxjs';\nimport {switchMap} from 'rxjs/operators';\n\nimport {RuntimeErrorCode} from '../errors';\nimport {Data} from '../models';\nimport {ChildrenOutletContexts} from '../router_outlet_context';\nimport {ActivatedRoute} from '../router_state';\nimport {Params, PRIMARY_OUTLET} from '../shared';\nimport {ComponentInputBindingOptions} from '../router_config';\n\n/**\n * An `InjectionToken` provided by the `RouterOutlet` and can be set using the `routerOutletData`\n * input.\n *\n * When unset, this value is `null` by default.\n *\n * @usageNotes\n *\n * To set the data from the template of the component with `router-outlet`:\n * ```html\n * <router-outlet [routerOutletData]=\"{name: 'Angular'}\" />\n * ```\n *\n * To read the data in the routed component:\n * ```ts\n * data = inject(ROUTER_OUTLET_DATA) as Signal<{name: string}>;\n * ```\n *\n * @publicApi\n * @see [Page routerOutletData](guide/routing/show-routes-with-outlets#passing-contextual-data-to-routed-components)\n */\nexport const ROUTER_OUTLET_DATA = new InjectionToken<Signal<unknown | undefined>>(\n  typeof ngDevMode !== 'undefined' && ngDevMode ? 'RouterOutlet data' : '',\n);\n\n/**\n * An interface that defines the contract for developing a component outlet for the `Router`.\n *\n * An outlet acts as a placeholder that Angular dynamically fills based on the current router state.\n *\n * A router outlet should register itself with the `Router` via\n * `ChildrenOutletContexts#onChildOutletCreated` and unregister with\n * `ChildrenOutletContexts#onChildOutletDestroyed`. When the `Router` identifies a matched `Route`,\n * it looks for a registered outlet in the `ChildrenOutletContexts` and activates it.\n *\n * @see {@link ChildrenOutletContexts}\n * @publicApi\n */\nexport interface RouterOutletContract {\n  /**\n   * Whether the given outlet is activated.\n   *\n   * An outlet is considered \"activated\" if it has an active component.\n   */\n  isActivated: boolean;\n\n  /** The instance of the activated component or `null` if the outlet is not activated. */\n  component: Object | null;\n\n  /**\n   * The `Data` of the `ActivatedRoute` snapshot.\n   */\n  activatedRouteData: Data;\n\n  /**\n   * The `ActivatedRoute` for the outlet or `null` if the outlet is not activated.\n   */\n  activatedRoute: ActivatedRoute | null;\n\n  /**\n   * Called by the `Router` when the outlet should activate (create a component).\n   */\n  activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector): void;\n\n  /**\n   * A request to destroy the currently activated component.\n   *\n   * When a `RouteReuseStrategy` indicates that an `ActivatedRoute` should be removed but stored for\n   * later re-use rather than destroyed, the `Router` will call `detach` instead.\n   */\n  deactivate(): void;\n\n  /**\n   * Called when the `RouteReuseStrategy` instructs to detach the subtree.\n   *\n   * This is similar to `deactivate`, but the activated component should _not_ be destroyed.\n   * Instead, it is returned so that it can be reattached later via the `attach` method.\n   */\n  detach(): ComponentRef<unknown>;\n\n  /**\n   * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree.\n   */\n  attach(ref: ComponentRef<unknown>, activatedRoute: ActivatedRoute): void;\n\n  /**\n   * Emits an activate event when a new component is instantiated\n   **/\n  activateEvents?: EventEmitter<unknown>;\n\n  /**\n   * Emits a deactivate event when a component is destroyed.\n   */\n  deactivateEvents?: EventEmitter<unknown>;\n\n  /**\n   * Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a\n   * previously detached subtree.\n   **/\n  attachEvents?: EventEmitter<unknown>;\n\n  /**\n   * Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the\n   * subtree.\n   */\n  detachEvents?: EventEmitter<unknown>;\n\n  /**\n   * Used to indicate that the outlet is able to bind data from the `Router` to the outlet\n   * component's inputs.\n   *\n   * When this is `undefined` or `false` and the developer has opted in to the\n   * feature using `withComponentInputBinding`, a warning will be logged in dev mode if this outlet\n   * is used in the application.\n   */\n  readonly supportsBindingToComponentInputs?: true;\n}\n\n/**\n * @description\n *\n * Acts as a placeholder that Angular dynamically fills based on the current router state.\n *\n * Each outlet can have a unique name, determined by the optional `name` attribute.\n * The name cannot be set or changed dynamically. If not set, default value is \"primary\".\n *\n * ```html\n * <router-outlet></router-outlet>\n * <router-outlet name='left'></router-outlet>\n * <router-outlet name='right'></router-outlet>\n * ```\n *\n * Named outlets can be the targets of secondary routes.\n * The `Route` object for a secondary route has an `outlet` property to identify the target outlet:\n *\n * `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}`\n *\n * Using named outlets and secondary routes, you can target multiple outlets in\n * the same `RouterLink` directive.\n *\n * The router keeps track of separate branches in a navigation tree for each named outlet and\n * generates a representation of that tree in the URL.\n * The URL for a secondary route uses the following syntax to specify both the primary and secondary\n * routes at the same time:\n *\n * `http://base-path/primary-route-path(outlet-name:route-path)`\n *\n * A router outlet emits an activate event when a new component is instantiated,\n * deactivate event when a component is destroyed.\n * An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the\n * subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to\n * detach the subtree.\n *\n * ```html\n * <router-outlet\n *   (activate)='onActivate($event)'\n *   (deactivate)='onDeactivate($event)'\n *   (attach)='onAttach($event)'\n *   (detach)='onDetach($event)'></router-outlet>\n * ```\n *\n * @see {@link RouterLink}\n * @see {@link Route}\n * @see [Show routes with outlets](guide/routing/show-routes-with-outlets)\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Directive({\n  selector: 'router-outlet',\n  exportAs: 'outlet',\n})\nexport class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract {\n  private activated: ComponentRef<any> | null = null;\n  /** @internal */\n  get activatedComponentRef(): ComponentRef<any> | null {\n    return this.activated;\n  }\n  private _activatedRoute: ActivatedRoute | null = null;\n  /**\n   * The name of the outlet\n   *\n   */\n  @Input() name = PRIMARY_OUTLET;\n\n  @Output('activate') activateEvents = new EventEmitter<any>();\n  @Output('deactivate') deactivateEvents = new EventEmitter<any>();\n  /**\n   * Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a\n   * previously detached subtree.\n   **/\n  @Output('attach') attachEvents = new EventEmitter<unknown>();\n  /**\n   * Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the\n   * subtree.\n   */\n  @Output('detach') detachEvents = new EventEmitter<unknown>();\n\n  /**\n   * Data that will be provided to the child injector through the `ROUTER_OUTLET_DATA` token.\n   *\n   * When unset, the value of the token is `undefined` by default.\n   */\n  readonly routerOutletData = input<unknown>();\n\n  private parentContexts = inject(ChildrenOutletContexts);\n  private location = inject(ViewContainerRef);\n  private changeDetector = inject(ChangeDetectorRef);\n  private inputBinder = inject(INPUT_BINDER, {optional: true});\n  /** @docs-private */\n  readonly supportsBindingToComponentInputs = true;\n\n  /** @docs-private */\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes['name']) {\n      const {firstChange, previousValue} = changes['name'];\n      if (firstChange) {\n        // The first change is handled by ngOnInit. Because ngOnChanges doesn't get called when no\n        // input is set at all, we need to centrally handle the first change there.\n        return;\n      }\n\n      // unregister with the old name\n      if (this.isTrackedInParentContexts(previousValue)) {\n        this.deactivate();\n        this.parentContexts.onChildOutletDestroyed(previousValue);\n      }\n      // register the new name\n      this.initializeOutletWithName();\n    }\n  }\n\n  /** @docs-private */\n  ngOnDestroy(): void {\n    // Ensure that the registered outlet is this one before removing it on the context.\n    if (this.isTrackedInParentContexts(this.name)) {\n      this.parentContexts.onChildOutletDestroyed(this.name);\n    }\n    this.inputBinder?.unsubscribeFromRouteData(this);\n  }\n\n  private isTrackedInParentContexts(outletName: string) {\n    return this.parentContexts.getContext(outletName)?.outlet === this;\n  }\n\n  /** @docs-private */\n  ngOnInit(): void {\n    this.initializeOutletWithName();\n  }\n\n  private initializeOutletWithName() {\n    this.parentContexts.onChildOutletCreated(this.name, this);\n    if (this.activated) {\n      return;\n    }\n\n    // If the outlet was not instantiated at the time the route got activated we need to populate\n    // the outlet when it is initialized (ie inside a NgIf)\n    const context = this.parentContexts.getContext(this.name);\n    if (context?.route) {\n      if (context.attachRef) {\n        // `attachRef` is populated when there is an existing component to mount\n        this.attach(context.attachRef, context.route);\n      } else {\n        // otherwise the component defined in the configuration is created\n        this.activateWith(context.route, context.injector);\n      }\n    }\n  }\n\n  get isActivated(): boolean {\n    return !!this.activated;\n  }\n\n  /**\n   * @returns The currently activated component instance.\n   * @throws An error if the outlet is not activated.\n   */\n  get component(): Object {\n    if (!this.activated)\n      throw new RuntimeError(\n        RuntimeErrorCode.OUTLET_NOT_ACTIVATED,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && 'Outlet is not activated',\n      );\n    return this.activated.instance;\n  }\n\n  get activatedRoute(): ActivatedRoute {\n    if (!this.activated)\n      throw new RuntimeError(\n        RuntimeErrorCode.OUTLET_NOT_ACTIVATED,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && 'Outlet is not activated',\n      );\n    return this._activatedRoute as ActivatedRoute;\n  }\n\n  get activatedRouteData(): Data {\n    if (this._activatedRoute) {\n      return this._activatedRoute.snapshot.data;\n    }\n    return {};\n  }\n\n  /**\n   * Called when the `RouteReuseStrategy` instructs to detach the subtree\n   */\n  detach(): ComponentRef<any> {\n    if (!this.activated)\n      throw new RuntimeError(\n        RuntimeErrorCode.OUTLET_NOT_ACTIVATED,\n        (typeof ngDevMode === 'undefined' || ngDevMode) && 'Outlet is not activated',\n      );\n    this.location.detach();\n    const cmp = this.activated;\n    this.activated = null;\n    this._activatedRoute = null;\n    this.detachEvents.emit(cmp.instance);\n    return cmp;\n  }\n\n  /**\n   * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree\n   */\n  attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void {\n    this.activated = ref;\n    this._activatedRoute = activatedRoute;\n    this.location.insert(ref.hostView);\n    this.inputBinder?.bindActivatedRouteToOutletComponent(this);\n    this.attachEvents.emit(ref.instance);\n  }\n\n  deactivate(): void {\n    if (this.activated) {\n      const c = this.component;\n      this.activated.destroy();\n      this.activated = null;\n      this._activatedRoute = null;\n      this.deactivateEvents.emit(c);\n    }\n  }\n\n  activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector): void {\n    if (this.isActivated) {\n      throw new RuntimeError(\n        RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          'Cannot activate an already activated outlet',\n      );\n    }\n    this._activatedRoute = activatedRoute;\n    const location = this.location;\n    const snapshot = activatedRoute.snapshot;\n    const component = snapshot.component!;\n    const childContexts = this.parentContexts.getOrCreateContext(this.name).children;\n    const injector = new OutletInjector(\n      activatedRoute,\n      childContexts,\n      location.injector,\n      this.routerOutletData,\n    );\n\n    this.activated = location.createComponent(component, {\n      index: location.length,\n      injector,\n      environmentInjector: environmentInjector,\n    });\n    // Calling `markForCheck` to make sure we will run the change detection when the\n    // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.\n    this.changeDetector.markForCheck();\n    this.inputBinder?.bindActivatedRouteToOutletComponent(this);\n    this.activateEvents.emit(this.activated.instance);\n  }\n}\n\nclass OutletInjector implements Injector {\n  constructor(\n    private route: ActivatedRoute,\n    private childContexts: ChildrenOutletContexts,\n    private parent: Injector,\n    private outletData: Signal<unknown>,\n  ) {}\n\n  get(token: any, notFoundValue?: any): any {\n    if (token === ActivatedRoute) {\n      return this.route;\n    }\n\n    if (token === ChildrenOutletContexts) {\n      return this.childContexts;\n    }\n\n    if (token === ROUTER_OUTLET_DATA) {\n      return this.outletData;\n    }\n\n    return this.parent.get(token, notFoundValue);\n  }\n}\n\nexport const INPUT_BINDER = new InjectionToken<RoutedComponentInputBinder>(\n  typeof ngDevMode !== 'undefined' && ngDevMode ? 'Router Input Binder' : '',\n);\n\n/**\n * Injectable used as a tree-shakable provider for opting in to binding router data to component\n * inputs.\n *\n * The RouterOutlet registers itself with this service when an `ActivatedRoute` is attached or\n * activated. When this happens, the service subscribes to the `ActivatedRoute` observables (params,\n * queryParams, data) and sets the inputs of the component using `ComponentRef.setInput`.\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` by default. If it were not done this way, the previous information would be\n * retained if the data got removed from the route (i.e. if a query parameter is removed).\n * The `unmatchedInputBehavior` option can be used to configure this behavior.\n *\n * The `RouterOutlet` should unregister itself when destroyed via `unsubscribeFromRouteData` so that\n * the subscriptions are cleaned up.\n */\n@Injectable()\nexport class RoutedComponentInputBinder {\n  private outletDataSubscriptions = new Map<RouterOutlet, Subscription>();\n  private outletSeenKeys = new Map<RouterOutlet, Set<string>>();\n\n  constructor(private options: ComponentInputBindingOptions) {\n    this.options.queryParams ??= true;\n  }\n\n  bindActivatedRouteToOutletComponent(outlet: RouterOutlet): void {\n    this.unsubscribeFromRouteData(outlet);\n    this.subscribeToRouteData(outlet);\n  }\n\n  unsubscribeFromRouteData(outlet: RouterOutlet): void {\n    this.outletDataSubscriptions.get(outlet)?.unsubscribe();\n    this.outletDataSubscriptions.delete(outlet);\n    this.outletSeenKeys.delete(outlet);\n  }\n\n  private subscribeToRouteData(outlet: RouterOutlet) {\n    const {activatedRoute} = outlet;\n    const dataSubscription = combineLatest([\n      this.options.queryParams ? activatedRoute.queryParams : of({}),\n      activatedRoute.params,\n      activatedRoute.data,\n    ])\n      .pipe(\n        switchMap(([queryParams, params, data], index) => {\n          data = {...queryParams, ...params, ...data};\n          // Get the first result from the data subscription synchronously so it's available to\n          // the component as soon as possible (and doesn't require a second change detection).\n          if (index === 0) {\n            return of(data);\n          }\n          // Promise.resolve is used to avoid synchronously writing the wrong data when\n          // two of the Observables in the `combineLatest` stream emit one after\n          // another.\n          return Promise.resolve(data);\n        }),\n      )\n      .subscribe((data) => {\n        // Outlet may have been deactivated or changed names to be associated with a different\n        // route\n        if (\n          !outlet.isActivated ||\n          !outlet.activatedComponentRef ||\n          outlet.activatedRoute !== activatedRoute ||\n          activatedRoute.component === null\n        ) {\n          this.unsubscribeFromRouteData(outlet);\n          return;\n        }\n\n        const mirror = reflectComponentType(activatedRoute.component);\n        if (!mirror) {\n          this.unsubscribeFromRouteData(outlet);\n          return;\n        }\n\n        let seenKeys = this.outletSeenKeys.get(outlet);\n        if (!seenKeys) {\n          seenKeys = new Set<string>();\n          this.outletSeenKeys.set(outlet, seenKeys);\n        }\n\n        for (const key of Object.keys(data)) {\n          seenKeys.add(key);\n        }\n\n        const behavior = this.options.unmatchedInputBehavior ?? 'alwaysUndefined';\n\n        for (const {templateName} of mirror.inputs) {\n          const value = data[templateName];\n          if (value !== undefined || behavior === 'alwaysUndefined' || seenKeys.has(templateName)) {\n            outlet.activatedComponentRef.setInput(templateName, value);\n          }\n        }\n      });\n\n    this.outletDataSubscriptions.set(outlet, dataSubscription);\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectionStrategy, Component} from '@angular/core';\n\nimport {RouterOutlet} from '../directives/router_outlet';\nimport {Route} from '../models';\nimport {PRIMARY_OUTLET} from '../shared';\nexport {ɵEmptyOutletComponent as EmptyOutletComponent};\n\n/**\n * This component is used internally within the router to be a placeholder when an empty\n * router-outlet is needed. For example, with a config such as:\n *\n * `{path: 'parent', outlet: 'nav', children: [...]}`\n *\n * In order to render, there needs to be a component on this config, which will default\n * to this `EmptyOutletComponent`.\n */\n@Component({\n  template: `<router-outlet />`,\n  imports: [RouterOutlet],\n  // Used to avoid component ID collisions with user code.\n  exportAs: 'emptyRouterOutlet',\n  changeDetection: ChangeDetectionStrategy.Eager,\n})\nexport class ɵEmptyOutletComponent {}\n\n/**\n * Makes a copy of the config and adds any default required properties.\n */\nexport function standardizeConfig(r: Route): Route {\n  const children = r.children && r.children.map(standardizeConfig);\n  const c = children ? {...r, children} : {...r};\n  if (\n    !c.component &&\n    !c.loadComponent &&\n    (children || c.loadChildren) &&\n    c.outlet &&\n    c.outlet !== PRIMARY_OUTLET\n  ) {\n    c.component = ɵEmptyOutletComponent;\n  }\n  return c;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {BehaviorSubject} from 'rxjs';\n\nimport {DetachedRouteHandleInternal, RouteReuseStrategy} from './route_reuse_strategy';\nimport {\n  ActivatedRoute,\n  ActivatedRouteSnapshot,\n  RouterState,\n  RouterStateSnapshot,\n} from './router_state';\nimport {TreeNode} from './utils/tree';\n\nexport function createRouterState(\n  routeReuseStrategy: RouteReuseStrategy,\n  curr: RouterStateSnapshot,\n  prevState: RouterState,\n): RouterState {\n  const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);\n  return new RouterState(root, curr);\n}\n\nfunction createNode(\n  routeReuseStrategy: RouteReuseStrategy,\n  curr: TreeNode<ActivatedRouteSnapshot>,\n  prevState?: TreeNode<ActivatedRoute>,\n): TreeNode<ActivatedRoute> {\n  // reuse an activated route that is currently displayed on the screen\n  if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {\n    const value = prevState.value;\n    value._futureSnapshot = curr.value;\n    const children = createOrReuseChildren(routeReuseStrategy, curr, prevState);\n    return new TreeNode<ActivatedRoute>(value, children);\n  } else {\n    if (routeReuseStrategy.shouldAttach(curr.value)) {\n      // retrieve an activated route that is used to be displayed, but is not currently displayed\n      const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);\n      if (detachedRouteHandle !== null) {\n        const tree = (detachedRouteHandle as DetachedRouteHandleInternal).route;\n        tree.value._futureSnapshot = curr.value;\n        tree.children = curr.children.map((c) => createNode(routeReuseStrategy, c));\n        return tree;\n      }\n    }\n\n    const value = createActivatedRoute(curr.value);\n    const children = curr.children.map((c) => createNode(routeReuseStrategy, c));\n    return new TreeNode<ActivatedRoute>(value, children);\n  }\n}\n\nfunction createOrReuseChildren(\n  routeReuseStrategy: RouteReuseStrategy,\n  curr: TreeNode<ActivatedRouteSnapshot>,\n  prevState: TreeNode<ActivatedRoute>,\n) {\n  return curr.children.map((child) => {\n    for (const p of prevState.children) {\n      if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {\n        return createNode(routeReuseStrategy, child, p);\n      }\n    }\n    return createNode(routeReuseStrategy, child);\n  });\n}\n\nfunction createActivatedRoute(c: ActivatedRouteSnapshot) {\n  return new ActivatedRoute(\n    new BehaviorSubject(c.url),\n    new BehaviorSubject(c.params),\n    new BehaviorSubject(c.queryParams),\n    new BehaviorSubject(c.fragment),\n    new BehaviorSubject(c.data),\n    c.outlet,\n    c.component,\n    c,\n  );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  DefaultExport,\n  EnvironmentInjector,\n  EnvironmentProviders,\n  NgModuleFactory,\n  Provider,\n  ProviderToken,\n  Type,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\nexport {DefaultExport} from '@angular/core';\n\nimport type {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';\nimport type {UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';\n\n/**\n * How to handle a navigation request to the current URL. One of:\n *\n * - `'ignore'` : The router ignores the request if it is the same as the current state.\n * - `'reload'` : The router processes the URL even if it is not different from the current state.\n * One example of when you might want to use this option is if a `canMatch` guard depends on the\n * application state and initially rejects navigation to a route. After fixing the state, you want\n * to re-navigate to the same URL so that the route with the `canMatch` guard can activate.\n *\n * Note that this only configures whether or not the Route reprocesses the URL and triggers related\n * actions and events like redirects, guards, and resolvers. By default, the router re-uses a\n * component instance when it re-navigates to the same component type without visiting a different\n * component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload\n * routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`\n * _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`. Additionally,\n * resolvers and most guards for routes do not run unless the path or path params have changed\n * (configured by `runGuardsAndResolvers`).\n *\n * @publicApi\n * @see {@link RouteReuseStrategy}\n * @see {@link RunGuardsAndResolvers}\n * @see {@link NavigationBehaviorOptions}\n * @see {@link RouterConfigOptions}\n */\nexport type OnSameUrlNavigation = 'reload' | 'ignore';\n\n/**\n * The `InjectionToken` and `@Injectable` classes for guards are deprecated in favor\n * of plain JavaScript functions instead. Dependency injection can still be achieved using the\n * [`inject`](api/core/inject) function from `@angular/core` and an injectable class can be used as\n * a functional guard using [`inject`](api/core/inject): `canActivate: [() =>\n * inject(myGuard).canActivate()]`.\n *\n * @deprecated\n * @see {@link CanMatchFn}\n * @see {@link CanLoadFn}\n * @see {@link CanActivateFn}\n * @see {@link CanActivateChildFn}\n * @see {@link CanDeactivateFn}\n * @see {@link /api/core/inject inject}\n * @publicApi\n */\nexport type DeprecatedGuard = ProviderToken<any> | string;\n\n/**\n * The `InjectionToken` and `@Injectable` classes for resolvers are deprecated in favor\n * of plain JavaScript functions instead. Dependency injection can still be achieved using the\n * [`inject`](api/core/inject) function from `@angular/core` and an injectable class can be used as\n * a functional guard using [`inject`](api/core/inject): `myResolvedData: () => inject(MyResolver).resolve()`.\n *\n * @deprecated\n * @see {@link ResolveFn}\n * @see {@link /api/core/inject inject}\n * @publicApi\n */\nexport type DeprecatedResolve = DeprecatedGuard | any;\n\n/**\n * The supported types that can be returned from a `Router` guard.\n *\n * @see [Routing guide](guide/routing/common-router-tasks#preventing-unauthorized-access)\n * @publicApi\n */\nexport type GuardResult = boolean | UrlTree | RedirectCommand;\n\n/**\n * Can be returned by a `Router` guard to instruct the `Router` to redirect rather than continue\n * processing the path of the in-flight navigation. The `redirectTo` indicates _where_ the new\n * navigation should go to and the optional `navigationBehaviorOptions` can provide more information\n * about _how_ to perform the navigation.\n *\n * ```ts\n * const route: Route = {\n *   path: \"user/:userId\",\n *   component: User,\n *   canActivate: [\n *     () => {\n *       const router = inject(Router);\n *       const authService = inject(AuthenticationService);\n *\n *       if (!authService.isLoggedIn()) {\n *         const loginPath = router.parseUrl(\"/login\");\n *         return new RedirectCommand(loginPath, {\n *           skipLocationChange: true,\n *         });\n *       }\n *\n *       return true;\n *     },\n *   ],\n * };\n * ```\n * @see [Routing guide](guide/routing/common-router-tasks#preventing-unauthorized-access)\n *\n * @publicApi\n */\nexport class RedirectCommand {\n  constructor(\n    readonly redirectTo: UrlTree,\n    readonly navigationBehaviorOptions?: NavigationBehaviorOptions,\n  ) {}\n}\n\n/**\n * Type used to represent a value which may be synchronous or async.\n *\n * @publicApi\n */\nexport type MaybeAsync<T> = T | Observable<T> | Promise<T>;\n\n/**\n * Represents a route configuration for the Router service.\n * An array of `Route` objects, used in `Router.config` and for nested route configurations\n * in `Route.children`.\n *\n * @see {@link Route}\n * @see {@link Router}\n * @see [Router configuration guide](guide/routing/router-reference#configuration)\n * @publicApi\n */\nexport type Routes = Route[];\n\n/**\n * Represents the result of matching URLs with a custom matching function.\n *\n * * `consumed` is an array of the consumed URL segments.\n * * `posParams` is a map of positional parameters.\n *\n * @see {@link UrlMatcher}\n * @publicApi\n */\nexport type UrlMatchResult = {\n  consumed: UrlSegment[];\n  posParams?: {[name: string]: UrlSegment};\n};\n\n/**\n * A function for matching a route against URLs. Implement a custom URL matcher\n * for `Route.matcher` when a combination of `path` and `pathMatch`\n * is not expressive enough. Cannot be used together with `path` and `pathMatch`.\n *\n * The function takes the following arguments and returns a `UrlMatchResult` object.\n * * *segments* : An array of URL segments.\n * * *group* : A segment group.\n * * *route* : The route to match against.\n *\n * The following example implementation matches HTML files.\n *\n * ```ts\n * export function htmlFiles(url: UrlSegment[]) {\n *   return url.length === 1 && url[0].path.endsWith('.html') ? ({consumed: url}) : null;\n * }\n *\n * export const routes = [{ matcher: htmlFiles, component: AnyComponent }];\n * ```\n *\n * @see [Creating custom route matches](guide/routing/routing-with-urlmatcher)\n * @publicApi\n */\nexport type UrlMatcher = (\n  segments: UrlSegment[],\n  group: UrlSegmentGroup,\n  route: Route,\n) => UrlMatchResult | null;\n\n/**\n *\n * Represents static data associated with a particular route.\n *\n * @see {@link Route#data}\n *\n * @publicApi\n */\nexport type Data = {\n  [key: string | symbol]: any;\n};\n\n/**\n *\n * Represents the resolved data associated with a particular route.\n *\n * Returning a `RedirectCommand` directs the router to cancel the current navigation and redirect to\n * the location provided in the `RedirectCommand`. Note that there are no ordering guarantees when\n * resolvers execute. If multiple resolvers would return a `RedirectCommand`, only the first one\n * returned will be used.\n *\n * @see {@link Route#resolve}\n *\n * @publicApi\n */\nexport type ResolveData = {\n  [key: string | symbol]: ResolveFn<unknown> | DeprecatedResolve;\n};\n\n/**\n *\n * A function that is called to resolve a collection of lazy-loaded routes.\n * Must be an arrow function of the following form:\n * `() => import('...').then(mod => mod.MODULE)`\n * or\n * `() => import('...').then(mod => mod.ROUTES)`\n *\n * For example:\n *\n * ```ts\n * [{\n *   path: 'lazy',\n *   loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),\n * }];\n * ```\n * or\n * ```ts\n * [{\n *   path: 'lazy',\n *   loadChildren: () => import('./lazy-route/lazy.routes').then(mod => mod.ROUTES),\n * }];\n * ```\n *\n * If the lazy-loaded routes are exported via a `default` export, the `.then` can be omitted:\n * ```ts\n * [{\n *   path: 'lazy',\n *   loadChildren: () => import('./lazy-route/lazy.routes'),\n * }];\n * ```\n *\n * @see {@link Route#loadChildren}\n * @publicApi\n */\nexport type LoadChildrenCallback = () =>\n  | Type<any>\n  | NgModuleFactory<any>\n  | Routes\n  | Observable<Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>>\n  | Promise<\n      NgModuleFactory<any> | Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>\n    >;\n\n/**\n *\n * A function that returns a set of routes to load.\n *\n * @see {@link LoadChildrenCallback}\n * @publicApi\n */\nexport type LoadChildren = LoadChildrenCallback;\n\n/**\n *\n * How to handle query parameters in a router link.\n * One of:\n * - `\"merge\"` : Merge new parameters with current parameters.\n * - `\"preserve\"` : Preserve current parameters.\n * - `\"replace\"` : Replace current parameters with new parameters. This is the default behavior.\n * - `\"\"` : For legacy reasons, the same as `'replace'`.\n *\n * @see {@link UrlCreationOptions#queryParamsHandling}\n * @see {@link RouterLink}\n * @publicApi\n */\nexport type QueryParamsHandling = 'merge' | 'preserve' | 'replace' | '';\n\n/**\n * The type for the function that can be used to handle redirects when the path matches a `Route` config.\n *\n * The `RedirectFunction` does not have access to the full\n * `ActivatedRouteSnapshot` interface because Route matching has not\n * yet completed when the function is called. See {@link PartialMatchRouteSnapshot}\n * for more information.\n *\n * @see {@link Route#redirectTo}\n * @publicApi\n */\nexport type RedirectFunction = (\n  redirectData: PartialMatchRouteSnapshot,\n) => MaybeAsync<string | UrlTree>;\n\n/**\n * A policy for when to run guards and resolvers on a route.\n *\n * Guards and/or resolvers will always run when a route is activated or deactivated. When a route is\n * unchanged, the default behavior is the same as `paramsChange`.\n *\n * `paramsChange` : Rerun the guards and resolvers when path or\n * path param changes. This does not include query parameters. This option is the default.\n * - `always` : Run on every execution.\n * - `pathParamsChange` : Rerun guards and resolvers when the path params\n * change. This does not compare matrix or query parameters.\n * - `paramsOrQueryParamsChange` : Run when path, matrix, or query parameters change.\n * - `pathParamsOrQueryParamsChange` : Rerun guards and resolvers when the path params\n * change or query params have changed. This does not include matrix parameters.\n *\n * @see {@link Route#runGuardsAndResolvers}\n * @see [Control when guards and resolvers execute](guide/routing/customizing-route-behavior#control-when-guards-and-resolvers-execute)\n * @publicApi\n */\nexport type RunGuardsAndResolvers =\n  | 'pathParamsChange'\n  | 'pathParamsOrQueryParamsChange'\n  | 'paramsChange'\n  | 'paramsOrQueryParamsChange'\n  | 'always'\n  | ((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean);\n\n/**\n * A configuration object that defines a single route.\n * A set of routes are collected in a `Routes` array to define a `Router` configuration.\n * The router attempts to match segments of a given URL against each route,\n * using the configuration options defined in this object.\n *\n * Supports static, parameterized, redirect, and wildcard routes, as well as\n * custom route data and resolve methods.\n *\n * For detailed usage information, see the [Routing Guide](guide/routing/common-router-tasks).\n *\n * @usageNotes\n *\n * ### Simple Configuration\n *\n * The following route specifies that when navigating to, for example,\n * `/team/11/user/bob`, the router creates the 'Team' component\n * with the 'User' child component in it.\n *\n * ```ts\n * [{\n *   path: 'team/:id',\n *  component: Team,\n *   children: [{\n *     path: 'user/:name',\n *     component: User\n *   }]\n * }]\n * ```\n *\n * ### Multiple Outlets\n *\n * The following route creates sibling components with multiple outlets.\n * When navigating to `/team/11(aux:chat/jim)`, the router creates the 'Team' component next to\n * the 'Chat' component. The 'Chat' component is placed into the 'aux' outlet.\n *\n * ```ts\n * [{\n *   path: 'team/:id',\n *   component: Team\n * }, {\n *   path: 'chat/:user',\n *   component: Chat\n *   outlet: 'aux'\n * }]\n * ```\n *\n * ### Wild Cards\n *\n * The following route uses wild-card notation to specify a component\n * that is always instantiated regardless of where you navigate to.\n *\n * ```ts\n * [{\n *   path: '**',\n *   component: WildcardComponent\n * }]\n * ```\n *\n * ### Redirects\n *\n * The following route uses the `redirectTo` property to ignore a segment of\n * a given URL when looking for a child path.\n *\n * When navigating to '/team/11/legacy/user/jim', the router changes the URL segment\n * '/team/11/legacy/user/jim' to '/team/11/user/jim', and then instantiates\n * the Team component with the User child component in it.\n *\n * ```ts\n * [{\n *   path: 'team/:id',\n *   component: Team,\n *   children: [{\n *     path: 'legacy/user/:name',\n *     redirectTo: 'user/:name'\n *   }, {\n *     path: 'user/:name',\n *     component: User\n *   }]\n * }]\n * ```\n *\n * The redirect path can be relative, as shown in this example, or absolute.\n * If we change the `redirectTo` value in the example to the absolute URL segment '/user/:name',\n * the result URL is also absolute, '/user/jim'.\n\n * ### Empty Path\n *\n * Empty-path route configurations can be used to instantiate components that do not 'consume'\n * any URL segments.\n *\n * In the following configuration, when navigating to\n * `/team/11`, the router instantiates the 'AllUsers' component.\n *\n * ```ts\n * [{\n *   path: 'team/:id',\n *   component: Team,\n *   children: [{\n *     path: '',\n *     component: AllUsers\n *   }, {\n *     path: 'user/:name',\n *     component: User\n *   }]\n * }]\n * ```\n *\n * Empty-path routes can have children. In the following example, when navigating\n * to `/team/11/user/jim`, the router instantiates the wrapper component with\n * the user component in it.\n *\n * Note that an empty path route inherits its parent's parameters and data.\n *\n * ```ts\n * [{\n *   path: 'team/:id',\n *   component: Team,\n *   children: [{\n *     path: '',\n *     component: WrapperCmp,\n *     children: [{\n *       path: 'user/:name',\n *       component: User\n *     }]\n *   }]\n * }]\n * ```\n *\n * ### Matching Strategy\n *\n * The default path-match strategy is 'prefix', which means that the router\n * checks URL elements from the left to see if the URL matches a specified path.\n * For example, '/team/11/user' matches 'team/:id'.\n *\n * ```ts\n * [{\n *   path: '',\n *   pathMatch: 'prefix', //default\n *   redirectTo: 'main'\n * }, {\n *   path: 'main',\n *   component: Main\n * }]\n * ```\n *\n * You can specify the path-match strategy 'full' to make sure that the path\n * covers the whole unconsumed URL. It is important to do this when redirecting\n * empty-path routes. Otherwise, because an empty path is a prefix of any URL,\n * the router would apply the redirect even when navigating to the redirect destination,\n * creating an endless loop.\n *\n * In the following example, supplying the 'full' `pathMatch` strategy ensures\n * that the router applies the redirect if and only if navigating to '/'.\n *\n * ```ts\n * [{\n *   path: '',\n *   pathMatch: 'full',\n *   redirectTo: 'main'\n * }, {\n *   path: 'main',\n *   component: Main\n * }]\n * ```\n *\n * ### Componentless Routes\n *\n * You can share parameters between sibling components.\n * For example, suppose that two sibling components should go next to each other,\n * and both of them require an ID parameter. You can accomplish this using a route\n * that does not specify a component at the top level.\n *\n * In the following example, 'MainChild' and 'AuxChild' are siblings.\n * When navigating to 'parent/10/(a//aux:b)', the route instantiates\n * the main child and aux child components next to each other.\n * For this to work, the application component must have the primary and aux outlets defined.\n *\n * ```ts\n * [{\n *    path: 'parent/:id',\n *    children: [\n *      { path: 'a', component: MainChild },\n *      { path: 'b', component: AuxChild, outlet: 'aux' }\n *    ]\n * }]\n * ```\n *\n * The router merges the parameters, data, and resolve of the componentless\n * parent into the parameters, data, and resolve of the children.\n *\n * This is especially useful when child components are defined\n * with an empty path string, as in the following example.\n * With this configuration, navigating to '/parent/10' creates\n * the main child and aux components.\n *\n * ```ts\n * [{\n *    path: 'parent/:id',\n *    children: [\n *      { path: '', component: MainChild },\n *      { path: '', component: AuxChild, outlet: 'aux' }\n *    ]\n * }]\n * ```\n *\n * ### Lazy Loading\n *\n * Lazy loading speeds up application load time by splitting the application\n * into multiple bundles and loading them on demand.\n * To use lazy loading, provide the `loadChildren` property in the `Route` object,\n * instead of the `children` property.\n *\n * Given the following example route, the router will lazy load\n * the associated module on demand using the browser native import system.\n *\n * ```ts\n * [{\n *   path: 'lazy',\n *   loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),\n * }];\n * ```\n *\n * @publicApi\n */\nexport interface Route {\n  /**\n   * Used to define a page title for the route. This can be a static string or an `Injectable` that\n   * implements `Resolve`.\n   *\n   * @see {@link TitleStrategy}\n   * @see [Page titles](guide/routing/define-routes#page-titles)\n   */\n  title?: string | Type<Resolve<string>> | ResolveFn<string>;\n\n  /**\n   * The path to match against. Cannot be used together with a custom `matcher` function.\n   * A URL string that uses router matching notation.\n   * Can be a wild card (`**`) that matches any URL (see Usage Notes below).\n   * Default is \"/\" (the root path).\n   *\n   */\n  path?: string;\n  /**\n   * The path-matching strategy, one of 'prefix' or 'full'.\n   * Default is 'prefix'.\n   *\n   * By default, the router checks URL elements from the left to see if the URL\n   * matches a given path and stops when there is a config match. Importantly there must still be a\n   * config match for each segment of the URL. For example, '/team/11/user' matches the prefix\n   * 'team/:id' if one of the route's children matches the segment 'user'. That is, the URL\n   * '/team/11/user' matches the config\n   * `{path: 'team/:id', children: [{path: ':user', component: User}]}`\n   * but does not match when there are no children as in `{path: 'team/:id', component: Team}`.\n   *\n   * The path-match strategy 'full' matches against the entire URL.\n   * It is important to do this when redirecting empty-path routes.\n   * Otherwise, because an empty path is a prefix of any URL,\n   * the router would apply the redirect even when navigating\n   * to the redirect destination, creating an endless loop.\n   *\n   * @see [Redirecting Routes](guide/routing/redirecting-routes)\n   *\n   */\n  pathMatch?: 'prefix' | 'full';\n  /**\n   * A custom URL-matching function. Cannot be used together with `path`.\n   *\n   * @see [Creating custom route matches](guide/routing/routing-with-urlmatcher)\n   *\n   */\n  matcher?: UrlMatcher;\n  /**\n   * The component to instantiate when the path matches.\n   * Can be empty if child routes specify components.\n   */\n  component?: Type<any>;\n\n  /**\n   * An object specifying a lazy-loaded component.\n   *\n   * @see [Injection context lazy loading](guide/routing/define-routes#injection-context-lazy-loading)\n   *\n   */\n  loadComponent?: () =>\n    | Type<unknown>\n    | Observable<Type<unknown> | DefaultExport<Type<unknown>>>\n    | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;\n  /**\n   * Filled for routes `loadComponent` once the component is loaded.\n   * @internal\n   */\n  _loadedComponent?: Type<unknown>;\n\n  /**\n   * A URL or function that returns a URL to redirect to when the path matches.\n   *\n   * Absolute if the URL begins with a slash (/) or the function returns a `UrlTree`, otherwise\n   * relative to the path URL.\n   *\n   * The `RedirectFunction` is run in an injection context so it can call `inject` to get any\n   * required dependencies.\n   *\n   * When not present, router does not redirect.\n   *\n   * @see [Conditional redirects](guide/routing/redirecting-routes#conditional-redirects)\n   */\n  redirectTo?: string | RedirectFunction;\n  /**\n   * Name of a `RouterOutlet` object where the component can be placed\n   * when the path matches.\n   *\n   * @see [Show routes with outlets](guide/routing/show-routes-with-outlets)\n   *\n   */\n  outlet?: string;\n  /**\n   * An array of `CanActivateFn` or DI tokens used to look up `CanActivate()`\n   * handlers, in order to determine if the current user is allowed to\n   * activate the component. By default, any user can activate.\n   *\n   * When using a function rather than DI tokens, the function can call `inject` to get any required\n   * dependencies. This `inject` call must be done in a synchronous context.\n   *\n   * @see [CanActivate](guide/routing/route-guards#canactivate)\n   *\n   */\n  canActivate?: Array<CanActivateFn | DeprecatedGuard>;\n  /**\n   * An array of `CanMatchFn` or DI tokens used to look up `CanMatch()`\n   * handlers, in order to determine if the current user is allowed to\n   * match the `Route`. By default, any route can match.\n   *\n   * When using a function rather than DI tokens, the function can call `inject` to get any required\n   * dependencies. This `inject` call must be done in a synchronous context.\n   *\n   * @see [CanMatch](guide/routing/route-guards#canmatch)\n   *\n   */\n  canMatch?: Array<CanMatchFn | DeprecatedGuard>;\n  /**\n   * An array of `CanActivateChildFn` or DI tokens used to look up `CanActivateChild()` handlers,\n   * in order to determine if the current user is allowed to activate\n   * a child of the component. By default, any user can activate a child.\n   *\n   * When using a function rather than DI tokens, the function can call `inject` to get any required\n   * dependencies. This `inject` call must be done in a synchronous context.\n   *\n   * @see [CanActivateChild](guide/routing/route-guards#canactivatechild)\n   *\n   */\n  canActivateChild?: Array<CanActivateChildFn | DeprecatedGuard>;\n  /**\n   * An array of `CanDeactivateFn` or DI tokens used to look up `CanDeactivate()`\n   * handlers, in order to determine if the current user is allowed to\n   * deactivate the component. By default, any user can deactivate.\n   *\n   * When using a function rather than DI tokens, the function can call `inject` to get any required\n   * dependencies. This `inject` call must be done in a synchronous context.\n   *\n   * @see [CanDeactivate](guide/routing/route-guards#candeactivate)\n   *\n   */\n  canDeactivate?: Array<CanDeactivateFn<any> | DeprecatedGuard>;\n  /**\n   * An array of `CanLoadFn` or DI tokens used to look up `CanLoad()`\n   * handlers, in order to determine if the current user is allowed to\n   * load the component. By default, any user can load.\n   *\n   * When using a function rather than DI tokens, the function can call `inject` to get any required\n   * dependencies. This `inject` call must be done in a synchronous context.\n   * @deprecated Use `canMatch` instead\n   */\n  canLoad?: Array<CanLoadFn | DeprecatedGuard>;\n  /**\n   * Additional developer-defined data provided to the component via\n   * `ActivatedRoute`. By default, no additional data is passed.\n   */\n  data?: Data;\n  /**\n   * A map of DI tokens used to look up data resolvers. See `Resolve`.\n   *\n   * @see [Resolve](guide/routing/data-resolvers#what-are-data-resolvers)\n   */\n  resolve?: ResolveData;\n  /**\n   * An array of child `Route` objects that specifies a nested route\n   * configuration.\n   */\n  children?: Routes;\n  /**\n   * An object specifying lazy-loaded child routes.\n   *\n   * @see [Injection context lazy loading](guide/routing/define-routes#injection-context-lazy-loading)\n   *\n   */\n  loadChildren?: LoadChildren;\n\n  /**\n   * A policy for when to run guards and resolvers on a route.\n   *\n   * Guards and/or resolvers will always run when a route is activated or deactivated. When a route\n   * is unchanged, the default behavior is the same as `paramsChange`.\n   *\n   * `paramsChange` : Rerun the guards and resolvers when path or\n   * path param changes. This does not include query parameters. This option is the default.\n   * - `always` : Run on every execution.\n   * - `pathParamsChange` : Rerun guards and resolvers when the path params\n   * change. This does not compare matrix or query parameters.\n   * - `paramsOrQueryParamsChange` : Run when path, matrix, or query parameters change.\n   * - `pathParamsOrQueryParamsChange` : Rerun guards and resolvers when the path params\n   * change or query params have changed. This does not include matrix parameters.\n   *\n   * @see {@link RunGuardsAndResolvers}\n   * @see [Control when guards and resolvers execute](guide/routing/customizing-route-behavior#control-when-guards-and-resolvers-execute)\n   */\n  runGuardsAndResolvers?: RunGuardsAndResolvers;\n\n  /**\n   * A `Provider` array to use for this `Route` and its `children`.\n   *\n   * The `Router` will create a new `EnvironmentInjector` for this\n   * `Route` and use it for this `Route` and its `children`. If this\n   * route also has a `loadChildren` function which returns an `NgModuleRef`, this injector will be\n   * used as the parent of the lazy loaded module.\n   * @see [Route providers](guide/di/defining-dependency-providers#route-providers)\n   */\n  providers?: Array<Provider | EnvironmentProviders>;\n\n  /**\n   * Injector created from the static route providers\n   * @internal\n   */\n  _injector?: EnvironmentInjector;\n\n  /**\n   * Filled for routes with `loadChildren` once the routes are loaded.\n   * @internal\n   */\n  _loadedRoutes?: Route[];\n\n  /**\n   * Filled for routes with `loadChildren` once the routes are loaded\n   * @internal\n   */\n  _loadedInjector?: EnvironmentInjector;\n  /**\n   * Filled if loadChildren retruns a module factory\n   * @internal\n   */\n  _loadedNgModuleFactory?: NgModuleFactory<any>;\n}\n\nexport interface LoadedRouterConfig {\n  routes: Route[];\n  injector: EnvironmentInjector | undefined;\n  factory?: NgModuleFactory<unknown>;\n}\n\n/**\n * @description\n *\n * Interface that a class can implement to be a guard deciding if a route can be activated.\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, the current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements a `CanActivate` function that checks whether the\n * current user has permission to activate the requested route.\n *\n * ```ts\n * class UserToken {}\n * class Permissions {\n *   canActivate(): boolean {\n *     return true;\n *   }\n * }\n *\n * @Injectable()\n * class CanActivateTeam implements CanActivate {\n *   private readonly permissions = inject(Permissions);\n *   private readonly currentUser = inject(UserToken);\n *\n *   canActivate(\n *     route: ActivatedRouteSnapshot,\n *     state: RouterStateSnapshot\n *   ): MaybeAsync<GuardResult> {\n *     return this.permissions.canActivate(this.currentUser, route.params.id);\n *   }\n * }\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'team/:id',\n *         component: TeamComponent,\n *         canActivate: [CanActivateTeam]\n *       }\n *     ])\n *   ],\n *   providers: [CanActivateTeam, UserToken, Permissions]\n * })\n * class AppModule {}\n * ```\n *\n * @see [CanActivate](guide/routing/route-guards#canactivate)\n *\n *\n * @publicApi\n */\nexport interface CanActivate {\n  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): MaybeAsync<GuardResult>;\n}\n\n/**\n * The signature of a function used as a `canActivate` guard on a `Route`.\n *\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, the current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements and uses a `CanActivateFn` that checks whether the\n * current user has permission to activate the requested route.\n *\n * ```ts\n * @Injectable()\n * class UserToken {}\n *\n * @Injectable()\n * class PermissionsService {\n *   canActivate(currentUser: UserToken, userId: string): boolean {\n *     return true;\n *   }\n *   canMatch(currentUser: UserToken): boolean {\n *     return true;\n *   }\n * }\n *\n * const canActivateTeam: CanActivateFn = (\n *   route: ActivatedRouteSnapshot,\n *   state: RouterStateSnapshot,\n * ) => {\n *   return inject(PermissionsService).canActivate(inject(UserToken), route.params['id']);\n * };\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * bootstrapApplication(App, {\n *    providers: [\n *      provideRouter([\n *        {\n *          path: 'team/:id',\n *          component: TeamComponent,\n *          canActivate: [canActivateTeam],\n *        },\n *      ]),\n *    ],\n *  });\n * ```\n *\n * @publicApi\n * @see {@link Route}\n * @see [CanActivate](guide/routing/route-guards#canactivate)\n */\nexport type CanActivateFn = (\n  route: ActivatedRouteSnapshot,\n  state: RouterStateSnapshot,\n) => MaybeAsync<GuardResult>;\n\n/**\n * @description\n *\n * Interface that a class can implement to be a guard deciding if a child route can be activated.\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements a `CanActivateChild` function that checks whether the\n * current user has permission to activate the requested child route.\n *\n * ```ts\n * class UserToken {}\n * class Permissions {\n *   canActivate(user: UserToken, id: string): boolean {\n *     return true;\n *   }\n * }\n *\n * @Injectable()\n * class CanActivateTeam implements CanActivateChild {\n *   private readonly permissions = inject(Permissions);\n *   private readonly currentUser = inject(UserToken);\n *\n *   canActivateChild(\n *     route: ActivatedRouteSnapshot,\n *     state: RouterStateSnapshot\n *   ): MaybeAsync<GuardResult> {\n *     return this.permissions.canActivate(this.currentUser, route.params.id);\n *   }\n * }\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'root',\n *         canActivateChild: [CanActivateTeam],\n *         children: [\n *           {\n *              path: 'team/:id',\n *              component: TeamComponent\n *           }\n *         ]\n *       }\n *     ])\n *   ],\n *   providers: [CanActivateTeam, UserToken, Permissions]\n * })\n * class AppModule {}\n * ```\n * @see [CanActivateChild](guide/routing/route-guards#canactivatechild)\n * @publicApi\n */\nexport interface CanActivateChild {\n  canActivateChild(\n    childRoute: ActivatedRouteSnapshot,\n    state: RouterStateSnapshot,\n  ): MaybeAsync<GuardResult>;\n}\n\n/**\n * The signature of a function used as a `canActivateChild` guard on a `Route`.\n *\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, the current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements a `canActivate` function that checks whether the\n * current user has permission to activate the requested route.\n *\n * {@example router/route_functional_guards.ts region=\"CanActivateChildFn\"}\n *\n * @publicApi\n * @see {@link Route}\n * @see [CanActivateChild](guide/routing/route-guards#canactivatechild)\n */\nexport type CanActivateChildFn = (\n  childRoute: ActivatedRouteSnapshot,\n  state: RouterStateSnapshot,\n) => MaybeAsync<GuardResult>;\n\n/**\n * @description\n *\n * Interface that a class can implement to be a guard deciding if a route can be deactivated.\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements a `CanDeactivate` function that checks whether the\n * current user has permission to deactivate the requested route.\n *\n * ```ts\n * class UserToken {}\n * class Permissions {\n *   canDeactivate(user: UserToken, id: string): boolean {\n *     return true;\n *   }\n * }\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @Injectable()\n * class CanDeactivateTeam implements CanDeactivate<TeamComponent> {\n *   private readonly permissions = inject(Permissions);\n *   private readonly currentUser = inject(UserToken);\n *\n *   canDeactivate(\n *     component: TeamComponent,\n *     currentRoute: ActivatedRouteSnapshot,\n *     currentState: RouterStateSnapshot,\n *     nextState: RouterStateSnapshot\n *   ): MaybeAsync<GuardResult> {\n *     return this.permissions.canDeactivate(this.currentUser, route.params.id);\n *   }\n * }\n *\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'team/:id',\n *         component: TeamComponent,\n *         canDeactivate: [CanDeactivateTeam]\n *       }\n *     ])\n *   ],\n *   providers: [CanDeactivateTeam, UserToken, Permissions]\n * })\n * class AppModule {}\n * ```\n * @see [CanDeactivate](guide/routing/route-guards#candeactivate)\n * @publicApi\n */\nexport interface CanDeactivate<T> {\n  canDeactivate(\n    component: T,\n    currentRoute: ActivatedRouteSnapshot,\n    currentState: RouterStateSnapshot,\n    nextState: RouterStateSnapshot,\n  ): MaybeAsync<GuardResult>;\n}\n\n/**\n * The signature of a function used as a `canDeactivate` guard on a `Route`.\n *\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, the current navigation\n * is cancelled and a new navigation begins to the `UrlTree` returned from the guard.\n *\n * The following example implements and uses a `CanDeactivateFn` that checks whether the\n * user component has unsaved changes before navigating away from the route.\n *\n * {@example router/route_functional_guards.ts region=\"CanDeactivateFn\"}\n *\n * @publicApi\n * @see {@link Route}\n * @see [CanDeactivate](guide/routing/route-guards#candeactivate)\n */\nexport type CanDeactivateFn<T> = (\n  component: T,\n  currentRoute: ActivatedRouteSnapshot,\n  currentState: RouterStateSnapshot,\n  nextState: RouterStateSnapshot,\n) => MaybeAsync<GuardResult>;\n\n/**\n * @description\n *\n * Interface that a class can implement to be a guard deciding if a `Route` can be matched.\n * If all guards return `true`, navigation continues and the `Router` will use the `Route` during\n * activation. If any guard returns `false`, the `Route` is skipped for matching and other `Route`\n * configurations are processed instead.\n *\n * The following example implements a `CanMatch` function that decides whether the\n * current user has permission to access the users page.\n *\n *\n * ```ts\n * class UserToken {}\n * class Permissions {\n *   canAccess(user: UserToken, route: Route, segments: UrlSegment[]): boolean {\n *     return true;\n *   }\n * }\n *\n * @Injectable()\n * class CanMatchTeamSection implements CanMatch {\n *   private readonly permissions = inject(Permissions);\n *   private readonly currentUser = inject(UserToken);\n *\n *   canMatch(\n *     route: Route,\n *     segments: UrlSegment[],\n *     currentSnapshot: PartialMatchRouteSnapshot,\n *   ): Observable<boolean> | Promise<boolean> | boolean {\n *     return this.permissions.canAccess(this.currentUser, route, segments);\n *   }\n * }\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'team/:id',\n *         component: TeamComponent,\n *         loadChildren: () => import('./team').then(mod => mod.TeamModule),\n *         canMatch: [CanMatchTeamSection]\n *       },\n *       {\n *         path: '**',\n *         component: NotFoundComponent\n *       }\n *     ])\n *   ],\n *   providers: [CanMatchTeamSection, UserToken, Permissions]\n * })\n * class AppModule {}\n * ```\n *\n * If the `CanMatchTeamSection` were to return `false`, the router would continue navigating to the\n * `team/:id` URL, but would load the `NotFoundComponent` because the `Route` for `'team/:id'`\n * could not be used for a URL match but the catch-all `**` `Route` did instead.\n *\n * @publicApi\n * @see [CanMatch](guide/routing/route-guards#canmatch)\n */\nexport interface CanMatch {\n  canMatch(\n    route: Route,\n    segments: UrlSegment[],\n    currentSnapshot: PartialMatchRouteSnapshot,\n  ): MaybeAsync<GuardResult>;\n}\n\n/**\n * The signature of a function used as a `canMatch` guard on a `Route`.\n *\n * If all guards return `true`, navigation continues and the `Router` will use the `Route` during\n * activation. If any guard returns `false`, the `Route` is skipped for matching and other `Route`\n * configurations are processed instead.\n *\n * The following example implements and uses a `CanMatchFn` that checks whether the\n * current user has permission to access the team page.\n *\n * {@example router/route_functional_guards.ts region=\"CanMatchFn\"}\n *\n * @param route The route configuration.\n * @param segments The URL segments that have not been consumed by previous parent route evaluations.\n * @param currentSnapshot The current route snapshot up to this point in the matching process.\n *\n * @publicApi\n * @see {@link Route}\n * @see [CanMatch](guide/routing/route-guards#canmatch)\n */\nexport type CanMatchFn = (\n  route: Route,\n  segments: UrlSegment[],\n  currentSnapshot: PartialMatchRouteSnapshot,\n) => MaybeAsync<GuardResult>;\n\n/**\n * A subset of the `ActivatedRouteSnapshot` interface that includes only the known data\n * up to the route matching phase. Some data are not accurately known\n * at in this phase. For example, resolvers are not run until\n * later, so any resolved title would not be populated. The same goes for lazy\n * loaded components. This is also true for all the snapshots up to the\n * root, so properties that include parents (root, parent, pathFromRoot)\n * are also excluded. And naturally, the full route matching hasn't yet\n * happened so firstChild and children are not available either.\n *\n * @publicApi\n */\nexport type PartialMatchRouteSnapshot = Pick<\n  ActivatedRouteSnapshot,\n  | 'routeConfig'\n  | 'url'\n  | 'params'\n  | 'queryParams'\n  | 'fragment'\n  | 'data'\n  | 'outlet'\n  | 'title'\n  | 'paramMap'\n  | 'queryParamMap'\n>;\n\n/**\n * @description\n *\n * Interface that classes can implement to be a data provider.\n * A data provider class can be used with the router to resolve data during navigation.\n * The interface defines a `resolve()` method that is invoked right after the `ResolveStart`\n * router event. The router waits for the data to be resolved before the route is finally activated.\n *\n * The following example implements a `resolve()` method that retrieves the data\n * needed to activate the requested route.\n *\n * ```ts\n * @Injectable({ providedIn: 'root' })\n * export class HeroResolver implements Resolve<Hero> {\n *   private readonly service = inject(HeroService);\n *\n *   resolve(\n *     route: ActivatedRouteSnapshot,\n *     state: RouterStateSnapshot\n *   ): Observable<Hero>|Promise<Hero>|Hero {\n *     return this.service.getHero(route.paramMap.get('id'));\n *   }\n * }\n * ```\n *\n * Here, the defined `resolve()` function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'detail/:id',\n *         component: HeroDetailComponent,\n *         resolve: {\n *           hero: HeroResolver\n *         }\n *       }\n *     ])\n *   ],\n *   exports: [RouterModule]\n * })\n * export class AppRoutingModule {}\n * ```\n *\n * And you can access to your resolved data from `HeroComponent`:\n *\n * ```ts\n * @Component({\n *  selector: \"app-hero\",\n *  templateUrl: \"hero.component.html\",\n * })\n * export class HeroComponent {\n *\n *   private readonly activatedRoute = inject(ActivatedRoute);\n *\n *  ngOnInit() {\n *    this.activatedRoute.data.subscribe(({ hero }) => {\n *      // do something with your resolved data ...\n *    })\n *  }\n *\n * }\n * ```\n *\n * @usageNotes\n *\n * When both guard and resolvers are specified, the resolvers are not executed until\n * all guards have run and succeeded.\n * For example, consider the following route configuration:\n *\n * ```ts\n * {\n *  path: 'base'\n *  canActivate: [BaseGuard],\n *  resolve: {data: BaseDataResolver}\n *  children: [\n *   {\n *     path: 'child',\n *     guards: [ChildGuard],\n *     component: ChildComponent,\n *     resolve: {childData: ChildDataResolver}\n *    }\n *  ]\n * }\n * ```\n * The order of execution is: BaseGuard, ChildGuard, BaseDataResolver, ChildDataResolver.\n *\n * @publicApi\n * @see {@link ResolveFn}\n * @see [Data resolvers](guide/routing/data-resolvers)\n */\nexport interface Resolve<T> {\n  resolve(\n    route: ActivatedRouteSnapshot,\n    state: RouterStateSnapshot,\n  ): MaybeAsync<T | RedirectCommand>;\n}\n\n/**\n * Function type definition for a data provider.\n *\n * A data provider can be used with the router to resolve data during navigation.\n * The router waits for the data to be resolved before the route is finally activated.\n *\n * A resolver can also redirect a `RedirectCommand` and the Angular router will use\n * it to redirect the current navigation to the new destination.\n *\n * @usageNotes\n *\n * The following example implements a function that retrieves the data\n * needed to activate the requested route.\n *\n * ```ts\n * interface Hero {\n *   name: string;\n * }\n * @Injectable()\n * export class HeroService {\n *   getHero(id: string) {\n *     return {name: `Superman-${id}`};\n *   }\n * }\n *\n * export const heroResolver: ResolveFn<Hero> = (\n *   route: ActivatedRouteSnapshot,\n *   state: RouterStateSnapshot,\n * ) => {\n *   return inject(HeroService).getHero(route.paramMap.get('id')!);\n * };\n *\n * bootstrapApplication(App, {\n *   providers: [\n *     provideRouter([\n *       {\n *         path: 'detail/:id',\n *         component: HeroDetailComponent,\n *         resolve: {hero: heroResolver},\n *       },\n *     ]),\n *   ],\n * });\n * ```\n *\n * And you can access to your resolved data from `HeroComponent`:\n *\n * ```ts\n * @Component({template: ''})\n * export class HeroDetailComponent {\n *   private activatedRoute = inject(ActivatedRoute);\n *\n *   ngOnInit() {\n *     this.activatedRoute.data.subscribe(({hero}) => {\n *       // do something with your resolved data ...\n *     });\n *   }\n * }\n * ```\n *\n * If resolved data cannot be retrieved, you may want to redirect the user\n * to a new page instead:\n *\n * ```ts\n * export const heroResolver: ResolveFn<Hero> = async (\n *   route: ActivatedRouteSnapshot,\n *   state: RouterStateSnapshot,\n * ) => {\n *   const router = inject(Router);\n *   const heroService = inject(HeroService);\n *   try {\n *     return await heroService.getHero(route.paramMap.get('id')!);\n *   } catch {\n *     return new RedirectCommand(router.parseUrl('/404'));\n *   }\n * };\n * ```\n *\n * When both guard and resolvers are specified, the resolvers are not executed until\n * all guards have run and succeeded.\n * For example, consider the following route configuration:\n *\n * ```ts\n * {\n *  path: 'base'\n *  canActivate: [baseGuard],\n *  resolve: {data: baseDataResolver}\n *  children: [\n *   {\n *     path: 'child',\n *     canActivate: [childGuard],\n *     component: ChildComponent,\n *     resolve: {childData: childDataResolver}\n *    }\n *  ]\n * }\n * ```\n * The order of execution is: baseGuard, childGuard, baseDataResolver, childDataResolver.\n *\n * @publicApi\n * @see {@link Route}\n * @see [Data resolvers](guide/routing/data-resolvers)\n */\nexport type ResolveFn<T> = (\n  route: ActivatedRouteSnapshot,\n  state: RouterStateSnapshot,\n) => MaybeAsync<T | RedirectCommand>;\n\n/**\n * @description\n *\n * Interface that a class can implement to be a guard deciding if children can be loaded.\n * If all guards return `true`, navigation continues. If any guard returns `false`,\n * navigation is cancelled. If any guard returns a `UrlTree`, current navigation\n * is cancelled and a new navigation starts to the `UrlTree` returned from the guard.\n *\n * The following example implements a `CanLoad` function that decides whether the\n * current user has permission to load requested child routes.\n *\n *\n * ```ts\n * class UserToken {}\n * class Permissions {\n *   canLoadChildren(user: UserToken, id: string, segments: UrlSegment[]): boolean {\n *     return true;\n *   }\n * }\n *\n * @Injectable()\n * class CanLoadTeamSection implements CanLoad {\n *   private readonly permissions = inject(Permissions);\n *   private readonly currentUser = inject(UserToken);\n *\n *   canLoad(route: Route, segments: UrlSegment[]): Observable<boolean>|Promise<boolean>|boolean {\n *     return this.permissions.canLoadChildren(this.currentUser, route, segments);\n *   }\n * }\n * ```\n *\n * Here, the defined guard function is provided as part of the `Route` object\n * in the router configuration:\n *\n * ```ts\n * @NgModule({\n *   imports: [\n *     RouterModule.forRoot([\n *       {\n *         path: 'team/:id',\n *         component: TeamComponent,\n *         loadChildren: () => import('./team').then(mod => mod.TeamModule),\n *         canLoad: [CanLoadTeamSection]\n *       }\n *     ])\n *   ],\n *   providers: [CanLoadTeamSection, UserToken, Permissions]\n * })\n * class AppModule {}\n * ```\n *\n * @publicApi\n * @deprecated Use {@link CanMatch} instead\n */\nexport interface CanLoad {\n  canLoad(route: Route, segments: UrlSegment[]): MaybeAsync<GuardResult>;\n}\n\n/**\n * The signature of a function used as a `canLoad` guard on a `Route`.\n *\n * @publicApi\n * @see {@link CanLoad}\n * @see {@link Route}\n * @see {@link CanMatch}\n * @deprecated Use `Route.canMatch` and `CanMatchFn` instead\n */\nexport type CanLoadFn = (route: Route, segments: UrlSegment[]) => MaybeAsync<GuardResult>;\n\n/**\n * @description\n *\n * Options that modify the `Router` navigation strategy.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the navigation should be handled.\n *\n * @see {@link Router#navigate}\n * @see {@link Router#navigateByUrl}\n * @see [Routing and Navigation guide](guide/routing/common-router-tasks)\n *\n * @publicApi\n */\nexport interface NavigationBehaviorOptions {\n  /**\n   * How to handle a navigation request to the current URL.\n   *\n   * This value is a subset of the options available in `OnSameUrlNavigation` and\n   * will take precedence over the default value set for the `Router`.\n   *\n   * @see {@link OnSameUrlNavigation}\n   * @see {@link RouterConfigOptions}\n   */\n  onSameUrlNavigation?: OnSameUrlNavigation;\n\n  /**\n   * When true, navigates without pushing a new state into history.\n   *\n   * ```ts\n   * // Navigate silently to /view\n   * this.router.navigate(['/view'], { skipLocationChange: true });\n   * ```\n   */\n  skipLocationChange?: boolean;\n\n  /**\n   * When true, navigates while replacing the current state in history.\n   *\n   * ```ts\n   * // Navigate to /view\n   * this.router.navigate(['/view'], { replaceUrl: true });\n   * ```\n   */\n  replaceUrl?: boolean;\n\n  /**\n   * Developer-defined state that can be passed to any navigation.\n   * Access this value through the `Navigation.extras` object\n   * returned from the [Router.currentNavigation()\n   * method](api/router/Router#currentNavigation) while a navigation is executing.\n   *\n   * After a navigation completes, the router writes an object containing this\n   * value together with a `navigationId` to `history.state`.\n   * The value is written when `location.go()` or `location.replaceState()`\n   * is called before activating this route.\n   *\n   * Note that `history.state` does not pass an object equality test because\n   * the router adds the `navigationId` on each navigation.\n   *\n   */\n  state?: {[k: string]: any};\n\n  /**\n   * Use this to convey transient information about this particular navigation, such as how it\n   * happened. In this way, it's different from the persisted value `state` that will be set to\n   * `history.state`. This object is assigned directly to the Router's current `Navigation`\n   * (it is not copied or cloned), so it should be mutated with caution.\n   *\n   * One example of how this might be used is to trigger different single-page navigation animations\n   * depending on how a certain route was reached. For example, consider a photo gallery app, where\n   * you can reach the same photo URL and state via various routes:\n   *\n   * - Clicking on it in a gallery view\n   * - Clicking\n   * - \"next\" or \"previous\" when viewing another photo in the album\n   * - Etc.\n   *\n   * Each of these wants a different animation at navigate time. This information doesn't make sense\n   * to store in the persistent URL or history entry state, but it's still important to communicate\n   * from the rest of the application, into the router.\n   *\n   * This information could be used in coordination with the View Transitions feature and the\n   * `onViewTransitionCreated` callback. The information might be used in the callback to set\n   * classes on the document in order to control the transition animations and remove the classes\n   * when the transition has finished animating.\n   */\n  readonly info?: unknown;\n\n  /**\n   * When set, the Router will update the browser's address bar to match the given `UrlTree` instead\n   * of the one used for route matching.\n   *\n   *\n   * @usageNotes\n   *\n   * This feature is useful for redirects, such as redirecting to an error page, without changing\n   * the value that will be displayed in the browser's address bar.\n   *\n   * ```ts\n   * const canActivate: CanActivateFn = (route: ActivatedRouteSnapshot) => {\n   *   const userService = inject(UserService);\n   *   const router = inject(Router);\n   *   if (!userService.isLoggedIn()) {\n   *     const targetOfCurrentNavigation = router.currentNavigation()?.finalUrl;\n   *     const redirect = router.parseUrl('/404');\n   *     return new RedirectCommand(redirect, {browserUrl: targetOfCurrentNavigation});\n   *   }\n   *   return true;\n   * };\n   * ```\n   *\n   * This value is used directly, without considering any `UrlHandingStrategy`. In this way,\n   * `browserUrl` can also be used to use a different value for the browser URL than what would have\n   * been produced by from the navigation due to `UrlHandlingStrategy.merge`.\n   *\n   * This value only affects the path presented in the browser's address bar. It does not apply to\n   * the internal `Router` state. Information such as `params` and `data` will match the internal\n   * state used to match routes which will be different from the browser URL when using this feature\n   * The same is true when using other APIs that cause the browser URL the differ from the Router\n   * state, such as `skipLocationChange`.\n   */\n  readonly browserUrl?: UrlTree | string;\n\n  /**\n   * Configures how scrolling is handled for an individual navigation when scroll restoration\n   * is enabled in the router.\n   *\n   * - When 'manual', the router will not perform scrolling when the navigation is complete,\n   * even if scroll restoration is enabled.\n   * - When 'after-transition', scrolling will be performed after the `NavigationEnd` event,\n   * according to the behavior configured in the router scrolling feature.\n   *\n   * @see withInMemoryRouterScroller\n   * @see InMemoryScrollingOptions\n   */\n  readonly scroll?: 'manual' | 'after-transition';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NavigationCancellationCode} from './events';\nimport {NavigationBehaviorOptions, RedirectCommand} from './models';\nimport {isUrlTree, UrlSerializer, UrlTree} from './url_tree';\n\nexport const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';\n\nexport type NavigationCancelingError = Error & {\n  [NAVIGATION_CANCELING_ERROR]: true;\n  cancellationCode: NavigationCancellationCode;\n};\nexport type RedirectingNavigationCancelingError = NavigationCancelingError & {\n  url: UrlTree;\n  navigationBehaviorOptions?: NavigationBehaviorOptions;\n  cancellationCode: NavigationCancellationCode.Redirect;\n};\n\nexport function redirectingNavigationError(\n  urlSerializer: UrlSerializer,\n  redirect: UrlTree | RedirectCommand,\n): RedirectingNavigationCancelingError {\n  const {redirectTo, navigationBehaviorOptions} = isUrlTree(redirect)\n    ? {redirectTo: redirect, navigationBehaviorOptions: undefined}\n    : redirect;\n  const error = navigationCancelingError(\n    ngDevMode && `Redirecting to \"${urlSerializer.serialize(redirectTo)}\"`,\n    NavigationCancellationCode.Redirect,\n  ) as RedirectingNavigationCancelingError;\n  error.url = redirectTo;\n  error.navigationBehaviorOptions = navigationBehaviorOptions;\n  return error;\n}\n\nexport function navigationCancelingError(\n  message: string | null | false,\n  code: NavigationCancellationCode,\n) {\n  const error = new Error(`NavigationCancelingError: ${message || ''}`) as NavigationCancelingError;\n  error[NAVIGATION_CANCELING_ERROR] = true;\n  error.cancellationCode = code;\n  return error;\n}\n\nexport function isRedirectingNavigationCancelingError(\n  error: unknown | RedirectingNavigationCancelingError,\n): error is RedirectingNavigationCancelingError {\n  return (\n    isNavigationCancelingError(error) &&\n    isUrlTree((error as RedirectingNavigationCancelingError).url)\n  );\n}\n\nexport function isNavigationCancelingError(error: unknown): error is NavigationCancelingError {\n  return !!error && (error as NavigationCancelingError)[NAVIGATION_CANCELING_ERROR];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ActivationEnd, ChildActivationEnd, Event} from '../events';\nimport type {DetachedRouteHandleInternal, RouteReuseStrategy} from '../route_reuse_strategy';\nimport type {ChildrenOutletContexts} from '../router_outlet_context';\nimport {ActivatedRoute, advanceActivatedRoute, RouterState} from '../router_state';\nimport {nodeChildrenAsMap, TreeNode} from '../utils/tree';\n\nlet warnedAboutUnsupportedInputBinding = false;\nexport class ActivateRoutes {\n  constructor(\n    private routeReuseStrategy: RouteReuseStrategy,\n    private futureState: RouterState,\n    private currState: RouterState,\n    private forwardEvent: (evt: Event) => void,\n    private inputBindingEnabled: boolean,\n  ) {}\n\n  activate(parentContexts: ChildrenOutletContexts): void {\n    const futureRoot = this.futureState._root;\n    const currRoot = this.currState ? this.currState._root : null;\n\n    this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);\n    advanceActivatedRoute(this.futureState.root);\n    this.activateChildRoutes(futureRoot, currRoot, parentContexts);\n  }\n\n  // De-activate the child route that are not re-used for the future state\n  private deactivateChildRoutes(\n    futureNode: TreeNode<ActivatedRoute>,\n    currNode: TreeNode<ActivatedRoute> | null,\n    contexts: ChildrenOutletContexts,\n  ): void {\n    const children: {[outletName: string]: TreeNode<ActivatedRoute>} = nodeChildrenAsMap(currNode);\n\n    // Recurse on the routes active in the future state to de-activate deeper children\n    futureNode.children.forEach((futureChild) => {\n      const childOutletName = futureChild.value.outlet;\n      this.deactivateRoutes(futureChild, children[childOutletName], contexts);\n      delete children[childOutletName];\n    });\n\n    // De-activate the routes that will not be re-used\n    Object.values(children).forEach((v: TreeNode<ActivatedRoute>) => {\n      this.deactivateRouteAndItsChildren(v, contexts);\n    });\n  }\n\n  private deactivateRoutes(\n    futureNode: TreeNode<ActivatedRoute>,\n    currNode: TreeNode<ActivatedRoute>,\n    parentContext: ChildrenOutletContexts,\n  ): void {\n    const future = futureNode.value;\n    const curr = currNode ? currNode.value : null;\n\n    if (future === curr) {\n      // Reusing the node, check to see if the children need to be de-activated\n      if (future.component) {\n        // If we have a normal route, we need to go through an outlet.\n        const context = parentContext.getContext(future.outlet);\n        if (context) {\n          this.deactivateChildRoutes(futureNode, currNode, context.children);\n        }\n      } else {\n        // if we have a componentless route, we recurse but keep the same outlet map.\n        this.deactivateChildRoutes(futureNode, currNode, parentContext);\n      }\n    } else {\n      if (curr) {\n        // Deactivate the current route which will not be re-used\n        this.deactivateRouteAndItsChildren(currNode, parentContext);\n      }\n    }\n  }\n\n  private deactivateRouteAndItsChildren(\n    route: TreeNode<ActivatedRoute>,\n    parentContexts: ChildrenOutletContexts,\n  ): void {\n    // If there is no component, the Route is never attached to an outlet (because there is no\n    // component to attach).\n    if (route.value.component && this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {\n      this.detachAndStoreRouteSubtree(route, parentContexts);\n    } else {\n      this.deactivateRouteAndOutlet(route, parentContexts);\n    }\n  }\n\n  private detachAndStoreRouteSubtree(\n    route: TreeNode<ActivatedRoute>,\n    parentContexts: ChildrenOutletContexts,\n  ): void {\n    const context = parentContexts.getContext(route.value.outlet);\n    const contexts = context && route.value.component ? context.children : parentContexts;\n    const children: {[outletName: string]: TreeNode<ActivatedRoute>} = nodeChildrenAsMap(route);\n\n    for (const treeNode of Object.values(children)) {\n      this.deactivateRouteAndItsChildren(treeNode, contexts);\n    }\n\n    if (context && context.outlet) {\n      const componentRef = context.outlet.detach();\n      const contexts = context.children.onOutletDeactivated();\n      this.routeReuseStrategy.store(route.value.snapshot, {componentRef, route, contexts});\n    }\n  }\n\n  private deactivateRouteAndOutlet(\n    route: TreeNode<ActivatedRoute>,\n    parentContexts: ChildrenOutletContexts,\n  ): void {\n    const context = parentContexts.getContext(route.value.outlet);\n    // The context could be `null` if we are on a componentless route but there may still be\n    // children that need deactivating.\n    const contexts = context && route.value.component ? context.children : parentContexts;\n    const children: {[outletName: string]: TreeNode<ActivatedRoute>} = nodeChildrenAsMap(route);\n\n    for (const treeNode of Object.values(children)) {\n      this.deactivateRouteAndItsChildren(treeNode, contexts);\n    }\n\n    if (context) {\n      if (context.outlet) {\n        // Destroy the component\n        context.outlet.deactivate();\n        // Destroy the contexts for all the outlets that were in the component\n        context.children.onOutletDeactivated();\n      }\n      // Clear the information about the attached component on the context but keep the reference to\n      // the outlet. Clear even if outlet was not yet activated to avoid activating later with old\n      // info\n      context.attachRef = null;\n      context.route = null;\n    }\n  }\n\n  private activateChildRoutes(\n    futureNode: TreeNode<ActivatedRoute>,\n    currNode: TreeNode<ActivatedRoute> | null,\n    contexts: ChildrenOutletContexts,\n  ): void {\n    const children: {[outlet: string]: TreeNode<ActivatedRoute>} = nodeChildrenAsMap(currNode);\n    futureNode.children.forEach((c) => {\n      this.activateRoutes(c, children[c.value.outlet], contexts);\n      this.forwardEvent(new ActivationEnd(c.value.snapshot));\n    });\n    if (futureNode.children.length) {\n      this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));\n    }\n  }\n\n  private activateRoutes(\n    futureNode: TreeNode<ActivatedRoute>,\n    currNode: TreeNode<ActivatedRoute>,\n    parentContexts: ChildrenOutletContexts,\n  ): void {\n    const future = futureNode.value;\n    const curr = currNode ? currNode.value : null;\n\n    advanceActivatedRoute(future);\n\n    // reusing the node\n    if (future === curr) {\n      if (future.component) {\n        // If we have a normal route, we need to go through an outlet.\n        const context = parentContexts.getOrCreateContext(future.outlet);\n        this.activateChildRoutes(futureNode, currNode, context.children);\n      } else {\n        // if we have a componentless route, we recurse but keep the same outlet map.\n        this.activateChildRoutes(futureNode, currNode, parentContexts);\n      }\n    } else {\n      if (future.component) {\n        // if we have a normal route, we need to place the component into the outlet and recurse.\n        const context = parentContexts.getOrCreateContext(future.outlet);\n\n        if (this.routeReuseStrategy.shouldAttach(future.snapshot)) {\n          const stored = <DetachedRouteHandleInternal>(\n            this.routeReuseStrategy.retrieve(future.snapshot)\n          );\n          this.routeReuseStrategy.store(future.snapshot, null);\n          context.children.onOutletReAttached(stored.contexts);\n          context.attachRef = stored.componentRef;\n          context.route = stored.route.value;\n          if (context.outlet) {\n            // Attach right away when the outlet has already been instantiated\n            // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated\n            context.outlet.attach(stored.componentRef, stored.route.value);\n          }\n\n          advanceActivatedRoute(stored.route.value);\n          this.activateChildRoutes(futureNode, null, context.children);\n        } else {\n          context.attachRef = null;\n          context.route = future;\n          if (context.outlet) {\n            // Activate the outlet when it has already been instantiated\n            // Otherwise it will get activated from its `ngOnInit` when instantiated\n            context.outlet.activateWith(future, context.injector);\n          }\n\n          this.activateChildRoutes(futureNode, null, context.children);\n        }\n      } else {\n        // if we have a componentless route, we recurse but keep the same outlet map.\n        this.activateChildRoutes(futureNode, null, parentContexts);\n      }\n    }\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      const context = parentContexts.getOrCreateContext(future.outlet);\n      const outlet = context.outlet;\n      if (\n        outlet &&\n        this.inputBindingEnabled &&\n        !outlet.supportsBindingToComponentInputs &&\n        !warnedAboutUnsupportedInputBinding\n      ) {\n        console.warn(\n          `'withComponentInputBinding' feature is enabled but ` +\n            `this application is using an outlet that may not support binding to component inputs.`,\n        );\n        warnedAboutUnsupportedInputBinding = true;\n      }\n    }\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  Injector,\n  ProviderToken,\n  ɵisInjectable as isInjectable,\n  EnvironmentInjector,\n  runInInjectionContext,\n} from '@angular/core';\nimport {RunGuardsAndResolvers} from '../models';\n\nimport {ChildrenOutletContexts, OutletContext} from '../router_outlet_context';\nimport {\n  ActivatedRouteSnapshot,\n  equalParamsAndUrlSegments,\n  RouterStateSnapshot,\n} from '../router_state';\nimport {equalPath} from '../url_tree';\nimport {shallowEqual} from '../utils/collection';\nimport {nodeChildrenAsMap, TreeNode} from '../utils/tree';\n\nexport class CanActivate {\n  readonly route: ActivatedRouteSnapshot;\n  constructor(public path: ActivatedRouteSnapshot[]) {\n    this.route = this.path[this.path.length - 1];\n  }\n}\n\nexport class CanDeactivate {\n  constructor(\n    public component: Object | null,\n    public route: ActivatedRouteSnapshot,\n  ) {}\n}\n\nexport declare type Checks = {\n  canDeactivateChecks: CanDeactivate[];\n  canActivateChecks: CanActivate[];\n};\n\nexport function getAllRouteGuards(\n  future: RouterStateSnapshot,\n  curr: RouterStateSnapshot,\n  parentContexts: ChildrenOutletContexts,\n): Checks {\n  const futureRoot = future._root;\n  const currRoot = curr ? curr._root : null;\n\n  return getChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);\n}\n\nexport function getCanActivateChild(\n  p: ActivatedRouteSnapshot,\n): {node: ActivatedRouteSnapshot; guards: any[]} | null {\n  const canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;\n  if (!canActivateChild || canActivateChild.length === 0) return null;\n  return {node: p, guards: canActivateChild};\n}\n\nexport function getTokenOrFunctionIdentity<T>(\n  tokenOrFunction: Function | ProviderToken<T>,\n  injector: Injector,\n): Function | T {\n  const NOT_FOUND = Symbol();\n  const result = injector.get<T | Symbol>(tokenOrFunction, NOT_FOUND);\n  if (result === NOT_FOUND) {\n    if (typeof tokenOrFunction === 'function' && !isInjectable(tokenOrFunction)) {\n      // We think the token is just a function so return it as-is\n      return tokenOrFunction;\n    } else {\n      // This will throw the not found error\n      return injector.get<T>(tokenOrFunction);\n    }\n  }\n  return result as T;\n}\n\nfunction getChildRouteGuards(\n  futureNode: TreeNode<ActivatedRouteSnapshot>,\n  currNode: TreeNode<ActivatedRouteSnapshot> | null,\n  contexts: ChildrenOutletContexts | null,\n  futurePath: ActivatedRouteSnapshot[],\n  checks: Checks = {\n    canDeactivateChecks: [],\n    canActivateChecks: [],\n  },\n): Checks {\n  const prevChildren = nodeChildrenAsMap(currNode);\n\n  // Process the children of the future route\n  futureNode.children.forEach((c) => {\n    getRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]), checks);\n    delete prevChildren[c.value.outlet];\n  });\n\n  // Process any children left from the current route (not active for the future route)\n  Object.entries(prevChildren).forEach(([k, v]: [string, TreeNode<ActivatedRouteSnapshot>]) =>\n    deactivateRouteAndItsChildren(v, contexts!.getContext(k), checks),\n  );\n\n  return checks;\n}\n\nfunction getRouteGuards(\n  futureNode: TreeNode<ActivatedRouteSnapshot>,\n  currNode: TreeNode<ActivatedRouteSnapshot>,\n  parentContexts: ChildrenOutletContexts | null,\n  futurePath: ActivatedRouteSnapshot[],\n  checks: Checks = {\n    canDeactivateChecks: [],\n    canActivateChecks: [],\n  },\n): Checks {\n  const future = futureNode.value;\n  const curr = currNode ? currNode.value : null;\n  const context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;\n\n  // reusing the node\n  if (curr && future.routeConfig === curr.routeConfig) {\n    const shouldRun = shouldRunGuardsAndResolvers(\n      curr,\n      future,\n      future.routeConfig!.runGuardsAndResolvers,\n    );\n    if (shouldRun) {\n      checks.canActivateChecks.push(new CanActivate(futurePath));\n    } else {\n      // we need to set the data\n      future.data = curr.data;\n      future._resolvedData = curr._resolvedData;\n    }\n\n    // If we have a component, we need to go through an outlet.\n    if (future.component) {\n      getChildRouteGuards(\n        futureNode,\n        currNode,\n        context ? context.children : null,\n        futurePath,\n        checks,\n      );\n\n      // if we have a componentless route, we recurse but keep the same outlet map.\n    } else {\n      getChildRouteGuards(futureNode, currNode, parentContexts, futurePath, checks);\n    }\n\n    if (shouldRun && context && context.outlet && context.outlet.isActivated) {\n      checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, curr));\n    }\n  } else {\n    if (curr) {\n      deactivateRouteAndItsChildren(currNode, context, checks);\n    }\n\n    checks.canActivateChecks.push(new CanActivate(futurePath));\n    // If we have a component, we need to go through an outlet.\n    if (future.component) {\n      getChildRouteGuards(futureNode, null, context ? context.children : null, futurePath, checks);\n\n      // if we have a componentless route, we recurse but keep the same outlet map.\n    } else {\n      getChildRouteGuards(futureNode, null, parentContexts, futurePath, checks);\n    }\n  }\n\n  return checks;\n}\n\nfunction shouldRunGuardsAndResolvers(\n  curr: ActivatedRouteSnapshot,\n  future: ActivatedRouteSnapshot,\n  mode: RunGuardsAndResolvers | undefined,\n): boolean {\n  if (typeof mode === 'function') {\n    return runInInjectionContext(future._environmentInjector, () => mode(curr, future));\n  }\n  switch (mode) {\n    case 'pathParamsChange':\n      return !equalPath(curr.url, future.url);\n\n    case 'pathParamsOrQueryParamsChange':\n      return (\n        !equalPath(curr.url, future.url) || !shallowEqual(curr.queryParams, future.queryParams)\n      );\n\n    case 'always':\n      return true;\n\n    case 'paramsOrQueryParamsChange':\n      return (\n        !equalParamsAndUrlSegments(curr, future) ||\n        !shallowEqual(curr.queryParams, future.queryParams)\n      );\n\n    case 'paramsChange':\n    default:\n      return !equalParamsAndUrlSegments(curr, future);\n  }\n}\n\nfunction deactivateRouteAndItsChildren(\n  route: TreeNode<ActivatedRouteSnapshot>,\n  context: OutletContext | null,\n  checks: Checks,\n): void {\n  const children = nodeChildrenAsMap(route);\n  const r = route.value;\n\n  Object.entries(children).forEach(([childName, node]) => {\n    if (!r.component) {\n      deactivateRouteAndItsChildren(node, context, checks);\n    } else if (context) {\n      deactivateRouteAndItsChildren(node, context.children.getContext(childName), checks);\n    } else {\n      deactivateRouteAndItsChildren(node, null, checks);\n    }\n  });\n\n  if (!r.component) {\n    checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n  } else if (context && context.outlet && context.outlet.isActivated) {\n    checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));\n  } else {\n    checks.canDeactivateChecks.push(new CanDeactivate(null, r));\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmptyError} from 'rxjs';\n\nimport {CanActivateChildFn, CanActivateFn, CanDeactivateFn, CanLoadFn, CanMatchFn} from '../models';\n\n/**\n * Simple function check, but generic so type inference will flow. Example:\n *\n * function product(a: number, b: number) {\n *   return a * b;\n * }\n *\n * if (isFunction<product>(fn)) {\n *   return fn(1, 2);\n * } else {\n *   throw \"Must provide the `product` function\";\n * }\n */\nexport function isFunction<T>(v: any): v is T {\n  return typeof v === 'function';\n}\n\nexport function isBoolean(v: any): v is boolean {\n  return typeof v === 'boolean';\n}\n\nexport function isCanLoad(guard: any): guard is {canLoad: CanLoadFn} {\n  return guard && isFunction<CanLoadFn>(guard.canLoad);\n}\n\nexport function isCanActivate(guard: any): guard is {canActivate: CanActivateFn} {\n  return guard && isFunction<CanActivateFn>(guard.canActivate);\n}\n\nexport function isCanActivateChild(guard: any): guard is {canActivateChild: CanActivateChildFn} {\n  return guard && isFunction<CanActivateChildFn>(guard.canActivateChild);\n}\n\nexport function isCanDeactivate<T>(guard: any): guard is {canDeactivate: CanDeactivateFn<T>} {\n  return guard && isFunction<CanDeactivateFn<T>>(guard.canDeactivate);\n}\nexport function isCanMatch(guard: any): guard is {canMatch: CanMatchFn} {\n  return guard && isFunction<CanMatchFn>(guard.canMatch);\n}\n\nexport function isEmptyError(e: Error): e is EmptyError {\n  return e instanceof EmptyError || e?.name === 'EmptyError';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {combineLatest, Observable, OperatorFunction} from 'rxjs';\nimport {filter, map, startWith, switchMap, take} from 'rxjs/operators';\n\nimport {GuardResult, RedirectCommand} from '../models';\nimport {isUrlTree, UrlTree} from '../url_tree';\n\nconst INITIAL_VALUE = /* @__PURE__ */ Symbol('INITIAL_VALUE');\ndeclare type INTERIM_VALUES = typeof INITIAL_VALUE | GuardResult;\n\nexport function prioritizedGuardValue(): OperatorFunction<Observable<GuardResult>[], GuardResult> {\n  return switchMap((obs) => {\n    return combineLatest(\n      obs.map((o) => o.pipe(take(1), startWith(INITIAL_VALUE as INTERIM_VALUES))),\n    ).pipe(\n      map((results: INTERIM_VALUES[]) => {\n        for (const result of results) {\n          if (result === true) {\n            // If result is true, check the next one\n            continue;\n          } else if (result === INITIAL_VALUE) {\n            // If guard has not finished, we need to stop processing.\n            return INITIAL_VALUE;\n          } else if (result === false || isRedirect(result)) {\n            // Result finished and was not true. Return the result.\n            // Note that we only allow false/UrlTree/RedirectCommand. Other values are considered invalid and\n            // ignored.\n            return result;\n          }\n        }\n        // Everything resolved to true. Return true.\n        return true;\n      }),\n      filter((item): item is GuardResult => item !== INITIAL_VALUE),\n      take(1),\n    );\n  });\n}\n\nfunction isRedirect(val: INTERIM_VALUES): val is UrlTree | RedirectCommand {\n  return isUrlTree(val) || val instanceof RedirectCommand;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Observable, of} from 'rxjs';\nimport {take, takeUntil} from 'rxjs/operators';\n\n/**\n * Converts an AbortSignal to an Observable<void>.\n * Emits and completes when the signal is aborted.\n * If the signal is already aborted, it emits and completes immediately.\n */\nexport function abortSignalToObservable(signal: AbortSignal): Observable<void> {\n  if (signal.aborted) {\n    return of(undefined).pipe(take(1)); // Emit and complete immediately\n  }\n  return new Observable<void>((subscriber) => {\n    const handler = () => {\n      subscriber.next();\n      subscriber.complete();\n    };\n    signal.addEventListener('abort', handler);\n    return () => signal.removeEventListener('abort', handler);\n  });\n}\n\nexport function takeUntilAbort<T>(signal: AbortSignal) {\n  return takeUntil<T>(abortSignalToObservable(signal));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector, ProviderToken, runInInjectionContext} from '@angular/core';\nimport {\n  concat,\n  defer,\n  from,\n  MonoTypeOperatorFunction,\n  Observable,\n  of,\n  OperatorFunction,\n  pipe,\n} from 'rxjs';\nimport {concatMap, first, map, mergeMap, tap} from 'rxjs/operators';\n\nimport {ActivationStart, ChildActivationStart, Event} from '../events';\nimport {\n  CanActivateChildFn,\n  CanActivateFn,\n  CanDeactivateFn,\n  GuardResult,\n  CanLoadFn,\n  CanMatchFn,\n  Route,\n  PartialMatchRouteSnapshot,\n} from '../models';\nimport {redirectingNavigationError} from '../navigation_canceling_error';\nimport type {NavigationTransition} from '../navigation_transition';\nimport type {ActivatedRouteSnapshot, RouterStateSnapshot} from '../router_state';\nimport {UrlSegment, UrlSerializer} from '../url_tree';\nimport {wrapIntoObservable} from '../utils/collection';\nimport {\n  CanActivate,\n  CanDeactivate,\n  getCanActivateChild,\n  getTokenOrFunctionIdentity,\n} from '../utils/preactivation';\nimport {\n  isBoolean,\n  isCanActivate,\n  isCanActivateChild,\n  isCanDeactivate,\n  isCanLoad,\n  isCanMatch,\n} from '../utils/type_guards';\n\nimport {prioritizedGuardValue} from './prioritized_guard_value';\nimport {takeUntilAbort} from '../utils/abort_signal_to_observable';\n\nexport function checkGuards(\n  forwardEvent?: (evt: Event) => void,\n): MonoTypeOperatorFunction<NavigationTransition> {\n  return mergeMap((t) => {\n    const {\n      targetSnapshot,\n      currentSnapshot,\n      guards: {canActivateChecks, canDeactivateChecks},\n    } = t;\n    if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) {\n      return of({...t, guardsResult: true});\n    }\n\n    return runCanDeactivateChecks(canDeactivateChecks, targetSnapshot!, currentSnapshot).pipe(\n      mergeMap((canDeactivate) => {\n        return canDeactivate && isBoolean(canDeactivate)\n          ? runCanActivateChecks(targetSnapshot!, canActivateChecks, forwardEvent)\n          : of(canDeactivate);\n      }),\n      map((guardsResult) => ({...t, guardsResult})),\n    );\n  });\n}\n\nfunction runCanDeactivateChecks(\n  checks: CanDeactivate[],\n  futureRSS: RouterStateSnapshot,\n  currRSS: RouterStateSnapshot,\n) {\n  return from(checks).pipe(\n    mergeMap((check) => runCanDeactivate(check.component, check.route, currRSS, futureRSS)),\n    first((result) => {\n      return result !== true;\n    }, true),\n  );\n}\n\nfunction runCanActivateChecks(\n  futureSnapshot: RouterStateSnapshot,\n  checks: CanActivate[],\n  forwardEvent?: (evt: Event) => void,\n) {\n  return from(checks).pipe(\n    concatMap((check: CanActivate) => {\n      return concat(\n        fireChildActivationStart(check.route.parent, forwardEvent),\n        fireActivationStart(check.route, forwardEvent),\n        runCanActivateChild(futureSnapshot, check.path),\n        runCanActivate(futureSnapshot, check.route),\n      );\n    }),\n    first((result) => {\n      return result !== true;\n    }, true),\n  );\n}\n\n/**\n * This should fire off `ActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n */\nfunction fireActivationStart(\n  snapshot: ActivatedRouteSnapshot | null,\n  forwardEvent?: (evt: Event) => void,\n): Observable<boolean> {\n  if (snapshot !== null && forwardEvent) {\n    forwardEvent(new ActivationStart(snapshot));\n  }\n  return of(true);\n}\n\n/**\n * This should fire off `ChildActivationStart` events for each route being activated at this\n * level.\n * In other words, if you're activating `a` and `b` below, `path` will contain the\n * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always\n * return\n * `true` so checks continue to run.\n */\nfunction fireChildActivationStart(\n  snapshot: ActivatedRouteSnapshot | null,\n  forwardEvent?: (evt: Event) => void,\n): Observable<boolean> {\n  if (snapshot !== null && forwardEvent) {\n    forwardEvent(new ChildActivationStart(snapshot));\n  }\n  return of(true);\n}\n\nfunction runCanActivate(\n  futureRSS: RouterStateSnapshot,\n  futureARS: ActivatedRouteSnapshot,\n): Observable<GuardResult> {\n  const canActivate = futureARS.routeConfig ? futureARS.routeConfig.canActivate : null;\n  if (!canActivate || canActivate.length === 0) return of(true);\n\n  const canActivateObservables = canActivate.map((canActivate) => {\n    return defer(() => {\n      const closestInjector = futureARS._environmentInjector;\n      const guard = getTokenOrFunctionIdentity<CanActivate>(\n        canActivate as ProviderToken<CanActivate>,\n        closestInjector,\n      );\n      const guardVal = isCanActivate(guard)\n        ? guard.canActivate(futureARS, futureRSS)\n        : runInInjectionContext(closestInjector, () =>\n            (guard as CanActivateFn)(futureARS, futureRSS),\n          );\n      return wrapIntoObservable(guardVal).pipe(first());\n    });\n  });\n  return of(canActivateObservables).pipe(prioritizedGuardValue());\n}\n\nfunction runCanActivateChild(\n  futureRSS: RouterStateSnapshot,\n  path: ActivatedRouteSnapshot[],\n): Observable<GuardResult> {\n  const futureARS = path[path.length - 1];\n\n  const canActivateChildGuards = path\n    .slice(0, path.length - 1)\n    .reverse()\n    .map((p) => getCanActivateChild(p))\n    .filter((_) => _ !== null);\n\n  const canActivateChildGuardsMapped = canActivateChildGuards.map((d: any) => {\n    return defer(() => {\n      const guardsMapped = d.guards.map(\n        (canActivateChild: CanActivateChildFn | ProviderToken<unknown>) => {\n          const closestInjector = d.node._environmentInjector;\n          const guard = getTokenOrFunctionIdentity<{canActivateChild: CanActivateChildFn}>(\n            canActivateChild,\n            closestInjector,\n          );\n          const guardVal = isCanActivateChild(guard)\n            ? guard.canActivateChild(futureARS, futureRSS)\n            : runInInjectionContext(closestInjector, () =>\n                (guard as CanActivateChildFn)(futureARS, futureRSS),\n              );\n          return wrapIntoObservable(guardVal).pipe(first());\n        },\n      );\n      return of(guardsMapped).pipe(prioritizedGuardValue());\n    });\n  });\n  return of(canActivateChildGuardsMapped).pipe(prioritizedGuardValue());\n}\n\nfunction runCanDeactivate(\n  component: Object | null,\n  currARS: ActivatedRouteSnapshot,\n  currRSS: RouterStateSnapshot,\n  futureRSS: RouterStateSnapshot,\n): Observable<GuardResult> {\n  const canDeactivate = currARS && currARS.routeConfig ? currARS.routeConfig.canDeactivate : null;\n  if (!canDeactivate || canDeactivate.length === 0) return of(true);\n  const canDeactivateObservables = canDeactivate.map((c: any) => {\n    const closestInjector = currARS._environmentInjector;\n    const guard = getTokenOrFunctionIdentity<any>(c, closestInjector);\n    const guardVal = isCanDeactivate(guard)\n      ? guard.canDeactivate(component, currARS, currRSS, futureRSS)\n      : runInInjectionContext(closestInjector, () =>\n          (guard as CanDeactivateFn<any>)(component, currARS, currRSS, futureRSS),\n        );\n    return wrapIntoObservable(guardVal).pipe(first());\n  });\n  return of(canDeactivateObservables).pipe(prioritizedGuardValue());\n}\n\nexport function runCanLoadGuards(\n  injector: EnvironmentInjector,\n  route: Route,\n  segments: UrlSegment[],\n  urlSerializer: UrlSerializer,\n  abortSignal?: AbortSignal,\n): Observable<boolean> {\n  const canLoad = route.canLoad;\n  if (canLoad === undefined || canLoad.length === 0) {\n    return of(true);\n  }\n\n  const canLoadObservables = canLoad.map((injectionToken: any) => {\n    const guard = getTokenOrFunctionIdentity<any>(injectionToken, injector);\n    const guardVal = isCanLoad(guard)\n      ? guard.canLoad(route, segments)\n      : runInInjectionContext(injector, () => (guard as CanLoadFn)(route, segments));\n    const obs$ = wrapIntoObservable(guardVal);\n    return abortSignal ? obs$.pipe(takeUntilAbort(abortSignal)) : obs$;\n  });\n\n  return of(canLoadObservables).pipe(prioritizedGuardValue(), redirectIfUrlTree(urlSerializer));\n}\n\nfunction redirectIfUrlTree(urlSerializer: UrlSerializer): OperatorFunction<GuardResult, boolean> {\n  return pipe(\n    tap((result: GuardResult) => {\n      if (typeof result === 'boolean') return;\n\n      throw redirectingNavigationError(urlSerializer, result);\n    }),\n    map((result) => result === true),\n  );\n}\n\nexport function runCanMatchGuards(\n  injector: EnvironmentInjector,\n  route: Route,\n  segments: UrlSegment[],\n  urlSerializer: UrlSerializer,\n  currentSnapshot: PartialMatchRouteSnapshot,\n  abortSignal: AbortSignal,\n): Observable<GuardResult> {\n  const canMatch = route.canMatch;\n  if (!canMatch || canMatch.length === 0) return of(true);\n\n  const canMatchObservables = canMatch.map((injectionToken) => {\n    const guard = getTokenOrFunctionIdentity(injectionToken as ProviderToken<any>, injector);\n    const guardVal = isCanMatch(guard)\n      ? guard.canMatch(route, segments, currentSnapshot)\n      : runInInjectionContext(injector, () =>\n          (guard as CanMatchFn)(route, segments, currentSnapshot),\n        );\n    return wrapIntoObservable(guardVal).pipe(takeUntilAbort(abortSignal));\n  });\n\n  return of(canMatchObservables).pipe(prioritizedGuardValue(), redirectIfUrlTree(urlSerializer));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector, runInInjectionContext, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from './errors';\nimport {NavigationCancellationCode} from './events';\nimport {PartialMatchRouteSnapshot, RedirectFunction, Route} from './models';\nimport {navigationCancelingError} from './navigation_canceling_error';\nimport {Params, PRIMARY_OUTLET} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nimport {wrapIntoObservable} from './utils/collection';\nimport {firstValueFrom} from './utils/first_value_from';\n\nexport class NoMatch extends Error {\n  public segmentGroup: UrlSegmentGroup | null;\n\n  constructor(segmentGroup?: UrlSegmentGroup) {\n    super();\n    this.segmentGroup = segmentGroup || null;\n\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, NoMatch.prototype);\n  }\n}\n\nexport class AbsoluteRedirect extends Error {\n  constructor(public urlTree: UrlTree) {\n    super();\n\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, AbsoluteRedirect.prototype);\n  }\n}\n\nexport function namedOutletsRedirect(redirectTo: string): never {\n  throw new RuntimeError(\n    RuntimeErrorCode.NAMED_OUTLET_REDIRECT,\n    (typeof ngDevMode === 'undefined' || ngDevMode) &&\n      `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`,\n  );\n}\n\nexport function canLoadFails(route: Route): never {\n  throw navigationCancelingError(\n    (typeof ngDevMode === 'undefined' || ngDevMode) &&\n      `Cannot load children because the guard of the route \"path: '${route.path}'\" returned false`,\n    NavigationCancellationCode.GuardRejected,\n  );\n}\n\nexport class ApplyRedirects {\n  constructor(\n    private urlSerializer: UrlSerializer,\n    private urlTree: UrlTree,\n  ) {}\n\n  async lineralizeSegments(route: Route, urlTree: UrlTree): Promise<UrlSegment[]> {\n    let res: UrlSegment[] = [];\n    let c = urlTree.root;\n    while (true) {\n      res = res.concat(c.segments);\n      if (c.numberOfChildren === 0) {\n        return res;\n      }\n\n      if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {\n        throw namedOutletsRedirect(`${route.redirectTo!}`);\n      }\n\n      c = c.children[PRIMARY_OUTLET];\n    }\n  }\n\n  async applyRedirectCommands(\n    segments: UrlSegment[],\n    redirectTo: string | RedirectFunction,\n    posParams: {[k: string]: UrlSegment},\n    currentSnapshot: PartialMatchRouteSnapshot,\n    injector: Injector,\n  ): Promise<UrlTree> {\n    const redirect = await getRedirectResult(redirectTo, currentSnapshot, injector);\n    if (redirect instanceof UrlTree) {\n      throw new AbsoluteRedirect(redirect);\n    }\n\n    const newTree = this.applyRedirectCreateUrlTree(\n      redirect,\n      this.urlSerializer.parse(redirect),\n      segments,\n      posParams,\n    );\n\n    if (redirect[0] === '/') {\n      throw new AbsoluteRedirect(newTree);\n    }\n    return newTree;\n  }\n\n  applyRedirectCreateUrlTree(\n    redirectTo: string,\n    urlTree: UrlTree,\n    segments: UrlSegment[],\n    posParams: {[k: string]: UrlSegment},\n  ): UrlTree {\n    const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);\n    return new UrlTree(\n      newRoot,\n      this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams),\n      urlTree.fragment,\n    );\n  }\n\n  createQueryParams(redirectToParams: Params, actualParams: Params): Params {\n    const res: Params = {};\n    Object.entries(redirectToParams).forEach(([k, v]) => {\n      const copySourceValue = typeof v === 'string' && v[0] === ':';\n      if (copySourceValue) {\n        const sourceName = v.substring(1);\n        res[k] = actualParams[sourceName];\n      } else {\n        res[k] = v;\n      }\n    });\n    return res;\n  }\n\n  createSegmentGroup(\n    redirectTo: string,\n    group: UrlSegmentGroup,\n    segments: UrlSegment[],\n    posParams: {[k: string]: UrlSegment},\n  ): UrlSegmentGroup {\n    const updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);\n\n    let children: {[n: string]: UrlSegmentGroup} = {};\n    Object.entries(group.children).forEach(([name, child]) => {\n      children[name] = this.createSegmentGroup(redirectTo, child, segments, posParams);\n    });\n\n    return new UrlSegmentGroup(updatedSegments, children);\n  }\n\n  createSegments(\n    redirectTo: string,\n    redirectToSegments: UrlSegment[],\n    actualSegments: UrlSegment[],\n    posParams: {[k: string]: UrlSegment},\n  ): UrlSegment[] {\n    return redirectToSegments.map((s) =>\n      s.path[0] === ':'\n        ? this.findPosParam(redirectTo, s, posParams)\n        : this.findOrReturn(s, actualSegments),\n    );\n  }\n\n  findPosParam(\n    redirectTo: string,\n    redirectToUrlSegment: UrlSegment,\n    posParams: {[k: string]: UrlSegment},\n  ): UrlSegment {\n    const pos = posParams[redirectToUrlSegment.path.substring(1)];\n    if (!pos)\n      throw new RuntimeError(\n        RuntimeErrorCode.MISSING_REDIRECT,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          `Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`,\n      );\n    return pos;\n  }\n\n  findOrReturn(redirectToUrlSegment: UrlSegment, actualSegments: UrlSegment[]): UrlSegment {\n    let idx = 0;\n    for (const s of actualSegments) {\n      if (s.path === redirectToUrlSegment.path) {\n        actualSegments.splice(idx);\n        return s;\n      }\n      idx++;\n    }\n    return redirectToUrlSegment;\n  }\n}\n\nfunction getRedirectResult(\n  redirectTo: string | RedirectFunction,\n  currentSnapshot: PartialMatchRouteSnapshot,\n  injector: Injector,\n): Promise<string | UrlTree> {\n  if (typeof redirectTo === 'string') {\n    return Promise.resolve(redirectTo);\n  }\n  const redirectToFn = redirectTo;\n  return firstValueFrom(\n    wrapIntoObservable(runInInjectionContext(injector, () => redirectToFn(currentSnapshot))),\n  );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  createEnvironmentInjector,\n  EnvironmentInjector,\n  isStandalone,\n  Type,\n  ɵisNgModule as isNgModule,\n  ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\nimport {Route, Routes} from '../models';\nimport {ActivatedRouteSnapshot} from '../router_state';\nimport {PRIMARY_OUTLET} from '../shared';\n\n/**\n * Creates an `EnvironmentInjector` if the `Route` has providers and one does not already exist\n * and returns the injector. Otherwise, if the `Route` does not have `providers`, returns the\n * `currentInjector`.\n *\n * @param route The route that might have providers\n * @param currentInjector The parent injector of the `Route`\n */\nexport function getOrCreateRouteInjectorIfNeeded(\n  route: Route,\n  currentInjector: EnvironmentInjector,\n): EnvironmentInjector {\n  if (route.providers && !route._injector) {\n    route._injector = createEnvironmentInjector(\n      route.providers,\n      currentInjector,\n      `Route: ${route.path}`,\n    );\n  }\n  return route._injector ?? currentInjector;\n}\n\nexport function getLoadedRoutes(route: Route): Route[] | undefined {\n  return route._loadedRoutes;\n}\n\nexport function getLoadedInjector(route: Route): EnvironmentInjector | undefined {\n  return route._loadedInjector;\n}\nexport function getLoadedComponent(route: Route): Type<unknown> | undefined {\n  return route._loadedComponent;\n}\n\nexport function getProvidersInjector(route: Route): EnvironmentInjector | undefined {\n  return route._injector;\n}\n\nexport function validateConfig(\n  config: Routes,\n  parentPath: string = '',\n  requireStandaloneComponents = false,\n): void {\n  // forEach doesn't iterate undefined values\n  for (let i = 0; i < config.length; i++) {\n    const route: Route = config[i];\n    const fullPath: string = getFullPath(parentPath, route);\n    validateNode(route, fullPath, requireStandaloneComponents);\n  }\n}\n\nexport function assertStandalone(fullPath: string, component: Type<unknown> | undefined): void {\n  if (component && isNgModule(component)) {\n    throw new RuntimeError(\n      RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n      `Invalid configuration of route '${fullPath}'. You are using 'loadComponent' with a module, ` +\n        `but it must be used with standalone components. Use 'loadChildren' instead.`,\n    );\n  } else if (component && !isStandalone(component)) {\n    throw new RuntimeError(\n      RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n      `Invalid configuration of route '${fullPath}'. The component must be standalone.`,\n    );\n  }\n}\n\nfunction validateNode(route: Route, fullPath: string, requireStandaloneComponents: boolean): void {\n  if (typeof ngDevMode === 'undefined' || ngDevMode) {\n    if (!route) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `\n      Invalid configuration of route '${fullPath}': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    `,\n      );\n    }\n    if (Array.isArray(route)) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': Array cannot be specified`,\n      );\n    }\n    if (\n      !route.redirectTo &&\n      !route.component &&\n      !route.loadComponent &&\n      !route.children &&\n      !route.loadChildren &&\n      route.outlet &&\n      route.outlet !== PRIMARY_OUTLET\n    ) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`,\n      );\n    }\n    if (route.redirectTo && route.children) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`,\n      );\n    }\n    if (route.redirectTo && route.loadChildren) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`,\n      );\n    }\n    if (route.children && route.loadChildren) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`,\n      );\n    }\n    if (route.component && route.loadComponent) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`,\n      );\n    }\n\n    if (route.redirectTo) {\n      if (route.component || route.loadComponent) {\n        throw new RuntimeError(\n          RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n          `Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`,\n        );\n      }\n      if (route.canMatch || route.canActivate) {\n        throw new RuntimeError(\n          RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n          `Invalid configuration of route '${fullPath}': redirectTo and ${route.canMatch ? 'canMatch' : 'canActivate'} cannot be used together.` +\n            `Redirects happen before guards are executed.`,\n        );\n      }\n    }\n\n    if (route.path && route.matcher) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`,\n      );\n    }\n    if (\n      route.redirectTo === void 0 &&\n      !route.component &&\n      !route.loadComponent &&\n      !route.children &&\n      !route.loadChildren\n    ) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`,\n      );\n    }\n    if (route.path === void 0 && route.matcher === void 0) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`,\n      );\n    }\n    if (typeof route.path === 'string' && route.path.charAt(0) === '/') {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '${fullPath}': path cannot start with a slash`,\n      );\n    }\n    if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {\n      const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_ROUTE_CONFIG,\n        `Invalid configuration of route '{path: \"${fullPath}\", redirectTo: \"${route.redirectTo}\"}': please provide 'pathMatch'. ${exp}`,\n      );\n    }\n    if (requireStandaloneComponents) {\n      assertStandalone(fullPath, route.component);\n    }\n  }\n  if (route.children) {\n    validateConfig(route.children, fullPath, requireStandaloneComponents);\n  }\n}\n\nfunction getFullPath(parentPath: string, currentRoute: Route): string {\n  if (!currentRoute) {\n    return parentPath;\n  }\n  if (!parentPath && !currentRoute.path) {\n    return '';\n  } else if (parentPath && !currentRoute.path) {\n    return `${parentPath}/`;\n  } else if (!parentPath && currentRoute.path) {\n    return currentRoute.path;\n  } else {\n    return `${parentPath}/${currentRoute.path}`;\n  }\n}\n\n/** Returns the `route.outlet` or PRIMARY_OUTLET if none exists. */\nexport function getOutlet(route: Route): string {\n  return route.outlet || PRIMARY_OUTLET;\n}\n\n/**\n * Sorts the `routes` such that the ones with an outlet matching `outletName` come first.\n * The order of the configs is otherwise preserved.\n */\nexport function sortByMatchingOutlets(routes: Routes, outletName: string): Routes {\n  const sortedConfig = routes.filter((r) => getOutlet(r) === outletName);\n  sortedConfig.push(...routes.filter((r) => getOutlet(r) !== outletName));\n  return sortedConfig;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector} from '@angular/core';\nimport {Observable, of} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {PartialMatchRouteSnapshot, Route} from '../models';\nimport {runCanMatchGuards} from '../operators/check_guards';\nimport {ActivatedRouteSnapshot} from '../router_state';\nimport {defaultUrlMatcher, PRIMARY_OUTLET} from '../shared';\nimport {UrlSegment, UrlSegmentGroup, UrlSerializer} from '../url_tree';\n\nimport {getOrCreateRouteInjectorIfNeeded, getOutlet} from './config';\n\nexport interface MatchResult {\n  matched: boolean;\n  consumedSegments: UrlSegment[];\n  remainingSegments: UrlSegment[];\n  parameters: {[k: string]: string};\n  positionalParamSegments: {[k: string]: UrlSegment};\n}\n\nconst noMatch: MatchResult = {\n  matched: false,\n  consumedSegments: [],\n  remainingSegments: [],\n  parameters: {},\n  positionalParamSegments: {},\n};\n\nexport function createPreMatchRouteSnapshot(\n  snapshot: ActivatedRouteSnapshot,\n): PartialMatchRouteSnapshot {\n  return {\n    routeConfig: snapshot.routeConfig,\n    url: snapshot.url,\n    params: snapshot.params,\n    queryParams: snapshot.queryParams,\n    fragment: snapshot.fragment,\n    data: snapshot.data,\n    outlet: snapshot.outlet,\n    title: snapshot.title,\n    paramMap: snapshot.paramMap,\n    queryParamMap: snapshot.queryParamMap,\n  };\n}\n\nexport function matchWithChecks(\n  segmentGroup: UrlSegmentGroup,\n  route: Route,\n  segments: UrlSegment[],\n  injector: EnvironmentInjector,\n  urlSerializer: UrlSerializer,\n  createSnapshot: (result: MatchResult) => ActivatedRouteSnapshot,\n  abortSignal: AbortSignal,\n): Observable<MatchResult> {\n  const result = match(segmentGroup, route, segments);\n  if (!result.matched) {\n    return of(result);\n  }\n\n  const currentSnapshot = createPreMatchRouteSnapshot(createSnapshot(result));\n  // Only create the Route's `EnvironmentInjector` if it matches the attempted\n  // navigation\n  injector = getOrCreateRouteInjectorIfNeeded(route, injector);\n  return runCanMatchGuards(\n    injector,\n    route,\n    segments,\n    urlSerializer,\n    currentSnapshot,\n    abortSignal,\n  ).pipe(map((v) => (v === true ? result : {...noMatch})));\n}\n\nexport function match(\n  segmentGroup: UrlSegmentGroup,\n  route: Route,\n  segments: UrlSegment[],\n): MatchResult {\n  if (route.path === '') {\n    if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {\n      return {...noMatch};\n    }\n\n    return {\n      matched: true,\n      consumedSegments: [],\n      remainingSegments: segments,\n      parameters: {},\n      positionalParamSegments: {},\n    };\n  }\n\n  const matcher = route.matcher || defaultUrlMatcher;\n  const res = matcher(segments, segmentGroup, route);\n  if (!res) return {...noMatch};\n\n  const posParams: {[n: string]: string} = {};\n  Object.entries(res.posParams ?? {}).forEach(([k, v]) => {\n    posParams[k] = v.path;\n  });\n  const parameters =\n    res.consumed.length > 0\n      ? {...posParams, ...res.consumed[res.consumed.length - 1].parameters}\n      : posParams;\n\n  return {\n    matched: true,\n    consumedSegments: res.consumed,\n    remainingSegments: segments.slice(res.consumed.length),\n    // TODO(atscott): investigate combining parameters and positionalParamSegments\n    parameters,\n    positionalParamSegments: res.posParams ?? {},\n  };\n}\n\nexport function split(\n  segmentGroup: UrlSegmentGroup,\n  consumedSegments: UrlSegment[],\n  slicedSegments: UrlSegment[],\n  config: Route[],\n  outlet?: string,\n): {\n  segmentGroup: UrlSegmentGroup;\n  slicedSegments: UrlSegment[];\n} {\n  if (\n    slicedSegments.length > 0 &&\n    containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config, outlet)\n  ) {\n    const s = new UrlSegmentGroup(\n      consumedSegments,\n      createChildrenForEmptyPaths(\n        config,\n        new UrlSegmentGroup(slicedSegments, segmentGroup.children),\n      ),\n    );\n    return {segmentGroup: s, slicedSegments: []};\n  }\n\n  if (\n    slicedSegments.length === 0 &&\n    containsEmptyPathMatches(segmentGroup, slicedSegments, config)\n  ) {\n    const s = new UrlSegmentGroup(\n      segmentGroup.segments,\n      addEmptyPathsToChildrenIfNeeded(segmentGroup, slicedSegments, config, segmentGroup.children),\n    );\n    return {segmentGroup: s, slicedSegments};\n  }\n\n  const s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);\n  return {segmentGroup: s, slicedSegments};\n}\n\nfunction addEmptyPathsToChildrenIfNeeded(\n  segmentGroup: UrlSegmentGroup,\n  slicedSegments: UrlSegment[],\n  routes: Route[],\n  children: {[name: string]: UrlSegmentGroup},\n): {[name: string]: UrlSegmentGroup} {\n  const res: {[name: string]: UrlSegmentGroup} = {};\n  for (const r of routes) {\n    if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {\n      const s = new UrlSegmentGroup([], {});\n      res[getOutlet(r)] = s;\n    }\n  }\n  return {...children, ...res};\n}\n\nfunction createChildrenForEmptyPaths(\n  routes: Route[],\n  primarySegment: UrlSegmentGroup,\n): {[name: string]: UrlSegmentGroup} {\n  const res: {[name: string]: UrlSegmentGroup} = {};\n  res[PRIMARY_OUTLET] = primarySegment;\n\n  for (const r of routes) {\n    if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {\n      const s = new UrlSegmentGroup([], {});\n      res[getOutlet(r)] = s;\n    }\n  }\n  return res;\n}\n\nfunction containsEmptyPathMatchesWithNamedOutlets(\n  segmentGroup: UrlSegmentGroup,\n  slicedSegments: UrlSegment[],\n  routes: Route[],\n  outlet?: string,\n): boolean {\n  return routes.some((r) => {\n    // 1. Can this route match as an empty path?\n    const matchesEmpty = emptyPathMatch(segmentGroup, slicedSegments, r);\n    if (!matchesEmpty) return false;\n\n    // 2. Is this a named outlet? (We only pull in empty paths if they are named outlets).\n    const isNamedOutlet = getOutlet(r) !== PRIMARY_OUTLET;\n    if (!isNamedOutlet) return false;\n\n    // 3. Are we already processing this outlet? If so, we ignore it as a pull-in\n    // candidate. For example, if we are evaluating the 'secondary' outlet, we shouldn't\n    // \"pull in\" an empty 'secondary' group.  We should let standard\n    // segment matching handle it (which looks at the actual characters in the URL).\n    const isSelfEvaluating = outlet !== undefined && getOutlet(r) === outlet;\n    return !isSelfEvaluating;\n  });\n}\n\nfunction containsEmptyPathMatches(\n  segmentGroup: UrlSegmentGroup,\n  slicedSegments: UrlSegment[],\n  routes: Route[],\n): boolean {\n  return routes.some((r) => emptyPathMatch(segmentGroup, slicedSegments, r));\n}\n\nexport function emptyPathMatch(\n  segmentGroup: UrlSegmentGroup,\n  slicedSegments: UrlSegment[],\n  r: Route,\n): boolean {\n  if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {\n    return false;\n  }\n\n  return r.path === '';\n}\n\nexport function noLeftoversInUrl(\n  segmentGroup: UrlSegmentGroup,\n  segments: UrlSegment[],\n  outlet: string,\n): boolean {\n  return segments.length === 0 && !segmentGroup.children[outlet];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector, Type, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {AbsoluteRedirect, ApplyRedirects, canLoadFails, NoMatch} from './apply_redirects';\nimport {createUrlTreeFromSnapshot} from './create_url_tree';\nimport {RuntimeErrorCode} from './errors';\nimport {Data, LoadedRouterConfig, ResolveData, Route, Routes} from './models';\nimport {runCanLoadGuards} from './operators/check_guards';\nimport {RouterConfigLoader} from './router_config_loader';\nimport {\n  ActivatedRouteSnapshot,\n  getInherited,\n  ParamsInheritanceStrategy,\n  RouterStateSnapshot,\n} from './router_state';\nimport {Params, PRIMARY_OUTLET} from './shared';\nimport {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';\nimport {getOutlet, sortByMatchingOutlets} from './utils/config';\nimport {\n  createPreMatchRouteSnapshot,\n  emptyPathMatch,\n  match,\n  MatchResult,\n  matchWithChecks,\n  noLeftoversInUrl,\n  split,\n} from './utils/config_matching';\nimport {TreeNode} from './utils/tree';\nimport {firstValueFrom} from './utils/first_value_from';\nimport {isEmptyError} from './utils/type_guards';\n\n/**\n * Class used to indicate there were no additional route config matches but that all segments of\n * the URL were consumed during matching so the route was URL matched. When this happens, we still\n * try to match child configs in case there are empty path children.\n */\nclass NoLeftoversInUrl {}\n\nexport async function recognize(\n  injector: EnvironmentInjector,\n  configLoader: RouterConfigLoader,\n  rootComponentType: Type<any> | null,\n  config: Routes,\n  urlTree: UrlTree,\n  urlSerializer: UrlSerializer,\n  paramsInheritanceStrategy: ParamsInheritanceStrategy,\n  abortSignal: AbortSignal,\n): Promise<{state: RouterStateSnapshot; tree: UrlTree}> {\n  return new Recognizer(\n    injector,\n    configLoader,\n    rootComponentType,\n    config,\n    urlTree,\n    paramsInheritanceStrategy,\n    urlSerializer,\n    abortSignal,\n  ).recognize();\n}\n\nconst MAX_ALLOWED_REDIRECTS = 31;\n\nexport class Recognizer {\n  private applyRedirects: ApplyRedirects;\n  private absoluteRedirectCount = 0;\n  allowRedirects = true;\n\n  constructor(\n    private injector: EnvironmentInjector,\n    private configLoader: RouterConfigLoader,\n    private rootComponentType: Type<any> | null,\n    private config: Routes,\n    private urlTree: UrlTree,\n    private paramsInheritanceStrategy: ParamsInheritanceStrategy,\n    private readonly urlSerializer: UrlSerializer,\n    private readonly abortSignal: AbortSignal,\n  ) {\n    this.applyRedirects = new ApplyRedirects(this.urlSerializer, this.urlTree);\n  }\n\n  private noMatchError(e: NoMatch): RuntimeError<RuntimeErrorCode.NO_MATCH> {\n    return new RuntimeError(\n      RuntimeErrorCode.NO_MATCH,\n      typeof ngDevMode === 'undefined' || ngDevMode\n        ? `Cannot match any routes. URL Segment: '${e.segmentGroup}'`\n        : `'${e.segmentGroup}'`,\n    );\n  }\n\n  async recognize(): Promise<{state: RouterStateSnapshot; tree: UrlTree}> {\n    const rootSegmentGroup = split(this.urlTree.root, [], [], this.config).segmentGroup;\n\n    const {children, rootSnapshot} = await this.match(rootSegmentGroup);\n    const rootNode = new TreeNode(rootSnapshot, children);\n    const routeState = new RouterStateSnapshot('', rootNode);\n    const tree = createUrlTreeFromSnapshot(\n      rootSnapshot,\n      [],\n      this.urlTree.queryParams,\n      this.urlTree.fragment,\n    );\n    // Creating the tree stringifies the query params\n    // We don't want to do this here to preserve pre-existing behavior\n    // so reassign them to the original.\n    tree.queryParams = this.urlTree.queryParams;\n    routeState.url = this.urlSerializer.serialize(tree);\n    return {state: routeState, tree};\n  }\n\n  private async match(rootSegmentGroup: UrlSegmentGroup): Promise<{\n    children: TreeNode<ActivatedRouteSnapshot>[];\n    rootSnapshot: ActivatedRouteSnapshot;\n  }> {\n    // Use Object.freeze to prevent readers of the Router state from modifying it outside\n    // of a navigation, resulting in the router being out of sync with the browser.\n    const rootSnapshot = new ActivatedRouteSnapshot(\n      [],\n      Object.freeze({}),\n      Object.freeze({...this.urlTree.queryParams}),\n      this.urlTree.fragment,\n      Object.freeze({}),\n      PRIMARY_OUTLET,\n      this.rootComponentType,\n      null,\n      {},\n      this.injector,\n    );\n    try {\n      const children = await this.processSegmentGroup(\n        this.injector,\n        this.config,\n        rootSegmentGroup,\n        PRIMARY_OUTLET,\n        rootSnapshot,\n      );\n      return {children, rootSnapshot};\n    } catch (e: any) {\n      if (e instanceof AbsoluteRedirect) {\n        this.urlTree = e.urlTree;\n        return this.match(e.urlTree.root);\n      }\n      if (e instanceof NoMatch) {\n        throw this.noMatchError(e);\n      }\n\n      throw e;\n    }\n  }\n\n  async processSegmentGroup(\n    injector: EnvironmentInjector,\n    config: Route[],\n    segmentGroup: UrlSegmentGroup,\n    outlet: string,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot>[]> {\n    if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {\n      return this.processChildren(injector, config, segmentGroup, parentRoute);\n    }\n\n    const child = await this.processSegment(\n      injector,\n      config,\n      segmentGroup,\n      segmentGroup.segments,\n      outlet,\n      true,\n      parentRoute,\n    );\n    return child instanceof TreeNode ? [child] : [];\n  }\n\n  /**\n   * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if\n   * we cannot find a match for _any_ of the children.\n   *\n   * @param config - The `Routes` to match against\n   * @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the\n   *     config.\n   */\n  async processChildren(\n    injector: EnvironmentInjector,\n    config: Route[],\n    segmentGroup: UrlSegmentGroup,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot>[]> {\n    // Expand outlets one at a time, starting with the primary outlet. We need to do it this way\n    // because an absolute redirect from the primary outlet takes precedence.\n    const childOutlets: string[] = [];\n    for (const child of Object.keys(segmentGroup.children)) {\n      if (child === 'primary') {\n        childOutlets.unshift(child);\n      } else {\n        childOutlets.push(child);\n      }\n    }\n\n    let children: TreeNode<ActivatedRouteSnapshot>[] = [];\n    for (const childOutlet of childOutlets) {\n      const child = segmentGroup.children[childOutlet];\n      // Sort the config so that routes with outlets that match the one being activated\n      // appear first, followed by routes for other outlets, which might match if they have\n      // an empty path.\n      const sortedConfig = sortByMatchingOutlets(config, childOutlet);\n      const outletChildren = await this.processSegmentGroup(\n        injector,\n        sortedConfig,\n        child,\n        childOutlet,\n        parentRoute,\n      );\n      children.push(...outletChildren);\n    }\n\n    // Because we may have matched two outlets to the same empty path segment, we can have\n    // multiple activated results for the same outlet. We should merge the children of\n    // these results so the final return value is only one `TreeNode` per outlet.\n    const mergedChildren = mergeEmptyPathMatches(children);\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      // This should really never happen - we are only taking the first match for each\n      // outlet and merge the empty path matches.\n      checkOutletNameUniqueness(mergedChildren);\n    }\n    sortActivatedRouteSnapshots(mergedChildren);\n    return mergedChildren;\n  }\n\n  async processSegment(\n    injector: EnvironmentInjector,\n    routes: Route[],\n    segmentGroup: UrlSegmentGroup,\n    segments: UrlSegment[],\n    outlet: string,\n    allowRedirects: boolean,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot> | NoLeftoversInUrl> {\n    for (const r of routes) {\n      try {\n        return await this.processSegmentAgainstRoute(\n          r._injector ?? injector,\n          routes,\n          r,\n          segmentGroup,\n          segments,\n          outlet,\n          allowRedirects,\n          parentRoute,\n        );\n      } catch (e: any) {\n        if (e instanceof NoMatch || isEmptyError(e)) {\n          continue;\n        }\n        throw e;\n      }\n    }\n\n    if (noLeftoversInUrl(segmentGroup, segments, outlet)) {\n      return new NoLeftoversInUrl();\n    }\n    throw new NoMatch(segmentGroup);\n  }\n\n  async processSegmentAgainstRoute(\n    injector: EnvironmentInjector,\n    routes: Route[],\n    route: Route,\n    rawSegment: UrlSegmentGroup,\n    segments: UrlSegment[],\n    outlet: string,\n    allowRedirects: boolean,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot> | NoLeftoversInUrl> {\n    // We allow matches to empty paths when the outlets differ so we can match a url like `/(b:b)` to\n    // a config like\n    // * `{path: '', children: [{path: 'b', outlet: 'b'}]}`\n    // or even\n    // * `{path: '', outlet: 'a', children: [{path: 'b', outlet: 'b'}]`\n    //\n    // The exception here is when the segment outlet is for the primary outlet. This would\n    // result in a match inside the named outlet because all children there are written as primary\n    // outlets. So we need to prevent child named outlet matches in a url like `/b` in a config like\n    // * `{path: '', outlet: 'x' children: [{path: 'b'}]}`\n    // This should only match if the url is `/(x:b)`.\n    if (\n      getOutlet(route) !== outlet &&\n      (outlet === PRIMARY_OUTLET || !emptyPathMatch(rawSegment, segments, route))\n    ) {\n      throw new NoMatch(rawSegment);\n    }\n\n    if (route.redirectTo === undefined) {\n      return this.matchSegmentAgainstRoute(\n        injector,\n        rawSegment,\n        route,\n        segments,\n        outlet,\n        parentRoute,\n      );\n    }\n\n    if (this.allowRedirects && allowRedirects) {\n      return this.expandSegmentAgainstRouteUsingRedirect(\n        injector,\n        rawSegment,\n        routes,\n        route,\n        segments,\n        outlet,\n        parentRoute,\n      );\n    }\n\n    throw new NoMatch(rawSegment);\n  }\n\n  private async expandSegmentAgainstRouteUsingRedirect(\n    injector: EnvironmentInjector,\n    segmentGroup: UrlSegmentGroup,\n    routes: Route[],\n    route: Route,\n    segments: UrlSegment[],\n    outlet: string,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot> | NoLeftoversInUrl> {\n    const {matched, parameters, consumedSegments, positionalParamSegments, remainingSegments} =\n      match(segmentGroup, route, segments);\n    if (!matched) throw new NoMatch(segmentGroup);\n\n    // TODO(atscott): Move all of this under an if(ngDevMode) as a breaking change and allow stack\n    // size exceeded in production\n    if (typeof route.redirectTo === 'string' && route.redirectTo[0] === '/') {\n      this.absoluteRedirectCount++;\n      if (this.absoluteRedirectCount > MAX_ALLOWED_REDIRECTS) {\n        if (ngDevMode) {\n          throw new RuntimeError(\n            RuntimeErrorCode.INFINITE_REDIRECT,\n            `Detected possible infinite redirect when redirecting from '${this.urlTree}' to '${route.redirectTo}'.\\n` +\n              `This is currently a dev mode only error but will become a` +\n              ` call stack size exceeded error in production in a future major version.`,\n          );\n        }\n        this.allowRedirects = false;\n      }\n    }\n    const currentSnapshot = this.createSnapshot(injector, route, segments, parameters, parentRoute);\n    if (this.abortSignal.aborted) {\n      throw new Error(this.abortSignal.reason);\n    }\n    const newTree = await this.applyRedirects.applyRedirectCommands(\n      consumedSegments,\n      route.redirectTo!,\n      positionalParamSegments,\n      createPreMatchRouteSnapshot(currentSnapshot),\n      injector,\n    );\n\n    const newSegments = await this.applyRedirects.lineralizeSegments(route, newTree);\n    return this.processSegment(\n      injector,\n      routes,\n      segmentGroup,\n      newSegments.concat(remainingSegments),\n      outlet,\n      false,\n      parentRoute,\n    );\n  }\n\n  private createSnapshot(\n    injector: EnvironmentInjector,\n    route: Route,\n    segments: UrlSegment[],\n    parameters: Params,\n    parentRoute: ActivatedRouteSnapshot,\n  ): ActivatedRouteSnapshot {\n    const snapshot = new ActivatedRouteSnapshot(\n      segments,\n      parameters,\n      Object.freeze({...this.urlTree.queryParams}),\n      this.urlTree.fragment,\n      getData(route),\n      getOutlet(route),\n      route.component ?? route._loadedComponent ?? null,\n      route,\n      getResolve(route),\n      injector,\n    );\n    const inherited = getInherited(snapshot, parentRoute, this.paramsInheritanceStrategy);\n    snapshot.params = Object.freeze(inherited.params);\n    snapshot.data = Object.freeze(inherited.data);\n    return snapshot;\n  }\n\n  async matchSegmentAgainstRoute(\n    injector: EnvironmentInjector,\n    rawSegment: UrlSegmentGroup,\n    route: Route,\n    segments: UrlSegment[],\n    outlet: string,\n    parentRoute: ActivatedRouteSnapshot,\n  ): Promise<TreeNode<ActivatedRouteSnapshot>> {\n    if (this.abortSignal.aborted) {\n      throw new Error(this.abortSignal.reason);\n    }\n\n    const createSnapshot = (result: MatchResult) =>\n      this.createSnapshot(injector, route, result.consumedSegments, result.parameters, parentRoute);\n    const result = await firstValueFrom(\n      matchWithChecks(\n        rawSegment,\n        route,\n        segments,\n        injector,\n        this.urlSerializer,\n        createSnapshot,\n        this.abortSignal,\n      ),\n    );\n    if (route.path === '**') {\n      // Prior versions of the route matching algorithm would stop matching at the wildcard route.\n      // We should investigate a better strategy for any existing children. Otherwise, these\n      // child segments are silently dropped from the navigation.\n      // https://github.com/angular/angular/issues/40089\n      rawSegment.children = {};\n    }\n\n    if (!result?.matched) {\n      throw new NoMatch(rawSegment);\n    }\n    // If the route has an injector created from providers, we should start using that.\n    injector = route._injector ?? injector;\n    const {routes: childConfig} = await this.getChildConfig(injector, route, segments);\n    const childInjector = route._loadedInjector ?? injector;\n\n    const {parameters, consumedSegments, remainingSegments} = result;\n    const snapshot = this.createSnapshot(\n      injector,\n      route,\n      consumedSegments,\n      parameters,\n      parentRoute,\n    );\n\n    const {segmentGroup, slicedSegments} = split(\n      rawSegment,\n      consumedSegments,\n      remainingSegments,\n      childConfig,\n      outlet,\n    );\n\n    if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {\n      const children = await this.processChildren(\n        childInjector,\n        childConfig,\n        segmentGroup,\n        snapshot,\n      );\n      return new TreeNode(snapshot, children);\n    }\n\n    if (childConfig.length === 0 && slicedSegments.length === 0) {\n      return new TreeNode(snapshot, []);\n    }\n\n    const matchedOnOutlet = getOutlet(route) === outlet;\n    // If we matched a config due to empty path match on a different outlet, we need to\n    // continue passing the current outlet for the segment rather than switch to PRIMARY.\n    // Note that we switch to primary when we have a match because outlet configs look like\n    // this: {path: 'a', outlet: 'a', children: [\n    //  {path: 'b', component: B},\n    //  {path: 'c', component: C},\n    // ]}\n    // Notice that the children of the named outlet are configured with the primary outlet\n    const child = await this.processSegment(\n      childInjector,\n      childConfig,\n      segmentGroup,\n      slicedSegments,\n      matchedOnOutlet ? PRIMARY_OUTLET : outlet,\n      true,\n      snapshot,\n    );\n    return new TreeNode(snapshot, child instanceof TreeNode ? [child] : []);\n  }\n  private async getChildConfig(\n    injector: EnvironmentInjector,\n    route: Route,\n    segments: UrlSegment[],\n  ): Promise<LoadedRouterConfig> {\n    if (route.children) {\n      // The children belong to the same module\n      return {routes: route.children, injector};\n    }\n\n    if (route.loadChildren) {\n      // lazy children belong to the loaded module\n      if (route._loadedRoutes !== undefined) {\n        const ngModuleFactory = route._loadedNgModuleFactory;\n        if (ngModuleFactory && !route._loadedInjector) {\n          route._loadedInjector = ngModuleFactory.create(injector).injector;\n        }\n        return {routes: route._loadedRoutes, injector: route._loadedInjector};\n      }\n\n      if (this.abortSignal.aborted) {\n        throw new Error(this.abortSignal.reason);\n      }\n      const shouldLoadResult = await firstValueFrom(\n        runCanLoadGuards(injector, route, segments, this.urlSerializer, this.abortSignal),\n      );\n      if (shouldLoadResult) {\n        const cfg = await this.configLoader.loadChildren(injector, route);\n        route._loadedRoutes = cfg.routes;\n        route._loadedInjector = cfg.injector;\n        route._loadedNgModuleFactory = cfg.factory;\n        return cfg;\n      }\n      throw canLoadFails(route);\n    }\n\n    return {routes: [], injector};\n  }\n}\n\nfunction sortActivatedRouteSnapshots(nodes: TreeNode<ActivatedRouteSnapshot>[]): void {\n  nodes.sort((a, b) => {\n    if (a.value.outlet === PRIMARY_OUTLET) return -1;\n    if (b.value.outlet === PRIMARY_OUTLET) return 1;\n    return a.value.outlet.localeCompare(b.value.outlet);\n  });\n}\n\nfunction hasEmptyPathConfig(node: TreeNode<ActivatedRouteSnapshot>) {\n  const config = node.value.routeConfig;\n  return config && config.path === '';\n}\n\n/**\n * Finds `TreeNode`s with matching empty path route configs and merges them into `TreeNode` with\n * the children from each duplicate. This is necessary because different outlets can match a\n * single empty path route config and the results need to then be merged.\n */\nfunction mergeEmptyPathMatches(\n  nodes: Array<TreeNode<ActivatedRouteSnapshot>>,\n): Array<TreeNode<ActivatedRouteSnapshot>> {\n  const result: Array<TreeNode<ActivatedRouteSnapshot>> = [];\n  // The set of nodes which contain children that were merged from two duplicate empty path nodes.\n  const mergedNodes: Set<TreeNode<ActivatedRouteSnapshot>> = new Set();\n\n  for (const node of nodes) {\n    if (!hasEmptyPathConfig(node)) {\n      result.push(node);\n      continue;\n    }\n\n    const duplicateEmptyPathNode = result.find(\n      (resultNode) => node.value.routeConfig === resultNode.value.routeConfig,\n    );\n    if (duplicateEmptyPathNode !== undefined) {\n      duplicateEmptyPathNode.children.push(...node.children);\n      mergedNodes.add(duplicateEmptyPathNode);\n    } else {\n      result.push(node);\n    }\n  }\n  // For each node which has children from multiple sources, we need to recompute a new `TreeNode`\n  // by also merging those children. This is necessary when there are multiple empty path configs\n  // in a row. Put another way: whenever we combine children of two nodes, we need to also check\n  // if any of those children can be combined into a single node as well.\n  for (const mergedNode of mergedNodes) {\n    const mergedChildren = mergeEmptyPathMatches(mergedNode.children);\n    result.push(new TreeNode(mergedNode.value, mergedChildren));\n  }\n  return result.filter((n) => !mergedNodes.has(n));\n}\n\nfunction checkOutletNameUniqueness(nodes: TreeNode<ActivatedRouteSnapshot>[]): void {\n  const names: {[k: string]: ActivatedRouteSnapshot} = {};\n  nodes.forEach((n) => {\n    const routeWithSameOutletName = names[n.value.outlet];\n    if (routeWithSameOutletName) {\n      const p = routeWithSameOutletName.url.map((s) => s.toString()).join('/');\n      const c = n.value.url.map((s) => s.toString()).join('/');\n      throw new RuntimeError(\n        RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          `Two segments cannot have the same outlet name: '${p}' and '${c}'.`,\n      );\n    }\n    names[n.value.outlet] = n.value;\n  });\n}\n\nfunction getData(route: Route): Data {\n  return route.data || {};\n}\n\nfunction getResolve(route: Route): ResolveData {\n  return route.resolve || {};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector, Type} from '@angular/core';\nimport {MonoTypeOperatorFunction} from 'rxjs';\nimport {mergeMap} from 'rxjs/operators';\n\nimport type {Route} from '../models';\nimport type {NavigationTransition} from '../navigation_transition';\nimport {recognize as recognizeFn} from '../recognize';\nimport type {RouterConfigLoader} from '../router_config_loader';\nimport type {UrlSerializer} from '../url_tree';\n\nexport function recognize(\n  injector: EnvironmentInjector,\n  configLoader: RouterConfigLoader,\n  rootComponentType: Type<any> | null,\n  config: Route[],\n  serializer: UrlSerializer,\n  paramsInheritanceStrategy: 'emptyOnly' | 'always',\n  abortSignal: AbortSignal,\n): MonoTypeOperatorFunction<NavigationTransition> {\n  return mergeMap(async (t) => {\n    const {state: targetSnapshot, tree: urlAfterRedirects} = await recognizeFn(\n      injector,\n      configLoader,\n      rootComponentType,\n      config,\n      t.extractedUrl,\n      serializer,\n      paramsInheritanceStrategy,\n      abortSignal,\n    );\n    return {...t, targetSnapshot, urlAfterRedirects};\n  });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentInjector, ProviderToken, runInInjectionContext} from '@angular/core';\nimport {defer, EMPTY, from, MonoTypeOperatorFunction, Observable, of, throwError} from 'rxjs';\nimport {catchError, concatMap, first, map, mergeMap, takeLast, tap} from 'rxjs/operators';\n\nimport {RedirectCommand, ResolveData} from '../models';\nimport type {NavigationTransition} from '../navigation_transition';\nimport {\n  ActivatedRouteSnapshot,\n  getInherited,\n  hasStaticTitle,\n  RouterStateSnapshot,\n} from '../router_state';\nimport {RouteTitleKey} from '../shared';\nimport {getDataKeys, wrapIntoObservable} from '../utils/collection';\nimport {getTokenOrFunctionIdentity} from '../utils/preactivation';\nimport {isEmptyError} from '../utils/type_guards';\nimport {redirectingNavigationError} from '../navigation_canceling_error';\nimport {DefaultUrlSerializer} from '../url_tree';\n\nexport function resolveData(\n  paramsInheritanceStrategy: 'emptyOnly' | 'always',\n): MonoTypeOperatorFunction<NavigationTransition> {\n  return mergeMap((t) => {\n    const {\n      targetSnapshot,\n      guards: {canActivateChecks},\n    } = t;\n\n    if (!canActivateChecks.length) {\n      return of(t);\n    }\n    // Iterating a Set in javascript  happens in insertion order so it is safe to use a `Set` to\n    // preserve the correct order that the resolvers should run in.\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#description\n    const routesWithResolversToRun = new Set(canActivateChecks.map((check) => check.route));\n    const routesNeedingDataUpdates = new Set<ActivatedRouteSnapshot>();\n    for (const route of routesWithResolversToRun) {\n      if (routesNeedingDataUpdates.has(route)) {\n        continue;\n      }\n      // All children under the route with a resolver to run need to recompute inherited data.\n      for (const newRoute of flattenRouteTree(route)) {\n        routesNeedingDataUpdates.add(newRoute);\n      }\n    }\n    let routesProcessed = 0;\n    return from(routesNeedingDataUpdates).pipe(\n      concatMap((route) => {\n        if (routesWithResolversToRun.has(route)) {\n          return runResolve(route, targetSnapshot!, paramsInheritanceStrategy);\n        } else {\n          route.data = getInherited(route, route.parent, paramsInheritanceStrategy).resolve;\n          return of(void 0);\n        }\n      }),\n      tap(() => routesProcessed++),\n      takeLast(1),\n      mergeMap((_) => (routesProcessed === routesNeedingDataUpdates.size ? of(t) : EMPTY)),\n    );\n  });\n}\n\n/**\n *  Returns the `ActivatedRouteSnapshot` tree as an array, using DFS to traverse the route tree.\n */\nfunction flattenRouteTree(route: ActivatedRouteSnapshot): ActivatedRouteSnapshot[] {\n  const descendants = route.children.map((child) => flattenRouteTree(child)).flat();\n  return [route, ...descendants];\n}\n\nfunction runResolve(\n  futureARS: ActivatedRouteSnapshot,\n  futureRSS: RouterStateSnapshot,\n  paramsInheritanceStrategy: 'emptyOnly' | 'always',\n) {\n  const config = futureARS.routeConfig;\n  const resolve = futureARS._resolve;\n  if (config?.title !== undefined && !hasStaticTitle(config)) {\n    resolve[RouteTitleKey] = config.title;\n  }\n  return defer(() => {\n    futureARS.data = getInherited(futureARS, futureARS.parent, paramsInheritanceStrategy).resolve;\n    return resolveNode(resolve, futureARS, futureRSS).pipe(\n      map((resolvedData: any) => {\n        futureARS._resolvedData = resolvedData;\n        futureARS.data = {...futureARS.data, ...resolvedData};\n        return null;\n      }),\n    );\n  });\n}\n\nfunction resolveNode(\n  resolve: ResolveData,\n  futureARS: ActivatedRouteSnapshot,\n  futureRSS: RouterStateSnapshot,\n): Observable<any> {\n  const keys = getDataKeys(resolve);\n  if (keys.length === 0) {\n    return of({});\n  }\n  const data: {[k: string | symbol]: any} = {};\n  return from(keys).pipe(\n    mergeMap((key) =>\n      getResolver(resolve[key], futureARS, futureRSS).pipe(\n        first(),\n        tap((value: any) => {\n          if (value instanceof RedirectCommand) {\n            throw redirectingNavigationError(new DefaultUrlSerializer(), value);\n          }\n          data[key] = value;\n        }),\n      ),\n    ),\n    takeLast(1),\n    map(() => data),\n    catchError((e: unknown) => (isEmptyError(e as Error) ? EMPTY : throwError(e))),\n  );\n}\n\nfunction getResolver(\n  injectionToken: ProviderToken<any> | Function,\n  futureARS: ActivatedRouteSnapshot,\n  futureRSS: RouterStateSnapshot,\n): Observable<any> {\n  const closestInjector = futureARS._environmentInjector;\n  const resolver = getTokenOrFunctionIdentity(injectionToken, closestInjector);\n  const resolverValue = resolver.resolve\n    ? resolver.resolve(futureARS, futureRSS)\n    : runInInjectionContext(closestInjector, () => resolver(futureARS, futureRSS));\n  return wrapIntoObservable(resolverValue);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {from, MonoTypeOperatorFunction, ObservableInput, of} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\n/**\n * Perform a side effect through a switchMap for every emission on the source Observable,\n * but return an Observable that is identical to the source. It's essentially the same as\n * the `tap` operator, but if the side effectful `next` function returns an ObservableInput,\n * it will wait before continuing with the original value.\n */\nexport function switchTap<T>(\n  next: (x: T) => void | ObservableInput<any>,\n): MonoTypeOperatorFunction<T> {\n  return switchMap((v) => {\n    const nextResult = next(v);\n    if (nextResult) {\n      return from(nextResult).pipe(map(() => v));\n    }\n    return of(v);\n  });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Injectable, Service} from '@angular/core';\nimport {Title} from '@angular/platform-browser';\n\nimport {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';\nimport {PRIMARY_OUTLET, RouteTitleKey} from './shared';\n\n/**\n * Provides a strategy for setting the page title after a router navigation.\n *\n * The built-in implementation traverses the router state snapshot and finds the deepest primary\n * outlet with `title` property. Given the `Routes` below, navigating to\n * `/base/child(popup:aux)` would result in the document title being set to \"child\".\n * ```ts\n * [\n *   {path: 'base', title: 'base', children: [\n *     {path: 'child', title: 'child'},\n *   ],\n *   {path: 'aux', outlet: 'popup', title: 'popupTitle'}\n * ]\n * ```\n *\n * This class can be used as a base class for custom title strategies. That is, you can create your\n * own class that extends the `TitleStrategy`. Note that in the above example, the `title`\n * from the named outlet is never used. However, a custom strategy might be implemented to\n * incorporate titles in named outlets.\n *\n * @publicApi\n * @see [Page title guide](guide/routing/define-routes#using-titlestrategy-for-page-titles)\n */\n@Service({factory: () => inject(DefaultTitleStrategy)})\nexport abstract class TitleStrategy {\n  /** Performs the application title update. */\n  abstract updateTitle(snapshot: RouterStateSnapshot): void;\n\n  /**\n   * @returns The `title` of the deepest primary route.\n   */\n  buildTitle(snapshot: RouterStateSnapshot): string | undefined {\n    let pageTitle: string | undefined;\n    let route: ActivatedRouteSnapshot | undefined = snapshot.root;\n    while (route !== undefined) {\n      pageTitle = this.getResolvedTitleForRoute(route) ?? pageTitle;\n      route = route.children.find((child) => child.outlet === PRIMARY_OUTLET);\n    }\n    return pageTitle;\n  }\n\n  /**\n   * Given an `ActivatedRouteSnapshot`, returns the final value of the\n   * `Route.title` property, which can either be a static string or a resolved value.\n   */\n  getResolvedTitleForRoute(snapshot: ActivatedRouteSnapshot): string | undefined {\n    return snapshot.data[RouteTitleKey];\n  }\n}\n\n/**\n * The default `TitleStrategy` used by the router that updates the title using the `Title` service.\n */\n@Injectable({providedIn: 'root'})\nexport class DefaultTitleStrategy extends TitleStrategy {\n  constructor(readonly title: Title) {\n    super();\n  }\n\n  /**\n   * Sets the title of the browser to the given value.\n   *\n   * @param title The `pageTitle` from the deepest primary route.\n   */\n  override updateTitle(snapshot: RouterStateSnapshot): void {\n    const title = this.buildTitle(snapshot);\n    if (title !== undefined) {\n      this.title.setTitle(title);\n    }\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\nimport {OnSameUrlNavigation, QueryParamsHandling, RedirectCommand} from './models';\n\n/**\n * Allowed values in an `ExtraOptions` object that configure\n * when the router performs the initial navigation operation.\n *\n * * 'enabledNonBlocking' - (default) The initial navigation starts after the\n * root component has been created. The bootstrap is not blocked on the completion of the initial\n * navigation.\n * * 'enabledBlocking' - The initial navigation starts before the root component is created.\n * The bootstrap is blocked until the initial navigation is complete. This value should be set in\n * case you use [server-side rendering](guide/ssr), but do not enable [hydration](guide/hydration)\n * for your application.\n * * 'disabled' - The initial navigation is not performed. The location listener is set up before\n * the root component gets created. Use if there is a reason to have\n * more control over when the router starts its initial navigation due to some complex\n * initialization logic.\n *\n * @see {@link /api/router/RouterModule#forRoot forRoot}\n *\n * @publicApi\n */\nexport type InitialNavigation = 'disabled' | 'enabledBlocking' | 'enabledNonBlocking';\n\n/**\n * Extra configuration options that can be used with the `withRouterConfig` function.\n *\n * @see [Router configuration options](guide/routing/customizing-route-behavior#router-configuration-options)\n *\n * @publicApi\n */\nexport interface RouterConfigOptions {\n  /**\n   * Configures how the Router attempts to restore state when a navigation is cancelled.\n   *\n   * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the\n   * router before the navigation started. This means that if the URL of the browser is updated\n   * _before_ the navigation is canceled, the Router will simply replace the item in history rather\n   * than trying to restore to the previous location in the session history. This happens most\n   * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward\n   * buttons.\n   *\n   * 'computed' - Will attempt to return to the same index in the session history that corresponds\n   * to the Angular route when the navigation gets cancelled. For example, if the browser back\n   * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation\n   * and vice versa.\n   *\n   * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only\n   * handles a portion of the URL because the history restoration navigates to the previous place in\n   * the browser history rather than simply resetting a portion of the URL.\n   *\n   * The default value is `replace` when not set.\n   *\n   * @see [Handle canceled navigations](guide/routing/customizing-route-behavior#handle-canceled-navigations)\n   *\n   */\n  canceledNavigationResolution?: 'replace' | 'computed';\n\n  /**\n   * Configures the default for handling a navigation request to the current URL.\n   *\n   * If unset, the `Router` will use `'ignore'`.\n   *\n   * @see {@link OnSameUrlNavigation}\n   *\n   * @see [React to same-URL navigations](guide/routing/customizing-route-behavior#react-to-same-url-navigations)\n   */\n  onSameUrlNavigation?: OnSameUrlNavigation;\n\n  /**\n   * Defines how the router merges parameters, data, and resolved data from parent to child\n   * routes.\n   *\n   * By default ('always'), a route inherits all parameters from its parent routes.\n   *\n   * Set to 'emptyOnly' to preserve the legacy behavior where a route only inherits the parent\n   * route's parameters when the route itself has an empty path or when the parent route doesn't\n   * have any component set.\n   *\n   * Note that when dealing with matrix parameters, \"parent\" refers to the parent `Route`\n   * config which does not necessarily mean the \"URL segment to the left\". When the `Route` `path`\n   * contains multiple segments, the matrix parameters must appear on the last segment. For example,\n   * matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not\n   * `a;foo=bar/b`.\n   *\n   * @see [Control parameter inheritance](guide/routing/customizing-route-behavior#control-parameter-inheritance)\n   *\n   */\n  paramsInheritanceStrategy?: 'emptyOnly' | 'always';\n\n  /**\n   * Defines when the router updates the browser URL. By default ('deferred'),\n   * update after successful navigation.\n   * Set to 'eager' if prefer to update the URL at the beginning of navigation.\n   * Updating the URL early allows you to handle a failure of navigation by\n   * showing an error message with the URL that failed.\n   *\n   * @see [Decide when the URL updates](guide/routing/customizing-route-behavior#decide-when-the-url-updates)\n   *\n   */\n  urlUpdateStrategy?: 'deferred' | 'eager';\n\n  /**\n   * The default strategy to use for handling query params in `Router.createUrlTree` when one is not provided.\n   *\n   * The `createUrlTree` method is used internally by `Router.navigate` and `RouterLink`.\n   * Note that `QueryParamsHandling` does not apply to `Router.navigateByUrl`.\n   *\n   * When neither the default nor the queryParamsHandling option is specified in the call to `createUrlTree`,\n   * the current parameters will be replaced by new parameters.\n   *\n   * @see {@link Router#createUrlTree}\n   * @see {@link QueryParamsHandling}\n   * \n   * @see [Choose default query parameter handling](guide/routing/customizing-route-behavior#choose-default-query-parameter-handling)\n\n   * \n   */\n  defaultQueryParamsHandling?: QueryParamsHandling;\n\n  /**\n   * When `true`, the `Promise` will instead resolve with `false`, as it does with other failed\n   * navigations (for example, when guards are rejected).\n\n   * Otherwise the `Promise` returned by the Router's navigation with be rejected\n   * if an error occurs.\n   */\n  resolveNavigationPromiseOnError?: boolean;\n}\n\n/**\n * Configuration options for the scrolling feature which can be used with `withInMemoryScrolling`\n * function or `RouterModule.forRoot`.\n *\n * @publicApi\n * @see withInMemoryScrolling\n * @see RouterModule#forRoot\n */\nexport interface InMemoryScrollingOptions {\n  /**\n   * When set to 'enabled', scrolls to the anchor element when the URL has a fragment.\n   * Anchor scrolling is disabled by default.\n   *\n   * Anchor scrolling does not happen on 'popstate'. Instead, we restore the position\n   * that we stored or scroll to the top.\n   */\n  anchorScrolling?: 'disabled' | 'enabled';\n\n  /**\n   * Configures if the scroll position needs to be restored when navigating back.\n   *\n   * * 'disabled'- (Default) Does nothing. Scroll position is maintained on navigation.\n   * * 'top'- Sets the scroll position to x = 0, y = 0 on all navigation.\n   * * 'enabled'- Restores the previous scroll position on backward navigation, else sets the\n   * position to the anchor if one is provided, or sets the scroll position to [0, 0] (forward\n   * navigation). This option will be the default in the future.\n   *\n   * You can implement custom scroll restoration behavior by adapting the enabled behavior as\n   * in the following example.\n   *\n   * ```ts\n   * class AppComponent {\n   *   movieData: any;\n   *\n   *   constructor(private router: Router, private viewportScroller: ViewportScroller,\n   * changeDetectorRef: ChangeDetectorRef) {\n   *   router.events.pipe(filter((event: Event): event is Scroll => event instanceof Scroll)\n   *     ).subscribe(e => {\n   *       fetch('http://example.com/movies.json').then(response => {\n   *         this.movieData = response.json();\n   *         // update the template with the data before restoring scroll\n   *         changeDetectorRef.detectChanges();\n   *\n   *         if (e.position) {\n   *           viewportScroller.scrollToPosition(e.position);\n   *         }\n   *       });\n   *     });\n   *   }\n   * }\n   * ```\n   */\n  scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';\n}\n\n/**\n * Configuration options for the component input binding feature which can be used\n * with `withComponentInputBinding` function or `RouterModule.forRoot`\n *\n * @publicApi\n * @see withComponentInputBinding\n * @see RouterModule#forRoot\n * @see [Disable query parameter binding](guide/routing/common-router-tasks#disable-query-parameter-binding)\n */\nexport interface ComponentInputBindingOptions {\n  /**\n   * When true (default), will configure query parameters to bind to component\n   * inputs.\n   */\n  queryParams?: boolean;\n\n  /**\n   * Configures the behavior when an input is not matched by any key in the router data.\n   *\n   * - `'alwaysUndefined'`: (Default) Binds `undefined` to the input. This ensures that stale data\n   *   is not retained.\n   * - `'undefinedIfStale'`: Binds `undefined` only if the input was previously available\n   *   in the router data during the lifetime of the active route in this outlet. This avoids\n   *   setting `undefined` for inputs that were never expected to be set by the router.\n   */\n  unmatchedInputBehavior?: 'alwaysUndefined' | 'undefinedIfStale';\n}\n\n/**\n * A set of configuration options for a router module, provided in the\n * `forRoot()` method.\n *\n * @see {@link /api/router/RouterModule#forRoot forRoot}\n *\n *\n * @publicApi\n */\nexport interface ExtraOptions extends InMemoryScrollingOptions, RouterConfigOptions {\n  /**\n   * When true, log all internal navigation events to the console.\n   * Use for debugging.\n   */\n  enableTracing?: boolean;\n\n  /**\n   * When true, enable the location strategy that uses the URL fragment\n   * instead of the history API.\n   */\n  useHash?: boolean;\n\n  /**\n   * One of `enabled`, `enabledBlocking`, `enabledNonBlocking` or `disabled`.\n   * When set to `enabled` or `enabledBlocking`, the initial navigation starts before the root\n   * component is created. The bootstrap is blocked until the initial navigation is complete. This\n   * value should be set in case you use [server-side rendering](guide/ssr), but do not enable\n   * [hydration](guide/hydration) for your application. When set to `enabledNonBlocking`,\n   * the initial navigation starts after the root component has been created.\n   * The bootstrap is not blocked on the completion of the initial navigation. When set to\n   * `disabled`, the initial navigation is not performed. The location listener is set up before the\n   * root component gets created. Use if there is a reason to have more control over when the router\n   * starts its initial navigation due to some complex initialization logic.\n   */\n  initialNavigation?: InitialNavigation;\n\n  /**\n   * When true, enables binding information from the `Router` state directly to the inputs of the\n   * component in `Route` configurations. Can also accept an `ComponentInputBindingOptions` object\n   * to set whether to exclude queryParams from binding.\n   */\n  bindToComponentInputs?: boolean | ComponentInputBindingOptions;\n\n  /**\n   * When true, enables view transitions in the Router by running the route activation and\n   * deactivation inside of `document.startViewTransition`.\n   *\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   * @experimental 17.0\n   */\n  enableViewTransitions?: boolean;\n\n  /**\n   * A custom error handler for failed navigations.\n   * If the handler returns a value, the navigation Promise is resolved with this value.\n   * If the handler throws an exception, the navigation Promise is rejected with the exception.\n   *\n   * @see RouterConfigOptions\n   */\n  errorHandler?: (error: any) => RedirectCommand | any;\n\n  /**\n   * Configures a preloading strategy.\n   * One of `PreloadAllModules` or `NoPreloading` (the default).\n   */\n  preloadingStrategy?: any;\n\n  /**\n   * Configures the scroll offset the router will use when scrolling to an element.\n   *\n   * When given a tuple with x and y position value,\n   * the router uses that offset each time it scrolls.\n   * When given a function, the router invokes the function every time\n   * it restores scroll position.\n   */\n  scrollOffset?: [number, number] | (() => [number, number]);\n}\n\n/**\n * A DI token for the router service.\n *\n * @publicApi\n */\nexport const ROUTER_CONFIGURATION = new InjectionToken<ExtraOptions>(\n  typeof ngDevMode === 'undefined' || ngDevMode ? 'router config' : '',\n  {\n    factory: () => ({}),\n  },\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n  Compiler,\n  EnvironmentInjector,\n  inject,\n  InjectionToken,\n  Injector,\n  ɵmaybeUnwrapDefaultExport as maybeUnwrapDefaultExport,\n  NgModuleFactory,\n  ɵresolveComponentResources as resolveComponentResources,\n  runInInjectionContext,\n  Service,\n  Type,\n} from '@angular/core';\n\nimport {standardizeConfig} from './components/empty_outlet';\nimport {LoadedRouterConfig, Route, Routes} from './models';\nimport {wrapIntoPromise} from './utils/collection';\nimport {assertStandalone, validateConfig} from './utils/config';\n\n/**\n * The DI token for a router configuration.\n *\n * `ROUTES` is a low level API for router configuration via dependency injection.\n *\n * We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,\n * `provideRouter`, or `Router.resetConfig()`.\n *\n * @publicApi\n */\nexport const ROUTES = new InjectionToken<Route[][]>(\n  typeof ngDevMode !== 'undefined' && ngDevMode ? 'ROUTES' : '',\n);\n\n@Service()\nexport class RouterConfigLoader {\n  private componentLoaders = new WeakMap<Route, Promise<Type<unknown>>>();\n  private childrenLoaders = new WeakMap<Route, Promise<LoadedRouterConfig>>();\n  onLoadStartListener?: (r: Route) => void;\n  onLoadEndListener?: (r: Route) => void;\n  private readonly compiler = inject(Compiler);\n\n  async loadComponent(injector: EnvironmentInjector, route: Route): Promise<Type<unknown>> {\n    if (this.componentLoaders.get(route)) {\n      return this.componentLoaders.get(route)!;\n    } else if (route._loadedComponent) {\n      return Promise.resolve(route._loadedComponent);\n    }\n\n    if (this.onLoadStartListener) {\n      this.onLoadStartListener(route);\n    }\n    const loader = (async () => {\n      try {\n        const loaded = await wrapIntoPromise(\n          runInInjectionContext(injector, () => route.loadComponent!()),\n        );\n        const component = await maybeResolveResources(maybeUnwrapDefaultExport(loaded));\n\n        if (this.onLoadEndListener) {\n          this.onLoadEndListener(route);\n        }\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          assertStandalone(route.path ?? '', component);\n        route._loadedComponent = component;\n        return component;\n      } finally {\n        this.componentLoaders.delete(route);\n      }\n    })();\n    this.componentLoaders.set(route, loader);\n    return loader;\n  }\n\n  loadChildren(parentInjector: Injector, route: Route): Promise<LoadedRouterConfig> {\n    if (this.childrenLoaders.get(route)) {\n      return this.childrenLoaders.get(route)!;\n    } else if (route._loadedRoutes) {\n      return Promise.resolve({routes: route._loadedRoutes, injector: route._loadedInjector});\n    }\n\n    if (this.onLoadStartListener) {\n      this.onLoadStartListener(route);\n    }\n    const loader = (async () => {\n      try {\n        const result = await loadChildren(\n          route,\n          this.compiler,\n          parentInjector,\n          this.onLoadEndListener,\n        );\n        route._loadedRoutes = result.routes;\n        route._loadedInjector = result.injector;\n        route._loadedNgModuleFactory = result.factory;\n        return result;\n      } finally {\n        this.childrenLoaders.delete(route);\n      }\n    })();\n    this.childrenLoaders.set(route, loader);\n    return loader;\n  }\n}\n\n/**\n * Executes a `route.loadChildren` callback and converts the result to an array of child routes and\n * an injector if that callback returned a module.\n *\n * This function is used for the route discovery during prerendering\n * in @angular-devkit/build-angular. If there are any updates to the contract here, it will require\n * an update to the extractor.\n */\nexport async function loadChildren(\n  route: Route,\n  compiler: Compiler,\n  parentInjector: Injector,\n  onLoadEndListener?: (r: Route) => void,\n): Promise<LoadedRouterConfig> {\n  const loaded = await wrapIntoPromise(\n    runInInjectionContext(parentInjector, () => route.loadChildren!()),\n  );\n  const t = await maybeResolveResources(maybeUnwrapDefaultExport(loaded));\n\n  let factoryOrRoutes: NgModuleFactory<any> | Routes;\n  if (t instanceof NgModuleFactory || Array.isArray(t)) {\n    factoryOrRoutes = t;\n  } else {\n    factoryOrRoutes = await compiler.compileModuleAsync(t);\n  }\n\n  if (onLoadEndListener) {\n    onLoadEndListener(route);\n  }\n  // This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is\n  // no injector associated with lazy loading a `Route` array.\n  let injector: EnvironmentInjector | undefined;\n  let rawRoutes: Route[];\n  let requireStandaloneComponents = false;\n  let factory: NgModuleFactory<unknown> | undefined = undefined;\n  if (Array.isArray(factoryOrRoutes)) {\n    rawRoutes = factoryOrRoutes;\n    requireStandaloneComponents = true;\n  } else {\n    injector = factoryOrRoutes.create(parentInjector).injector;\n    factory = factoryOrRoutes;\n    // When loading a module that doesn't provide `RouterModule.forChild()` preloader\n    // will get stuck in an infinite loop. The child module's Injector will look to\n    // its parent `Injector` when it doesn't find any ROUTES so it will return routes\n    // for it's parent module instead.\n    rawRoutes = injector.get(ROUTES, [], {optional: true, self: true}).flat();\n  }\n  const routes = rawRoutes.map(standardizeConfig);\n  (typeof ngDevMode === 'undefined' || ngDevMode) &&\n    validateConfig(routes, route.path, requireStandaloneComponents);\n  return {routes, injector, factory};\n}\n\nasync function maybeResolveResources<T>(value: T): Promise<T> {\n  // In JIT mode we usually resolve the resources of components on bootstrap, however\n  // that won't have happened for lazy-loaded. Attempt to load any pending\n  // resources again here.\n  if ((typeof ngJitMode === 'undefined' || ngJitMode) && typeof fetch === 'function') {\n    try {\n      await resolveComponentResources(fetch);\n    } catch (error) {\n      console.error(error);\n    }\n  }\n\n  return value;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Service} from '@angular/core';\n\nimport {UrlTree} from './url_tree';\n\n/**\n * @description\n *\n * Provides a way to migrate AngularJS applications to Angular.\n *\n * @see [URL handling strategy](guide/routing/customizing-route-behavior#built-in-preloading-strategies)\n *\n * @publicApi\n */\n@Service({factory: () => inject(DefaultUrlHandlingStrategy)})\nexport abstract class UrlHandlingStrategy {\n  /**\n   * Tells the router if this URL should be processed.\n   *\n   * When it returns true, the router will execute the regular navigation.\n   * When it returns false, the router will set the router state to an empty state.\n   * As a result, all the active components will be destroyed.\n   *\n   */\n  abstract shouldProcessUrl(url: UrlTree): boolean;\n\n  /**\n   * Extracts the part of the URL that should be handled by the router.\n   * The rest of the URL will remain untouched.\n   */\n  abstract extract(url: UrlTree): UrlTree;\n\n  /**\n   * Merges the URL fragment with the rest of the URL.\n   */\n  abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;\n}\n\n/**\n * @publicApi\n */\n@Service()\nexport class DefaultUrlHandlingStrategy implements UrlHandlingStrategy {\n  shouldProcessUrl(url: UrlTree): boolean {\n    return true;\n  }\n  extract(url: UrlTree): UrlTree {\n    return url;\n  }\n  merge(newUrlPart: UrlTree, wholeUrl: UrlTree): UrlTree {\n    return newUrlPart;\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {afterNextRender, InjectionToken, Injector, runInInjectionContext} from '@angular/core';\n\nimport {ActivatedRouteSnapshot} from '../router_state';\n\nexport const CREATE_VIEW_TRANSITION = new InjectionToken<typeof createViewTransition>(\n  typeof ngDevMode !== 'undefined' && ngDevMode ? 'view transition helper' : '',\n);\nexport const VIEW_TRANSITION_OPTIONS = new InjectionToken<\n  ViewTransitionsFeatureOptions & {skipNextTransition: boolean}\n>(typeof ngDevMode !== 'undefined' && ngDevMode ? 'view transition options' : '');\n\n/**\n * Options to configure the View Transitions integration in the Router.\n *\n * @developerPreview 20.0\n * @see withViewTransitions\n */\nexport interface ViewTransitionsFeatureOptions {\n  /**\n   * Skips the very first call to `startViewTransition`. This can be useful for disabling the\n   * animation during the application's initial loading phase.\n   */\n  skipInitialTransition?: boolean;\n\n  /**\n   * A function to run after the `ViewTransition` is created.\n   *\n   * This function is run in an injection context and can use `inject`.\n   */\n  onViewTransitionCreated?: (transitionInfo: ViewTransitionInfo) => void;\n}\n\n/**\n * The information passed to the `onViewTransitionCreated` function provided in the\n * `withViewTransitions` feature options.\n *\n * @developerPreview 20.0\n */\nexport interface ViewTransitionInfo {\n  /**\n   * The `ViewTransition` returned by the call to `startViewTransition`.\n   * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition\n   */\n  transition: ViewTransition;\n  /**\n   * The `ActivatedRouteSnapshot` that the navigation is transitioning from.\n   */\n  from: ActivatedRouteSnapshot;\n  /**\n   * The `ActivatedRouteSnapshot` that the navigation is transitioning to.\n   */\n  to: ActivatedRouteSnapshot;\n}\n\n/**\n * A helper function for using browser view transitions. This function skips the call to\n * `startViewTransition` if the browser does not support it.\n *\n * @returns A Promise that resolves when the view transition callback begins.\n */\nexport function createViewTransition(\n  injector: Injector,\n  from: ActivatedRouteSnapshot,\n  to: ActivatedRouteSnapshot,\n): Promise<void> {\n  const transitionOptions = injector.get(VIEW_TRANSITION_OPTIONS);\n  const document = injector.get(DOCUMENT);\n  if (!document.startViewTransition || transitionOptions.skipNextTransition) {\n    transitionOptions.skipNextTransition = false;\n    // The timing of `startViewTransition` is closer to a macrotask. It won't be called\n    // until the current event loop exits so we use a promise resolved in a timeout instead\n    // of Promise.resolve().\n    return new Promise((resolve) => setTimeout(resolve));\n  }\n\n  let resolveViewTransitionStarted: () => void;\n  const viewTransitionStarted = new Promise<void>((resolve) => {\n    resolveViewTransitionStarted = resolve;\n  });\n  const transition = document.startViewTransition(() => {\n    resolveViewTransitionStarted();\n    // We don't actually update dom within the transition callback. The resolving of the above\n    // promise unblocks the Router navigation, which synchronously activates and deactivates\n    // routes (the DOM update). This view transition waits for the next change detection to\n    // complete (below), which includes the update phase of the routed components.\n    return createRenderPromise(injector);\n  });\n  transition.updateCallbackDone.catch((error) => {\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      console.error(error);\n    }\n  });\n  transition.ready.catch((error) => {\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      console.error(error);\n    }\n  });\n  transition.finished.catch((error) => {\n    if (typeof ngDevMode === 'undefined' || ngDevMode) {\n      console.error(error);\n    }\n  });\n  const {onViewTransitionCreated} = transitionOptions;\n  if (onViewTransitionCreated) {\n    runInInjectionContext(injector, () => onViewTransitionCreated({transition, from, to}));\n  }\n  return viewTransitionStarted;\n}\n\n/**\n * Creates a promise that resolves after next render.\n */\nfunction createRenderPromise(injector: Injector) {\n  return new Promise<void>((resolve) => {\n    // Wait for the microtask queue to empty after the next render happens (by waiting a macrotask).\n    // This ensures any follow-up renders in the microtask queue are completed before the\n    // view transition starts animating.\n    afterNextRender({read: () => setTimeout(resolve)}, {injector});\n  });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {\n  DestroyRef,\n  EnvironmentInjector,\n  inject,\n  InjectionToken,\n  runInInjectionContext,\n  Service,\n  signal,\n  Type,\n  untracked,\n  ɵWritable as Writable,\n} from '@angular/core';\nimport {BehaviorSubject, EMPTY, from, Observable, of, Subject} from 'rxjs';\nimport {catchError, filter, finalize, map, switchMap, take, takeUntil, tap} from 'rxjs/operators';\n\nimport {createRouterState} from './create_router_state';\n\nimport {INPUT_BINDER} from './directives/router_outlet';\nimport {\n  BeforeActivateRoutes,\n  BeforeRoutesRecognized,\n  Event,\n  GuardsCheckEnd,\n  GuardsCheckStart,\n  IMPERATIVE_NAVIGATION,\n  NavigationCancel,\n  NavigationCancellationCode,\n  NavigationEnd,\n  NavigationError,\n  NavigationSkipped,\n  NavigationSkippedCode,\n  NavigationStart,\n  NavigationTrigger,\n  RedirectRequest,\n  ResolveEnd,\n  ResolveStart,\n  RouteConfigLoadEnd,\n  RouteConfigLoadStart,\n  RoutesRecognized,\n} from './events';\nimport {\n  GuardResult,\n  NavigationBehaviorOptions,\n  QueryParamsHandling,\n  RedirectCommand,\n  Route,\n} from './models';\nimport {\n  isNavigationCancelingError,\n  isRedirectingNavigationCancelingError,\n  redirectingNavigationError,\n} from './navigation_canceling_error';\nimport {ActivateRoutes} from './operators/activate_routes';\nimport {checkGuards} from './operators/check_guards';\nimport {recognize} from './operators/recognize';\nimport {resolveData} from './operators/resolve_data';\nimport {switchTap} from './operators/switch_tap';\nimport {TitleStrategy} from './page_title_strategy';\nimport type {Router} from './router';\nimport {ROUTER_CONFIGURATION} from './router_config';\nimport {RouterConfigLoader} from './router_config_loader';\nimport {ChildrenOutletContexts} from './router_outlet_context';\nimport {\n  ActivatedRoute,\n  ActivatedRouteSnapshot,\n  createEmptyState,\n  DEFAULT_PARAMS_INHERITANCE_STRATEGY,\n  RouterState,\n  RouterStateSnapshot,\n} from './router_state';\nimport type {Params} from './shared';\nimport {UrlHandlingStrategy} from './url_handling_strategy';\nimport {UrlSerializer, UrlTree} from './url_tree';\nimport {abortSignalToObservable} from './utils/abort_signal_to_observable';\nimport {Checks, getAllRouteGuards} from './utils/preactivation';\nimport {CREATE_VIEW_TRANSITION} from './utils/view_transition';\n\n/**\n * @description\n *\n * Options that modify the `Router` URL.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the target URL should be constructed.\n *\n * @see {@link Router#navigate}\n * @see {@link Router#createUrlTree}\n * @see [Routing and Navigation guide](guide/routing/common-router-tasks)\n *\n * @publicApi\n */\nexport interface UrlCreationOptions {\n  /**\n   * Specifies a root URI to use for relative navigation.\n   *\n   * For example, consider the following route configuration where the parent route\n   * has two children.\n   *\n   * ```ts\n   * [{\n   *   path: 'parent',\n   *   component: ParentComponent,\n   *   children: [{\n   *     path: 'list',\n   *     component: ListComponent\n   *   },{\n   *     path: 'child',\n   *     component: ChildComponent\n   *   }]\n   * }]\n   * ```\n   *\n   * The following `go()` function navigates to the `list` route by\n   * interpreting the destination URI as relative to the activated `child`  route\n   *\n   * ```ts\n   *  @Component({...})\n   *  class ChildComponent {\n   *    constructor(private router: Router, private route: ActivatedRoute) {}\n   *\n   *    go() {\n   *      router.navigate(['../list'], { relativeTo: this.route });\n   *    }\n   *  }\n   * ```\n   *\n   * A value of `null` or `undefined` indicates that the navigation commands should be applied\n   * relative to the root.\n   */\n  relativeTo?: ActivatedRoute | null;\n\n  /**\n   * Sets query parameters to the URL.\n   *\n   * ```ts\n   * // Navigate to /results?page=1\n   * router.navigate(['/results'], { queryParams: { page: 1 } });\n   * ```\n   */\n  queryParams?: Params | null;\n\n  /**\n   * Sets the hash fragment for the URL.\n   *\n   * ```ts\n   * // Navigate to /results#top\n   * router.navigate(['/results'], { fragment: 'top' });\n   * ```\n   */\n  fragment?: string;\n\n  /**\n   * How to handle query parameters in the router link for the next navigation.\n   * One of:\n   * * `preserve` : Preserve current parameters.\n   * * `merge` : Merge new with current parameters.\n   *\n   * The \"preserve\" option discards any new query params:\n   * ```ts\n   * // from /view1?page=1 to/view2?page=1\n   * router.navigate(['/view2'], { queryParams: { page: 2 },  queryParamsHandling: \"preserve\"\n   * });\n   * ```\n   * The \"merge\" option appends new query params to the params from the current URL:\n   * ```ts\n   * // from /view1?page=1 to/view2?page=1&otherKey=2\n   * router.navigate(['/view2'], { queryParams: { otherKey: 2 },  queryParamsHandling: \"merge\"\n   * });\n   * ```\n   * In case of a key collision between current parameters and those in the `queryParams` object,\n   * the new value is used.\n   *\n   */\n  queryParamsHandling?: QueryParamsHandling | null;\n\n  /**\n   * When true, preserves the URL fragment for the next navigation\n   *\n   * ```ts\n   * // Preserve fragment from /results#top to /view#top\n   * router.navigate(['/view'], { preserveFragment: true });\n   * ```\n   */\n  preserveFragment?: boolean;\n}\n\n/**\n * @description\n *\n * Options that modify the `Router` navigation strategy.\n * Supply an object containing any of these properties to a `Router` navigation function to\n * control how the target URL should be constructed or interpreted.\n *\n * @see {@link Router#navigate}\n * @see {@link Router#navigateByUrl}\n * @see {@link Router#createurltree}\n * @see [Routing and Navigation guide](guide/routing/common-router-tasks)\n * @see {@link UrlCreationOptions}\n * @see {@link NavigationBehaviorOptions}\n *\n * @publicApi\n */\nexport interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {}\n\nexport type RestoredState = {\n  [k: string]: any;\n  // TODO(#27607): Remove `navigationId` and `ɵrouterPageId` and move to `ng` or `ɵ` namespace.\n  navigationId: number;\n  // The `ɵ` prefix is there to reduce the chance of colliding with any existing user properties on\n  // the history state.\n  ɵrouterPageId?: number;\n  // When `browserUrl` is used, the actual route URL is stored here so that popstate events\n  // can use it for route matching instead of the displayed browser URL.\n  ɵrouterUrl?: string;\n};\n\n/**\n * Information about a navigation operation.\n * Retrieve the most recent navigation object with the\n * [Router.currentNavigation() method](api/router/Router#currentNavigation) .\n *\n * * *id* : The unique identifier of the current navigation.\n * * *initialUrl* : The target URL passed into the `Router#navigateByUrl()` call before navigation.\n * This is the value before the router has parsed or applied redirects to it.\n * * *extractedUrl* : The initial target URL after being parsed with `UrlSerializer.extract()`.\n * * *finalUrl* : The extracted URL after redirects have been applied.\n * This URL may not be available immediately, therefore this property can be `undefined`.\n * It is guaranteed to be set after the `RoutesRecognized` event fires.\n * * *trigger* : Identifies how this navigation was triggered.\n * -- 'imperative'--Triggered by `router.navigateByUrl` or `router.navigate`.\n * -- 'popstate'--Triggered by a popstate event.\n * -- 'hashchange'--Triggered by a hashchange event.\n * * *extras* : A `NavigationExtras` options object that controlled the strategy used for this\n * navigation.\n * * *previousNavigation* : The previously successful `Navigation` object. Only one previous\n * navigation is available, therefore this previous `Navigation` object has a `null` value for its\n * own `previousNavigation`.\n *\n * @publicApi\n */\nexport interface Navigation {\n  /**\n   * The unique identifier of the current navigation.\n   */\n  id: number;\n  /**\n   * The target URL passed into the `Router#navigateByUrl()` call before navigation. This is\n   * the value before the router has parsed or applied redirects to it.\n   */\n  initialUrl: UrlTree;\n  /**\n   * The initial target URL after being parsed with `UrlHandlingStrategy.extract()`.\n   */\n  extractedUrl: UrlTree;\n  /**\n   * The extracted URL after redirects have been applied.\n   * This URL may not be available immediately, therefore this property can be `undefined`.\n   * It is guaranteed to be set after the `RoutesRecognized` event fires.\n   */\n  finalUrl?: UrlTree;\n  /**\n   * `UrlTree` to use when updating the browser URL for the navigation when `extras.browserUrl` is\n   * defined.\n   * @internal\n   */\n  readonly targetBrowserUrl?: UrlTree | string;\n  /**\n   * TODO(atscott): If we want to make StateManager public, they will need access to this. Note that\n   * it's already eventually exposed through router.routerState.\n   * @internal\n   */\n  targetRouterState?: RouterState;\n  /**\n   * Identifies how this navigation was triggered.\n   */\n  trigger: NavigationTrigger;\n  /**\n   * Options that controlled the strategy used for this navigation.\n   * See `NavigationExtras`.\n   */\n  extras: NavigationExtras;\n  /**\n   * The previously successful `Navigation` object. Only one previous navigation\n   * is available, therefore this previous `Navigation` object has a `null` value\n   * for its own `previousNavigation`.\n   */\n  previousNavigation: Navigation | null;\n\n  /**\n   * Aborts the navigation if it has not yet been completed or reached the point where routes are being activated.\n   * This function is a no-op if the navigation is beyond the point where it can be aborted.\n   */\n  readonly abort: () => void;\n\n  /** @internal */\n  routesRecognizeHandler: {deferredHandle?: Promise<void>};\n  /** @internal */\n  beforeActivateHandler: {deferredHandle?: Promise<void>};\n}\n\nconst noop = () => {};\n\nexport interface NavigationTransition {\n  id: number;\n  currentUrlTree: UrlTree;\n  extractedUrl: UrlTree;\n  currentRawUrl: UrlTree;\n  urlAfterRedirects?: UrlTree;\n  rawUrl: UrlTree;\n  extras: NavigationExtras;\n  resolve: (value: boolean | PromiseLike<boolean>) => void;\n  reject: (reason?: any) => void;\n  promise: Promise<boolean>;\n  source: NavigationTrigger;\n  restoredState: RestoredState | null;\n  currentSnapshot: RouterStateSnapshot;\n  targetSnapshot: RouterStateSnapshot | null;\n  currentRouterState: RouterState;\n  targetRouterState: RouterState | null;\n  guards: Checks;\n  guardsResult: GuardResult | null;\n\n  routesRecognizeHandler: {deferredHandle?: Promise<void>};\n  beforeActivateHandler: {deferredHandle?: Promise<void>};\n}\n\nexport const NAVIGATION_ERROR_HANDLER = new InjectionToken<\n  (error: NavigationError) => unknown | RedirectCommand\n>(typeof ngDevMode === 'undefined' || ngDevMode ? 'navigation error handler' : '');\n\n@Service()\nexport class NavigationTransitions {\n  // Some G3 targets expect the navigation object to be mutated (and not getting a new reference on changes).\n  currentNavigation = signal<Navigation | null>(null, {equal: () => false});\n\n  currentTransition: NavigationTransition | null = null;\n  lastSuccessfulNavigation = signal<Navigation | null>(null);\n  /**\n   * These events are used to communicate back to the Router about the state of the transition. The\n   * Router wants to respond to these events in various ways. Because the `NavigationTransition`\n   * class is not public, this event subject is not publicly exposed.\n   */\n  readonly events = new Subject<Event | BeforeActivateRoutes | RedirectRequest>();\n  /**\n   * Used to abort the current transition with an error.\n   */\n  readonly transitionAbortWithErrorSubject = new Subject<Error>();\n  private readonly configLoader = inject(RouterConfigLoader);\n  private readonly environmentInjector = inject(EnvironmentInjector);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly urlSerializer = inject(UrlSerializer);\n  private readonly rootContexts = inject(ChildrenOutletContexts);\n  private readonly location = inject(Location);\n  private readonly inputBindingEnabled = inject(INPUT_BINDER, {optional: true}) !== null;\n  private readonly titleStrategy?: TitleStrategy = inject(TitleStrategy);\n  private readonly options = inject(ROUTER_CONFIGURATION, {optional: true}) || {};\n  private readonly paramsInheritanceStrategy =\n    this.options.paramsInheritanceStrategy || DEFAULT_PARAMS_INHERITANCE_STRATEGY;\n  private readonly urlHandlingStrategy = inject(UrlHandlingStrategy);\n  private readonly createViewTransition = inject(CREATE_VIEW_TRANSITION, {optional: true});\n  private readonly navigationErrorHandler = inject(NAVIGATION_ERROR_HANDLER, {optional: true});\n\n  navigationId = 0;\n  get hasRequestedNavigation() {\n    return this.navigationId !== 0;\n  }\n  private transitions?: BehaviorSubject<NavigationTransition | null>;\n  /**\n   * Hook that enables you to pause navigation after the preactivation phase.\n   * Used by `RouterModule`.\n   *\n   * @internal\n   */\n  afterPreactivation: () => Observable<void> = () => of(void 0);\n  /** @internal */\n  rootComponentType: Type<any> | null = null;\n\n  private destroyed = false;\n\n  constructor() {\n    const onLoadStart = (r: Route) => this.events.next(new RouteConfigLoadStart(r));\n    const onLoadEnd = (r: Route) => this.events.next(new RouteConfigLoadEnd(r));\n    this.configLoader.onLoadEndListener = onLoadEnd;\n    this.configLoader.onLoadStartListener = onLoadStart;\n    this.destroyRef.onDestroy(() => {\n      this.destroyed = true;\n    });\n  }\n\n  complete() {\n    this.transitions?.complete();\n  }\n\n  handleNavigationRequest(\n    request: Pick<\n      NavigationTransition,\n      | 'source'\n      | 'restoredState'\n      | 'currentUrlTree'\n      | 'currentRawUrl'\n      | 'rawUrl'\n      | 'extras'\n      | 'resolve'\n      | 'reject'\n      | 'promise'\n      | 'currentSnapshot'\n      | 'currentRouterState'\n    >,\n  ) {\n    const id = ++this.navigationId;\n\n    // Navigation can happen as a side effect of template execution, as such we need to untrack signal updates\n    // (Writing to signals is not allowed while Angular renders the template)\n    // TODO: We might want to reconsider allowing navigation as side effect of template execution.\n    untracked(() => {\n      this.transitions?.next({\n        ...request,\n        extractedUrl: this.urlHandlingStrategy.extract(request.rawUrl),\n        targetSnapshot: null,\n        targetRouterState: null,\n        guards: {canActivateChecks: [], canDeactivateChecks: []},\n        guardsResult: null,\n        id,\n\n        routesRecognizeHandler: {},\n        beforeActivateHandler: {},\n      });\n    });\n  }\n\n  setupNavigations(router: Router): Observable<NavigationTransition> {\n    this.transitions = new BehaviorSubject<NavigationTransition | null>(null);\n    return this.transitions.pipe(\n      filter((t): t is NavigationTransition => t !== null),\n\n      // Using switchMap so we cancel executing navigations when a new one comes in\n      switchMap((overallTransitionState) => {\n        let abortable = true;\n        let completedOrAborted = false;\n        const abortController = new AbortController();\n        const shouldContinueNavigation = () => {\n          return !completedOrAborted && this.currentTransition?.id === overallTransitionState.id;\n        };\n        return of(overallTransitionState).pipe(\n          switchMap((t) => {\n            // It is possible that `switchMap` fails to cancel previous navigations if a new one happens synchronously while the operator\n            // is processing the `next` notification of that previous navigation. This can happen when a new navigation (say 2) cancels a\n            // previous one (1) and yet another navigation (3) happens synchronously in response to the `NavigationCancel` event for (1).\n            // https://github.com/ReactiveX/rxjs/issues/7455\n            if (this.navigationId > overallTransitionState.id) {\n              const cancellationReason =\n                typeof ngDevMode === 'undefined' || ngDevMode\n                  ? `Navigation ID ${overallTransitionState.id} is not equal to the current navigation id ${this.navigationId}`\n                  : '';\n              this.cancelNavigationTransition(\n                overallTransitionState,\n                cancellationReason,\n                NavigationCancellationCode.SupersededByNewNavigation,\n              );\n              return EMPTY;\n            }\n            this.currentTransition = overallTransitionState;\n            const lastSuccessfulNavigation = this.lastSuccessfulNavigation();\n            // Store the Navigation object\n            this.currentNavigation.set({\n              id: t.id,\n              initialUrl: t.rawUrl,\n              extractedUrl: t.extractedUrl,\n              targetBrowserUrl:\n                typeof t.extras.browserUrl === 'string'\n                  ? this.urlSerializer.parse(t.extras.browserUrl)\n                  : t.extras.browserUrl,\n              trigger: t.source,\n              extras: t.extras,\n              previousNavigation: !lastSuccessfulNavigation\n                ? null\n                : {\n                    ...lastSuccessfulNavigation,\n                    previousNavigation: null,\n                  },\n              abort: () => abortController.abort(),\n\n              routesRecognizeHandler: t.routesRecognizeHandler,\n              beforeActivateHandler: t.beforeActivateHandler,\n            });\n            const urlTransition =\n              !router.navigated || this.isUpdatingInternalState() || this.isUpdatedBrowserUrl();\n\n            const onSameUrlNavigation = t.extras.onSameUrlNavigation ?? router.onSameUrlNavigation;\n            if (!urlTransition && onSameUrlNavigation !== 'reload') {\n              const reason =\n                typeof ngDevMode === 'undefined' || ngDevMode\n                  ? `Navigation to ${t.rawUrl} was ignored because it is the same as the current Router URL.`\n                  : '';\n              this.events.next(\n                new NavigationSkipped(\n                  t.id,\n                  this.urlSerializer.serialize(t.rawUrl),\n                  reason,\n                  NavigationSkippedCode.IgnoredSameUrlNavigation,\n                ),\n              );\n              t.resolve(false);\n              return EMPTY;\n            }\n\n            if (this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl)) {\n              return of(t).pipe(\n                // Fire NavigationStart event\n                switchMap((t) => {\n                  this.events.next(\n                    new NavigationStart(\n                      t.id,\n                      this.urlSerializer.serialize(t.extractedUrl),\n                      t.source,\n                      t.restoredState,\n                    ),\n                  );\n                  if (t.id !== this.navigationId) {\n                    return EMPTY;\n                  }\n\n                  // This delay is required to match old behavior that forced\n                  // navigation to always be async\n                  return Promise.resolve(t);\n                }),\n\n                // Recognize\n                recognize(\n                  this.environmentInjector,\n                  this.configLoader,\n                  this.rootComponentType,\n                  router.config,\n                  this.urlSerializer,\n                  this.paramsInheritanceStrategy,\n                  abortController.signal,\n                ),\n\n                // Update URL if in `eager` update mode\n                tap((t) => {\n                  overallTransitionState.targetSnapshot = t.targetSnapshot;\n                  overallTransitionState.urlAfterRedirects = t.urlAfterRedirects;\n                  this.currentNavigation.update((nav) => {\n                    nav!.finalUrl = t.urlAfterRedirects;\n                    return nav;\n                  });\n                  this.events.next(new BeforeRoutesRecognized());\n                }),\n\n                switchMap((value) =>\n                  from(\n                    overallTransitionState.routesRecognizeHandler.deferredHandle ?? of(void 0),\n                  ).pipe(map(() => value)),\n                ),\n\n                tap(() => {\n                  // Fire RoutesRecognized\n                  const routesRecognized = new RoutesRecognized(\n                    t.id,\n                    this.urlSerializer.serialize(t.extractedUrl),\n                    this.urlSerializer.serialize(t.urlAfterRedirects!),\n                    t.targetSnapshot!,\n                  );\n                  this.events.next(routesRecognized);\n                }),\n              );\n            } else if (\n              urlTransition &&\n              this.urlHandlingStrategy.shouldProcessUrl(t.currentRawUrl)\n            ) {\n              /* When the current URL shouldn't be processed, but the previous one\n               * was, we handle this \"error condition\" by navigating to the\n               * previously successful URL, but leaving the URL intact.*/\n              const {id, extractedUrl, source, restoredState, extras} = t;\n              const navStart = new NavigationStart(\n                id,\n                this.urlSerializer.serialize(extractedUrl),\n                source,\n                restoredState,\n              );\n              this.events.next(navStart);\n              const targetSnapshot = createEmptyState(\n                this.rootComponentType,\n                this.environmentInjector,\n              ).snapshot;\n\n              this.currentTransition = overallTransitionState = {\n                ...t,\n                targetSnapshot,\n                urlAfterRedirects: extractedUrl,\n                extras: {...extras, skipLocationChange: false, replaceUrl: false},\n              };\n              this.currentNavigation.update((nav) => {\n                nav!.finalUrl = extractedUrl;\n                return nav;\n              });\n              return of(overallTransitionState);\n            } else {\n              /* When neither the current or previous URL can be processed, do\n               * nothing other than update router's internal reference to the\n               * current \"settled\" URL. This way the next navigation will be coming\n               * from the current URL in the browser.\n               */\n              const reason =\n                typeof ngDevMode === 'undefined' || ngDevMode\n                  ? `Navigation was ignored because the UrlHandlingStrategy` +\n                    ` indicated neither the current URL ${t.currentRawUrl} nor target URL ${t.rawUrl} should be processed.`\n                  : '';\n              this.events.next(\n                new NavigationSkipped(\n                  t.id,\n                  this.urlSerializer.serialize(t.extractedUrl),\n                  reason,\n                  NavigationSkippedCode.IgnoredByUrlHandlingStrategy,\n                ),\n              );\n              t.resolve(false);\n              return EMPTY;\n            }\n          }),\n\n          map((t) => {\n            const guardsStart = new GuardsCheckStart(\n              t.id,\n              this.urlSerializer.serialize(t.extractedUrl),\n              this.urlSerializer.serialize(t.urlAfterRedirects!),\n              t.targetSnapshot!,\n            );\n            this.events.next(guardsStart);\n            // Note we don't have to check shouldContinueNavigation here because we don't do anything\n            // in the remainder of this operator that has side effects. If `checkGuards` is combined into\n            // this operators, we would need to ensure we check shouldContinueNavigation before running the guards.\n\n            this.currentTransition = overallTransitionState = {\n              ...t,\n              guards: getAllRouteGuards(t.targetSnapshot!, t.currentSnapshot, this.rootContexts),\n            };\n            return overallTransitionState;\n          }),\n\n          checkGuards((evt: Event) => this.events.next(evt)),\n\n          switchMap((t) => {\n            overallTransitionState.guardsResult = t.guardsResult;\n            if (t.guardsResult && typeof t.guardsResult !== 'boolean') {\n              throw redirectingNavigationError(this.urlSerializer, t.guardsResult);\n            }\n\n            const guardsEnd = new GuardsCheckEnd(\n              t.id,\n              this.urlSerializer.serialize(t.extractedUrl),\n              this.urlSerializer.serialize(t.urlAfterRedirects!),\n              t.targetSnapshot!,\n              !!t.guardsResult,\n            );\n            this.events.next(guardsEnd);\n            if (!shouldContinueNavigation()) {\n              return EMPTY;\n            }\n            if (!t.guardsResult) {\n              this.cancelNavigationTransition(t, '', NavigationCancellationCode.GuardRejected);\n              return EMPTY;\n            }\n\n            if (t.guards.canActivateChecks.length === 0) {\n              return of(t);\n            }\n\n            const resolveStart = new ResolveStart(\n              t.id,\n              this.urlSerializer.serialize(t.extractedUrl),\n              this.urlSerializer.serialize(t.urlAfterRedirects!),\n              t.targetSnapshot!,\n            );\n            this.events.next(resolveStart);\n            if (!shouldContinueNavigation()) {\n              return EMPTY;\n            }\n\n            let dataResolved = false;\n            return of(t).pipe(\n              resolveData(this.paramsInheritanceStrategy),\n              tap({\n                next: () => {\n                  dataResolved = true;\n                  const resolveEnd = new ResolveEnd(\n                    t.id,\n                    this.urlSerializer.serialize(t.extractedUrl),\n                    this.urlSerializer.serialize(t.urlAfterRedirects!),\n                    t.targetSnapshot!,\n                  );\n                  this.events.next(resolveEnd);\n                },\n                complete: () => {\n                  if (!dataResolved) {\n                    this.cancelNavigationTransition(\n                      t,\n                      typeof ngDevMode === 'undefined' || ngDevMode\n                        ? `At least one route resolver didn't emit any value.`\n                        : '',\n                      NavigationCancellationCode.NoDataFromResolver,\n                    );\n                  }\n                },\n              }),\n            );\n          }),\n\n          // --- LOAD COMPONENTS ---\n          switchTap((t: NavigationTransition) => {\n            const loadComponents = (route: ActivatedRouteSnapshot): Array<Promise<void>> => {\n              const loaders: Array<Promise<void>> = [];\n              if (route.routeConfig?._loadedComponent) {\n                route.component = route.routeConfig?._loadedComponent;\n              } else if (route.routeConfig?.loadComponent) {\n                const injector = route._environmentInjector;\n                loaders.push(\n                  this.configLoader\n                    .loadComponent(injector, route.routeConfig)\n                    .then((loadedComponent) => {\n                      route.component = loadedComponent;\n                    }),\n                );\n              }\n              for (const child of route.children) {\n                loaders.push(...loadComponents(child));\n              }\n              return loaders;\n            };\n            const loaders = loadComponents(t.targetSnapshot!.root);\n            return loaders.length === 0 ? of(t) : from(Promise.all(loaders).then(() => t));\n          }),\n\n          switchMap((t: NavigationTransition) => {\n            const targetRouterState = createRouterState(\n              router.routeReuseStrategy,\n              t.targetSnapshot!,\n              t.currentRouterState,\n            );\n            this.currentTransition = overallTransitionState = t = {...t, targetRouterState};\n            this.currentNavigation.update((nav) => {\n              nav!.targetRouterState = targetRouterState;\n              return nav;\n            });\n            return of(t);\n          }),\n\n          switchTap(() => this.afterPreactivation()),\n\n          // TODO(atscott): Move this into the last block below.\n          switchMap(() => {\n            const {currentSnapshot, targetSnapshot} = overallTransitionState;\n            const viewTransitionStarted = this.createViewTransition?.(\n              this.environmentInjector,\n              currentSnapshot.root,\n              targetSnapshot!.root,\n            );\n\n            // If view transitions are enabled, block the navigation until the view\n            // transition callback starts. Otherwise, continue immediately.\n            return viewTransitionStarted\n              ? from(viewTransitionStarted).pipe(map(() => overallTransitionState))\n              : of(overallTransitionState);\n          }),\n\n          // Ensure that if some observable used to drive the transition doesn't\n          // complete, the navigation still finalizes This should never happen, but\n          // this is done as a safety measure to avoid surfacing this error (#49567).\n          take(1),\n\n          switchMap((t: NavigationTransition) => {\n            abortable = false;\n            this.events.next(new BeforeActivateRoutes());\n            const deferred = overallTransitionState.beforeActivateHandler.deferredHandle;\n            return deferred ? from(deferred.then(() => t)) : of(t);\n          }),\n\n          tap((t: NavigationTransition) => {\n            new ActivateRoutes(\n              router.routeReuseStrategy,\n              overallTransitionState.targetRouterState!,\n              overallTransitionState.currentRouterState,\n              (evt: Event) => this.events.next(evt),\n              this.inputBindingEnabled,\n            ).activate(this.rootContexts);\n\n            if (!shouldContinueNavigation()) {\n              return;\n            }\n\n            completedOrAborted = true;\n            this.currentNavigation.update((nav) => {\n              (nav as Writable<Navigation>).abort = noop;\n              return nav;\n            });\n            this.lastSuccessfulNavigation.set(untracked(this.currentNavigation));\n            this.events.next(\n              new NavigationEnd(\n                t.id,\n                this.urlSerializer.serialize(t.extractedUrl),\n                this.urlSerializer.serialize(t.urlAfterRedirects!),\n              ),\n            );\n            this.titleStrategy?.updateTitle(t.targetRouterState!.snapshot);\n            t.resolve(true);\n          }),\n\n          takeUntil(\n            abortSignalToObservable(abortController.signal).pipe(\n              // Ignore aborts if we are already completed, canceled, or are in the activation stage (we have targetRouterState)\n              filter(() => !completedOrAborted && abortable),\n              tap(() => {\n                this.cancelNavigationTransition(\n                  overallTransitionState,\n                  abortController.signal.reason + '',\n                  NavigationCancellationCode.Aborted,\n                );\n              }),\n            ),\n          ),\n\n          tap({\n            complete: () => {\n              completedOrAborted = true;\n            },\n          }),\n\n          // There used to be a lot more logic happening directly within the\n          // transition Observable. Some of this logic has been refactored out to\n          // other places but there may still be errors that happen there. This gives\n          // us a way to cancel the transition from the outside. This may also be\n          // required in the future to support something like the abort signal of the\n          // Navigation API where the navigation gets aborted from outside the\n          // transition.\n          takeUntil(\n            this.transitionAbortWithErrorSubject.pipe(\n              tap((err) => {\n                throw err;\n              }),\n            ),\n          ),\n\n          finalize(() => {\n            abortController.abort();\n            /* When the navigation stream finishes either through error or success,\n             * we set the `completed` or `errored` flag. However, there are some\n             * situations where we could get here without either of those being set.\n             * For instance, a redirect during NavigationStart. Therefore, this is a\n             * catch-all to make sure the NavigationCancel event is fired when a\n             * navigation gets cancelled but not caught by other means. */\n            if (!completedOrAborted) {\n              const cancelationReason =\n                typeof ngDevMode === 'undefined' || ngDevMode\n                  ? `Navigation ID ${overallTransitionState.id} is not equal to the current navigation id ${this.navigationId}`\n                  : '';\n              this.cancelNavigationTransition(\n                overallTransitionState,\n                cancelationReason,\n                NavigationCancellationCode.SupersededByNewNavigation,\n              );\n            }\n            // Only clear current navigation if it is still set to the one that\n            // finalized.\n            if (this.currentTransition?.id === overallTransitionState.id) {\n              this.currentNavigation.set(null);\n              this.currentTransition = null;\n            }\n          }),\n          catchError((e) => {\n            completedOrAborted = true;\n            // If the application is already destroyed, the catch block should not\n            // execute anything in practice because other resources have already\n            // been released and destroyed.\n            if (this.destroyed) {\n              overallTransitionState.resolve(false);\n              return EMPTY;\n            }\n\n            /* This error type is issued during Redirect, and is handled as a\n             * cancellation rather than an error. */\n            if (isNavigationCancelingError(e)) {\n              this.events.next(\n                new NavigationCancel(\n                  overallTransitionState.id,\n                  this.urlSerializer.serialize(overallTransitionState.extractedUrl),\n                  e.message,\n                  e.cancellationCode,\n                ),\n              );\n\n              // When redirecting, we need to delay resolving the navigation\n              // promise and push it to the redirect navigation\n              if (!isRedirectingNavigationCancelingError(e)) {\n                overallTransitionState.resolve(false);\n              } else {\n                this.events.next(new RedirectRequest(e.url, e.navigationBehaviorOptions));\n              }\n\n              /* All other errors should reset to the router's internal URL reference\n               * to the pre-error state. */\n            } else {\n              const navigationError = new NavigationError(\n                overallTransitionState.id,\n                this.urlSerializer.serialize(overallTransitionState.extractedUrl),\n                e,\n                overallTransitionState.targetSnapshot ?? undefined,\n              );\n\n              try {\n                const navigationErrorHandlerResult = runInInjectionContext(\n                  this.environmentInjector,\n                  () => this.navigationErrorHandler?.(navigationError),\n                );\n\n                if (navigationErrorHandlerResult instanceof RedirectCommand) {\n                  const {message, cancellationCode} = redirectingNavigationError(\n                    this.urlSerializer,\n                    navigationErrorHandlerResult,\n                  );\n                  this.events.next(\n                    new NavigationCancel(\n                      overallTransitionState.id,\n                      this.urlSerializer.serialize(overallTransitionState.extractedUrl),\n                      message,\n                      cancellationCode,\n                    ),\n                  );\n                  this.events.next(\n                    new RedirectRequest(\n                      navigationErrorHandlerResult.redirectTo,\n                      navigationErrorHandlerResult.navigationBehaviorOptions,\n                    ),\n                  );\n                } else {\n                  this.events.next(navigationError);\n                  throw e;\n                }\n              } catch (ee) {\n                // TODO(atscott): consider flipping the default behavior of\n                // resolveNavigationPromiseOnError to be `resolve(false)` when\n                // undefined. This is the most sane thing to do given that\n                // applications very rarely handle the promise rejection and, as a\n                // result, would get \"unhandled promise rejection\" console logs.\n                // The vast majority of applications would not be affected by this\n                // change so omitting a migration seems reasonable. Instead,\n                // applications that rely on rejection can specifically opt-in to the\n                // old behavior.\n                if (this.options.resolveNavigationPromiseOnError) {\n                  overallTransitionState.resolve(false);\n                } else {\n                  overallTransitionState.reject(ee);\n                }\n              }\n            }\n\n            return EMPTY;\n          }),\n        );\n        // casting because `pipe` returns observable({}) when called with 8+ arguments\n      }),\n    ) as Observable<NavigationTransition>;\n  }\n\n  private cancelNavigationTransition(\n    t: NavigationTransition,\n    reason: string,\n    code: NavigationCancellationCode,\n  ) {\n    const navCancel = new NavigationCancel(\n      t.id,\n      this.urlSerializer.serialize(t.extractedUrl),\n      reason,\n      code,\n    );\n    this.events.next(navCancel);\n    t.resolve(false);\n  }\n\n  /**\n   * @returns Whether we're navigating to somewhere that is not what the Router is\n   * currently set to.\n   */\n  private isUpdatingInternalState() {\n    // TODO(atscott): The serializer should likely be used instead of\n    // `UrlTree.toString()`. Custom serializers are often written to handle\n    // things better than the default one (objects, for example will be\n    // [Object object] with the custom serializer and be \"the same\" when they\n    // aren't).\n    // (Same for isUpdatedBrowserUrl)\n    return (\n      this.currentTransition?.extractedUrl.toString() !==\n      this.currentTransition?.currentUrlTree.toString()\n    );\n  }\n\n  /**\n   * @returns Whether we're updating the browser URL to something new (navigation is going\n   * to somewhere not displayed in the URL bar and we will update the URL\n   * bar if navigation succeeds).\n   */\n  private isUpdatedBrowserUrl() {\n    // The extracted URL is the part of the URL that this application cares about. `extract` may\n    // return only part of the browser URL and that part may have not changed even if some other\n    // portion of the URL did.\n    const currentBrowserUrl = this.urlHandlingStrategy.extract(\n      this.urlSerializer.parse(this.location.path(true)),\n    );\n\n    const currentNavigation = untracked(this.currentNavigation);\n    const targetBrowserUrl = currentNavigation?.targetBrowserUrl ?? currentNavigation?.extractedUrl;\n    return (\n      currentBrowserUrl.toString() !== targetBrowserUrl?.toString() &&\n      !currentNavigation?.extras.skipLocationChange\n    );\n  }\n}\n\nexport function isBrowserTriggeredNavigation(source: NavigationTrigger) {\n  return source !== IMPERATIVE_NAVIGATION;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\nimport {Route, Routes} from './models';\nimport {\n  DetachedRouteHandleInternal,\n  ExperimentalRouteReuseStrategy,\n  RouteReuseStrategy,\n} from './route_reuse_strategy';\nimport {ActivatedRouteSnapshot, RouterState} from './router_state';\n\n/**\n * @description\n *\n * Cleans up `EnvironmentInjector`s assigned to `Route`s that are no longer in use.\n */\nexport const ROUTE_INJECTOR_CLEANUP = new InjectionToken<typeof routeInjectorCleanup>(\n  typeof ngDevMode === 'undefined' || ngDevMode ? 'RouteInjectorCleanup' : '',\n);\n\nexport function routeInjectorCleanup(\n  routeReuseStrategy: RouteReuseStrategy,\n  routerState: RouterState,\n  config: Routes,\n) {\n  const activeRoutes = new Set<Route>();\n  // Collect all active routes from the current state tree\n  if (routerState.snapshot.root) {\n    collectDescendants(routerState.snapshot.root, activeRoutes);\n  }\n\n  // For stored routes, collect them and all their parents by iterating pathFromRoot.\n  const storedHandles =\n    (routeReuseStrategy as ExperimentalRouteReuseStrategy).retrieveStoredRouteHandles?.() || [];\n  for (const handle of storedHandles) {\n    const internalHandle = handle as DetachedRouteHandleInternal;\n    if (internalHandle?.route?.value?.snapshot) {\n      for (const snapshot of internalHandle.route.value.snapshot.pathFromRoot) {\n        if (snapshot.routeConfig) {\n          activeRoutes.add(snapshot.routeConfig);\n        }\n      }\n    }\n  }\n\n  destroyUnusedInjectors(config, activeRoutes, routeReuseStrategy, false);\n}\n\nfunction collectDescendants(snapshot: ActivatedRouteSnapshot, activeRoutes: Set<Route>) {\n  if (snapshot.routeConfig) {\n    activeRoutes.add(snapshot.routeConfig);\n  }\n\n  for (const child of snapshot.children) {\n    collectDescendants(child, activeRoutes);\n  }\n}\n\nfunction destroyUnusedInjectors(\n  routes: Routes,\n  activeRoutes: Set<Route>,\n  strategy: RouteReuseStrategy,\n  inheritedForceDestroy: boolean,\n) {\n  for (const route of routes) {\n    const shouldDestroyCurrentRoute =\n      inheritedForceDestroy ||\n      !!(\n        (route._injector || route._loadedInjector) &&\n        !activeRoutes.has(route) &&\n        ((strategy as ExperimentalRouteReuseStrategy).shouldDestroyInjector?.(route) ?? false)\n      );\n\n    if (route.children) {\n      destroyUnusedInjectors(route.children, activeRoutes, strategy, shouldDestroyCurrentRoute);\n    }\n    if (route.loadChildren && route._loadedRoutes) {\n      destroyUnusedInjectors(\n        route._loadedRoutes,\n        activeRoutes,\n        strategy,\n        shouldDestroyCurrentRoute,\n      );\n    }\n\n    if (shouldDestroyCurrentRoute) {\n      if (route._injector) {\n        route._injector.destroy();\n        route._injector = undefined;\n      }\n      if (route._loadedInjector) {\n        route._loadedInjector.destroy();\n        route._loadedInjector = undefined;\n      }\n    }\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentRef, inject, Service} from '@angular/core';\n\nimport {Route} from './models';\nimport {OutletContext} from './router_outlet_context';\nimport {ActivatedRoute, ActivatedRouteSnapshot} from './router_state';\nimport {TreeNode} from './utils/tree';\n\n/**\n * @description\n *\n * Represents the detached route tree.\n *\n * This is an opaque value the router will give to a custom route reuse strategy\n * to store and retrieve later on.\n *\n * @publicApi\n */\nexport type DetachedRouteHandle = {};\n\n/** @internal */\nexport type DetachedRouteHandleInternal = {\n  contexts: Map<string, OutletContext>;\n  componentRef: ComponentRef<any>;\n  route: TreeNode<ActivatedRoute>;\n};\n\n/**\n * @description\n *\n * Destroys the component associated with a `DetachedRouteHandle`.\n *\n * This function should be used when a `RouteReuseStrategy` decides to drop a stored handle\n * and wants to ensure that the component is destroyed.\n *\n * @param handle The detached route handle to destroy.\n *\n * @publicApi\n * @see [Manually destroying detached route handles](guide/routing/customizing-route-behavior#manually-destroying-detached-route-handles)\n */\nexport function destroyDetachedRouteHandle(handle: DetachedRouteHandle): void {\n  const internalHandle = handle as DetachedRouteHandleInternal;\n  if (internalHandle && internalHandle.componentRef) {\n    internalHandle.componentRef.destroy();\n  }\n}\n\nexport interface ExperimentalRouteReuseStrategy {\n  shouldDestroyInjector?(route: Route): boolean;\n  retrieveStoredRouteHandles?(): Array<DetachedRouteHandleInternal>;\n}\n\n/**\n * @description\n *\n * Provides a way to customize when activated routes get reused.\n *\n * @publicApi\n */\n@Service({factory: () => inject(DefaultRouteReuseStrategy)})\nexport abstract class RouteReuseStrategy {\n  /** Determines if this route (and its subtree) should be detached to be reused later */\n  abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;\n\n  /**\n   * Stores the detached route.\n   *\n   * Storing a `null` value should erase the previously stored value.\n   */\n  abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;\n\n  /** Determines if this route (and its subtree) should be reattached */\n  abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;\n\n  /** Retrieves the previously stored route */\n  abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;\n\n  /** Determines if a route should be reused */\n  abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;\n}\n\n/**\n * @description\n *\n * This base route reuse strategy only reuses routes when the matched router configs are\n * identical. This prevents components from being destroyed and recreated\n * when just the route parameters, query parameters or fragment change\n * (that is, the existing component is _reused_).\n *\n * This strategy does not store any routes for later reuse.\n *\n * Angular uses this strategy by default.\n *\n *\n * It can be used as a base class for custom route reuse strategies, i.e. you can create your own\n * class that extends the `BaseRouteReuseStrategy` one.\n * @publicApi\n */\nexport abstract class BaseRouteReuseStrategy implements RouteReuseStrategy {\n  /**\n   * Whether the given route should detach for later reuse.\n   * Always returns false for `BaseRouteReuseStrategy`.\n   * */\n  shouldDetach(route: ActivatedRouteSnapshot): boolean {\n    return false;\n  }\n\n  /**\n   * A no-op; the route is never stored since this strategy never detaches routes for later re-use.\n   */\n  store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void {}\n\n  /** Returns `false`, meaning the route (and its subtree) is never reattached */\n  shouldAttach(route: ActivatedRouteSnapshot): boolean {\n    return false;\n  }\n\n  /** Returns `null` because this strategy does not store routes for later re-use. */\n  retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null {\n    return null;\n  }\n\n  /**\n   * Determines if a route should be reused.\n   * This strategy returns `true` when the future route config and current route config are\n   * identical.\n   */\n  shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {\n    return future.routeConfig === curr.routeConfig;\n  }\n\n  /**\n   * Determines if the injector for the given route should be destroyed.\n   *\n   * This method is called by the router when the `RouteReuseStrategy` is destroyed.\n   * If this method returns `true`, the router will destroy the injector for the given route.\n   *\n   * @see {@link withExperimentalAutoCleanupInjectors}\n   * @xperimental 21.1\n   */\n  shouldDestroyInjector(route: Route): boolean {\n    return true;\n  }\n}\n\n@Service()\nexport class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {EnvironmentInjector, inject, Service} from '@angular/core';\nimport {SubscriptionLike} from 'rxjs';\n\nimport {\n  BeforeActivateRoutes,\n  Event,\n  isRedirectingEvent,\n  NavigationCancel,\n  NavigationEnd,\n  NavigationError,\n  NavigationSkipped,\n  NavigationStart,\n  NavigationTrigger,\n  PrivateRouterEvents,\n  RoutesRecognized,\n} from '../events';\nimport {Navigation, NavigationExtras, RestoredState} from '../navigation_transition';\nimport {ROUTER_CONFIGURATION} from '../router_config';\nimport {createEmptyState, RouterState} from '../router_state';\nimport {UrlHandlingStrategy} from '../url_handling_strategy';\nimport {UrlSerializer, UrlTree} from '../url_tree';\n\n@Service({factory: () => inject(HistoryStateManager)})\nexport abstract class StateManager {\n  protected readonly urlSerializer = inject(UrlSerializer);\n  private readonly options = inject(ROUTER_CONFIGURATION, {optional: true}) || {};\n  protected readonly canceledNavigationResolution =\n    this.options.canceledNavigationResolution || 'replace';\n  protected location = inject(Location);\n  protected urlHandlingStrategy = inject(UrlHandlingStrategy);\n  protected urlUpdateStrategy = this.options.urlUpdateStrategy || 'deferred';\n\n  protected currentUrlTree = new UrlTree();\n  /**\n   * Returns the currently activated `UrlTree`.\n   *\n   * This `UrlTree` shows only URLs that the `Router` is configured to handle (through\n   * `UrlHandlingStrategy`).\n   *\n   * The value is set after finding the route config tree to activate but before activating the\n   * route.\n   */\n  getCurrentUrlTree(): UrlTree {\n    return this.currentUrlTree;\n  }\n\n  protected rawUrlTree = this.currentUrlTree;\n  /**\n   * Returns a `UrlTree` that is represents what the browser is actually showing.\n   *\n   * In the life of a navigation transition:\n   * 1. When a navigation begins, the raw `UrlTree` is updated to the full URL that's being\n   * navigated to.\n   * 2. During a navigation, redirects are applied, which might only apply to _part_ of the URL (due\n   * to `UrlHandlingStrategy`).\n   * 3. Just before activation, the raw `UrlTree` is updated to include the redirects on top of the\n   * original raw URL.\n   *\n   * Note that this is _only_ here to support `UrlHandlingStrategy.extract` and\n   * `UrlHandlingStrategy.shouldProcessUrl`. Without those APIs, the current `UrlTree` would not\n   * deviated from the raw `UrlTree`.\n   *\n   * For `extract`, a raw `UrlTree` is needed because `extract` may only return part\n   * of the navigation URL. Thus, the current `UrlTree` may only represent _part_ of the browser\n   * URL. When a navigation gets cancelled and the router needs to reset the URL or a new navigation\n   * occurs, it needs to know the _whole_ browser URL, not just the part handled by\n   * `UrlHandlingStrategy`.\n   * For `shouldProcessUrl`, when the return is `false`, the router ignores the navigation but\n   * still updates the raw `UrlTree` with the assumption that the navigation was caused by the\n   * location change listener due to a URL update by the AngularJS router. In this case, the router\n   * still need to know what the browser's URL is for future navigations.\n   */\n  getRawUrlTree(): UrlTree {\n    return this.rawUrlTree;\n  }\n\n  protected createBrowserPath({finalUrl, initialUrl, targetBrowserUrl}: Navigation): string {\n    const rawUrl =\n      finalUrl !== undefined ? this.urlHandlingStrategy.merge(finalUrl!, initialUrl) : initialUrl;\n    const url = targetBrowserUrl ?? rawUrl;\n    const path = url instanceof UrlTree ? this.urlSerializer.serialize(url) : url;\n    return path;\n  }\n\n  protected routerUrlState(navigation?: Navigation): {\n    ɵrouterUrl?: string;\n  } {\n    if (navigation?.targetBrowserUrl === undefined || navigation?.finalUrl === undefined) {\n      return {};\n    }\n    return {ɵrouterUrl: this.urlSerializer.serialize(navigation.finalUrl)};\n  }\n\n  protected commitTransition({targetRouterState, finalUrl, initialUrl}: Navigation): void {\n    // If we are committing the transition after having a final URL and target state, we're updating\n    // all pieces of the state. Otherwise, we likely skipped the transition (due to URL handling strategy)\n    // and only want to update the rawUrlTree, which represents the browser URL (and doesn't necessarily match router state).\n    if (finalUrl && targetRouterState) {\n      this.currentUrlTree = finalUrl;\n      this.rawUrlTree = this.urlHandlingStrategy.merge(finalUrl, initialUrl);\n      this.routerState = targetRouterState;\n    } else {\n      this.rawUrlTree = initialUrl;\n    }\n  }\n\n  protected routerState = createEmptyState(null, inject(EnvironmentInjector));\n\n  /** Returns the current RouterState. */\n  getRouterState(): RouterState {\n    return this.routerState;\n  }\n\n  private _stateMemento = this.createStateMemento();\n  get stateMemento() {\n    return this._stateMemento;\n  }\n\n  protected updateStateMemento(): void {\n    this._stateMemento = this.createStateMemento();\n  }\n\n  private createStateMemento() {\n    return {\n      rawUrlTree: this.rawUrlTree,\n      currentUrlTree: this.currentUrlTree,\n      routerState: this.routerState,\n    };\n  }\n\n  /** Returns the current state stored by the browser for the current history entry. */\n  restoredState(): RestoredState | null | undefined {\n    return this.location.getState() as RestoredState | null | undefined;\n  }\n\n  /**\n   * Registers a listener that is called whenever the current history entry changes by some API\n   * outside the Router. This includes user-activated changes like back buttons and link clicks, but\n   * also includes programmatic APIs called by non-Router JavaScript.\n   */\n  abstract registerNonRouterCurrentEntryChangeListener(\n    listener: (\n      url: string,\n      state: RestoredState | null | undefined,\n      trigger: NavigationTrigger,\n      extras: NavigationExtras,\n    ) => void,\n  ): SubscriptionLike;\n\n  /**\n   * Handles a navigation event sent from the Router. These are typically events that indicate a\n   * navigation has started, progressed, been cancelled, or finished.\n   */\n  abstract handleRouterEvent(e: Event | PrivateRouterEvents, currentTransition: Navigation): void;\n}\n\n@Service()\nexport class HistoryStateManager extends StateManager {\n  /**\n   * The id of the currently active page in the router.\n   * Updated to the transition's target id on a successful navigation.\n   *\n   * This is used to track what page the router last activated. When an attempted navigation fails,\n   * the router can then use this to compute how to restore the state back to the previously active\n   * page.\n   */\n  private currentPageId: number = 0;\n  private lastSuccessfulId: number = -1;\n\n  /**\n   * The ɵrouterPageId of whatever page is currently active in the browser history. This is\n   * important for computing the target page id for new navigations because we need to ensure each\n   * page id in the browser history is 1 more than the previous entry.\n   */\n  private get browserPageId(): number {\n    if (this.canceledNavigationResolution !== 'computed') {\n      return this.currentPageId;\n    }\n    return this.restoredState()?.ɵrouterPageId ?? this.currentPageId;\n  }\n\n  override registerNonRouterCurrentEntryChangeListener(\n    listener: (\n      url: string,\n      state: RestoredState | null | undefined,\n      trigger: NavigationTrigger,\n      extras: NavigationExtras,\n    ) => void,\n  ): SubscriptionLike {\n    return this.location.subscribe((event) => {\n      if (event['type'] === 'popstate') {\n        // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS\n        // hybrid apps.\n        setTimeout(() => {\n          listener(event['url']!, event.state as RestoredState | null | undefined, 'popstate', {\n            replaceUrl: true,\n          });\n        });\n      }\n    });\n  }\n\n  override handleRouterEvent(e: Event | PrivateRouterEvents, currentTransition: Navigation): void {\n    if (e instanceof NavigationStart) {\n      this.updateStateMemento();\n    } else if (e instanceof NavigationSkipped) {\n      this.commitTransition(currentTransition);\n    } else if (e instanceof RoutesRecognized) {\n      if (this.urlUpdateStrategy === 'eager') {\n        if (!currentTransition.extras.skipLocationChange) {\n          this.setBrowserUrl(this.createBrowserPath(currentTransition), currentTransition);\n        }\n      }\n    } else if (e instanceof BeforeActivateRoutes) {\n      this.commitTransition(currentTransition);\n      if (this.urlUpdateStrategy === 'deferred' && !currentTransition.extras.skipLocationChange) {\n        this.setBrowserUrl(this.createBrowserPath(currentTransition), currentTransition);\n      }\n    } else if (e instanceof NavigationCancel && !isRedirectingEvent(e)) {\n      this.restoreHistory(currentTransition);\n    } else if (e instanceof NavigationError) {\n      this.restoreHistory(currentTransition, true);\n    } else if (e instanceof NavigationEnd) {\n      this.lastSuccessfulId = e.id;\n      this.currentPageId = this.browserPageId;\n    }\n  }\n\n  private setBrowserUrl(path: string, navigation: Navigation) {\n    const {extras, id} = navigation;\n    const {replaceUrl, state} = extras;\n\n    if (this.location.isCurrentPathEqualTo(path) || !!replaceUrl) {\n      // replacements do not update the target page\n      const currentBrowserPageId = this.browserPageId;\n      const newState = {\n        ...state,\n        ...this.generateNgRouterState(id, currentBrowserPageId, navigation),\n      };\n      this.location.replaceState(path, '', newState);\n    } else {\n      const newState = {\n        ...state,\n        ...this.generateNgRouterState(id, this.browserPageId + 1, navigation),\n      };\n      this.location.go(path, '', newState);\n    }\n  }\n\n  /**\n   * Performs the necessary rollback action to restore the browser URL to the\n   * state before the transition.\n   */\n  private restoreHistory(navigation: Navigation, restoringFromCaughtError = false) {\n    if (this.canceledNavigationResolution === 'computed') {\n      const currentBrowserPageId = this.browserPageId;\n      const targetPagePosition = this.currentPageId - currentBrowserPageId;\n      if (targetPagePosition !== 0) {\n        this.location.historyGo(targetPagePosition);\n      } else if (this.getCurrentUrlTree() === navigation.finalUrl && targetPagePosition === 0) {\n        // We got to the activation stage (where currentUrlTree is set to the navigation's\n        // finalUrl), but we weren't moving anywhere in history (skipLocationChange or replaceUrl).\n        // We still need to reset the router state back to what it was when the navigation started.\n        this.resetInternalState(navigation);\n        this.resetUrlToCurrentUrlTree();\n      } else {\n        // The browser URL and router state was not updated before the navigation cancelled so\n        // there's no restoration needed.\n      }\n    } else if (this.canceledNavigationResolution === 'replace') {\n      // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op\n      // for `deferred` navigations that haven't change the internal state yet because guards\n      // reject. For 'eager' navigations, it seems like we also really should reset the state\n      // because the navigation was cancelled. Investigate if this can be done by running TGP.\n      if (restoringFromCaughtError) {\n        this.resetInternalState(navigation);\n      }\n      this.resetUrlToCurrentUrlTree();\n    }\n  }\n\n  private resetInternalState({finalUrl}: Navigation): void {\n    this.routerState = this.stateMemento.routerState;\n    this.currentUrlTree = this.stateMemento.currentUrlTree;\n    // Note here that we use the urlHandlingStrategy to get the reset `rawUrlTree` because it may be\n    // configured to handle only part of the navigation URL. This means we would only want to reset\n    // the part of the navigation handled by the Angular router rather than the whole URL. In\n    // addition, the URLHandlingStrategy may be configured to specifically preserve parts of the URL\n    // when merging, such as the query params so they are not lost on a refresh.\n    this.rawUrlTree = this.urlHandlingStrategy.merge(\n      this.currentUrlTree,\n      finalUrl ?? this.rawUrlTree,\n    );\n  }\n\n  private resetUrlToCurrentUrlTree(): void {\n    this.location.replaceState(\n      this.urlSerializer.serialize(this.getRawUrlTree()),\n      '',\n      this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId),\n    );\n  }\n\n  private generateNgRouterState(\n    navigationId: number,\n    routerPageId: number,\n    navigation?: Navigation,\n  ) {\n    if (this.canceledNavigationResolution === 'computed') {\n      return {navigationId, ɵrouterPageId: routerPageId, ...this.routerUrlState(navigation)};\n    }\n\n    return {navigationId, ...this.routerUrlState(navigation)};\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Observable} from 'rxjs';\nimport {filter, map, take} from 'rxjs/operators';\n\nimport {\n  Event,\n  NavigationCancel,\n  NavigationCancellationCode,\n  NavigationEnd,\n  NavigationError,\n  NavigationSkipped,\n} from '../events';\n\nconst enum NavigationResult {\n  COMPLETE,\n  FAILED,\n  REDIRECTING,\n}\n\n/**\n * Performs the given action once the router finishes its next/current navigation.\n *\n * The navigation is considered complete under the following conditions:\n * - `NavigationCancel` event emits and the code is not `NavigationCancellationCode.Redirect` or\n * `NavigationCancellationCode.SupersededByNewNavigation`. In these cases, the\n * redirecting/superseding navigation must finish.\n * - `NavigationError`, `NavigationEnd`, or `NavigationSkipped` event emits\n */\nexport function afterNextNavigation(router: {events: Observable<Event>}, action: () => void): void {\n  router.events\n    .pipe(\n      filter(\n        (e): e is NavigationEnd | NavigationCancel | NavigationError | NavigationSkipped =>\n          e instanceof NavigationEnd ||\n          e instanceof NavigationCancel ||\n          e instanceof NavigationError ||\n          e instanceof NavigationSkipped,\n      ),\n      map((e) => {\n        if (e instanceof NavigationEnd || e instanceof NavigationSkipped) {\n          return NavigationResult.COMPLETE;\n        }\n        const redirecting =\n          e instanceof NavigationCancel\n            ? e.code === NavigationCancellationCode.Redirect ||\n              e.code === NavigationCancellationCode.SupersededByNewNavigation\n            : false;\n        return redirecting ? NavigationResult.REDIRECTING : NavigationResult.FAILED;\n      }),\n      filter(\n        (result): result is NavigationResult.COMPLETE | NavigationResult.FAILED =>\n          result !== NavigationResult.REDIRECTING,\n      ),\n      take(1),\n    )\n    .subscribe(() => {\n      action();\n    });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {\n  ɵConsole as Console,\n  EnvironmentInjector,\n  ɵformatRuntimeError as formatRuntimeError,\n  inject,\n  ɵPendingTasksInternal as PendingTasks,\n  ɵRuntimeError as RuntimeError,\n  Service,\n  Signal,\n  Type,\n  untracked,\n  ɵINTERNAL_APPLICATION_ERROR_HANDLER,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, SubscriptionLike} from 'rxjs';\n\nimport {standardizeConfig} from './components/empty_outlet';\nimport {createSegmentGroupFromRoute, createUrlTreeFromSegmentGroup} from './create_url_tree';\nimport {INPUT_BINDER} from './directives/router_outlet';\nimport {RuntimeErrorCode} from './errors';\n\nimport {\n  Event,\n  IMPERATIVE_NAVIGATION,\n  isPublicRouterEvent,\n  NavigationCancel,\n  NavigationCancellationCode,\n  NavigationEnd,\n  NavigationTrigger,\n  RedirectRequest,\n} from './events';\n\nimport {NavigationBehaviorOptions, OnSameUrlNavigation, Routes} from './models';\nimport {\n  isBrowserTriggeredNavigation,\n  Navigation,\n  NavigationExtras,\n  NavigationTransitions,\n  RestoredState,\n  UrlCreationOptions,\n} from './navigation_transition';\nimport {ROUTE_INJECTOR_CLEANUP} from './route_injector_cleanup';\n\nimport {RouteReuseStrategy} from './route_reuse_strategy';\n\nimport {ROUTER_CONFIGURATION} from './router_config';\nimport {ROUTES} from './router_config_loader';\nimport {RouterState} from './router_state';\nimport {Params} from './shared';\nimport {StateManager} from './statemanager/state_manager';\nimport {UrlHandlingStrategy} from './url_handling_strategy';\nimport {\n  containsTree,\n  exactMatchOptions,\n  IsActiveMatchOptions,\n  isUrlTree,\n  subsetMatchOptions,\n  UrlSegmentGroup,\n  UrlSerializer,\n  UrlTree,\n} from './url_tree';\nimport {validateConfig} from './utils/config';\nimport {afterNextNavigation} from './utils/navigations';\n\n/**\n * @description\n *\n * A service that facilitates navigation among views and URL manipulation capabilities.\n * This service is provided in the root scope and configured with [provideRouter](api/router/provideRouter).\n *\n * @see {@link Route}\n * @see {@link provideRouter}\n * @see [Routing and Navigation Guide](guide/routing/common-router-tasks).\n *\n * @ngModule RouterModule\n *\n * @publicApi\n */\n@Service()\nexport class Router {\n  private get currentUrlTree() {\n    return this.stateManager.getCurrentUrlTree();\n  }\n  private get rawUrlTree() {\n    return this.stateManager.getRawUrlTree();\n  }\n  private disposed = false;\n  private nonRouterCurrentEntryChangeSubscription?: SubscriptionLike;\n\n  private readonly console = inject(Console);\n  private readonly stateManager = inject(StateManager);\n  private readonly options = inject(ROUTER_CONFIGURATION, {optional: true}) || {};\n  private readonly pendingTasks = inject(PendingTasks);\n  private readonly urlUpdateStrategy = this.options.urlUpdateStrategy || 'deferred';\n  private readonly navigationTransitions = inject(NavigationTransitions);\n  private readonly urlSerializer = inject(UrlSerializer);\n  private readonly location = inject(Location);\n  private readonly urlHandlingStrategy = inject(UrlHandlingStrategy);\n  private readonly injector = inject(EnvironmentInjector);\n\n  /**\n   * The private `Subject` type for the public events exposed in the getter. This is used internally\n   * to push events to. The separate field allows us to expose separate types in the public API\n   * (i.e., an Observable rather than the Subject).\n   */\n  private _events = new Subject<Event>();\n  /**\n   * An event stream for routing events.\n   */\n  public get events(): Observable<Event> {\n    // TODO(atscott): This _should_ be events.asObservable(). However, this change requires internal\n    // cleanup: tests are doing `(route.events as Subject<Event>).next(...)`. This isn't\n    // allowed/supported but we still have to fix these or file bugs against the teams before making\n    // the change.\n    return this._events;\n  }\n  /**\n   * The current state of routing in this NgModule.\n   */\n  get routerState(): RouterState {\n    return this.stateManager.getRouterState();\n  }\n\n  /**\n   * True if at least one navigation event has occurred,\n   * false otherwise.\n   */\n  navigated: boolean = false;\n\n  /**\n   * A strategy for re-using routes.\n   *\n   * @deprecated Configure using `providers` instead:\n   *   `{provide: RouteReuseStrategy, useClass: MyStrategy}`.\n   */\n  routeReuseStrategy: RouteReuseStrategy = inject(RouteReuseStrategy);\n\n  /** @internal */\n  readonly injectorCleanup = inject(ROUTE_INJECTOR_CLEANUP, {optional: true});\n\n  // TODO: Consider exposing releaseUnusedRouteInjectors as a public API\n\n  /**\n   * How to handle a navigation request to the current URL.\n   *\n   *\n   * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.\n   * @see {@link withRouterConfig}\n   * @see {@link provideRouter}\n   * @see {@link RouterModule}\n   */\n  onSameUrlNavigation: OnSameUrlNavigation = this.options.onSameUrlNavigation || 'ignore';\n\n  config: Routes = inject(ROUTES, {optional: true})?.flat() ?? [];\n\n  /**\n   * Indicates whether the application has opted in to binding Router data to component inputs.\n   *\n   * This option is enabled by the `withComponentInputBinding` feature of `provideRouter` or\n   * `bindToComponentInputs` in the `ExtraOptions` of `RouterModule.forRoot`.\n   */\n  readonly componentInputBindingEnabled: boolean = !!inject(INPUT_BINDER, {optional: true});\n\n  /**\n   * Signal of the current `Navigation` object when the router is navigating, and `null` when idle.\n   *\n   * Note: The current navigation becomes to null after the NavigationEnd event is emitted.\n   */\n  readonly currentNavigation = this.navigationTransitions.currentNavigation.asReadonly();\n\n  constructor() {\n    this.resetConfig(this.config);\n\n    this.navigationTransitions.setupNavigations(this).subscribe({\n      error: (e) => {\n        // Note: This subscription is not unsubscribed when the `Router` is destroyed.\n        // This is intentional as the `Router` is generally never destroyed.\n        // If it is destroyed, the `events` subject is completed, which cleans up this subscription.\n      },\n    });\n    this.subscribeToNavigationEvents();\n  }\n\n  private eventsSubscription = new Subscription();\n  private subscribeToNavigationEvents() {\n    const subscription = this.navigationTransitions.events.subscribe((e) => {\n      try {\n        const currentTransition = this.navigationTransitions.currentTransition;\n        const currentNavigation = untracked(this.navigationTransitions.currentNavigation);\n\n        if (currentTransition !== null && currentNavigation !== null) {\n          this.stateManager.handleRouterEvent(e, currentNavigation);\n          if (\n            e instanceof NavigationCancel &&\n            e.code !== NavigationCancellationCode.Redirect &&\n            e.code !== NavigationCancellationCode.SupersededByNewNavigation\n          ) {\n            // It seems weird that `navigated` is set to `true` when the navigation is rejected,\n            // however it's how things were written initially. Investigation would need to be done\n            // to determine if this can be removed.\n            this.navigated = true;\n          } else if (e instanceof NavigationEnd) {\n            this.navigated = true;\n            this.injectorCleanup?.(this.routeReuseStrategy, this.routerState, this.config);\n          } else if (e instanceof RedirectRequest) {\n            const opts = e.navigationBehaviorOptions;\n            const mergedTree = this.urlHandlingStrategy.merge(\n              e.url,\n              currentTransition.currentRawUrl,\n            );\n            const extras = {\n              scroll: currentTransition.extras.scroll,\n              browserUrl: currentTransition.extras.browserUrl,\n              info: currentTransition.extras.info,\n              skipLocationChange: currentTransition.extras.skipLocationChange,\n              // The URL is already updated at this point if we have 'eager' URL\n              // updates or if the navigation was triggered by the browser (back\n              // button, URL bar, etc). We want to replace that item in history\n              // if the navigation is rejected.\n              replaceUrl:\n                currentTransition.extras.replaceUrl ||\n                this.urlUpdateStrategy === 'eager' ||\n                isBrowserTriggeredNavigation(currentTransition.source),\n              // allow developer to override default options with RedirectCommand\n              ...opts,\n            };\n\n            this.scheduleNavigation(mergedTree, IMPERATIVE_NAVIGATION, null, extras, {\n              resolve: currentTransition.resolve,\n              reject: currentTransition.reject,\n              promise: currentTransition.promise,\n            });\n          }\n        }\n\n        // Note that it's important to have the Router process the events _before_ the event is\n        // pushed through the public observable. This ensures the correct router state is in place\n        // before applications observe the events.\n        if (isPublicRouterEvent(e)) {\n          this._events.next(e);\n        }\n      } catch (e: unknown) {\n        this.navigationTransitions.transitionAbortWithErrorSubject.next(e as Error);\n      }\n    });\n    this.eventsSubscription.add(subscription);\n  }\n\n  /** @internal */\n  resetRootComponentType(rootComponentType: Type<any>): void {\n    // TODO: vsavkin router 4.0 should make the root component set to null\n    // this will simplify the lifecycle of the router.\n    this.routerState.root.component = rootComponentType;\n    this.navigationTransitions.rootComponentType = rootComponentType;\n  }\n\n  /**\n   * Sets up the location change listener and performs the initial navigation.\n   */\n  initialNavigation(): void {\n    this.setUpLocationChangeListener();\n    if (!this.navigationTransitions.hasRequestedNavigation) {\n      this.navigateToSyncWithBrowser(\n        this.location.path(true),\n        IMPERATIVE_NAVIGATION,\n        this.stateManager.restoredState(),\n        {replaceUrl: true},\n      );\n    }\n  }\n\n  /**\n   * Sets up the location change listener. This listener detects navigations triggered from outside\n   * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router\n   * navigation so that the correct events, guards, etc. are triggered.\n   */\n  setUpLocationChangeListener(): void {\n    // Don't need to use Zone.wrap any more, because zone.js\n    // already patch onPopState, so location change callback will\n    // run into ngZone\n    this.nonRouterCurrentEntryChangeSubscription ??=\n      this.stateManager.registerNonRouterCurrentEntryChangeListener(\n        (url, state, source, extras) => {\n          this.navigateToSyncWithBrowser(url, source, state, extras);\n        },\n      );\n  }\n\n  /**\n   * Schedules a router navigation to synchronize Router state with the browser state.\n   *\n   * This is done as a response to a popstate event and the initial navigation. These\n   * two scenarios represent times when the browser URL/state has been updated and\n   * the Router needs to respond to ensure its internal state matches.\n   */\n  private navigateToSyncWithBrowser(\n    url: string,\n    source: NavigationTrigger,\n    state: RestoredState | null | undefined,\n    extras: NavigationExtras,\n  ) {\n    // TODO: restoredState should always include the entire state, regardless\n    // of navigationId. This requires a breaking change to update the type on\n    // NavigationStart’s restoredState, which currently requires navigationId\n    // to always be present. The Router used to only restore history state if\n    // a navigationId was present.\n\n    // The stored navigationId is used by the RouterScroller to retrieve the scroll\n    // position for the page.\n    const restoredState = state?.navigationId ? state : null;\n\n    // When `browserUrl` was used during the original navigation, the actual route URL\n    // was stored in history state as `ɵrouterUrl`. Use it for route matching and\n    // preserve the browser URL as the displayed URL.\n    const routerUrl = state?.ɵrouterUrl ?? url;\n    if (state?.ɵrouterUrl) {\n      extras = {...extras, browserUrl: url};\n    }\n\n    // Separate to NavigationStart.restoredState, we must also restore the state to\n    // history.state and generate a new navigationId, since it will be overwritten\n    if (state) {\n      const stateCopy = {...state} as Partial<RestoredState>;\n      delete stateCopy.navigationId;\n      delete stateCopy.ɵrouterPageId;\n      delete stateCopy.ɵrouterUrl;\n      if (Object.keys(stateCopy).length !== 0) {\n        extras.state = stateCopy;\n      }\n    }\n\n    const urlTree = this.parseUrl(routerUrl);\n    this.scheduleNavigation(urlTree, source, restoredState, extras).catch((e) => {\n      if (this.disposed) {\n        return;\n      }\n      this.injector.get(ɵINTERNAL_APPLICATION_ERROR_HANDLER)(e);\n    });\n  }\n\n  /** The current URL. */\n  get url(): string {\n    return this.serializeUrl(this.currentUrlTree);\n  }\n\n  /**\n   * Returns the current `Navigation` object when the router is navigating,\n   * and `null` when idle.\n   *\n   * @deprecated 20.2 Use the `currentNavigation` signal instead.\n   */\n  getCurrentNavigation(): Navigation | null {\n    return untracked(this.navigationTransitions.currentNavigation);\n  }\n\n  /**\n   * The `Navigation` object of the most recent navigation to succeed and `null` if there\n   *     has not been a successful navigation yet.\n   */\n  get lastSuccessfulNavigation(): Signal<Navigation | null> {\n    return this.navigationTransitions.lastSuccessfulNavigation;\n  }\n\n  /**\n   * Resets the route configuration used for navigation and generating links.\n   *\n   * @param config The route array for the new configuration.\n   *\n   * @usageNotes\n   *\n   * ```ts\n   * router.resetConfig([\n   *  { path: 'team/:id', component: TeamCmp, children: [\n   *    { path: 'simple', component: SimpleCmp },\n   *    { path: 'user/:name', component: UserCmp }\n   *  ]}\n   * ]);\n   * ```\n   */\n  resetConfig(config: Routes): void {\n    (typeof ngDevMode === 'undefined' || ngDevMode) && validateConfig(config);\n    this.config = config.map(standardizeConfig);\n    this.navigated = false;\n  }\n\n  /** @docs-private */\n  ngOnDestroy(): void {\n    this.dispose();\n  }\n\n  /** Disposes of the router. */\n  dispose(): void {\n    // We call `unsubscribe()` to release observers, as users may forget to\n    // unsubscribe manually when subscribing to `router.events`. We do not call\n    // `complete()` because it is unsafe; if someone subscribes using the `first`\n    // operator and the observable completes before emitting a value,\n    // RxJS will throw an error.\n    this._events.unsubscribe();\n    this.navigationTransitions.complete();\n    this.nonRouterCurrentEntryChangeSubscription?.unsubscribe();\n    this.nonRouterCurrentEntryChangeSubscription = undefined;\n    this.disposed = true;\n    this.eventsSubscription.unsubscribe();\n  }\n\n  /**\n   * Appends URL segments to the current URL tree to create a new URL tree.\n   *\n   * @param commands An array of URL fragments with which to construct the new URL tree.\n   * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n   * segments, followed by the parameters for each segment.\n   * The fragments are applied to the current URL tree or the one provided  in the `relativeTo`\n   * property of the options object, if supplied.\n   * @param navigationExtras Options that control the navigation strategy.\n   * @returns The new URL tree.\n   *\n   * @usageNotes\n   *\n   * ```ts\n   * // create /team/33/user/11\n   * router.createUrlTree(['/team', 33, 'user', 11]);\n   *\n   * // create /team/33;expand=true/user/11\n   * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);\n   *\n   * // you can collapse static segments like this (this works only with the first passed-in value):\n   * router.createUrlTree(['/team/33/user', userId]);\n   *\n   * // If the first segment can contain slashes, and you do not want the router to split it,\n   * // you can do the following:\n   * router.createUrlTree([{segmentPath: '/one/two'}]);\n   *\n   * // create /team/33/(user/11//right:chat)\n   * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);\n   *\n   * // remove the right secondary node\n   * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);\n   *\n   * // assuming the current url is `/team/33/user/11` and the route points to `user/11`\n   *\n   * // navigate to /team/33/user/11/details\n   * router.createUrlTree(['details'], {relativeTo: route});\n   *\n   * // navigate to /team/33/user/22\n   * router.createUrlTree(['../22'], {relativeTo: route});\n   *\n   * // navigate to /team/44/user/22\n   * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});\n   * ```\n   * Note that a value of `null` or `undefined` for `relativeTo` indicates that the\n   * tree should be created relative to the root.\n   *\n   */\n  createUrlTree(commands: readonly any[], navigationExtras: UrlCreationOptions = {}): UrlTree {\n    const {relativeTo, queryParams, fragment, queryParamsHandling, preserveFragment} =\n      navigationExtras;\n    const f = preserveFragment ? this.currentUrlTree.fragment : fragment;\n    let q: Params | null = null;\n    switch (queryParamsHandling ?? this.options.defaultQueryParamsHandling) {\n      case 'merge':\n        q = {...this.currentUrlTree.queryParams, ...queryParams};\n        break;\n      case 'preserve':\n        q = this.currentUrlTree.queryParams;\n        break;\n      default:\n        q = queryParams || null;\n    }\n    if (q !== null) {\n      q = this.removeEmptyProps(q);\n    }\n\n    let relativeToUrlSegmentGroup: UrlSegmentGroup | undefined;\n    try {\n      const relativeToSnapshot = relativeTo ? relativeTo.snapshot : this.routerState.snapshot.root;\n      relativeToUrlSegmentGroup = createSegmentGroupFromRoute(relativeToSnapshot);\n    } catch (e: unknown) {\n      // This is strictly for backwards compatibility with tests that create\n      // invalid `ActivatedRoute` mocks.\n      // Note: the difference between having this fallback for invalid `ActivatedRoute` setups and\n      // just throwing is ~500 test failures. Fixing all of those tests by hand is not feasible at\n      // the moment.\n      if (typeof commands[0] !== 'string' || commands[0][0] !== '/') {\n        // Navigations that were absolute in the old way of creating UrlTrees\n        // would still work because they wouldn't attempt to match the\n        // segments in the `ActivatedRoute` to the `currentUrlTree` but\n        // instead just replace the root segment with the navigation result.\n        // Non-absolute navigations would fail to apply the commands because\n        // the logic could not find the segment to replace (so they'd act like there were no\n        // commands).\n        commands = [];\n      }\n      relativeToUrlSegmentGroup = this.currentUrlTree.root;\n    }\n    return createUrlTreeFromSegmentGroup(\n      relativeToUrlSegmentGroup,\n      commands,\n      q,\n      f ?? null,\n      this.urlSerializer,\n    );\n  }\n\n  /**\n   * Navigates to a view using an absolute route path.\n   *\n   * @param url An absolute path for a defined route. The function does not apply any delta to the\n   *     current URL.\n   * @param extras An object containing properties that modify the navigation strategy.\n   *\n   * @returns A Promise that resolves to 'true' when navigation succeeds,\n   * to 'false' when navigation fails, or is rejected on error.\n   *\n   * @usageNotes\n   *\n   * The following calls request navigation to an absolute path.\n   *\n   * ```ts\n   * router.navigateByUrl(\"/team/33/user/11\");\n   *\n   * // Navigate without updating the URL\n   * router.navigateByUrl(\"/team/33/user/11\", { skipLocationChange: true });\n   * ```\n   *\n   * @see [Routing and Navigation guide](guide/routing/common-router-tasks)\n   *\n   */\n  navigateByUrl(\n    url: string | UrlTree,\n    extras: NavigationBehaviorOptions = {\n      skipLocationChange: false,\n    },\n  ): Promise<boolean> {\n    const urlTree = isUrlTree(url) ? url : this.parseUrl(url);\n    const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);\n\n    return this.scheduleNavigation(mergedTree, IMPERATIVE_NAVIGATION, null, extras);\n  }\n\n  /**\n   * Navigate based on the provided array of commands and a starting point.\n   * If no starting route is provided, the navigation is absolute.\n   *\n   * @param commands An array of URL fragments with which to construct the target URL.\n   * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path\n   * segments, followed by the parameters for each segment.\n   * The fragments are applied to the current URL or the one provided  in the `relativeTo` property\n   * of the options object, if supplied.\n   * @param extras An options object that determines how the URL should be constructed or\n   *     interpreted.\n   *\n   * @returns A Promise that resolves to `true` when navigation succeeds, or `false` when navigation\n   *     fails. The Promise is rejected when an error occurs if `resolveNavigationPromiseOnError` is\n   * not `true`.\n   *\n   * @usageNotes\n   *\n   * The following calls request navigation to a dynamic route path relative to the current URL.\n   *\n   * ```ts\n   * router.navigate(['team', 33, 'user', 11], {relativeTo: route});\n   *\n   * // Navigate without updating the URL, overriding the default behavior\n   * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});\n   * ```\n   *\n   * @see [Routing and Navigation guide](guide/routing/common-router-tasks)\n   *\n   */\n  navigate(\n    commands: readonly any[],\n    extras: NavigationExtras = {skipLocationChange: false},\n  ): Promise<boolean> {\n    validateCommands(commands);\n    return this.navigateByUrl(this.createUrlTree(commands, extras), extras);\n  }\n\n  /** Serializes a `UrlTree` into a string */\n  serializeUrl(url: UrlTree): string {\n    return this.urlSerializer.serialize(url);\n  }\n\n  /** Parses a string into a `UrlTree` */\n  parseUrl(url: string): UrlTree {\n    try {\n      return this.urlSerializer.parse(url);\n    } catch (e) {\n      this.console.warn(\n        formatRuntimeError(\n          RuntimeErrorCode.ERROR_PARSING_URL,\n          ngDevMode && `Error parsing URL ${url}. Falling back to '/' instead. \\n` + e,\n        ),\n      );\n      return this.urlSerializer.parse('/');\n    }\n  }\n\n  /**\n   * Returns whether the url is activated.\n   *\n   * @deprecated\n   * Use `IsActiveMatchOptions` instead.\n   *\n   * - The equivalent `IsActiveMatchOptions` for `true` is\n   * `{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'}`.\n   * - The equivalent for `false` is\n   * `{paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored'}`.\n   */\n  isActive(url: string | UrlTree, exact: boolean): boolean;\n  /**\n   * @see {@link isActive}\n   * @deprecated 21.1 - Use the `isActive` function instead.\n   */\n  isActive(url: string | UrlTree, matchOptions: Partial<IsActiveMatchOptions>): boolean;\n  /** @internal */\n  isActive(url: string | UrlTree, matchOptions: boolean | IsActiveMatchOptions): boolean;\n  /**\n   * @deprecated 21.1 - Use the `isActive` function instead.\n   * @see {@link isActive}\n   */\n  isActive(url: string | UrlTree, matchOptions: boolean | Partial<IsActiveMatchOptions>): boolean {\n    let options: IsActiveMatchOptions;\n    if (matchOptions === true) {\n      options = {...exactMatchOptions};\n    } else if (matchOptions === false) {\n      options = {...subsetMatchOptions};\n    } else {\n      options = {...subsetMatchOptions, ...matchOptions};\n    }\n    if (isUrlTree(url)) {\n      return containsTree(this.currentUrlTree, url, options);\n    }\n\n    const urlTree = this.parseUrl(url);\n    return containsTree(this.currentUrlTree, urlTree, options);\n  }\n\n  private removeEmptyProps(params: Params): Params {\n    return Object.entries(params).reduce((result: Params, [key, value]: [string, any]) => {\n      if (value !== null && value !== undefined) {\n        result[key] = value;\n      }\n      return result;\n    }, {});\n  }\n\n  private scheduleNavigation(\n    rawUrl: UrlTree,\n    source: NavigationTrigger,\n    restoredState: RestoredState | null,\n    extras: NavigationExtras,\n    priorPromise?: {\n      resolve: (result: boolean | PromiseLike<boolean>) => void;\n      reject: (reason?: any) => void;\n      promise: Promise<boolean>;\n    },\n  ): Promise<boolean> {\n    if (this.disposed) {\n      return Promise.resolve(false);\n    }\n\n    let resolve: (result: boolean | PromiseLike<boolean>) => void;\n    let reject: (reason?: any) => void;\n    let promise: Promise<boolean>;\n    if (priorPromise) {\n      resolve = priorPromise.resolve;\n      reject = priorPromise.reject;\n      promise = priorPromise.promise;\n    } else {\n      promise = new Promise<boolean>((res, rej) => {\n        resolve = res;\n        reject = rej;\n      });\n    }\n\n    // Indicate that the navigation is happening.\n    const taskId = this.pendingTasks.add();\n    afterNextNavigation(this, () => {\n      // Remove pending task in a microtask to allow for cancelled\n      // initial navigations and redirects within the same task.\n      queueMicrotask(() => this.pendingTasks.remove(taskId));\n    });\n\n    this.navigationTransitions.handleNavigationRequest({\n      source,\n      restoredState,\n      currentUrlTree: this.currentUrlTree,\n      currentRawUrl: this.currentUrlTree,\n      rawUrl,\n      extras,\n      resolve: resolve!,\n      reject: reject!,\n      promise,\n      currentSnapshot: this.routerState.snapshot,\n      currentRouterState: this.routerState,\n    });\n\n    // Make sure that the error is propagated even though `processNavigations` catch\n    // handler does not rethrow\n    // perf: Use `.bind` to avoid holding the other closures in this scope while this promise is unsettled.\n    return promise.catch(Promise.reject.bind(Promise));\n  }\n}\n\nfunction validateCommands(commands: readonly string[]): void {\n  for (let i = 0; i < commands.length; i++) {\n    const cmd = commands[i];\n    if (cmd == null) {\n      throw new RuntimeError(\n        RuntimeErrorCode.NULLISH_COMMAND,\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n          `The requested path contains ${cmd} segment at index ${i}`,\n      );\n    }\n  }\n}\n"],"names":["PRIMARY_OUTLET","RouteTitleKey","Symbol","ParamsAsMap","params","constructor","has","name","Object","prototype","hasOwnProperty","call","get","v","Array","isArray","getAll","keys","convertToParamMap","matchParts","routeParts","urlSegments","posParams","i","length","part","segment","isParameter","substring","path","defaultUrlMatcher","segments","segmentGroup","route","parts","split","wildcardIndex","indexOf","pathMatch","hasChildren","consumed","slice","lastIndexOf","pre","post","firstValueFrom","source","Promise","resolve","reject","pipe","first","subscribe","next","value","error","err","shallowEqualArrays","a","b","shallowEqual","k1","getDataKeys","undefined","k2","key","equalArraysOrString","obj","getOwnPropertySymbols","aSorted","sort","bSorted","every","val","index","last","wrapIntoObservable","isObservable","isPromise","from","of","wrapIntoPromise","pathCompareMap","equalSegmentGroups","containsSegmentGroup","paramCompareMap","equalParams","containsParams","ignored","exactMatchOptions","paths","fragment","matrixParams","queryParams","subsetMatchOptions","isActive","url","router","matchOptions","urlTree","UrlTree","parseUrl","computed","containsTree","lastSuccessfulNavigation","finalUrl","container","containee","options","root","equalPath","matrixParamsMatch","numberOfChildren","c","children","containsSegmentGroupHelper","containeePaths","current","containerPaths","containeeSegment","parameters","_queryParamMap","UrlSegmentGroup","ngDevMode","RuntimeError","queryParamMap","toString","DEFAULT_SERIALIZER","serialize","parent","values","forEach","serializePaths","UrlSegment","_parameterMap","parameterMap","serializePath","equalSegments","as","bs","mapChildrenIntoArray","fn","res","entries","childOutlet","child","concat","UrlSerializer","deps","target","i0","ɵɵFactoryTarget","Service","ɵprov","ɵɵngDeclareService","minVersion","version","ngImport","type","factory","DefaultUrlSerializer","decorators","parse","p","UrlParser","parseRootSegment","parseQueryParams","parseFragment","tree","serializeSegment","query","serializeQueryParams","encodeUriFragment","map","join","primary","k","push","encodeUriString","s","encodeURIComponent","replace","encodeUriQuery","encodeURI","encodeUriSegment","decode","decodeURIComponent","decodeQuery","serializeMatrixParams","strParams","filter","SEGMENT_RE","matchSegments","str","match","MATRIX_PARAM_SEGMENT_RE","matchMatrixKeySegments","QUERY_PARAM_RE","matchQueryParams","QUERY_PARAM_VALUE_RE","matchUrlQueryParamValue","remaining","consumeOptional","peekStartsWith","parseChildren","parseQueryParam","depth","parseSegment","capture","parseParens","parseMatrixParams","parseParam","valueMatch","decodedKey","decodedVal","currentVal","allowPrimary","outletName","startsWith","createRoot","rootCandidate","squashSegmentGroup","newChildren","childCandidate","grandChildOutlet","grandChild","mergeTrivialChildren","isUrlTree","createUrlTreeFromSnapshot","relativeTo","commands","urlSerializer","relativeToUrlSegmentGroup","createSegmentGroupFromRoute","createUrlTreeFromSegmentGroup","targetGroup","createSegmentGroupFromRouteRecursive","currentRoute","childOutlets","childSnapshot","outlet","rootSegmentGroup","nav","computeNavigation","toRoot","position","findStartingPositionForTargetGroup","newSegmentGroup","processChildren","updateSegmentGroupChildren","updateSegmentGroup","isMatrixParams","command","outlets","segmentPath","isCommandWithOutlets","normalizeQueryParams","oldRoot","oldSegmentGroup","qp","replaceSegment","newRoot","oldSegment","newSegment","Navigation","isAbsolute","numberOfDoubleDots","cmdWithOutlet","find","reduce","cmd","cmdIdx","urlPart","partIndex","Position","NaN","modifier","createPositionApplyingDoubleDots","group","g","ci","dd","getOutlets","startIndex","m","prefixedWith","slicedCommands","commandIndex","pathIndex","createNewSegmentGroup","some","o","childrenOfEmptyChild","currentCommandIndex","currentPathIndex","noMatch","curr","compare","createNewSegmentChildren","stringify","IMPERATIVE_NAVIGATION","EventType","RouterEvent","id","NavigationStart","navigationTrigger","restoredState","NavigationEnd","urlAfterRedirects","NavigationCancellationCode","NavigationSkippedCode","NavigationCancel","reason","code","isRedirectingEvent","event","Redirect","SupersededByNewNavigation","NavigationSkipped","NavigationError","RoutesRecognized","state","GuardsCheckStart","GuardsCheckEnd","shouldActivate","ResolveStart","ResolveEnd","RouteConfigLoadStart","RouteConfigLoadEnd","ChildActivationStart","snapshot","routeConfig","ChildActivationEnd","ActivationStart","ActivationEnd","Scroll","routerEvent","anchor","scrollBehavior","pos","BeforeActivateRoutes","BeforeRoutesRecognized","RedirectRequest","navigationBehaviorOptions","isPublicRouterEvent","e","stringifyEvent","OutletContext","rootInjector","attachRef","injector","_environmentInjector","ChildrenOutletContexts","contexts","Map","onChildOutletCreated","childName","context","getOrCreateContext","set","onChildOutletDestroyed","getContext","onOutletDeactivated","onOutletReAttached","token","EnvironmentInjector","Injectable","ɵɵngDeclareInjectable","providedIn","Tree","_root","t","pathFromRoot","n","findNode","firstChild","siblings","findPath","cc","node","unshift","TreeNode","nodeChildrenAsMap","RouterState","setRouterState","createEmptyState","rootComponent","createEmptyStateSnapshot","emptyUrl","BehaviorSubject","emptyParams","emptyData","emptyQueryParams","activated","ActivatedRoute","ActivatedRouteSnapshot","RouterStateSnapshot","urlSubject","paramsSubject","queryParamsSubject","fragmentSubject","dataSubject","component","_futureSnapshot","_routerState","_paramMap","title","data","futureSnapshot","d","paramMap","DEFAULT_PARAMS_INHERITANCE_STRATEGY","getInherited","paramsInheritanceStrategy","inherited","loadComponent","_resolvedData","hasStaticTitle","_resolve","environmentInjector","matched","serializeNode","advanceActivatedRoute","currentSnapshot","nextSnapshot","equalParamsAndUrlSegments","equalUrlParams","parentsMismatch","config","ROUTER_OUTLET_DATA","InjectionToken","RouterOutlet","activatedComponentRef","_activatedRoute","activateEvents","EventEmitter","deactivateEvents","attachEvents","detachEvents","routerOutletData","input","parentContexts","inject","location","ViewContainerRef","changeDetector","ChangeDetectorRef","inputBinder","INPUT_BINDER","optional","supportsBindingToComponentInputs","ngOnChanges","changes","firstChange","previousValue","isTrackedInParentContexts","deactivate","initializeOutletWithName","ngOnDestroy","unsubscribeFromRouteData","ngOnInit","attach","activateWith","isActivated","instance","activatedRoute","activatedRouteData","detach","cmp","emit","ref","insert","hostView","bindActivatedRouteToOutletComponent","destroy","childContexts","OutletInjector","createComponent","markForCheck","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","exportAs","usesOnChanges","args","Input","Output","outletData","notFoundValue","RoutedComponentInputBinder","outletDataSubscriptions","outletSeenKeys","subscribeToRouteData","unsubscribe","delete","dataSubscription","combineLatest","switchMap","mirror","reflectComponentType","seenKeys","Set","add","behavior","unmatchedInputBehavior","templateName","setInput","ɵEmptyOutletComponent","Component","template","isInline","dependencies","kind","changeDetection","ChangeDetectionStrategy","Eager","imports","standardizeConfig","r","loadChildren","createRouterState","routeReuseStrategy","prevState","createNode","shouldReuseRoute","createOrReuseChildren","shouldAttach","detachedRouteHandle","retrieve","createActivatedRoute","RedirectCommand","redirectTo","NAVIGATION_CANCELING_ERROR","redirectingNavigationError","redirect","navigationCancelingError","message","Error","cancellationCode","isRedirectingNavigationCancelingError","isNavigationCancelingError","warnedAboutUnsupportedInputBinding","ActivateRoutes","futureState","currState","forwardEvent","inputBindingEnabled","activate","futureRoot","currRoot","deactivateChildRoutes","activateChildRoutes","futureNode","currNode","futureChild","childOutletName","deactivateRoutes","deactivateRouteAndItsChildren","parentContext","future","shouldDetach","detachAndStoreRouteSubtree","deactivateRouteAndOutlet","treeNode","componentRef","store","activateRoutes","stored","console","warn","CanActivate","CanDeactivate","getAllRouteGuards","getChildRouteGuards","getCanActivateChild","canActivateChild","guards","getTokenOrFunctionIdentity","tokenOrFunction","NOT_FOUND","result","isInjectable","futurePath","checks","canDeactivateChecks","canActivateChecks","prevChildren","getRouteGuards","shouldRun","shouldRunGuardsAndResolvers","runGuardsAndResolvers","mode","runInInjectionContext","isFunction","isBoolean","isCanLoad","guard","canLoad","isCanActivate","canActivate","isCanActivateChild","isCanDeactivate","canDeactivate","isCanMatch","canMatch","isEmptyError","EmptyError","INITIAL_VALUE","prioritizedGuardValue","obs","take","startWith","results","isRedirect","item","abortSignalToObservable","signal","aborted","Observable","subscriber","handler","complete","addEventListener","removeEventListener","takeUntilAbort","takeUntil","checkGuards","mergeMap","targetSnapshot","guardsResult","runCanDeactivateChecks","runCanActivateChecks","futureRSS","currRSS","check","runCanDeactivate","concatMap","fireChildActivationStart","fireActivationStart","runCanActivateChild","runCanActivate","futureARS","canActivateObservables","defer","closestInjector","guardVal","canActivateChildGuards","reverse","_","canActivateChildGuardsMapped","guardsMapped","currARS","canDeactivateObservables","runCanLoadGuards","abortSignal","canLoadObservables","injectionToken","obs$","redirectIfUrlTree","tap","runCanMatchGuards","canMatchObservables","NoMatch","setPrototypeOf","AbsoluteRedirect","namedOutletsRedirect","canLoadFails","GuardRejected","ApplyRedirects","lineralizeSegments","applyRedirectCommands","getRedirectResult","newTree","applyRedirectCreateUrlTree","createSegmentGroup","createQueryParams","redirectToParams","actualParams","copySourceValue","sourceName","updatedSegments","createSegments","redirectToSegments","actualSegments","findPosParam","findOrReturn","redirectToUrlSegment","idx","splice","redirectToFn","getOrCreateRouteInjectorIfNeeded","currentInjector","providers","_injector","createEnvironmentInjector","validateConfig","parentPath","requireStandaloneComponents","fullPath","getFullPath","validateNode","assertStandalone","isNgModule","matcher","charAt","exp","getOutlet","sortByMatchingOutlets","routes","sortedConfig","consumedSegments","remainingSegments","positionalParamSegments","createPreMatchRouteSnapshot","matchWithChecks","createSnapshot","slicedSegments","containsEmptyPathMatchesWithNamedOutlets","createChildrenForEmptyPaths","containsEmptyPathMatches","addEmptyPathsToChildrenIfNeeded","emptyPathMatch","primarySegment","matchesEmpty","isNamedOutlet","isSelfEvaluating","noLeftoversInUrl","NoLeftoversInUrl","recognize","configLoader","rootComponentType","Recognizer","MAX_ALLOWED_REDIRECTS","applyRedirects","absoluteRedirectCount","allowRedirects","noMatchError","rootSnapshot","rootNode","routeState","freeze","processSegmentGroup","parentRoute","processSegment","outletChildren","mergedChildren","mergeEmptyPathMatches","checkOutletNameUniqueness","sortActivatedRouteSnapshots","processSegmentAgainstRoute","rawSegment","matchSegmentAgainstRoute","expandSegmentAgainstRouteUsingRedirect","newSegments","getData","_loadedComponent","getResolve","childConfig","getChildConfig","childInjector","_loadedInjector","matchedOnOutlet","_loadedRoutes","ngModuleFactory","_loadedNgModuleFactory","create","shouldLoadResult","cfg","nodes","localeCompare","hasEmptyPathConfig","mergedNodes","duplicateEmptyPathNode","resultNode","mergedNode","names","routeWithSameOutletName","serializer","recognizeFn","extractedUrl","resolveData","routesWithResolversToRun","routesNeedingDataUpdates","newRoute","flattenRouteTree","routesProcessed","runResolve","takeLast","size","EMPTY","descendants","flat","resolveNode","resolvedData","getResolver","catchError","throwError","resolver","resolverValue","switchTap","nextResult","TitleStrategy","buildTitle","pageTitle","getResolvedTitleForRoute","DefaultTitleStrategy","updateTitle","setTitle","i1","Title","ROUTER_CONFIGURATION","ROUTES","RouterConfigLoader","componentLoaders","WeakMap","childrenLoaders","onLoadStartListener","onLoadEndListener","compiler","Compiler","loader","loaded","maybeResolveResources","maybeUnwrapDefaultExport","parentInjector","factoryOrRoutes","NgModuleFactory","compileModuleAsync","rawRoutes","self","ngJitMode","fetch","resolveComponentResources","UrlHandlingStrategy","DefaultUrlHandlingStrategy","shouldProcessUrl","extract","merge","newUrlPart","wholeUrl","CREATE_VIEW_TRANSITION","VIEW_TRANSITION_OPTIONS","createViewTransition","to","transitionOptions","document","DOCUMENT","startViewTransition","skipNextTransition","setTimeout","resolveViewTransitionStarted","viewTransitionStarted","transition","createRenderPromise","updateCallbackDone","catch","ready","finished","onViewTransitionCreated","afterNextRender","read","noop","NAVIGATION_ERROR_HANDLER","NavigationTransitions","currentNavigation","debugName","equal","currentTransition","events","Subject","transitionAbortWithErrorSubject","destroyRef","DestroyRef","rootContexts","Location","titleStrategy","urlHandlingStrategy","navigationErrorHandler","navigationId","hasRequestedNavigation","transitions","afterPreactivation","destroyed","onLoadStart","onLoadEnd","onDestroy","handleNavigationRequest","request","untracked","rawUrl","targetRouterState","routesRecognizeHandler","beforeActivateHandler","setupNavigations","overallTransitionState","abortable","completedOrAborted","abortController","AbortController","shouldContinueNavigation","cancellationReason","cancelNavigationTransition","initialUrl","targetBrowserUrl","extras","browserUrl","trigger","previousNavigation","abort","urlTransition","navigated","isUpdatingInternalState","isUpdatedBrowserUrl","onSameUrlNavigation","IgnoredSameUrlNavigation","update","deferredHandle","routesRecognized","currentRawUrl","navStart","skipLocationChange","replaceUrl","IgnoredByUrlHandlingStrategy","guardsStart","evt","guardsEnd","resolveStart","dataResolved","resolveEnd","NoDataFromResolver","loadComponents","loaders","then","loadedComponent","all","currentRouterState","deferred","Aborted","finalize","cancelationReason","navigationError","navigationErrorHandlerResult","ee","resolveNavigationPromiseOnError","navCancel","currentUrlTree","currentBrowserUrl","isBrowserTriggeredNavigation","ROUTE_INJECTOR_CLEANUP","routeInjectorCleanup","routerState","activeRoutes","collectDescendants","storedHandles","retrieveStoredRouteHandles","handle","internalHandle","destroyUnusedInjectors","strategy","inheritedForceDestroy","shouldDestroyCurrentRoute","shouldDestroyInjector","destroyDetachedRouteHandle","RouteReuseStrategy","DefaultRouteReuseStrategy","BaseRouteReuseStrategy","detachedTree","StateManager","canceledNavigationResolution","urlUpdateStrategy","getCurrentUrlTree","rawUrlTree","getRawUrlTree","createBrowserPath","routerUrlState","navigation","ɵrouterUrl","commitTransition","getRouterState","_stateMemento","createStateMemento","stateMemento","updateStateMemento","getState","HistoryStateManager","currentPageId","lastSuccessfulId","browserPageId","ɵrouterPageId","registerNonRouterCurrentEntryChangeListener","listener","handleRouterEvent","setBrowserUrl","restoreHistory","isCurrentPathEqualTo","currentBrowserPageId","newState","generateNgRouterState","replaceState","go","restoringFromCaughtError","targetPagePosition","historyGo","resetInternalState","resetUrlToCurrentUrlTree","routerPageId","afterNextNavigation","action","redirecting","Router","stateManager","disposed","nonRouterCurrentEntryChangeSubscription","Console","pendingTasks","PendingTasks","navigationTransitions","_events","injectorCleanup","componentInputBindingEnabled","asReadonly","resetConfig","subscribeToNavigationEvents","eventsSubscription","Subscription","subscription","opts","mergedTree","scroll","info","scheduleNavigation","promise","resetRootComponentType","initialNavigation","setUpLocationChangeListener","navigateToSyncWithBrowser","routerUrl","stateCopy","ɵINTERNAL_APPLICATION_ERROR_HANDLER","serializeUrl","getCurrentNavigation","dispose","createUrlTree","navigationExtras","queryParamsHandling","preserveFragment","f","q","defaultQueryParamsHandling","removeEmptyProps","relativeToSnapshot","navigateByUrl","navigate","validateCommands","formatRuntimeError","priorPromise","rej","taskId","queueMicrotask","remove","bind"],"mappings":";;;;;;;;;;;;;AAgBO,MAAMA,cAAc,GAAG;AAOvB,MAAMC,aAAa,kBAAkCC,MAAM,CAAC,YAAY,CAAC;AAmDhF,MAAMC,WAAW,CAAA;EACPC,MAAM;EAEdC,WAAAA,CAAYD,MAAc,EAAA;AACxB,IAAA,IAAI,CAACA,MAAM,GAAGA,MAAM,IAAI,EAAE;AAC5B,EAAA;EAEAE,GAAGA,CAACC,IAAY,EAAA;AACd,IAAA,OAAOC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAAC,IAAI,CAACP,MAAM,EAAEG,IAAI,CAAC;AAChE,EAAA;EAEAK,GAAGA,CAACL,IAAY,EAAA;AACd,IAAA,IAAI,IAAI,CAACD,GAAG,CAACC,IAAI,CAAC,EAAE;AAClB,MAAA,MAAMM,CAAC,GAAG,IAAI,CAACT,MAAM,CAACG,IAAI,CAAC;AAC3B,MAAA,OAAOO,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC;AACpC,IAAA;AAEA,IAAA,OAAO,IAAI;AACb,EAAA;EAEAG,MAAMA,CAACT,IAAY,EAAA;AACjB,IAAA,IAAI,IAAI,CAACD,GAAG,CAACC,IAAI,CAAC,EAAE;AAClB,MAAA,MAAMM,CAAC,GAAG,IAAI,CAACT,MAAM,CAACG,IAAI,CAAC;MAC3B,OAAOO,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAGA,CAAC,GAA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