@angular/core 16.0.0-next.3 → 16.0.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/{esm2020 → esm2022}/src/application_init.mjs +3 -3
  2. package/{esm2020 → esm2022}/src/application_module.mjs +4 -4
  3. package/esm2022/src/application_ref.mjs +908 -0
  4. package/esm2022/src/application_tokens.mjs +105 -0
  5. package/esm2022/src/change_detection/change_detector_ref.mjs +93 -0
  6. package/esm2022/src/change_detection/differs/iterable_differs.mjs +81 -0
  7. package/esm2022/src/change_detection/differs/keyvalue_differs.mjs +74 -0
  8. package/esm2022/src/compiler/compiler_facade_interface.mjs +29 -0
  9. package/{esm2020 → esm2022}/src/console.mjs +3 -3
  10. package/esm2022/src/core.mjs +56 -0
  11. package/esm2022/src/core_private_export.mjs +39 -0
  12. package/esm2022/src/core_reactivity_export_internal.mjs +12 -0
  13. package/esm2022/src/core_render3_private_export.mjs +37 -0
  14. package/esm2022/src/di/contextual.mjs +54 -0
  15. package/esm2022/src/di/index.mjs +29 -0
  16. package/esm2022/src/di/injector.mjs +62 -0
  17. package/esm2022/src/di/injector_compatibility.mjs +239 -0
  18. package/esm2022/src/di/provider_collection.mjs +279 -0
  19. package/esm2022/src/di/r3_injector.mjs +428 -0
  20. package/esm2022/src/di/reflective_injector.mjs +311 -0
  21. package/{esm2020 → esm2022}/src/errors.mjs +1 -1
  22. package/esm2022/src/hydration/annotate.mjs +426 -0
  23. package/esm2022/src/hydration/api.mjs +143 -0
  24. package/esm2022/src/hydration/cleanup.mjs +103 -0
  25. package/esm2022/src/hydration/compression.mjs +69 -0
  26. package/esm2022/src/hydration/error_handling.mjs +379 -0
  27. package/esm2022/src/hydration/interfaces.mjs +33 -0
  28. package/esm2022/src/hydration/node_lookup_utils.mjs +273 -0
  29. package/esm2022/src/hydration/utils.mjs +219 -0
  30. package/esm2022/src/hydration/views.mjs +84 -0
  31. package/esm2022/src/initial_render_pending_tasks.mjs +75 -0
  32. package/{esm2020 → esm2022}/src/linker/compiler.mjs +5 -5
  33. package/esm2022/src/linker/component_factory_resolver.mjs +42 -0
  34. package/esm2022/src/linker/destroy_ref.mjs +44 -0
  35. package/{esm2020 → esm2022}/src/linker/element_ref.mjs +6 -6
  36. package/esm2022/src/linker/query_list.mjs +169 -0
  37. package/{esm2020 → esm2022}/src/linker/template_ref.mjs +6 -6
  38. package/esm2022/src/linker/view_container_ref.mjs +395 -0
  39. package/esm2022/src/metadata/di.mjs +69 -0
  40. package/esm2022/src/metadata/directives.mjs +116 -0
  41. package/{esm2020 → esm2022}/src/metadata/do_boostrap.mjs +1 -1
  42. package/{esm2020 → esm2022}/src/metadata/ng_module.mjs +2 -2
  43. package/esm2022/src/metadata.mjs +18 -0
  44. package/{esm2020 → esm2022}/src/render/api.mjs +6 -6
  45. package/esm2022/src/render3/component_ref.mjs +386 -0
  46. package/{esm2020 → esm2022}/src/render3/context_discovery.mjs +1 -1
  47. package/esm2022/src/render3/features/standalone_feature.mjs +70 -0
  48. package/esm2022/src/render3/instructions/element.mjs +205 -0
  49. package/{esm2020 → esm2022}/src/render3/instructions/element_container.mjs +2 -5
  50. package/esm2022/src/render3/instructions/element_validation.mjs +271 -0
  51. package/esm2022/src/render3/instructions/listener.mjs +244 -0
  52. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +35 -0
  53. package/esm2022/src/render3/instructions/projection.mjs +121 -0
  54. package/esm2022/src/render3/instructions/shared.mjs +1681 -0
  55. package/{esm2020 → esm2022}/src/render3/instructions/styling.mjs +5 -2
  56. package/esm2022/src/render3/instructions/template.mjs +117 -0
  57. package/esm2022/src/render3/instructions/text.mjs +67 -0
  58. package/esm2022/src/render3/interfaces/public_definitions.mjs +9 -0
  59. package/esm2022/src/render3/interfaces/type_checks.mjs +42 -0
  60. package/esm2022/src/render3/interfaces/view.mjs +49 -0
  61. package/esm2022/src/render3/jit/module.mjs +531 -0
  62. package/esm2022/src/render3/node_manipulation.mjs +960 -0
  63. package/esm2022/src/render3/node_selector_matcher.mjs +426 -0
  64. package/esm2022/src/render3/reactive_lview_consumer.mjs +80 -0
  65. package/esm2022/src/render3/reactivity/effect.mjs +67 -0
  66. package/{esm2020 → esm2022}/src/render3/util/change_detection_utils.mjs +2 -2
  67. package/{esm2020 → esm2022}/src/render3/util/view_utils.mjs +12 -1
  68. package/esm2022/src/render3/view_ref.mjs +307 -0
  69. package/{esm2020 → esm2022}/src/sanitization/sanitizer.mjs +7 -7
  70. package/esm2022/src/signals/index.mjs +15 -0
  71. package/esm2022/src/signals/src/api.mjs +47 -0
  72. package/esm2022/src/signals/src/computed.mjs +139 -0
  73. package/esm2022/src/signals/src/graph.mjs +165 -0
  74. package/esm2022/src/signals/src/signal.mjs +75 -0
  75. package/esm2022/src/signals/src/watch.mjs +62 -0
  76. package/esm2022/src/signals/src/weak_ref.mjs +35 -0
  77. package/{esm2020 → esm2022}/src/testability/testability.mjs +5 -5
  78. package/esm2022/src/transfer_state.mjs +153 -0
  79. package/esm2022/src/util/ng_dev_mode.mjs +79 -0
  80. package/{esm2020 → esm2022}/src/version.mjs +1 -1
  81. package/{esm2020 → esm2022}/testing/src/logger.mjs +4 -4
  82. package/{esm2020 → esm2022}/testing/src/ng_zone_mock.mjs +4 -4
  83. package/{esm2020 → esm2022}/testing/src/test_bed.mjs +2 -2
  84. package/esm2022/testing/src/test_bed_compiler.mjs +846 -0
  85. package/{fesm2020 → fesm2022}/core.mjs +1890 -779
  86. package/fesm2022/core.mjs.map +1 -0
  87. package/{fesm2020 → fesm2022}/testing.mjs +1203 -178
  88. package/fesm2022/testing.mjs.map +1 -0
  89. package/index.d.ts +453 -394
  90. package/package.json +8 -16
  91. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +694 -0
  92. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js.map +7 -0
  93. package/schematics/migrations/{router-link-with-href → remove-module-id}/bundle.js +153 -155
  94. package/schematics/migrations/remove-module-id/bundle.js.map +7 -0
  95. package/schematics/migrations.json +8 -8
  96. package/schematics/ng-generate/standalone-migration/bundle.js +1082 -619
  97. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  98. package/testing/index.d.ts +1 -1
  99. package/esm2020/src/application_ref.mjs +0 -907
  100. package/esm2020/src/application_tokens.mjs +0 -73
  101. package/esm2020/src/change_detection/change_detector_ref.mjs +0 -93
  102. package/esm2020/src/change_detection/differs/iterable_differs.mjs +0 -81
  103. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +0 -74
  104. package/esm2020/src/compiler/compiler_facade_interface.mjs +0 -29
  105. package/esm2020/src/core.mjs +0 -55
  106. package/esm2020/src/core_private_export.mjs +0 -37
  107. package/esm2020/src/core_reactivity_export_internal.mjs +0 -9
  108. package/esm2020/src/core_render3_private_export.mjs +0 -38
  109. package/esm2020/src/di/contextual.mjs +0 -37
  110. package/esm2020/src/di/index.mjs +0 -29
  111. package/esm2020/src/di/injector.mjs +0 -62
  112. package/esm2020/src/di/injector_compatibility.mjs +0 -236
  113. package/esm2020/src/di/provider_collection.mjs +0 -279
  114. package/esm2020/src/di/r3_injector.mjs +0 -421
  115. package/esm2020/src/di/reflective_injector.mjs +0 -311
  116. package/esm2020/src/hydration/annotate.mjs +0 -271
  117. package/esm2020/src/hydration/api.mjs +0 -128
  118. package/esm2020/src/hydration/cleanup.mjs +0 -50
  119. package/esm2020/src/hydration/error_handling.mjs +0 -37
  120. package/esm2020/src/hydration/interfaces.mjs +0 -17
  121. package/esm2020/src/hydration/node_lookup_utils.mjs +0 -83
  122. package/esm2020/src/hydration/utils.mjs +0 -206
  123. package/esm2020/src/hydration/views.mjs +0 -80
  124. package/esm2020/src/linker/component_factory_resolver.mjs +0 -42
  125. package/esm2020/src/linker/destroy_ref.mjs +0 -41
  126. package/esm2020/src/linker/query_list.mjs +0 -169
  127. package/esm2020/src/linker/view_container_ref.mjs +0 -394
  128. package/esm2020/src/metadata/di.mjs +0 -108
  129. package/esm2020/src/metadata/directives.mjs +0 -111
  130. package/esm2020/src/metadata.mjs +0 -18
  131. package/esm2020/src/render3/component_ref.mjs +0 -377
  132. package/esm2020/src/render3/features/standalone_feature.mjs +0 -70
  133. package/esm2020/src/render3/instructions/element.mjs +0 -198
  134. package/esm2020/src/render3/instructions/element_validation.mjs +0 -271
  135. package/esm2020/src/render3/instructions/listener.mjs +0 -243
  136. package/esm2020/src/render3/instructions/projection.mjs +0 -118
  137. package/esm2020/src/render3/instructions/shared.mjs +0 -1696
  138. package/esm2020/src/render3/instructions/template.mjs +0 -120
  139. package/esm2020/src/render3/instructions/text.mjs +0 -67
  140. package/esm2020/src/render3/interfaces/public_definitions.mjs +0 -9
  141. package/esm2020/src/render3/interfaces/type_checks.mjs +0 -39
  142. package/esm2020/src/render3/interfaces/view.mjs +0 -47
  143. package/esm2020/src/render3/jit/module.mjs +0 -544
  144. package/esm2020/src/render3/node_manipulation.mjs +0 -961
  145. package/esm2020/src/render3/node_selector_matcher.mjs +0 -414
  146. package/esm2020/src/render3/view_ref.mjs +0 -306
  147. package/esm2020/src/signals/index.mjs +0 -15
  148. package/esm2020/src/signals/src/api.mjs +0 -46
  149. package/esm2020/src/signals/src/computed.mjs +0 -142
  150. package/esm2020/src/signals/src/effect.mjs +0 -69
  151. package/esm2020/src/signals/src/graph.mjs +0 -114
  152. package/esm2020/src/signals/src/signal.mjs +0 -78
  153. package/esm2020/src/signals/src/watch.mjs +0 -54
  154. package/esm2020/src/signals/src/weak_ref.mjs +0 -11
  155. package/esm2020/src/transfer_state.mjs +0 -153
  156. package/esm2020/src/util/ng_dev_mode.mjs +0 -78
  157. package/esm2020/testing/src/test_bed_compiler.mjs +0 -841
  158. package/fesm2015/core.mjs +0 -29585
  159. package/fesm2015/core.mjs.map +0 -1
  160. package/fesm2015/testing.mjs +0 -25669
  161. package/fesm2015/testing.mjs.map +0 -1
  162. package/fesm2020/core.mjs.map +0 -1
  163. package/fesm2020/testing.mjs.map +0 -1
  164. package/schematics/migrations/relative-link-resolution/bundle.js +0 -283
  165. package/schematics/migrations/relative-link-resolution/bundle.js.map +0 -7
  166. package/schematics/migrations/router-link-with-href/bundle.js.map +0 -7
  167. /package/{esm2020 → esm2022}/core.mjs +0 -0
  168. /package/{esm2020 → esm2022}/index.mjs +0 -0
  169. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
  170. /package/{esm2020 → esm2022}/src/application_config.mjs +0 -0
  171. /package/{esm2020 → esm2022}/src/change_detection/change_detection.mjs +0 -0
  172. /package/{esm2020 → esm2022}/src/change_detection/constants.mjs +0 -0
  173. /package/{esm2020 → esm2022}/src/change_detection/differs/default_iterable_differ.mjs +0 -0
  174. /package/{esm2020 → esm2022}/src/change_detection/differs/default_keyvalue_differ.mjs +0 -0
  175. /package/{esm2020 → esm2022}/src/change_detection/pipe_transform.mjs +0 -0
  176. /package/{esm2020 → esm2022}/src/change_detection.mjs +0 -0
  177. /package/{esm2020 → esm2022}/src/compiler/compiler_facade.mjs +0 -0
  178. /package/{esm2020 → esm2022}/src/core_reactivity_export.mjs +0 -0
  179. /package/{esm2020 → esm2022}/src/debug/debug_node.mjs +0 -0
  180. /package/{esm2020 → esm2022}/src/di/create_injector.mjs +0 -0
  181. /package/{esm2020 → esm2022}/src/di/forward_ref.mjs +0 -0
  182. /package/{esm2020 → esm2022}/src/di/initializer_token.mjs +0 -0
  183. /package/{esm2020 → esm2022}/src/di/inject_switch.mjs +0 -0
  184. /package/{esm2020 → esm2022}/src/di/injectable.mjs +0 -0
  185. /package/{esm2020 → esm2022}/src/di/injection_token.mjs +0 -0
  186. /package/{esm2020 → esm2022}/src/di/injector_marker.mjs +0 -0
  187. /package/{esm2020 → esm2022}/src/di/injector_token.mjs +0 -0
  188. /package/{esm2020 → esm2022}/src/di/interface/defs.mjs +0 -0
  189. /package/{esm2020 → esm2022}/src/di/interface/injector.mjs +0 -0
  190. /package/{esm2020 → esm2022}/src/di/interface/provider.mjs +0 -0
  191. /package/{esm2020 → esm2022}/src/di/internal_tokens.mjs +0 -0
  192. /package/{esm2020 → esm2022}/src/di/jit/environment.mjs +0 -0
  193. /package/{esm2020 → esm2022}/src/di/jit/injectable.mjs +0 -0
  194. /package/{esm2020 → esm2022}/src/di/jit/util.mjs +0 -0
  195. /package/{esm2020 → esm2022}/src/di/metadata.mjs +0 -0
  196. /package/{esm2020 → esm2022}/src/di/metadata_attr.mjs +0 -0
  197. /package/{esm2020 → esm2022}/src/di/null_injector.mjs +0 -0
  198. /package/{esm2020 → esm2022}/src/di/provider_token.mjs +0 -0
  199. /package/{esm2020 → esm2022}/src/di/reflective_errors.mjs +0 -0
  200. /package/{esm2020 → esm2022}/src/di/reflective_key.mjs +0 -0
  201. /package/{esm2020 → esm2022}/src/di/reflective_provider.mjs +0 -0
  202. /package/{esm2020 → esm2022}/src/di/scope.mjs +0 -0
  203. /package/{esm2020 → esm2022}/src/di.mjs +0 -0
  204. /package/{esm2020 → esm2022}/src/error_details_base_url.mjs +0 -0
  205. /package/{esm2020 → esm2022}/src/error_handler.mjs +0 -0
  206. /package/{esm2020 → esm2022}/src/event_emitter.mjs +0 -0
  207. /package/{esm2020 → esm2022}/src/hydration/skip_hydration.mjs +0 -0
  208. /package/{esm2020 → esm2022}/src/hydration/tokens.mjs +0 -0
  209. /package/{esm2020 → esm2022}/src/i18n/locale_data_api.mjs +0 -0
  210. /package/{esm2020 → esm2022}/src/i18n/locale_en.mjs +0 -0
  211. /package/{esm2020 → esm2022}/src/i18n/localization.mjs +0 -0
  212. /package/{esm2020 → esm2022}/src/i18n/tokens.mjs +0 -0
  213. /package/{esm2020 → esm2022}/src/interface/lifecycle_hooks.mjs +0 -0
  214. /package/{esm2020 → esm2022}/src/interface/simple_change.mjs +0 -0
  215. /package/{esm2020 → esm2022}/src/interface/type.mjs +0 -0
  216. /package/{esm2020 → esm2022}/src/linker/component_factory.mjs +0 -0
  217. /package/{esm2020 → esm2022}/src/linker/ng_module_factory.mjs +0 -0
  218. /package/{esm2020 → esm2022}/src/linker/ng_module_factory_loader.mjs +0 -0
  219. /package/{esm2020 → esm2022}/src/linker/ng_module_factory_loader_impl.mjs +0 -0
  220. /package/{esm2020 → esm2022}/src/linker/ng_module_registration.mjs +0 -0
  221. /package/{esm2020 → esm2022}/src/linker/view_ref.mjs +0 -0
  222. /package/{esm2020 → esm2022}/src/linker.mjs +0 -0
  223. /package/{esm2020 → esm2022}/src/metadata/ng_module_def.mjs +0 -0
  224. /package/{esm2020 → esm2022}/src/metadata/resource_loading.mjs +0 -0
  225. /package/{esm2020 → esm2022}/src/metadata/schema.mjs +0 -0
  226. /package/{esm2020 → esm2022}/src/metadata/view.mjs +0 -0
  227. /package/{esm2020 → esm2022}/src/platform_core_providers.mjs +0 -0
  228. /package/{esm2020 → esm2022}/src/r3_symbols.mjs +0 -0
  229. /package/{esm2020 → esm2022}/src/reflection/platform_reflection_capabilities.mjs +0 -0
  230. /package/{esm2020 → esm2022}/src/reflection/reflection_capabilities.mjs +0 -0
  231. /package/{esm2020 → esm2022}/src/render/api_flags.mjs +0 -0
  232. /package/{esm2020 → esm2022}/src/render.mjs +0 -0
  233. /package/{esm2020 → esm2022}/src/render3/assert.mjs +0 -0
  234. /package/{esm2020 → esm2022}/src/render3/bindings.mjs +0 -0
  235. /package/{esm2020 → esm2022}/src/render3/collect_native_nodes.mjs +0 -0
  236. /package/{esm2020 → esm2022}/src/render3/component.mjs +0 -0
  237. /package/{esm2020 → esm2022}/src/render3/definition.mjs +0 -0
  238. /package/{esm2020 → esm2022}/src/render3/definition_factory.mjs +0 -0
  239. /package/{esm2020 → esm2022}/src/render3/di.mjs +0 -0
  240. /package/{esm2020 → esm2022}/src/render3/di_setup.mjs +0 -0
  241. /package/{esm2020 → esm2022}/src/render3/errors.mjs +0 -0
  242. /package/{esm2020 → esm2022}/src/render3/errors_di.mjs +0 -0
  243. /package/{esm2020 → esm2022}/src/render3/features/copy_definition_feature.mjs +0 -0
  244. /package/{esm2020 → esm2022}/src/render3/features/host_directives_feature.mjs +0 -0
  245. /package/{esm2020 → esm2022}/src/render3/features/inherit_definition_feature.mjs +0 -0
  246. /package/{esm2020 → esm2022}/src/render3/features/ng_onchanges_feature.mjs +0 -0
  247. /package/{esm2020 → esm2022}/src/render3/features/providers_feature.mjs +0 -0
  248. /package/{esm2020 → esm2022}/src/render3/fields.mjs +0 -0
  249. /package/{esm2020 → esm2022}/src/render3/global_utils_api.mjs +0 -0
  250. /package/{esm2020 → esm2022}/src/render3/hooks.mjs +0 -0
  251. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_apply.mjs +0 -0
  252. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_debug.mjs +0 -0
  253. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_insert_before_index.mjs +0 -0
  254. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_locale_id.mjs +0 -0
  255. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_parse.mjs +0 -0
  256. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_postprocess.mjs +0 -0
  257. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_tree_shaking.mjs +0 -0
  258. /package/{esm2020 → esm2022}/src/render3/i18n/i18n_util.mjs +0 -0
  259. /package/{esm2020 → esm2022}/src/render3/index.mjs +0 -0
  260. /package/{esm2020 → esm2022}/src/render3/instructions/advance.mjs +0 -0
  261. /package/{esm2020 → esm2022}/src/render3/instructions/all.mjs +0 -0
  262. /package/{esm2020 → esm2022}/src/render3/instructions/attribute.mjs +0 -0
  263. /package/{esm2020 → esm2022}/src/render3/instructions/attribute_interpolation.mjs +0 -0
  264. /package/{esm2020 → esm2022}/src/render3/instructions/change_detection.mjs +0 -0
  265. /package/{esm2020 → esm2022}/src/render3/instructions/class_map_interpolation.mjs +0 -0
  266. /package/{esm2020 → esm2022}/src/render3/instructions/di.mjs +0 -0
  267. /package/{esm2020 → esm2022}/src/render3/instructions/di_attr.mjs +0 -0
  268. /package/{esm2020 → esm2022}/src/render3/instructions/get_current_view.mjs +0 -0
  269. /package/{esm2020 → esm2022}/src/render3/instructions/host_property.mjs +0 -0
  270. /package/{esm2020 → esm2022}/src/render3/instructions/i18n.mjs +0 -0
  271. /package/{esm2020 → esm2022}/src/render3/instructions/i18n_icu_container_visitor.mjs +0 -0
  272. /package/{esm2020 → esm2022}/src/render3/instructions/interpolation.mjs +0 -0
  273. /package/{esm2020 → esm2022}/src/render3/instructions/namespace.mjs +0 -0
  274. /package/{esm2020 → esm2022}/src/render3/instructions/next_context.mjs +0 -0
  275. /package/{esm2020 → esm2022}/src/render3/instructions/property.mjs +0 -0
  276. /package/{esm2020 → esm2022}/src/render3/instructions/property_interpolation.mjs +0 -0
  277. /package/{esm2020 → esm2022}/src/render3/instructions/storage.mjs +0 -0
  278. /package/{esm2020 → esm2022}/src/render3/instructions/style_map_interpolation.mjs +0 -0
  279. /package/{esm2020 → esm2022}/src/render3/instructions/style_prop_interpolation.mjs +0 -0
  280. /package/{esm2020 → esm2022}/src/render3/instructions/text_interpolation.mjs +0 -0
  281. /package/{esm2020 → esm2022}/src/render3/interfaces/container.mjs +0 -0
  282. /package/{esm2020 → esm2022}/src/render3/interfaces/context.mjs +0 -0
  283. /package/{esm2020 → esm2022}/src/render3/interfaces/definition.mjs +0 -0
  284. /package/{esm2020 → esm2022}/src/render3/interfaces/document.mjs +0 -0
  285. /package/{esm2020 → esm2022}/src/render3/interfaces/i18n.mjs +0 -0
  286. /package/{esm2020 → esm2022}/src/render3/interfaces/injector.mjs +0 -0
  287. /package/{esm2020 → esm2022}/src/render3/interfaces/lview_tracking.mjs +0 -0
  288. /package/{esm2020 → esm2022}/src/render3/interfaces/node.mjs +0 -0
  289. /package/{esm2020 → esm2022}/src/render3/interfaces/projection.mjs +0 -0
  290. /package/{esm2020 → esm2022}/src/render3/interfaces/query.mjs +0 -0
  291. /package/{esm2020 → esm2022}/src/render3/interfaces/renderer.mjs +0 -0
  292. /package/{esm2020 → esm2022}/src/render3/interfaces/renderer_dom.mjs +0 -0
  293. /package/{esm2020 → esm2022}/src/render3/interfaces/sanitization.mjs +0 -0
  294. /package/{esm2020 → esm2022}/src/render3/interfaces/styling.mjs +0 -0
  295. /package/{esm2020 → esm2022}/src/render3/jit/directive.mjs +0 -0
  296. /package/{esm2020 → esm2022}/src/render3/jit/environment.mjs +0 -0
  297. /package/{esm2020 → esm2022}/src/render3/jit/jit_options.mjs +0 -0
  298. /package/{esm2020 → esm2022}/src/render3/jit/module_patch.mjs +0 -0
  299. /package/{esm2020 → esm2022}/src/render3/jit/partial.mjs +0 -0
  300. /package/{esm2020 → esm2022}/src/render3/jit/pipe.mjs +0 -0
  301. /package/{esm2020 → esm2022}/src/render3/jit/util.mjs +0 -0
  302. /package/{esm2020 → esm2022}/src/render3/metadata.mjs +0 -0
  303. /package/{esm2020 → esm2022}/src/render3/namespaces.mjs +0 -0
  304. /package/{esm2020 → esm2022}/src/render3/ng_module_ref.mjs +0 -0
  305. /package/{esm2020 → esm2022}/src/render3/node_assert.mjs +0 -0
  306. /package/{esm2020 → esm2022}/src/render3/node_manipulation_i18n.mjs +0 -0
  307. /package/{esm2020 → esm2022}/src/render3/pipe.mjs +0 -0
  308. /package/{esm2020 → esm2022}/src/render3/profiler.mjs +0 -0
  309. /package/{esm2020 → esm2022}/src/render3/pure_function.mjs +0 -0
  310. /package/{esm2020 → esm2022}/src/render3/query.mjs +0 -0
  311. /package/{esm2020 → esm2022}/src/render3/state.mjs +0 -0
  312. /package/{esm2020 → esm2022}/src/render3/styling/class_differ.mjs +0 -0
  313. /package/{esm2020 → esm2022}/src/render3/styling/static_styling.mjs +0 -0
  314. /package/{esm2020 → esm2022}/src/render3/styling/style_binding_list.mjs +0 -0
  315. /package/{esm2020 → esm2022}/src/render3/styling/styling_parser.mjs +0 -0
  316. /package/{esm2020 → esm2022}/src/render3/tokens.mjs +0 -0
  317. /package/{esm2020 → esm2022}/src/render3/util/attrs_utils.mjs +0 -0
  318. /package/{esm2020 → esm2022}/src/render3/util/discovery_utils.mjs +0 -0
  319. /package/{esm2020 → esm2022}/src/render3/util/global_utils.mjs +0 -0
  320. /package/{esm2020 → esm2022}/src/render3/util/injector_utils.mjs +0 -0
  321. /package/{esm2020 → esm2022}/src/render3/util/misc_utils.mjs +0 -0
  322. /package/{esm2020 → esm2022}/src/render3/util/stringify_utils.mjs +0 -0
  323. /package/{esm2020 → esm2022}/src/render3/util/view_traversal_utils.mjs +0 -0
  324. /package/{esm2020 → esm2022}/src/render3/view_engine_compatibility_prebound.mjs +0 -0
  325. /package/{esm2020 → esm2022}/src/sanitization/bypass.mjs +0 -0
  326. /package/{esm2020 → esm2022}/src/sanitization/html_sanitizer.mjs +0 -0
  327. /package/{esm2020 → esm2022}/src/sanitization/iframe_attrs_validation.mjs +0 -0
  328. /package/{esm2020 → esm2022}/src/sanitization/inert_body.mjs +0 -0
  329. /package/{esm2020 → esm2022}/src/sanitization/sanitization.mjs +0 -0
  330. /package/{esm2020 → esm2022}/src/sanitization/security.mjs +0 -0
  331. /package/{esm2020 → esm2022}/src/sanitization/url_sanitizer.mjs +0 -0
  332. /package/{esm2020 → esm2022}/src/signals/src/untracked.mjs +0 -0
  333. /package/{esm2020 → esm2022}/src/util/array_utils.mjs +0 -0
  334. /package/{esm2020 → esm2022}/src/util/assert.mjs +0 -0
  335. /package/{esm2020 → esm2022}/src/util/char_code.mjs +0 -0
  336. /package/{esm2020 → esm2022}/src/util/closure.mjs +0 -0
  337. /package/{esm2020 → esm2022}/src/util/coercion.mjs +0 -0
  338. /package/{esm2020 → esm2022}/src/util/comparison.mjs +0 -0
  339. /package/{esm2020 → esm2022}/src/util/decorators.mjs +0 -0
  340. /package/{esm2020 → esm2022}/src/util/dom.mjs +0 -0
  341. /package/{esm2020 → esm2022}/src/util/empty.mjs +0 -0
  342. /package/{esm2020 → esm2022}/src/util/errors.mjs +0 -0
  343. /package/{esm2020 → esm2022}/src/util/global.mjs +0 -0
  344. /package/{esm2020 → esm2022}/src/util/is_dev_mode.mjs +0 -0
  345. /package/{esm2020 → esm2022}/src/util/iterable.mjs +0 -0
  346. /package/{esm2020 → esm2022}/src/util/lang.mjs +0 -0
  347. /package/{esm2020 → esm2022}/src/util/microtask.mjs +0 -0
  348. /package/{esm2020 → esm2022}/src/util/ng_i18n_closure_mode.mjs +0 -0
  349. /package/{esm2020 → esm2022}/src/util/ng_jit_mode.mjs +0 -0
  350. /package/{esm2020 → esm2022}/src/util/ng_reflect.mjs +0 -0
  351. /package/{esm2020 → esm2022}/src/util/noop.mjs +0 -0
  352. /package/{esm2020 → esm2022}/src/util/property.mjs +0 -0
  353. /package/{esm2020 → esm2022}/src/util/raf.mjs +0 -0
  354. /package/{esm2020 → esm2022}/src/util/security/trusted_type_defs.mjs +0 -0
  355. /package/{esm2020 → esm2022}/src/util/security/trusted_types.mjs +0 -0
  356. /package/{esm2020 → esm2022}/src/util/security/trusted_types_bypass.mjs +0 -0
  357. /package/{esm2020 → esm2022}/src/util/stringify.mjs +0 -0
  358. /package/{esm2020 → esm2022}/src/view/provider_flags.mjs +0 -0
  359. /package/{esm2020 → esm2022}/src/zone/async-stack-tagging.mjs +0 -0
  360. /package/{esm2020 → esm2022}/src/zone/ng_zone.mjs +0 -0
  361. /package/{esm2020 → esm2022}/src/zone.mjs +0 -0
  362. /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
  363. /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
  364. /package/{esm2020 → esm2022}/testing/src/async.mjs +0 -0
  365. /package/{esm2020 → esm2022}/testing/src/component_fixture.mjs +0 -0
  366. /package/{esm2020 → esm2022}/testing/src/fake_async.mjs +0 -0
  367. /package/{esm2020 → esm2022}/testing/src/metadata_override.mjs +0 -0
  368. /package/{esm2020 → esm2022}/testing/src/metadata_overrider.mjs +0 -0
  369. /package/{esm2020 → esm2022}/testing/src/resolvers.mjs +0 -0
  370. /package/{esm2020 → esm2022}/testing/src/styling.mjs +0 -0
  371. /package/{esm2020 → esm2022}/testing/src/test_bed_common.mjs +0 -0
  372. /package/{esm2020 → esm2022}/testing/src/test_hooks.mjs +0 -0
  373. /package/{esm2020 → esm2022}/testing/src/testing.mjs +0 -0
  374. /package/{esm2020 → esm2022}/testing/src/testing_internal.mjs +0 -0
  375. /package/{esm2020 → esm2022}/testing/testing.mjs +0 -0
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.3
2
+ * @license Angular v16.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { Subject, Subscription, Observable, merge as merge$1 } from 'rxjs';
8
- import { share } from 'rxjs/operators';
8
+ import { first, share } from 'rxjs/operators';
9
9
 
10
10
  function getClosureSafeProperty(objWithPropertyToExtract) {
11
11
  for (let key in objWithPropertyToExtract) {
@@ -558,6 +558,7 @@ function ngDevModeResetPerfCounters() {
558
558
  hydratedNodes: 0,
559
559
  hydratedComponents: 0,
560
560
  dehydratedViewsRemoved: 0,
561
+ dehydratedViewsCleanupRuns: 0,
561
562
  };
562
563
  // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.
563
564
  const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;
@@ -619,6 +620,9 @@ const SOURCE = '__source';
619
620
  * - Injector instance: Use the injector for resolution.
620
621
  */
621
622
  let _currentInjector = undefined;
623
+ function getCurrentInjector() {
624
+ return _currentInjector;
625
+ }
622
626
  function setCurrentInjector(injector) {
623
627
  const former = _currentInjector;
624
628
  _currentInjector = injector;
@@ -627,7 +631,7 @@ function setCurrentInjector(injector) {
627
631
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
628
632
  if (_currentInjector === undefined) {
629
633
  throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
630
- `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
634
+ `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`runInInjectionContext\`.`);
631
635
  }
632
636
  else if (_currentInjector === null) {
633
637
  return injectRootLimpMode(token, undefined, flags);
@@ -1187,12 +1191,19 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
1187
1191
  ngDevMode &&
1188
1192
  assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');
1189
1193
  let i = 0;
1194
+ // Indicates whether we are processing value from the implicit
1195
+ // attribute section (i.e. before the first marker in the array).
1196
+ let isImplicitAttrsSection = true;
1190
1197
  while (i < attrs.length) {
1191
1198
  let item = attrs[i++];
1192
- if (isProjectionMode && item === 'class') {
1193
- item = attrs[i];
1194
- if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {
1195
- return true;
1199
+ if (typeof item === 'string' && isImplicitAttrsSection) {
1200
+ const value = attrs[i++];
1201
+ if (isProjectionMode && item === 'class') {
1202
+ // We found a `class` attribute in the implicit attribute section,
1203
+ // check if it matches the value of the `cssClassToMatch` argument.
1204
+ if (classIndexOf(value.toLowerCase(), cssClassToMatch, 0) !== -1) {
1205
+ return true;
1206
+ }
1196
1207
  }
1197
1208
  }
1198
1209
  else if (item === 1 /* AttributeMarker.Classes */) {
@@ -1204,6 +1215,11 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
1204
1215
  }
1205
1216
  return false;
1206
1217
  }
1218
+ else if (typeof item === 'number') {
1219
+ // We've came across a first marker, which indicates
1220
+ // that the implicit attribute section is over.
1221
+ isImplicitAttrsSection = false;
1222
+ }
1207
1223
  }
1208
1224
  return false;
1209
1225
  }
@@ -1958,6 +1974,8 @@ const ID = 20;
1958
1974
  const EMBEDDED_VIEW_INJECTOR = 21;
1959
1975
  const ON_DESTROY_HOOKS = 22;
1960
1976
  const HYDRATION = 23;
1977
+ const REACTIVE_TEMPLATE_CONSUMER = 24;
1978
+ const REACTIVE_HOST_BINDING_CONSUMER = 25;
1961
1979
  /**
1962
1980
  * Size of LView's header. Necessary to adjust for it when setting slots.
1963
1981
  *
@@ -1965,7 +1983,7 @@ const HYDRATION = 23;
1965
1983
  * instruction index into `LView` index. All other indexes should be in the `LView` index space and
1966
1984
  * there should be no need to refer to `HEADER_OFFSET` anywhere else.
1967
1985
  */
1968
- const HEADER_OFFSET = 24;
1986
+ const HEADER_OFFSET = 26;
1969
1987
  // Note: This hack is necessary so we don't erroneously get a circular dependency
1970
1988
  // failure based on types.
1971
1989
  const unusedValueExportToPlacateAjd$4 = 1;
@@ -2038,6 +2056,9 @@ function isComponentDef(def) {
2038
2056
  function isRootView(target) {
2039
2057
  return (target[FLAGS] & 256 /* LViewFlags.IsRoot */) !== 0;
2040
2058
  }
2059
+ function isProjectionTNode(tNode) {
2060
+ return (tNode.type & 16 /* TNodeType.Projection */) === 16 /* TNodeType.Projection */;
2061
+ }
2041
2062
 
2042
2063
  // [Assert functions do not constraint type when they are guarded by a truthy
2043
2064
  // expression.](https://github.com/microsoft/TypeScript/issues/37295)
@@ -2451,6 +2472,17 @@ function storeLViewOnDestroy(lView, onDestroyCallback) {
2451
2472
  }
2452
2473
  lView[ON_DESTROY_HOOKS].push(onDestroyCallback);
2453
2474
  }
2475
+ /**
2476
+ * Removes previously registered LView-specific destroy callback.
2477
+ */
2478
+ function removeLViewOnDestroy(lView, onDestroyCallback) {
2479
+ if (lView[ON_DESTROY_HOOKS] === null)
2480
+ return;
2481
+ const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);
2482
+ if (destroyCBIdx !== -1) {
2483
+ lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);
2484
+ }
2485
+ }
2454
2486
 
2455
2487
  const instructionState = {
2456
2488
  lFrame: createLFrame(null),
@@ -4327,126 +4359,6 @@ function makePropDecorator(name, props, parentClass, additionalProcessing) {
4327
4359
  */
4328
4360
  const Attribute = makeParamDecorator('Attribute', (attributeName) => ({ attributeName, __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName) }));
4329
4361
 
4330
- /**
4331
- * Creates a token that can be used in a DI Provider.
4332
- *
4333
- * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
4334
- * runtime representation) such as when injecting an interface, callable type, array or
4335
- * parameterized type.
4336
- *
4337
- * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
4338
- * the `Injector`. This provides an additional level of type safety.
4339
- *
4340
- * ```
4341
- * interface MyInterface {...}
4342
- * const myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));
4343
- * // myInterface is inferred to be MyInterface.
4344
- * ```
4345
- *
4346
- * When creating an `InjectionToken`, you can optionally specify a factory function which returns
4347
- * (possibly by creating) a default value of the parameterized type `T`. This sets up the
4348
- * `InjectionToken` using this factory as a provider as if it was defined explicitly in the
4349
- * application's root injector. If the factory function, which takes zero arguments, needs to inject
4350
- * dependencies, it can do so using the `inject` function.
4351
- * As you can see in the Tree-shakable InjectionToken example below.
4352
- *
4353
- * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
4354
- * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:
4355
- * this option is now deprecated). As mentioned above, `'root'` is the default value for
4356
- * `providedIn`.
4357
- *
4358
- * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.
4359
- *
4360
- * @usageNotes
4361
- * ### Basic Examples
4362
- *
4363
- * ### Plain InjectionToken
4364
- *
4365
- * {@example core/di/ts/injector_spec.ts region='InjectionToken'}
4366
- *
4367
- * ### Tree-shakable InjectionToken
4368
- *
4369
- * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
4370
- *
4371
- *
4372
- * @publicApi
4373
- */
4374
- class InjectionToken {
4375
- /**
4376
- * @param _desc Description for the token,
4377
- * used only for debugging purposes,
4378
- * it should but does not need to be unique
4379
- * @param options Options for the token's usage, as described above
4380
- */
4381
- constructor(_desc, options) {
4382
- this._desc = _desc;
4383
- /** @internal */
4384
- this.ngMetadataName = 'InjectionToken';
4385
- this.ɵprov = undefined;
4386
- if (typeof options == 'number') {
4387
- (typeof ngDevMode === 'undefined' || ngDevMode) &&
4388
- assertLessThan(options, 0, 'Only negative numbers are supported here');
4389
- // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.
4390
- // See `InjectorMarkers`
4391
- this.__NG_ELEMENT_ID__ = options;
4392
- }
4393
- else if (options !== undefined) {
4394
- this.ɵprov = ɵɵdefineInjectable({
4395
- token: this,
4396
- providedIn: options.providedIn || 'root',
4397
- factory: options.factory,
4398
- });
4399
- }
4400
- }
4401
- /**
4402
- * @internal
4403
- */
4404
- get multi() {
4405
- return this;
4406
- }
4407
- toString() {
4408
- return `InjectionToken ${this._desc}`;
4409
- }
4410
- }
4411
-
4412
- /**
4413
- * A DI token that you can use to create a virtual [provider](guide/glossary#provider)
4414
- * that will populate the `entryComponents` field of components and NgModules
4415
- * based on its `useValue` property value.
4416
- * All components that are referenced in the `useValue` value (either directly
4417
- * or in a nested array or map) are added to the `entryComponents` property.
4418
- *
4419
- * @usageNotes
4420
- *
4421
- * The following example shows how the router can populate the `entryComponents`
4422
- * field of an NgModule based on a router configuration that refers
4423
- * to components.
4424
- *
4425
- * ```typescript
4426
- * // helper function inside the router
4427
- * function provideRoutes(routes) {
4428
- * return [
4429
- * {provide: ROUTES, useValue: routes},
4430
- * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}
4431
- * ];
4432
- * }
4433
- *
4434
- * // user code
4435
- * let routes = [
4436
- * {path: '/root', component: RootComp},
4437
- * {path: '/teams', component: TeamsComp}
4438
- * ];
4439
- *
4440
- * @NgModule({
4441
- * providers: [provideRoutes(routes)]
4442
- * })
4443
- * class ModuleWithRoutes {}
4444
- * ```
4445
- *
4446
- * @publicApi
4447
- * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.
4448
- */
4449
- const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
4450
4362
  // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
4451
4363
  // explicitly set.
4452
4364
  const emitDistinctChangesOnlyDefaultValue = true;
@@ -6435,6 +6347,8 @@ function detachView(lContainer, removeIndex) {
6435
6347
  function destroyLView(tView, lView) {
6436
6348
  if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
6437
6349
  const renderer = lView[RENDERER];
6350
+ lView[REACTIVE_TEMPLATE_CONSUMER]?.destroy();
6351
+ lView[REACTIVE_HOST_BINDING_CONSUMER]?.destroy();
6438
6352
  if (renderer.destroyNode) {
6439
6353
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
6440
6354
  }
@@ -6835,15 +6749,12 @@ function nativeRemoveNode(renderer, rNode, isHostElement) {
6835
6749
  }
6836
6750
  }
6837
6751
  /**
6838
- * Removes the contents of a given RElement using a given renderer.
6752
+ * Clears the contents of a given RElement.
6839
6753
  *
6840
- * @param renderer A renderer to be used
6841
6754
  * @param rElement the native RElement to be cleared
6842
6755
  */
6843
- function clearElementContents(renderer, rElement) {
6844
- while (rElement.firstChild) {
6845
- nativeRemoveChild(renderer, rElement, rElement.firstChild, false);
6846
- }
6756
+ function clearElementContents(rElement) {
6757
+ rElement.textContent = '';
6847
6758
  }
6848
6759
  /**
6849
6760
  * Performs the operation of `action` on the node. Typically this involves inserting or removing
@@ -8051,6 +7962,88 @@ function getSanitizer() {
8051
7962
  return lView && lView[SANITIZER];
8052
7963
  }
8053
7964
 
7965
+ /**
7966
+ * Creates a token that can be used in a DI Provider.
7967
+ *
7968
+ * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
7969
+ * runtime representation) such as when injecting an interface, callable type, array or
7970
+ * parameterized type.
7971
+ *
7972
+ * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
7973
+ * the `Injector`. This provides an additional level of type safety.
7974
+ *
7975
+ * ```
7976
+ * interface MyInterface {...}
7977
+ * const myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));
7978
+ * // myInterface is inferred to be MyInterface.
7979
+ * ```
7980
+ *
7981
+ * When creating an `InjectionToken`, you can optionally specify a factory function which returns
7982
+ * (possibly by creating) a default value of the parameterized type `T`. This sets up the
7983
+ * `InjectionToken` using this factory as a provider as if it was defined explicitly in the
7984
+ * application's root injector. If the factory function, which takes zero arguments, needs to inject
7985
+ * dependencies, it can do so using the `inject` function.
7986
+ * As you can see in the Tree-shakable InjectionToken example below.
7987
+ *
7988
+ * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
7989
+ * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:
7990
+ * this option is now deprecated). As mentioned above, `'root'` is the default value for
7991
+ * `providedIn`.
7992
+ *
7993
+ * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.
7994
+ *
7995
+ * @usageNotes
7996
+ * ### Basic Examples
7997
+ *
7998
+ * ### Plain InjectionToken
7999
+ *
8000
+ * {@example core/di/ts/injector_spec.ts region='InjectionToken'}
8001
+ *
8002
+ * ### Tree-shakable InjectionToken
8003
+ *
8004
+ * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
8005
+ *
8006
+ *
8007
+ * @publicApi
8008
+ */
8009
+ class InjectionToken {
8010
+ /**
8011
+ * @param _desc Description for the token,
8012
+ * used only for debugging purposes,
8013
+ * it should but does not need to be unique
8014
+ * @param options Options for the token's usage, as described above
8015
+ */
8016
+ constructor(_desc, options) {
8017
+ this._desc = _desc;
8018
+ /** @internal */
8019
+ this.ngMetadataName = 'InjectionToken';
8020
+ this.ɵprov = undefined;
8021
+ if (typeof options == 'number') {
8022
+ (typeof ngDevMode === 'undefined' || ngDevMode) &&
8023
+ assertLessThan(options, 0, 'Only negative numbers are supported here');
8024
+ // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.
8025
+ // See `InjectorMarkers`
8026
+ this.__NG_ELEMENT_ID__ = options;
8027
+ }
8028
+ else if (options !== undefined) {
8029
+ this.ɵprov = ɵɵdefineInjectable({
8030
+ token: this,
8031
+ providedIn: options.providedIn || 'root',
8032
+ factory: options.factory,
8033
+ });
8034
+ }
8035
+ }
8036
+ /**
8037
+ * @internal
8038
+ */
8039
+ get multi() {
8040
+ return this;
8041
+ }
8042
+ toString() {
8043
+ return `InjectionToken ${this._desc}`;
8044
+ }
8045
+ }
8046
+
8054
8047
  /**
8055
8048
  * A multi-provider token for initialization functions that will run upon construction of an
8056
8049
  * environment injector.
@@ -8154,7 +8147,7 @@ function internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {
8154
8147
  // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.
8155
8148
  const internalSource = source;
8156
8149
  if (walkProviderTree(internalSource, providersOut, [], dedup)) {
8157
- injectorTypesWithProviders || (injectorTypesWithProviders = []);
8150
+ injectorTypesWithProviders ||= [];
8158
8151
  injectorTypesWithProviders.push(internalSource);
8159
8152
  }
8160
8153
  });
@@ -8250,7 +8243,7 @@ function walkProviderTree(container, providersOut, parents, dedup) {
8250
8243
  try {
8251
8244
  deepForEach(injDef.imports, imported => {
8252
8245
  if (walkProviderTree(imported, providersOut, parents, dedup)) {
8253
- importTypesWithProviders || (importTypesWithProviders = []);
8246
+ importTypesWithProviders ||= [];
8254
8247
  // If the processed import is an injector type with providers, we store it in the
8255
8248
  // list of import types with providers, so that we can process those afterwards.
8256
8249
  importTypesWithProviders.push(imported);
@@ -8447,6 +8440,7 @@ class R3Injector extends EnvironmentInjector {
8447
8440
  }
8448
8441
  onDestroy(callback) {
8449
8442
  this._onDestroyHooks.push(callback);
8443
+ return () => this.removeOnDestroy(callback);
8450
8444
  }
8451
8445
  runInContext(fn) {
8452
8446
  this.assertNotDestroyed();
@@ -8621,6 +8615,12 @@ class R3Injector extends EnvironmentInjector {
8621
8615
  return this.injectorDefTypes.has(providedIn);
8622
8616
  }
8623
8617
  }
8618
+ removeOnDestroy(callback) {
8619
+ const destroyCBIdx = this._onDestroyHooks.indexOf(callback);
8620
+ if (destroyCBIdx !== -1) {
8621
+ this._onDestroyHooks.splice(destroyCBIdx, 1);
8622
+ }
8623
+ }
8624
8624
  }
8625
8625
  function injectableDefOrInjectorDefFactory(token) {
8626
8626
  // Most tokens will have an injectable def directly on them, which specifies a factory directly.
@@ -8806,6 +8806,37 @@ const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
8806
8806
  * @publicApi
8807
8807
  */
8808
8808
  const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
8809
+ // TODO(crisbeto): link to CSP guide here.
8810
+ /**
8811
+ * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that
8812
+ * Angular will apply when inserting inline styles. If not provided, Angular will look up its value
8813
+ * from the `ngCspNonce` attribute of the application root node.
8814
+ *
8815
+ * @publicApi
8816
+ */
8817
+ const CSP_NONCE = new InjectionToken('CSP nonce', {
8818
+ providedIn: 'root',
8819
+ factory: () => {
8820
+ // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on
8821
+ // the root node, but because the token value is used in renderers, it has to be available
8822
+ // *very* early in the bootstrapping process. This should be a fairly shallow search, because
8823
+ // the app won't have been added to the DOM yet. Some approaches that were considered:
8824
+ // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would
8825
+ // be enough for our purposes, but the token is injected very early so the `components` array
8826
+ // isn't populated yet.
8827
+ // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to
8828
+ // creating the `LView`. This means that no `LView` will have been entered when this factory is
8829
+ // invoked for the root component.
8830
+ // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -
8831
+ // the slightly later execution does allow us to get an `LView` reference, but the fact that
8832
+ // it is a function means that it could be executed at *any* time (including immediately) which
8833
+ // may lead to weird bugs.
8834
+ // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the
8835
+ // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root
8836
+ // node and the nonce value needs to be available when the renderer is created.
8837
+ return getDocument().body.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;
8838
+ },
8839
+ });
8809
8840
 
8810
8841
  function escapeTransferStateContent(text) {
8811
8842
  const escapedText = {
@@ -8870,6 +8901,13 @@ class TransferState {
8870
8901
  this.store = {};
8871
8902
  this.onSerializeCallbacks = {};
8872
8903
  }
8904
+ /** @nocollapse */
8905
+ static { this.ɵprov =
8906
+ /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
8907
+ token: TransferState,
8908
+ providedIn: 'root',
8909
+ factory: initTransferState,
8910
+ }); }
8873
8911
  /**
8874
8912
  * Get the value corresponding to a key. Return `defaultValue` if key is not found.
8875
8913
  */
@@ -8924,13 +8962,6 @@ class TransferState {
8924
8962
  return JSON.stringify(this.store);
8925
8963
  }
8926
8964
  }
8927
- /** @nocollapse */
8928
- TransferState.ɵprov =
8929
- /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
8930
- token: TransferState,
8931
- providedIn: 'root',
8932
- factory: initTransferState,
8933
- });
8934
8965
  function retrieveTransferredState(doc, appId) {
8935
8966
  // Locate the script tag with the JSON data transferred from the server.
8936
8967
  // The id of the script tag is set to the Angular appId + 'state'.
@@ -8948,6 +8979,19 @@ function retrieveTransferredState(doc, appId) {
8948
8979
  return initialState;
8949
8980
  }
8950
8981
 
8982
+ /** Encodes that the node lookup should start from the host node of this component. */
8983
+ const REFERENCE_NODE_HOST = 'h';
8984
+ /** Encodes that the node lookup should start from the document body node. */
8985
+ const REFERENCE_NODE_BODY = 'b';
8986
+ /**
8987
+ * Describes navigation steps that the runtime logic need to perform,
8988
+ * starting from a given (known) element.
8989
+ */
8990
+ var NodeNavigationStep;
8991
+ (function (NodeNavigationStep) {
8992
+ NodeNavigationStep["FirstChild"] = "f";
8993
+ NodeNavigationStep["NextSibling"] = "n";
8994
+ })(NodeNavigationStep || (NodeNavigationStep = {}));
8951
8995
  /**
8952
8996
  * Keys within serialized view data structure to represent various
8953
8997
  * parts. See the `SerializedView` interface below for additional information.
@@ -8955,8 +8999,11 @@ function retrieveTransferredState(doc, appId) {
8955
8999
  const ELEMENT_CONTAINERS = 'e';
8956
9000
  const TEMPLATES = 't';
8957
9001
  const CONTAINERS = 'c';
9002
+ const MULTIPLIER = 'x';
8958
9003
  const NUM_ROOT_NODES = 'r';
8959
9004
  const TEMPLATE_ID = 'i'; // as it's also an "id"
9005
+ const NODES = 'n';
9006
+ const DISCONNECTED_NODES = 'd';
8960
9007
 
8961
9008
  /**
8962
9009
  * The name of the key used in the TransferState collection,
@@ -9110,7 +9157,7 @@ function isRNodeClaimedForHydration(node) {
9110
9157
  return !!node.__claimed;
9111
9158
  }
9112
9159
  function setSegmentHead(hydrationInfo, index, node) {
9113
- hydrationInfo.segmentHeads ?? (hydrationInfo.segmentHeads = {});
9160
+ hydrationInfo.segmentHeads ??= {};
9114
9161
  hydrationInfo.segmentHeads[index] = node;
9115
9162
  }
9116
9163
  function getSegmentHead(hydrationInfo, index) {
@@ -9146,10 +9193,23 @@ function calcSerializedContainerSize(hydrationInfo, index) {
9146
9193
  const views = getSerializedContainerViews(hydrationInfo, index) ?? [];
9147
9194
  let numNodes = 0;
9148
9195
  for (let view of views) {
9149
- numNodes += view[NUM_ROOT_NODES];
9196
+ numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);
9150
9197
  }
9151
9198
  return numNodes;
9152
9199
  }
9200
+ /**
9201
+ * Checks whether a node is annotated as "disconnected", i.e. not present
9202
+ * in the DOM at serialization time. We should not attempt hydration for
9203
+ * such nodes and instead, use a regular "creation mode".
9204
+ */
9205
+ function isDisconnectedNode$1(hydrationInfo, index) {
9206
+ // Check if we are processing disconnected info for the first time.
9207
+ if (typeof hydrationInfo.disconnectedNodes === 'undefined') {
9208
+ const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];
9209
+ hydrationInfo.disconnectedNodes = nodeIds ? (new Set(nodeIds)) : null;
9210
+ }
9211
+ return !!hydrationInfo.disconnectedNodes?.has(index);
9212
+ }
9153
9213
 
9154
9214
  /**
9155
9215
  * Represents a component created by a `ComponentFactory`.
@@ -9176,7 +9236,7 @@ class ComponentFactory$1 {
9176
9236
  }
9177
9237
 
9178
9238
  function noComponentFactoryError(component) {
9179
- const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
9239
+ const error = Error(`No component factory found for ${stringify(component)}.`);
9180
9240
  error[ERROR_COMPONENT] = component;
9181
9241
  return error;
9182
9242
  }
@@ -9205,8 +9265,8 @@ class _NullComponentFactoryResolver {
9205
9265
  * Component class can be used directly.
9206
9266
  */
9207
9267
  class ComponentFactoryResolver$1 {
9268
+ static { this.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver()); }
9208
9269
  }
9209
- ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
9210
9270
 
9211
9271
  /**
9212
9272
  * Creates an ElementRef from the most recent node.
@@ -9245,12 +9305,12 @@ class ElementRef {
9245
9305
  constructor(nativeElement) {
9246
9306
  this.nativeElement = nativeElement;
9247
9307
  }
9308
+ /**
9309
+ * @internal
9310
+ * @nocollapse
9311
+ */
9312
+ static { this.__NG_ELEMENT_ID__ = injectElementRef; }
9248
9313
  }
9249
- /**
9250
- * @internal
9251
- * @nocollapse
9252
- */
9253
- ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
9254
9314
  /**
9255
9315
  * Unwraps `ElementRef` and return the `nativeElement`.
9256
9316
  *
@@ -9284,12 +9344,12 @@ class RendererFactory2 {
9284
9344
  * @publicApi
9285
9345
  */
9286
9346
  class Renderer2 {
9347
+ /**
9348
+ * @internal
9349
+ * @nocollapse
9350
+ */
9351
+ static { this.__NG_ELEMENT_ID__ = () => injectRenderer2(); }
9287
9352
  }
9288
- /**
9289
- * @internal
9290
- * @nocollapse
9291
- */
9292
- Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
9293
9353
  /** Injects a Renderer2 for the current component. */
9294
9354
  function injectRenderer2() {
9295
9355
  // We need the Renderer to be based on the component that it's being injected into, however since
@@ -9306,13 +9366,13 @@ function injectRenderer2() {
9306
9366
  * @publicApi
9307
9367
  */
9308
9368
  class Sanitizer {
9369
+ /** @nocollapse */
9370
+ static { this.ɵprov = ɵɵdefineInjectable({
9371
+ token: Sanitizer,
9372
+ providedIn: 'root',
9373
+ factory: () => null,
9374
+ }); }
9309
9375
  }
9310
- /** @nocollapse */
9311
- Sanitizer.ɵprov = ɵɵdefineInjectable({
9312
- token: Sanitizer,
9313
- providedIn: 'root',
9314
- factory: () => null,
9315
- });
9316
9376
 
9317
9377
  /**
9318
9378
  * @description Represents the version of Angular
@@ -9330,7 +9390,7 @@ class Version {
9330
9390
  /**
9331
9391
  * @publicApi
9332
9392
  */
9333
- const VERSION = new Version('16.0.0-next.3');
9393
+ const VERSION = new Version('16.0.0-next.5');
9334
9394
 
9335
9395
  // This default value is when checking the hierarchy for a token.
9336
9396
  //
@@ -9581,23 +9641,302 @@ function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValu
9581
9641
  return { propName: undefined, oldValue, newValue };
9582
9642
  }
9583
9643
 
9584
- /** A special value which designates that a value has not changed. */
9585
- const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {};
9644
+ /**
9645
+ * A `WeakRef`-compatible reference that fakes the API with a strong reference
9646
+ * internally.
9647
+ */
9648
+ class LeakyRef {
9649
+ constructor(ref) {
9650
+ this.ref = ref;
9651
+ }
9652
+ deref() {
9653
+ return this.ref;
9654
+ }
9655
+ }
9656
+ // `WeakRef` is not always defined in every TS environment where Angular is compiled. Instead,
9657
+ // read it off of the global context if available.
9658
+ // tslint:disable-next-line: no-toplevel-property-access
9659
+ let WeakRefImpl = _global['WeakRef'] ?? LeakyRef;
9660
+ function newWeakRef(value) {
9661
+ if (typeof ngDevMode !== 'undefined' && ngDevMode && WeakRefImpl === undefined) {
9662
+ throw new Error(`Angular requires a browser which supports the 'WeakRef' API`);
9663
+ }
9664
+ return new WeakRefImpl(value);
9665
+ }
9666
+ function setAlternateWeakRefImpl(impl) {
9667
+ // no-op since the alternate impl is included by default by the framework. Remove once internal
9668
+ // migration is complete.
9669
+ }
9586
9670
 
9587
9671
  /**
9588
- * Advances to an element for later binding instructions.
9672
+ * Counter tracking the next `ProducerId` or `ConsumerId`.
9673
+ */
9674
+ let _nextReactiveId = 0;
9675
+ /**
9676
+ * Tracks the currently active reactive consumer (or `null` if there is no active
9677
+ * consumer).
9678
+ */
9679
+ let activeConsumer = null;
9680
+ function setActiveConsumer(consumer) {
9681
+ const prev = activeConsumer;
9682
+ activeConsumer = consumer;
9683
+ return prev;
9684
+ }
9685
+ /**
9686
+ * A node in the reactive graph.
9589
9687
  *
9590
- * Used in conjunction with instructions like {@link property} to act on elements with specified
9591
- * indices, for example those created with {@link element} or {@link elementStart}.
9688
+ * Nodes can be producers of reactive values, consumers of other reactive values, or both.
9592
9689
  *
9593
- * ```ts
9594
- * (rf: RenderFlags, ctx: any) => {
9595
- * if (rf & 1) {
9596
- * text(0, 'Hello');
9597
- * text(1, 'Goodbye')
9598
- * element(2, 'div');
9599
- * }
9600
- * if (rf & 2) {
9690
+ * Producers are nodes that produce values, and can be depended upon by consumer nodes.
9691
+ *
9692
+ * Producers expose a monotonic `valueVersion` counter, and are responsible for incrementing this
9693
+ * version when their value semantically changes. Some producers may produce their values lazily and
9694
+ * thus at times need to be polled for potential updates to their value (and by extension their
9695
+ * `valueVersion`). This is accomplished via the `onProducerUpdateValueVersion` method for
9696
+ * implemented by producers, which should perform whatever calculations are necessary to ensure
9697
+ * `valueVersion` is up to date.
9698
+ *
9699
+ * Consumers are nodes that depend on the values of producers and are notified when those values
9700
+ * might have changed.
9701
+ *
9702
+ * Consumers do not wrap the reads they consume themselves, but rather can be set as the active
9703
+ * reader via `setActiveConsumer`. Reads of producers that happen while a consumer is active will
9704
+ * result in those producers being added as dependencies of that consumer node.
9705
+ *
9706
+ * The set of dependencies of a consumer is dynamic. Implementers expose a monotonically increasing
9707
+ * `trackingVersion` counter, which increments whenever the consumer is about to re-run any reactive
9708
+ * reads it needs and establish a new set of dependencies as a result.
9709
+ *
9710
+ * Producers store the last `trackingVersion` they've seen from `Consumer`s which have read them.
9711
+ * This allows a producer to identify whether its record of the dependency is current or stale, by
9712
+ * comparing the consumer's `trackingVersion` to the version at which the dependency was
9713
+ * last observed.
9714
+ */
9715
+ class ReactiveNode {
9716
+ constructor() {
9717
+ this.id = _nextReactiveId++;
9718
+ /**
9719
+ * A cached weak reference to this node, which will be used in `ReactiveEdge`s.
9720
+ */
9721
+ this.ref = newWeakRef(this);
9722
+ /**
9723
+ * Edges to producers on which this node depends (in its consumer capacity).
9724
+ */
9725
+ this.producers = new Map();
9726
+ /**
9727
+ * Edges to consumers on which this node depends (in its producer capacity).
9728
+ */
9729
+ this.consumers = new Map();
9730
+ /**
9731
+ * Monotonically increasing counter representing a version of this `Consumer`'s
9732
+ * dependencies.
9733
+ */
9734
+ this.trackingVersion = 0;
9735
+ /**
9736
+ * Monotonically increasing counter which increases when the value of this `Producer`
9737
+ * semantically changes.
9738
+ */
9739
+ this.valueVersion = 0;
9740
+ }
9741
+ /**
9742
+ * Polls dependencies of a consumer to determine if they have actually changed.
9743
+ *
9744
+ * If this returns `false`, then even though the consumer may have previously been notified of a
9745
+ * change, the values of its dependencies have not actually changed and the consumer should not
9746
+ * rerun any reactions.
9747
+ */
9748
+ consumerPollProducersForChange() {
9749
+ for (const [producerId, edge] of this.producers) {
9750
+ const producer = edge.producerNode.deref();
9751
+ if (producer === undefined || edge.atTrackingVersion !== this.trackingVersion) {
9752
+ // This dependency edge is stale, so remove it.
9753
+ this.producers.delete(producerId);
9754
+ producer?.consumers.delete(this.id);
9755
+ continue;
9756
+ }
9757
+ if (producer.producerPollStatus(edge.seenValueVersion)) {
9758
+ // One of the dependencies reports a real value change.
9759
+ return true;
9760
+ }
9761
+ }
9762
+ // No dependency reported a real value change, so the `Consumer` has also not been
9763
+ // impacted.
9764
+ return false;
9765
+ }
9766
+ /**
9767
+ * Notify all consumers of this producer that its value may have changed.
9768
+ */
9769
+ producerMayHaveChanged() {
9770
+ for (const [consumerId, edge] of this.consumers) {
9771
+ const consumer = edge.consumerNode.deref();
9772
+ if (consumer === undefined || consumer.trackingVersion !== edge.atTrackingVersion) {
9773
+ this.consumers.delete(consumerId);
9774
+ consumer?.producers.delete(this.id);
9775
+ continue;
9776
+ }
9777
+ consumer.onConsumerDependencyMayHaveChanged();
9778
+ }
9779
+ }
9780
+ /**
9781
+ * Mark that this producer node has been accessed in the current reactive context.
9782
+ */
9783
+ producerAccessed() {
9784
+ if (activeConsumer === null) {
9785
+ return;
9786
+ }
9787
+ // Either create or update the dependency `Edge` in both directions.
9788
+ let edge = activeConsumer.producers.get(this.id);
9789
+ if (edge === undefined) {
9790
+ edge = {
9791
+ consumerNode: activeConsumer.ref,
9792
+ producerNode: this.ref,
9793
+ seenValueVersion: this.valueVersion,
9794
+ atTrackingVersion: activeConsumer.trackingVersion,
9795
+ };
9796
+ activeConsumer.producers.set(this.id, edge);
9797
+ this.consumers.set(activeConsumer.id, edge);
9798
+ }
9799
+ else {
9800
+ edge.seenValueVersion = this.valueVersion;
9801
+ edge.atTrackingVersion = activeConsumer.trackingVersion;
9802
+ }
9803
+ }
9804
+ /**
9805
+ * Whether this consumer currently has any producers registered.
9806
+ */
9807
+ get hasProducers() {
9808
+ return this.producers.size > 0;
9809
+ }
9810
+ /**
9811
+ * Checks if a `Producer` has a current value which is different than the value
9812
+ * last seen at a specific version by a `Consumer` which recorded a dependency on
9813
+ * this `Producer`.
9814
+ */
9815
+ producerPollStatus(lastSeenValueVersion) {
9816
+ // `producer.valueVersion` may be stale, but a mismatch still means that the value
9817
+ // last seen by the `Consumer` is also stale.
9818
+ if (this.valueVersion !== lastSeenValueVersion) {
9819
+ return true;
9820
+ }
9821
+ // Trigger the `Producer` to update its `valueVersion` if necessary.
9822
+ this.onProducerUpdateValueVersion();
9823
+ // At this point, we can trust `producer.valueVersion`.
9824
+ return this.valueVersion !== lastSeenValueVersion;
9825
+ }
9826
+ }
9827
+
9828
+ /**
9829
+ * Marks current view and all ancestors dirty.
9830
+ *
9831
+ * Returns the root view because it is found as a byproduct of marking the view tree
9832
+ * dirty, and can be used by methods that consume markViewDirty() to easily schedule
9833
+ * change detection. Otherwise, such methods would need to traverse up the view tree
9834
+ * an additional time to get the root view and schedule a tick on it.
9835
+ *
9836
+ * @param lView The starting LView to mark dirty
9837
+ * @returns the root LView
9838
+ */
9839
+ function markViewDirty(lView) {
9840
+ while (lView) {
9841
+ lView[FLAGS] |= 32 /* LViewFlags.Dirty */;
9842
+ const parent = getLViewParent(lView);
9843
+ // Stop traversing up as soon as you find a root view that wasn't attached to any container
9844
+ if (isRootView(lView) && !parent) {
9845
+ return lView;
9846
+ }
9847
+ // continue otherwise
9848
+ lView = parent;
9849
+ }
9850
+ return null;
9851
+ }
9852
+
9853
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
9854
+ class ReactiveLViewConsumer extends ReactiveNode {
9855
+ constructor() {
9856
+ super(...arguments);
9857
+ this._lView = null;
9858
+ }
9859
+ set lView(lView) {
9860
+ NG_DEV_MODE && assertEqual(this._lView, null, 'Consumer already associated with a view.');
9861
+ this._lView = lView;
9862
+ }
9863
+ onConsumerDependencyMayHaveChanged() {
9864
+ NG_DEV_MODE &&
9865
+ assertDefined(this._lView, 'Updating a signal during template or host binding execution is not allowed.');
9866
+ markViewDirty(this._lView);
9867
+ }
9868
+ onProducerUpdateValueVersion() {
9869
+ // This type doesn't implement the producer side of a `ReactiveNode`.
9870
+ }
9871
+ get hasReadASignal() {
9872
+ return this.hasProducers;
9873
+ }
9874
+ runInContext(fn, rf, ctx) {
9875
+ const prevConsumer = setActiveConsumer(this);
9876
+ this.trackingVersion++;
9877
+ try {
9878
+ fn(rf, ctx);
9879
+ }
9880
+ finally {
9881
+ setActiveConsumer(prevConsumer);
9882
+ }
9883
+ }
9884
+ destroy() {
9885
+ // Incrementing the version means that every producer which tries to update this consumer will
9886
+ // consider its record stale, and not notify.
9887
+ this.trackingVersion++;
9888
+ }
9889
+ }
9890
+ let currentConsumer = null;
9891
+ function getOrCreateCurrentLViewConsumer() {
9892
+ currentConsumer ??= new ReactiveLViewConsumer();
9893
+ return currentConsumer;
9894
+ }
9895
+ /**
9896
+ * Create a new template consumer pointing at the specified LView.
9897
+ * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that
9898
+ * case, the LView will be updated.
9899
+ */
9900
+ function getReactiveLViewConsumer(lView, slot) {
9901
+ return lView[slot] ?? getOrCreateCurrentLViewConsumer();
9902
+ }
9903
+ /**
9904
+ * Assigns the `currentTemplateContext` to its LView's `REACTIVE_CONSUMER` slot if there are tracked
9905
+ * producers.
9906
+ *
9907
+ * The presence of producers means that a signal was read while the consumer was the active
9908
+ * consumer.
9909
+ *
9910
+ * If no producers are present, we do not assign the current template context. This also means we
9911
+ * can just reuse the template context for the next LView.
9912
+ */
9913
+ function commitLViewConsumerIfHasProducers(lView, slot) {
9914
+ const consumer = getOrCreateCurrentLViewConsumer();
9915
+ if (!consumer.hasReadASignal) {
9916
+ return;
9917
+ }
9918
+ lView[slot] = currentConsumer;
9919
+ consumer.lView = lView;
9920
+ currentConsumer = new ReactiveLViewConsumer();
9921
+ }
9922
+
9923
+ /** A special value which designates that a value has not changed. */
9924
+ const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {};
9925
+
9926
+ /**
9927
+ * Advances to an element for later binding instructions.
9928
+ *
9929
+ * Used in conjunction with instructions like {@link property} to act on elements with specified
9930
+ * indices, for example those created with {@link element} or {@link elementStart}.
9931
+ *
9932
+ * ```ts
9933
+ * (rf: RenderFlags, ctx: any) => {
9934
+ * if (rf & 1) {
9935
+ * text(0, 'Hello');
9936
+ * text(1, 'Goodbye')
9937
+ * element(2, 'div');
9938
+ * }
9939
+ * if (rf & 2) {
9601
9940
  * advance(2); // Advance twice to the <div>.
9602
9941
  * property('title', 'test');
9603
9942
  * }
@@ -9663,6 +10002,22 @@ function runInInjectionContext(injector, fn) {
9663
10002
  setInjectImplementation(previousInjectImplementation);
9664
10003
  }
9665
10004
  }
10005
+ /**
10006
+ * Asserts that the current stack frame is within an injection context and has access to `inject`.
10007
+ *
10008
+ * @param debugFn a reference to the function making the assertion (used for the error message).
10009
+ *
10010
+ * @publicApi
10011
+ */
10012
+ function assertInInjectionContext(debugFn) {
10013
+ // Taking a `Function` instead of a string name here prevents the unminified name of the function
10014
+ // from being retained in the bundle regardless of minification.
10015
+ if (!getInjectImplementation() && !getCurrentInjector()) {
10016
+ throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
10017
+ (debugFn.name +
10018
+ '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`'));
10019
+ }
10020
+ }
9666
10021
 
9667
10022
  /**
9668
10023
  * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.
@@ -9815,6 +10170,8 @@ function createInjectorWithoutInjectorInstances(defType, parent = null, addition
9815
10170
  * @publicApi
9816
10171
  */
9817
10172
  class Injector {
10173
+ static { this.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND; }
10174
+ static { this.NULL = ( /* @__PURE__ */new NullInjector()); }
9818
10175
  static create(options, parent) {
9819
10176
  if (Array.isArray(options)) {
9820
10177
  return createInjector({ name: '' }, parent, options, '');
@@ -9824,20 +10181,18 @@ class Injector {
9824
10181
  return createInjector({ name }, options.parent, options.providers, name);
9825
10182
  }
9826
10183
  }
10184
+ /** @nocollapse */
10185
+ static { this.ɵprov = ɵɵdefineInjectable({
10186
+ token: Injector,
10187
+ providedIn: 'any',
10188
+ factory: () => ɵɵinject(INJECTOR),
10189
+ }); }
10190
+ /**
10191
+ * @internal
10192
+ * @nocollapse
10193
+ */
10194
+ static { this.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */; }
9827
10195
  }
9828
- Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;
9829
- Injector.NULL = ( /* @__PURE__ */new NullInjector());
9830
- /** @nocollapse */
9831
- Injector.ɵprov = ɵɵdefineInjectable({
9832
- token: Injector,
9833
- providedIn: 'any',
9834
- factory: () => ɵɵinject(INJECTOR),
9835
- });
9836
- /**
9837
- * @internal
9838
- * @nocollapse
9839
- */
9840
- Injector.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */;
9841
10196
 
9842
10197
  function findFirstClosedCycle(keys) {
9843
10198
  const res = [];
@@ -10438,6 +10793,7 @@ class ReflectiveInjector {
10438
10793
  }
10439
10794
  }
10440
10795
  class ReflectiveInjector_ {
10796
+ static { this.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector)); }
10441
10797
  /**
10442
10798
  * Private
10443
10799
  */
@@ -10593,7 +10949,6 @@ class ReflectiveInjector_ {
10593
10949
  return this.displayName;
10594
10950
  }
10595
10951
  }
10596
- ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
10597
10952
  function _mapProviders(injector, fn) {
10598
10953
  const res = [];
10599
10954
  for (let i = 0; i < injector._providers.length; ++i) {
@@ -10667,6 +11022,7 @@ function processHostBindingOpCodes(tView, lView) {
10667
11022
  const hostBindingOpCodes = tView.hostBindingOpCodes;
10668
11023
  if (hostBindingOpCodes === null)
10669
11024
  return;
11025
+ const consumer = getReactiveLViewConsumer(lView, REACTIVE_HOST_BINDING_CONSUMER);
10670
11026
  try {
10671
11027
  for (let i = 0; i < hostBindingOpCodes.length; i++) {
10672
11028
  const opCode = hostBindingOpCodes[i];
@@ -10681,11 +11037,13 @@ function processHostBindingOpCodes(tView, lView) {
10681
11037
  const hostBindingFn = hostBindingOpCodes[++i];
10682
11038
  setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
10683
11039
  const context = lView[directiveIdx];
10684
- hostBindingFn(2 /* RenderFlags.Update */, context);
11040
+ consumer.runInContext(hostBindingFn, 2 /* RenderFlags.Update */, context);
10685
11041
  }
10686
11042
  }
10687
11043
  }
10688
11044
  finally {
11045
+ lView[REACTIVE_HOST_BINDING_CONSUMER] === null &&
11046
+ commitLViewConsumerIfHasProducers(lView, REACTIVE_HOST_BINDING_CONSUMER);
10689
11047
  setSelectedIndex(-1);
10690
11048
  }
10691
11049
  }
@@ -10741,6 +11099,7 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
10741
11099
  lView[ID] = getUniqueLViewId();
10742
11100
  lView[HYDRATION] = hydrationInfo;
10743
11101
  lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
11102
+ lView[REACTIVE_TEMPLATE_CONSUMER] = null;
10744
11103
  ngDevMode &&
10745
11104
  assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
10746
11105
  lView[DECLARATION_COMPONENT_VIEW] =
@@ -11025,6 +11384,7 @@ function refreshView(tView, lView, templateFn, context) {
11025
11384
  }
11026
11385
  }
11027
11386
  function executeTemplate(tView, lView, templateFn, rf, context) {
11387
+ const consumer = getReactiveLViewConsumer(lView, REACTIVE_TEMPLATE_CONSUMER);
11028
11388
  const prevSelectedIndex = getSelectedIndex();
11029
11389
  const isUpdatePhase = rf & 2 /* RenderFlags.Update */;
11030
11390
  try {
@@ -11036,9 +11396,12 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
11036
11396
  }
11037
11397
  const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;
11038
11398
  profiler(preHookType, context);
11039
- templateFn(rf, context);
11399
+ consumer.runInContext(templateFn, rf, context);
11040
11400
  }
11041
11401
  finally {
11402
+ if (lView[REACTIVE_TEMPLATE_CONSUMER] === null) {
11403
+ commitLViewConsumerIfHasProducers(lView, REACTIVE_TEMPLATE_CONSUMER);
11404
+ }
11042
11405
  setSelectedIndex(prevSelectedIndex);
11043
11406
  const postHookType = isUpdatePhase ? 3 /* ProfilerEvent.TemplateUpdateEnd */ : 1 /* ProfilerEvent.TemplateCreateEnd */;
11044
11407
  profiler(postHookType, context);
@@ -12142,30 +12505,6 @@ function addToViewTree(lView, lViewOrLContainer) {
12142
12505
  ///////////////////////////////
12143
12506
  //// Change detection
12144
12507
  ///////////////////////////////
12145
- /**
12146
- * Marks current view and all ancestors dirty.
12147
- *
12148
- * Returns the root view because it is found as a byproduct of marking the view tree
12149
- * dirty, and can be used by methods that consume markViewDirty() to easily schedule
12150
- * change detection. Otherwise, such methods would need to traverse up the view tree
12151
- * an additional time to get the root view and schedule a tick on it.
12152
- *
12153
- * @param lView The starting LView to mark dirty
12154
- * @returns the root LView
12155
- */
12156
- function markViewDirty(lView) {
12157
- while (lView) {
12158
- lView[FLAGS] |= 32 /* LViewFlags.Dirty */;
12159
- const parent = getLViewParent(lView);
12160
- // Stop traversing up as soon as you find a root view that wasn't attached to any container
12161
- if (isRootView(lView) && !parent) {
12162
- return lView;
12163
- }
12164
- // continue otherwise
12165
- lView = parent;
12166
- }
12167
- return null;
12168
- }
12169
12508
  function detectChangesInternal(tView, lView, context, notifyErrorHandler = true) {
12170
12509
  const rendererFactory = lView[RENDERER_FACTORY];
12171
12510
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
@@ -12846,6 +13185,7 @@ class ComponentRef extends ComponentRef$1 {
12846
13185
  this.location = location;
12847
13186
  this._rootLView = _rootLView;
12848
13187
  this._tNode = _tNode;
13188
+ this.previousInputValues = null;
12849
13189
  this.instance = instance;
12850
13190
  this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
12851
13191
  this.componentType = componentType;
@@ -12854,8 +13194,16 @@ class ComponentRef extends ComponentRef$1 {
12854
13194
  const inputData = this._tNode.inputs;
12855
13195
  let dataValue;
12856
13196
  if (inputData !== null && (dataValue = inputData[name])) {
13197
+ this.previousInputValues ??= new Map();
13198
+ // Do not set the input if it is the same as the last value
13199
+ // This behavior matches `bindingUpdated` when binding inputs in templates.
13200
+ if (this.previousInputValues.has(name) &&
13201
+ Object.is(this.previousInputValues.get(name), value)) {
13202
+ return;
13203
+ }
12857
13204
  const lView = this._rootLView;
12858
13205
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
13206
+ this.previousInputValues.set(name, value);
12859
13207
  markDirtyIfOnPush(lView, this._tNode.index);
12860
13208
  }
12861
13209
  else {
@@ -14070,106 +14418,690 @@ function detectChanges(component) {
14070
14418
  detectChangesInternal(view[TVIEW], view, component);
14071
14419
  }
14072
14420
 
14421
+ const AT_THIS_LOCATION = '<-- AT THIS LOCATION';
14073
14422
  /**
14074
- * Verifies whether a given node matches an expected criteria,
14075
- * based on internal data structure state.
14423
+ * Retrieves a user friendly string for a given TNodeType for use in
14424
+ * friendly error messages
14425
+ *
14426
+ * @param tNodeType
14427
+ * @returns
14076
14428
  */
14077
- function validateMatchingNode(node, nodeType, tagName, lView, tNode) {
14078
- validateNodeExists(node);
14079
- if (node.nodeType !== nodeType ||
14080
- node.nodeType === Node.ELEMENT_NODE &&
14081
- node.tagName.toLowerCase() !== tagName?.toLowerCase()) {
14082
- // TODO: improve error message and use RuntimeError instead.
14083
- throw new Error(`Unexpected node found during hydration.`);
14429
+ function getFriendlyStringFromTNodeType(tNodeType) {
14430
+ switch (tNodeType) {
14431
+ case 4 /* TNodeType.Container */:
14432
+ return 'view container';
14433
+ case 2 /* TNodeType.Element */:
14434
+ return 'element';
14435
+ case 8 /* TNodeType.ElementContainer */:
14436
+ return 'ng-container';
14437
+ case 32 /* TNodeType.Icu */:
14438
+ return 'icu';
14439
+ case 64 /* TNodeType.Placeholder */:
14440
+ return 'i18n';
14441
+ case 16 /* TNodeType.Projection */:
14442
+ return 'projection';
14443
+ case 1 /* TNodeType.Text */:
14444
+ return 'text';
14445
+ default:
14446
+ // This should not happen as we cover all possible TNode types above.
14447
+ return '<unknown>';
14448
+ }
14449
+ }
14450
+ /**
14451
+ * Validates that provided nodes match during the hydration process.
14452
+ */
14453
+ function validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {
14454
+ if (!node ||
14455
+ (node.nodeType !== nodeType ||
14456
+ (node.nodeType === Node.ELEMENT_NODE &&
14457
+ node.tagName.toLowerCase() !== tagName?.toLowerCase()))) {
14458
+ const expectedNode = shortRNodeDescription(nodeType, tagName, null);
14459
+ let header = `During hydration Angular expected ${expectedNode} but `;
14460
+ const hostComponentDef = getDeclarationComponentDef(lView);
14461
+ const componentClassName = hostComponentDef?.type?.name;
14462
+ const expected = `Angular expected this DOM:\n\n${describeExpectedDom(lView, tNode, isViewContainerAnchor)}\n\n`;
14463
+ let actual = '';
14464
+ if (!node) {
14465
+ // No node found during hydration.
14466
+ header += `the node was not found.\n\n`;
14467
+ }
14468
+ else {
14469
+ const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);
14470
+ header += `found ${actualNode}.\n\n`;
14471
+ actual = `Actual DOM is:\n\n${describeDomFromNode(node)}\n\n`;
14472
+ }
14473
+ const footer = getHydrationErrorFooter(componentClassName);
14474
+ const message = header + expected + actual + getHydrationAttributeNote() + footer;
14475
+ throw new RuntimeError(500 /* RuntimeErrorCode.HYDRATION_NODE_MISMATCH */, message);
14084
14476
  }
14085
14477
  }
14086
14478
  /**
14087
- * Verifies whether next sibling node exists.
14479
+ * Validates that a given node has sibling nodes
14088
14480
  */
14089
14481
  function validateSiblingNodeExists(node) {
14090
14482
  validateNodeExists(node);
14091
14483
  if (!node.nextSibling) {
14092
- // TODO: improve error message and use RuntimeError instead.
14093
- throw new Error(`Unexpected state: insufficient number of sibling nodes.`);
14484
+ const header = 'During hydration Angular expected more sibling nodes to be present.\n\n';
14485
+ const actual = `Actual DOM is:\n\n${describeDomFromNode(node)}\n\n`;
14486
+ const footer = getHydrationErrorFooter();
14487
+ const message = header + actual + footer;
14488
+ throw new RuntimeError(501 /* RuntimeErrorCode.HYDRATION_MISSING_SIBLINGS */, message);
14094
14489
  }
14095
14490
  }
14491
+ /**
14492
+ * Validates that a node exists or throws
14493
+ */
14096
14494
  function validateNodeExists(node) {
14097
14495
  if (!node) {
14098
- // TODO: improve error message and use RuntimeError instead.
14099
- throw new Error(`Hydration expected an element to be present at this location.`);
14496
+ throw new RuntimeError(502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, `Hydration expected an element to be present at this location.`);
14100
14497
  }
14101
14498
  }
14102
-
14103
- /** Whether current TNode is a first node in an <ng-container>. */
14104
- function isFirstElementInNgContainer(tNode) {
14105
- return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;
14499
+ /**
14500
+ * Builds the hydration error message when a node is not found
14501
+ *
14502
+ * @param lView the LView where the node exists
14503
+ * @param tNode the TNode
14504
+ */
14505
+ function nodeNotFoundError(lView, tNode) {
14506
+ const header = 'During serialization, Angular was unable to find an element in the DOM:\n\n';
14507
+ const expected = `${describeExpectedDom(lView, tNode, false)}\n\n`;
14508
+ const footer = getHydrationErrorFooter();
14509
+ throw new RuntimeError(502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + expected + footer);
14106
14510
  }
14107
14511
  /**
14108
- * Locate a node in DOM tree that corresponds to a given TNode.
14512
+ * Builds a hydration error message when a node is not found at a path location
14109
14513
  *
14110
- * @param hydrationInfo The hydration annotation data
14111
- * @param tView the current tView
14112
- * @param lView the current lView
14113
- * @param tNode the current tNode
14114
- * @returns an RNode that represents a given tNode
14514
+ * @param host the Host Node
14515
+ * @param path the path to the node
14115
14516
  */
14116
- function locateNextRNode(hydrationInfo, tView, lView, tNode) {
14117
- let native = null;
14118
- if (tView.firstChild === tNode) {
14119
- // We create a first node in this view, so we use a reference
14120
- // to the first child in this DOM segment.
14121
- native = hydrationInfo.firstChild;
14122
- }
14123
- else {
14124
- // Locate a node based on a previous sibling or a parent node.
14125
- const previousTNodeParent = tNode.prev === null;
14126
- const previousTNode = (tNode.prev ?? tNode.parent);
14127
- ngDevMode &&
14128
- assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +
14129
- 'to the previous node or a parent node.');
14130
- if (isFirstElementInNgContainer(tNode)) {
14131
- const noOffsetParentIndex = tNode.parent.index - HEADER_OFFSET;
14132
- native = getSegmentHead(hydrationInfo, noOffsetParentIndex);
14133
- }
14134
- else {
14135
- let previousRElement = getNativeByTNode(previousTNode, lView);
14136
- if (previousTNodeParent) {
14137
- native = previousRElement.firstChild;
14138
- }
14139
- else {
14140
- // If the previous node is an element, but it also has container info,
14141
- // this means that we are processing a node like `<div #vcrTarget>`, which is
14142
- // represented in the DOM as `<div></div>...<!--container-->`.
14143
- // In this case, there are nodes *after* this element and we need to skip
14144
- // all of them to reach an element that we are looking for.
14145
- const noOffsetPrevSiblingIndex = previousTNode.index - HEADER_OFFSET;
14146
- const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);
14147
- if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {
14148
- const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);
14149
- // `+1` stands for an anchor comment node after all the views in this container.
14150
- const nodesToSkip = numRootNodesToSkip + 1;
14151
- // First node after this segment.
14152
- native = siblingAfter(nodesToSkip, segmentHead);
14153
- }
14154
- else {
14155
- native = previousRElement.nextSibling;
14156
- }
14517
+ function nodeNotFoundAtPathError(host, path) {
14518
+ const header = `During hydration Angular was unable to locate a node ` +
14519
+ `using the "${path}" path, starting from the ${describeRNode(host)} node.\n\n`;
14520
+ const footer = getHydrationErrorFooter();
14521
+ throw new RuntimeError(502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + footer);
14522
+ }
14523
+ /**
14524
+ * Builds the hydration error message in the case that dom nodes are created outside of
14525
+ * the Angular context and are being used as projected nodes
14526
+ *
14527
+ * @param lView the LView
14528
+ * @param tNode the TNode
14529
+ * @returns an error
14530
+ */
14531
+ function unsupportedProjectionOfDomNodes(rNode) {
14532
+ const header = 'During serialization, Angular detected DOM nodes ' +
14533
+ 'that were created outside of Angular context and provided as projectable nodes ' +
14534
+ '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' +
14535
+ 'Hydration is not supported for such cases, consider refactoring the code to avoid ' +
14536
+ 'this pattern or using `ngSkipHydration` on the host element of the component.\n\n';
14537
+ const actual = `${describeDomFromNode(rNode)}\n\n`;
14538
+ const message = header + actual + getHydrationAttributeNote();
14539
+ return new RuntimeError(503 /* RuntimeErrorCode.UNSUPPORTED_PROJECTION_DOM_NODES */, message);
14540
+ }
14541
+ /**
14542
+ * Builds the hydration error message in the case that ngSkipHydration was used on a
14543
+ * node that is not a component host element or host binding
14544
+ *
14545
+ * @param rNode the HTML Element
14546
+ * @returns an error
14547
+ */
14548
+ function invalidSkipHydrationHost(rNode) {
14549
+ const header = 'The `ngSkipHydration` flag is applied on a node ' +
14550
+ 'that doesn\'t act as a component host. Hydration can be ' +
14551
+ 'skipped only on per-component basis.\n\n';
14552
+ const actual = `${describeDomFromNode(rNode)}\n\n`;
14553
+ const footer = 'Please move the `ngSkipHydration` attribute to the component host element.';
14554
+ const message = header + actual + footer;
14555
+ return new RuntimeError(504 /* RuntimeErrorCode.INVALID_SKIP_HYDRATION_HOST */, message);
14556
+ }
14557
+ /**
14558
+ * Builds the hydration error message in the case that a user is attempting to enable
14559
+ * hydration on internationalized nodes, which is not yet supported.
14560
+ *
14561
+ * @param rNode the HTML Element
14562
+ * @returns an error
14563
+ */
14564
+ function notYetSupportedI18nBlockError(rNode) {
14565
+ const header = 'Hydration for nodes marked with `i18n` is not yet supported. ' +
14566
+ 'You can opt-out a component that uses `i18n` in a template using ' +
14567
+ 'the `ngSkipHydration` attribute or fall back to the previous ' +
14568
+ 'hydration logic (which re-creates the application structure).\n\n';
14569
+ const actual = `${describeDomFromNode(rNode)}\n\n`;
14570
+ const message = header + actual;
14571
+ return new RuntimeError(518 /* RuntimeErrorCode.HYDRATION_I18N_NOT_YET_SUPPORTED */, message);
14572
+ }
14573
+ // Stringification methods
14574
+ /**
14575
+ * Stringifies a given TNode's attributes
14576
+ *
14577
+ * @param tNode a provided TNode
14578
+ * @returns string
14579
+ */
14580
+ function stringifyTNodeAttrs(tNode) {
14581
+ const results = [];
14582
+ if (tNode.attrs) {
14583
+ for (let i = 0; i < tNode.attrs.length;) {
14584
+ const attrName = tNode.attrs[i++];
14585
+ // Once we reach the first flag, we know that the list of
14586
+ // attributes is over.
14587
+ if (typeof attrName == 'number') {
14588
+ break;
14157
14589
  }
14590
+ const attrValue = tNode.attrs[i++];
14591
+ results.push(`${attrName}="${shorten(attrValue)}"`);
14158
14592
  }
14159
14593
  }
14160
- return native;
14594
+ return results.join(' ');
14161
14595
  }
14162
14596
  /**
14163
- * Skips over a specified number of nodes and returns the next sibling node after that.
14597
+ * The list of internal attributes that should be filtered out while
14598
+ * producing an error message.
14164
14599
  */
14165
- function siblingAfter(skip, from) {
14166
- let currentNode = from;
14167
- for (let i = 0; i < skip; i++) {
14168
- ngDevMode && validateSiblingNodeExists(currentNode);
14169
- currentNode = currentNode.nextSibling;
14600
+ const internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']);
14601
+ /**
14602
+ * Stringifies an HTML Element's attributes
14603
+ *
14604
+ * @param rNode an HTML Element
14605
+ * @returns string
14606
+ */
14607
+ function stringifyRNodeAttrs(rNode) {
14608
+ const results = [];
14609
+ for (let i = 0; i < rNode.attributes.length; i++) {
14610
+ const attr = rNode.attributes[i];
14611
+ if (internalAttrs.has(attr.name))
14612
+ continue;
14613
+ results.push(`${attr.name}="${shorten(attr.value)}"`);
14614
+ }
14615
+ return results.join(' ');
14616
+ }
14617
+ // Methods for Describing the DOM
14618
+ /**
14619
+ * Converts a tNode to a helpful readable string value for use in error messages
14620
+ *
14621
+ * @param tNode a given TNode
14622
+ * @param innerContent the content of the node
14623
+ * @returns string
14624
+ */
14625
+ function describeTNode(tNode, innerContent = '…') {
14626
+ switch (tNode.type) {
14627
+ case 1 /* TNodeType.Text */:
14628
+ const content = tNode.value ? `(${tNode.value})` : '';
14629
+ return `#text${content}`;
14630
+ case 2 /* TNodeType.Element */:
14631
+ const attrs = stringifyTNodeAttrs(tNode);
14632
+ const tag = tNode.value.toLowerCase();
14633
+ return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;
14634
+ case 8 /* TNodeType.ElementContainer */:
14635
+ return '<!-- ng-container -->';
14636
+ case 4 /* TNodeType.Container */:
14637
+ return '<!-- container -->';
14638
+ default:
14639
+ const typeAsString = getFriendlyStringFromTNodeType(tNode.type);
14640
+ return `#node(${typeAsString})`;
14641
+ }
14642
+ }
14643
+ /**
14644
+ * Converts an RNode to a helpful readable string value for use in error messages
14645
+ *
14646
+ * @param rNode a given RNode
14647
+ * @param innerContent the content of the node
14648
+ * @returns string
14649
+ */
14650
+ function describeRNode(rNode, innerContent = '…') {
14651
+ const node = rNode;
14652
+ switch (node.nodeType) {
14653
+ case Node.ELEMENT_NODE:
14654
+ const tag = node.tagName.toLowerCase();
14655
+ const attrs = stringifyRNodeAttrs(node);
14656
+ return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;
14657
+ case Node.TEXT_NODE:
14658
+ const content = node.textContent ? shorten(node.textContent) : '';
14659
+ return `#text${content ? `(${content})` : ''}`;
14660
+ case Node.COMMENT_NODE:
14661
+ return `<!-- ${shorten(node.textContent ?? '')} -->`;
14662
+ default:
14663
+ return `#node(${node.nodeType})`;
14664
+ }
14665
+ }
14666
+ /**
14667
+ * Builds the string containing the expected DOM present given the LView and TNode
14668
+ * values for a readable error message
14669
+ *
14670
+ * @param lView the lView containing the DOM
14671
+ * @param tNode the tNode
14672
+ * @param isViewContainerAnchor boolean
14673
+ * @returns string
14674
+ */
14675
+ function describeExpectedDom(lView, tNode, isViewContainerAnchor) {
14676
+ const spacer = ' ';
14677
+ let content = '';
14678
+ if (tNode.prev) {
14679
+ content += spacer + '…\n';
14680
+ content += spacer + describeTNode(tNode.prev) + '\n';
14681
+ }
14682
+ else if (tNode.type && tNode.type & 12 /* TNodeType.AnyContainer */) {
14683
+ content += spacer + '…\n';
14684
+ }
14685
+ if (isViewContainerAnchor) {
14686
+ content += spacer + describeTNode(tNode) + '\n';
14687
+ content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\n`;
14688
+ }
14689
+ else {
14690
+ content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\n`;
14691
+ }
14692
+ content += spacer + '…\n';
14693
+ const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;
14694
+ if (parentRNode) {
14695
+ content = describeRNode(parentRNode, '\n' + content);
14696
+ }
14697
+ return content;
14698
+ }
14699
+ /**
14700
+ * Builds the string containing the DOM present around a given RNode for a
14701
+ * readable error message
14702
+ *
14703
+ * @param node the RNode
14704
+ * @returns string
14705
+ */
14706
+ function describeDomFromNode(node) {
14707
+ const spacer = ' ';
14708
+ let content = '';
14709
+ const currentNode = node;
14710
+ if (currentNode.previousSibling) {
14711
+ content += spacer + '…\n';
14712
+ content += spacer + describeRNode(currentNode.previousSibling) + '\n';
14713
+ }
14714
+ content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\n`;
14715
+ if (node.nextSibling) {
14716
+ content += spacer + '…\n';
14717
+ }
14718
+ if (node.parentNode) {
14719
+ content = describeRNode(currentNode.parentNode, '\n' + content);
14720
+ }
14721
+ return content;
14722
+ }
14723
+ /**
14724
+ * Shortens the description of a given RNode by its type for readability
14725
+ *
14726
+ * @param nodeType the type of node
14727
+ * @param tagName the node tag name
14728
+ * @param textContent the text content in the node
14729
+ * @returns string
14730
+ */
14731
+ function shortRNodeDescription(nodeType, tagName, textContent) {
14732
+ switch (nodeType) {
14733
+ case Node.ELEMENT_NODE:
14734
+ return `<${tagName.toLowerCase()}>`;
14735
+ case Node.TEXT_NODE:
14736
+ const content = textContent ? ` (with the "${shorten(textContent)}" content)` : '';
14737
+ return `a text node${content}`;
14738
+ case Node.COMMENT_NODE:
14739
+ return 'a comment node';
14740
+ default:
14741
+ return `#node(nodeType=${nodeType})`;
14742
+ }
14743
+ }
14744
+ /**
14745
+ * Builds the footer hydration error message
14746
+ *
14747
+ * @param componentClassName the name of the component class
14748
+ * @returns string
14749
+ */
14750
+ function getHydrationErrorFooter(componentClassName) {
14751
+ const componentInfo = componentClassName ? `the "${componentClassName}"` : 'corresponding';
14752
+ return `To fix this problem:\n` +
14753
+ ` * check ${componentInfo} component for hydration-related issues\n` +
14754
+ ` * or skip hydration by adding the \`ngSkipHydration\` attribute ` +
14755
+ `to its host node in a template`;
14756
+ }
14757
+ /**
14758
+ * An attribute related note for hydration errors
14759
+ */
14760
+ function getHydrationAttributeNote() {
14761
+ return 'Note: attributes are only displayed to better represent the DOM' +
14762
+ ' but have no effect on hydration mismatches.\n\n';
14763
+ }
14764
+ // Node string utility functions
14765
+ /**
14766
+ * Strips all newlines out of a given string
14767
+ *
14768
+ * @param input a string to be cleared of new line characters
14769
+ * @returns
14770
+ */
14771
+ function stripNewlines(input) {
14772
+ return input.replace(/\s+/gm, '');
14773
+ }
14774
+ /**
14775
+ * Reduces a string down to a maximum length of characters with ellipsis for readability
14776
+ *
14777
+ * @param input a string input
14778
+ * @param maxLength a maximum length in characters
14779
+ * @returns string
14780
+ */
14781
+ function shorten(input, maxLength = 50) {
14782
+ if (!input) {
14783
+ return '';
14784
+ }
14785
+ input = stripNewlines(input);
14786
+ return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;
14787
+ }
14788
+
14789
+ /**
14790
+ * Regexp that extracts a reference node information from the compressed node location.
14791
+ * The reference node is represented as either:
14792
+ * - a number which points to an LView slot
14793
+ * - the `b` char which indicates that the lookup should start from the `document.body`
14794
+ * - the `h` char to start lookup from the component host node (`lView[HOST]`)
14795
+ */
14796
+ const REF_EXTRACTOR_REGEXP = new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);
14797
+ /**
14798
+ * Helper function that takes a reference node location and a set of navigation steps
14799
+ * (from the reference node) to a target node and outputs a string that represents
14800
+ * a location.
14801
+ *
14802
+ * For example, given: referenceNode = 'b' (body) and path = ['firstChild', 'firstChild',
14803
+ * 'nextSibling'], the function returns: `bf2n`.
14804
+ */
14805
+ function compressNodeLocation(referenceNode, path) {
14806
+ const result = [referenceNode];
14807
+ for (const segment of path) {
14808
+ const lastIdx = result.length - 1;
14809
+ if (lastIdx > 0 && result[lastIdx - 1] === segment) {
14810
+ // An empty string in a count slot represents 1 occurrence of an instruction.
14811
+ const value = (result[lastIdx] || 1);
14812
+ result[lastIdx] = value + 1;
14813
+ }
14814
+ else {
14815
+ // Adding a new segment to the path.
14816
+ // Using an empty string in a counter field to avoid encoding `1`s
14817
+ // into the path, since they are implicit (e.g. `f1n1` vs `fn`), so
14818
+ // it's enough to have a single char in this case.
14819
+ result.push(segment, '');
14820
+ }
14821
+ }
14822
+ return result.join('');
14823
+ }
14824
+ /**
14825
+ * Helper function that reverts the `compressNodeLocation` and transforms a given
14826
+ * string into an array where at 0th position there is a reference node info and
14827
+ * after that it contains information (in pairs) about a navigation step and the
14828
+ * number of repetitions.
14829
+ *
14830
+ * For example, the path like 'bf2n' will be transformed to:
14831
+ * ['b', 'firstChild', 2, 'nextSibling', 1].
14832
+ *
14833
+ * This information is later consumed by the code that navigates the DOM to find
14834
+ * a given node by its location.
14835
+ */
14836
+ function decompressNodeLocation(path) {
14837
+ const matches = path.match(REF_EXTRACTOR_REGEXP);
14838
+ const [_, refNodeId, refNodeName, rest] = matches;
14839
+ // If a reference node is represented by an index, transform it to a number.
14840
+ const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;
14841
+ const steps = [];
14842
+ // Match all segments in a path.
14843
+ for (const [_, step, count] of rest.matchAll(/(f|n)(\d*)/g)) {
14844
+ const repeat = parseInt(count, 10) || 1;
14845
+ steps.push(step, repeat);
14846
+ }
14847
+ return [ref, ...steps];
14848
+ }
14849
+
14850
+ /** Whether current TNode is a first node in an <ng-container>. */
14851
+ function isFirstElementInNgContainer(tNode) {
14852
+ return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;
14853
+ }
14854
+ /** Returns an instruction index (subtracting HEADER_OFFSET). */
14855
+ function getNoOffsetIndex(tNode) {
14856
+ return tNode.index - HEADER_OFFSET;
14857
+ }
14858
+ /**
14859
+ * Locate a node in DOM tree that corresponds to a given TNode.
14860
+ *
14861
+ * @param hydrationInfo The hydration annotation data
14862
+ * @param tView the current tView
14863
+ * @param lView the current lView
14864
+ * @param tNode the current tNode
14865
+ * @returns an RNode that represents a given tNode
14866
+ */
14867
+ function locateNextRNode(hydrationInfo, tView, lView, tNode) {
14868
+ let native = null;
14869
+ const noOffsetIndex = getNoOffsetIndex(tNode);
14870
+ const nodes = hydrationInfo.data[NODES];
14871
+ if (nodes?.[noOffsetIndex]) {
14872
+ // We know the exact location of the node.
14873
+ native = locateRNodeByPath(nodes[noOffsetIndex], lView);
14874
+ }
14875
+ else if (tView.firstChild === tNode) {
14876
+ // We create a first node in this view, so we use a reference
14877
+ // to the first child in this DOM segment.
14878
+ native = hydrationInfo.firstChild;
14879
+ }
14880
+ else {
14881
+ // Locate a node based on a previous sibling or a parent node.
14882
+ const previousTNodeParent = tNode.prev === null;
14883
+ const previousTNode = (tNode.prev ?? tNode.parent);
14884
+ ngDevMode &&
14885
+ assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +
14886
+ 'to the previous node or a parent node.');
14887
+ if (isFirstElementInNgContainer(tNode)) {
14888
+ const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);
14889
+ native = getSegmentHead(hydrationInfo, noOffsetParentIndex);
14890
+ }
14891
+ else {
14892
+ let previousRElement = getNativeByTNode(previousTNode, lView);
14893
+ if (previousTNodeParent) {
14894
+ native = previousRElement.firstChild;
14895
+ }
14896
+ else {
14897
+ // If the previous node is an element, but it also has container info,
14898
+ // this means that we are processing a node like `<div #vcrTarget>`, which is
14899
+ // represented in the DOM as `<div></div>...<!--container-->`.
14900
+ // In this case, there are nodes *after* this element and we need to skip
14901
+ // all of them to reach an element that we are looking for.
14902
+ const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);
14903
+ const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);
14904
+ if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {
14905
+ const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);
14906
+ // `+1` stands for an anchor comment node after all the views in this container.
14907
+ const nodesToSkip = numRootNodesToSkip + 1;
14908
+ // First node after this segment.
14909
+ native = siblingAfter(nodesToSkip, segmentHead);
14910
+ }
14911
+ else {
14912
+ native = previousRElement.nextSibling;
14913
+ }
14914
+ }
14915
+ }
14916
+ }
14917
+ return native;
14918
+ }
14919
+ /**
14920
+ * Skips over a specified number of nodes and returns the next sibling node after that.
14921
+ */
14922
+ function siblingAfter(skip, from) {
14923
+ let currentNode = from;
14924
+ for (let i = 0; i < skip; i++) {
14925
+ ngDevMode && validateSiblingNodeExists(currentNode);
14926
+ currentNode = currentNode.nextSibling;
14170
14927
  }
14171
14928
  return currentNode;
14172
14929
  }
14930
+ /**
14931
+ * Helper function to produce a string representation of the navigation steps
14932
+ * (in terms of `nextSibling` and `firstChild` navigations). Used in error
14933
+ * messages in dev mode.
14934
+ */
14935
+ function stringifyNavigationInstructions(instructions) {
14936
+ const container = [];
14937
+ for (let i = 0; i < instructions.length; i += 2) {
14938
+ const step = instructions[i];
14939
+ const repeat = instructions[i + 1];
14940
+ for (let r = 0; r < repeat; r++) {
14941
+ container.push(step === NodeNavigationStep.FirstChild ? 'firstChild' : 'nextSibling');
14942
+ }
14943
+ }
14944
+ return container.join('.');
14945
+ }
14946
+ /**
14947
+ * Helper function that navigates from a starting point node (the `from` node)
14948
+ * using provided set of navigation instructions (within `path` argument).
14949
+ */
14950
+ function navigateToNode(from, instructions) {
14951
+ let node = from;
14952
+ for (let i = 0; i < instructions.length; i += 2) {
14953
+ const step = instructions[i];
14954
+ const repeat = instructions[i + 1];
14955
+ for (let r = 0; r < repeat; r++) {
14956
+ if (ngDevMode && !node) {
14957
+ throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
14958
+ }
14959
+ switch (step) {
14960
+ case NodeNavigationStep.FirstChild:
14961
+ node = node.firstChild;
14962
+ break;
14963
+ case NodeNavigationStep.NextSibling:
14964
+ node = node.nextSibling;
14965
+ break;
14966
+ }
14967
+ }
14968
+ }
14969
+ if (ngDevMode && !node) {
14970
+ throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
14971
+ }
14972
+ return node;
14973
+ }
14974
+ /**
14975
+ * Locates an RNode given a set of navigation instructions (which also contains
14976
+ * a starting point node info).
14977
+ */
14978
+ function locateRNodeByPath(path, lView) {
14979
+ const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);
14980
+ let ref;
14981
+ if (referenceNode === REFERENCE_NODE_HOST) {
14982
+ ref = lView[0];
14983
+ }
14984
+ else if (referenceNode === REFERENCE_NODE_BODY) {
14985
+ ref = ɵɵresolveBody(lView[0]);
14986
+ }
14987
+ else {
14988
+ const parentElementId = Number(referenceNode);
14989
+ ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);
14990
+ }
14991
+ return navigateToNode(ref, navigationInstructions);
14992
+ }
14993
+ /**
14994
+ * Generate a list of DOM navigation operations to get from node `start` to node `finish`.
14995
+ *
14996
+ * Note: assumes that node `start` occurs before node `finish` in an in-order traversal of the DOM
14997
+ * tree. That is, we should be able to get from `start` to `finish` purely by using `.firstChild`
14998
+ * and `.nextSibling` operations.
14999
+ */
15000
+ function navigateBetween(start, finish) {
15001
+ if (start === finish) {
15002
+ return [];
15003
+ }
15004
+ else if (start.parentElement == null || finish.parentElement == null) {
15005
+ return null;
15006
+ }
15007
+ else if (start.parentElement === finish.parentElement) {
15008
+ return navigateBetweenSiblings(start, finish);
15009
+ }
15010
+ else {
15011
+ // `finish` is a child of its parent, so the parent will always have a child.
15012
+ const parent = finish.parentElement;
15013
+ const parentPath = navigateBetween(start, parent);
15014
+ const childPath = navigateBetween(parent.firstChild, finish);
15015
+ if (!parentPath || !childPath)
15016
+ return null;
15017
+ return [
15018
+ // First navigate to `finish`'s parent
15019
+ ...parentPath,
15020
+ // Then to its first child.
15021
+ NodeNavigationStep.FirstChild,
15022
+ // And finally from that node to `finish` (maybe a no-op if we're already there).
15023
+ ...childPath,
15024
+ ];
15025
+ }
15026
+ }
15027
+ /**
15028
+ * Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).
15029
+ */
15030
+ function navigateBetweenSiblings(start, finish) {
15031
+ const nav = [];
15032
+ let node = null;
15033
+ for (node = start; node != null && node !== finish; node = node.nextSibling) {
15034
+ nav.push(NodeNavigationStep.NextSibling);
15035
+ }
15036
+ return node === null ? [] : nav;
15037
+ }
15038
+ /**
15039
+ * Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`
15040
+ * navigations:
15041
+ * - the `from` node is a known node, used as an starting point for the lookup
15042
+ * (the `fromNodeName` argument is a string representation of the node).
15043
+ * - the `to` node is a node that the runtime logic would be looking up,
15044
+ * using the path generated by this function.
15045
+ */
15046
+ function calcPathBetween(from, to, fromNodeName) {
15047
+ const path = navigateBetween(from, to);
15048
+ return path === null ? null : compressNodeLocation(fromNodeName, path);
15049
+ }
15050
+ /**
15051
+ * Invoked at serialization time (on the server) when a set of navigation
15052
+ * instructions needs to be generated for a TNode.
15053
+ */
15054
+ function calcPathForNode(tNode, lView) {
15055
+ const parentTNode = tNode.parent;
15056
+ let parentIndex;
15057
+ let parentRNode;
15058
+ let referenceNodeName;
15059
+ if (parentTNode === null) {
15060
+ // No parent TNode - use host element as a reference node.
15061
+ parentIndex = referenceNodeName = REFERENCE_NODE_HOST;
15062
+ parentRNode = lView[HOST];
15063
+ }
15064
+ else {
15065
+ // Use parent TNode as a reference node.
15066
+ parentIndex = parentTNode.index;
15067
+ parentRNode = unwrapRNode(lView[parentIndex]);
15068
+ referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);
15069
+ }
15070
+ let rNode = unwrapRNode(lView[tNode.index]);
15071
+ if (tNode.type & 12 /* TNodeType.AnyContainer */) {
15072
+ // For <ng-container> nodes, instead of serializing a reference
15073
+ // to the anchor comment node, serialize a location of the first
15074
+ // DOM element. Paired with the container size (serialized as a part
15075
+ // of `ngh.containers`), it should give enough information for runtime
15076
+ // to hydrate nodes in this container.
15077
+ const firstRNode = getFirstNativeNode(lView, tNode);
15078
+ // If container is not empty, use a reference to the first element,
15079
+ // otherwise, rNode would point to an anchor comment node.
15080
+ if (firstRNode) {
15081
+ rNode = firstRNode;
15082
+ }
15083
+ }
15084
+ let path = calcPathBetween(parentRNode, rNode, referenceNodeName);
15085
+ if (path === null && parentRNode !== rNode) {
15086
+ // Searching for a path between elements within a host node failed.
15087
+ // Trying to find a path to an element starting from the `document.body` instead.
15088
+ //
15089
+ // Important note: this type of reference is relatively unstable, since Angular
15090
+ // may not be able to control parts of the page that the runtime logic navigates
15091
+ // through. This is mostly needed to cover "portals" use-case (like menus, dialog boxes,
15092
+ // etc), where nodes are content-projected (including direct DOM manipulations) outside
15093
+ // of the host node. The better solution is to provide APIs to work with "portals",
15094
+ // at which point this code path would not be needed.
15095
+ const body = parentRNode.ownerDocument.body;
15096
+ path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);
15097
+ if (path === null) {
15098
+ // If the path is still empty, it's likely that this node is detached and
15099
+ // won't be found during hydration.
15100
+ throw nodeNotFoundError(lView, tNode);
15101
+ }
15102
+ }
15103
+ return path;
15104
+ }
14173
15105
 
14174
15106
  function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) {
14175
15107
  ngDevMode && assertFirstCreatePass(tView);
@@ -14246,7 +15178,7 @@ function createContainerAnchorImpl(tView, lView, tNode, index) {
14246
15178
  */
14247
15179
  function locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {
14248
15180
  const hydrationInfo = lView[HYDRATION];
14249
- const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();
15181
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, index);
14250
15182
  lastNodeWasCreated(isNodeCreationMode);
14251
15183
  // Regular creation mode.
14252
15184
  if (isNodeCreationMode) {
@@ -14255,11 +15187,8 @@ function locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {
14255
15187
  // Hydration mode, looking up existing elements in DOM.
14256
15188
  const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);
14257
15189
  ngDevMode && validateNodeExists(currentRNode);
15190
+ setSegmentHead(hydrationInfo, index, currentRNode);
14258
15191
  const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index);
14259
- // If this container is non-empty, store the first node as a segment head,
14260
- // otherwise, this node is an anchor and segment head doesn't exist (thus `null`).
14261
- const segmentHead = viewContainerSize > 0 ? currentRNode : null;
14262
- setSegmentHead(hydrationInfo, index, segmentHead);
14263
15192
  const comment = siblingAfter(viewContainerSize, currentRNode);
14264
15193
  if (ngDevMode) {
14265
15194
  validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);
@@ -14515,7 +15444,7 @@ let _locateOrCreateElementNode = (tView, lView, tNode, renderer, name, index) =>
14515
15444
  */
14516
15445
  function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, index) {
14517
15446
  const hydrationInfo = lView[HYDRATION];
14518
- const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();
15447
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, index);
14519
15448
  lastNodeWasCreated(isNodeCreationMode);
14520
15449
  // Regular creation mode.
14521
15450
  if (isNodeCreationMode) {
@@ -14539,10 +15468,17 @@ function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, inde
14539
15468
  // Checks if the skip hydration attribute is present during hydration so we know to
14540
15469
  // skip attempting to hydrate this block.
14541
15470
  if (hydrationInfo && hasNgSkipHydrationAttr(tNode)) {
14542
- enterSkipHydrationBlock(tNode);
14543
- // Since this isn't hydratable, we need to empty the node
14544
- // so there's no duplicate content after render
14545
- clearElementContents(renderer, native);
15471
+ if (isComponentHost(tNode)) {
15472
+ enterSkipHydrationBlock(tNode);
15473
+ // Since this isn't hydratable, we need to empty the node
15474
+ // so there's no duplicate content after render
15475
+ clearElementContents(native);
15476
+ }
15477
+ else if (ngDevMode) {
15478
+ // If this is not a component host, throw an error.
15479
+ // Hydration can be skipped on per-component basis only.
15480
+ throw invalidSkipHydrationHost(native);
15481
+ }
14546
15482
  }
14547
15483
  return native;
14548
15484
  }
@@ -14676,10 +15612,7 @@ function locateOrCreateElementContainerNode(tView, lView, tNode, index) {
14676
15612
  ngDevMode &&
14677
15613
  assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' +
14678
15614
  'but no hydration info is available.');
14679
- // If this container is non-empty, store the first node as a segment head,
14680
- // otherwise, this node is an anchor and segment head doesn't exist (thus `null`).
14681
- const segmentHead = ngContainerSize > 0 ? currentRNode : null;
14682
- setSegmentHead(hydrationInfo, index, segmentHead);
15615
+ setSegmentHead(hydrationInfo, index, currentRNode);
14683
15616
  comment = siblingAfter(ngContainerSize, currentRNode);
14684
15617
  if (ngDevMode) {
14685
15618
  validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);
@@ -15061,7 +15994,10 @@ function ɵɵprojection(nodeIndex, selectorIndex = 0, attrs) {
15061
15994
  tProjectionNode.projection = selectorIndex;
15062
15995
  // `<ng-content>` has no content
15063
15996
  setCurrentTNodeAsNotParent();
15064
- if ((tProjectionNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
15997
+ const hydrationInfo = lView[HYDRATION];
15998
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();
15999
+ if (isNodeCreationMode &&
16000
+ (tProjectionNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
15065
16001
  // re-distribution of projectable nodes is stored on a component's view level
15066
16002
  applyProjection(tView, lView, tProjectionNode);
15067
16003
  }
@@ -16982,8 +17918,11 @@ function isStylingValuePresent(value) {
16982
17918
  * @param suffix
16983
17919
  */
16984
17920
  function normalizeSuffix(value, suffix) {
16985
- if (value == null /** || value === undefined */) {
17921
+ if (value == null || value === '') {
16986
17922
  // do nothing
17923
+ // Do not add the suffix if the value is going to be empty.
17924
+ // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.
17925
+ // Example: `"left": "px;"` instead of `"left": ""`.
16987
17926
  }
16988
17927
  else if (typeof suffix === 'string') {
16989
17928
  value = value + suffix;
@@ -17024,7 +17963,7 @@ function ɵɵtext(index, value = '') {
17024
17963
  const tNode = tView.firstCreatePass ?
17025
17964
  getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) :
17026
17965
  tView.data[adjustedIndex];
17027
- const textNative = _locateOrCreateTextNode(tView, lView, tNode, value);
17966
+ const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);
17028
17967
  lView[adjustedIndex] = textNative;
17029
17968
  if (wasLastNodeCreated()) {
17030
17969
  appendChild(tView, lView, textNative, tNode);
@@ -17032,7 +17971,7 @@ function ɵɵtext(index, value = '') {
17032
17971
  // Text nodes are self closing.
17033
17972
  setCurrentTNode(tNode, false);
17034
17973
  }
17035
- let _locateOrCreateTextNode = (tView, lView, tNode, value) => {
17974
+ let _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {
17036
17975
  lastNodeWasCreated(true);
17037
17976
  return createTextNode(lView[RENDERER], value);
17038
17977
  };
@@ -17040,9 +17979,9 @@ let _locateOrCreateTextNode = (tView, lView, tNode, value) => {
17040
17979
  * Enables hydration code path (to lookup existing elements in DOM)
17041
17980
  * in addition to the regular creation mode of text nodes.
17042
17981
  */
17043
- function locateOrCreateTextNodeImpl(tView, lView, tNode, value) {
17982
+ function locateOrCreateTextNodeImpl(tView, lView, tNode, value, index) {
17044
17983
  const hydrationInfo = lView[HYDRATION];
17045
- const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();
17984
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, index);
17046
17985
  lastNodeWasCreated(isNodeCreationMode);
17047
17986
  // Regular creation mode.
17048
17987
  if (isNodeCreationMode) {
@@ -20850,13 +21789,13 @@ class StandaloneService {
20850
21789
  this.cachedInjectors.clear();
20851
21790
  }
20852
21791
  }
21792
+ /** @nocollapse */
21793
+ static { this.ɵprov = ɵɵdefineInjectable({
21794
+ token: StandaloneService,
21795
+ providedIn: 'environment',
21796
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
21797
+ }); }
20853
21798
  }
20854
- /** @nocollapse */
20855
- StandaloneService.ɵprov = ɵɵdefineInjectable({
20856
- token: StandaloneService,
20857
- providedIn: 'environment',
20858
- factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
20859
- });
20860
21799
  /**
20861
21800
  * A feature that acts as a setup code for the {@link StandaloneService}.
20862
21801
  *
@@ -21898,6 +22837,7 @@ function symbolIterator() {
21898
22837
  * @publicApi
21899
22838
  */
21900
22839
  class QueryList {
22840
+ static { Symbol.iterator; }
21901
22841
  /**
21902
22842
  * Returns `Observable` of `QueryList` notifying the subscriber of changes.
21903
22843
  */
@@ -22025,7 +22965,6 @@ class QueryList {
22025
22965
  this.changes.unsubscribe();
22026
22966
  }
22027
22967
  }
22028
- Symbol.iterator;
22029
22968
 
22030
22969
  /**
22031
22970
  * Represents an embedded template that can be used to instantiate embedded views.
@@ -22046,12 +22985,12 @@ Symbol.iterator;
22046
22985
  * @publicApi
22047
22986
  */
22048
22987
  class TemplateRef {
22988
+ /**
22989
+ * @internal
22990
+ * @nocollapse
22991
+ */
22992
+ static { this.__NG_ELEMENT_ID__ = injectTemplateRef; }
22049
22993
  }
22050
- /**
22051
- * @internal
22052
- * @nocollapse
22053
- */
22054
- TemplateRef.__NG_ELEMENT_ID__ = injectTemplateRef;
22055
22994
  const ViewEngineTemplateRef = TemplateRef;
22056
22995
  // TODO(alxhub): combine interface and implementation. Currently this is challenging since something
22057
22996
  // in g3 depends on them being separate.
@@ -22150,6 +23089,56 @@ function removeDehydratedView(dehydratedView, renderer) {
22150
23089
  }
22151
23090
  }
22152
23091
  }
23092
+ /**
23093
+ * Walks over all views within this LContainer invokes dehydrated views
23094
+ * cleanup function for each one.
23095
+ */
23096
+ function cleanupLContainer(lContainer) {
23097
+ removeDehydratedViews(lContainer);
23098
+ for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
23099
+ cleanupLView(lContainer[i]);
23100
+ }
23101
+ }
23102
+ /**
23103
+ * Walks over `LContainer`s and components registered within
23104
+ * this LView and invokes dehydrated views cleanup function for each one.
23105
+ */
23106
+ function cleanupLView(lView) {
23107
+ const tView = lView[TVIEW];
23108
+ for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
23109
+ if (isLContainer(lView[i])) {
23110
+ const lContainer = lView[i];
23111
+ cleanupLContainer(lContainer);
23112
+ }
23113
+ else if (Array.isArray(lView[i])) {
23114
+ // This is a component, enter the `cleanupLView` recursively.
23115
+ cleanupLView(lView[i]);
23116
+ }
23117
+ }
23118
+ }
23119
+ /**
23120
+ * Walks over all views registered within the ApplicationRef and removes
23121
+ * all dehydrated views from all `LContainer`s along the way.
23122
+ */
23123
+ function cleanupDehydratedViews(appRef, pendingTasks) {
23124
+ // Wait once an app becomes stable and cleanup all views that
23125
+ // were not claimed during the application bootstrap process.
23126
+ // The timing is similar to when we kick off serialization on the server.
23127
+ const isStablePromise = appRef.isStable.pipe(first((isStable) => isStable)).toPromise();
23128
+ const pendingTasksPromise = pendingTasks.whenAllTasksComplete;
23129
+ return Promise.allSettled([isStablePromise, pendingTasksPromise]).then(() => {
23130
+ const viewRefs = appRef._views;
23131
+ for (const viewRef of viewRefs) {
23132
+ const lView = getComponentLViewForHydration(viewRef);
23133
+ // An `lView` might be `null` if a `ViewRef` represents
23134
+ // an embedded view (not a component view).
23135
+ if (lView !== null && lView[HOST] !== null) {
23136
+ cleanupLView(lView);
23137
+ ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;
23138
+ }
23139
+ }
23140
+ });
23141
+ }
22153
23142
 
22154
23143
  /**
22155
23144
  * Given a current DOM node and a serialized information about the views
@@ -22159,20 +23148,24 @@ function removeDehydratedView(dehydratedView, renderer) {
22159
23148
  function locateDehydratedViewsInContainer(currentRNode, serializedViews) {
22160
23149
  const dehydratedViews = [];
22161
23150
  for (const serializedView of serializedViews) {
22162
- const view = {
22163
- data: serializedView,
22164
- firstChild: null,
22165
- };
22166
- if (serializedView[NUM_ROOT_NODES] > 0) {
22167
- // Keep reference to the first node in this view,
22168
- // so it can be accessed while invoking template instructions.
22169
- view.firstChild = currentRNode;
22170
- // Move over to the next node after this view, which can
22171
- // either be a first node of the next view or an anchor comment
22172
- // node after the last view in a container.
22173
- currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);
23151
+ // Repeats a view multiple times as needed, based on the serialized information
23152
+ // (for example, for *ngFor-produced views).
23153
+ for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {
23154
+ const view = {
23155
+ data: serializedView,
23156
+ firstChild: null,
23157
+ };
23158
+ if (serializedView[NUM_ROOT_NODES] > 0) {
23159
+ // Keep reference to the first node in this view,
23160
+ // so it can be accessed while invoking template instructions.
23161
+ view.firstChild = currentRNode;
23162
+ // Move over to the next node after this view, which can
23163
+ // either be a first node of the next view or an anchor comment
23164
+ // node after the last view in a container.
23165
+ currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);
23166
+ }
23167
+ dehydratedViews.push(view);
22174
23168
  }
22175
- dehydratedViews.push(view);
22176
23169
  }
22177
23170
  return [currentRNode, dehydratedViews];
22178
23171
  }
@@ -22236,12 +23229,12 @@ function findMatchingDehydratedView(lContainer, template) {
22236
23229
  * @publicApi
22237
23230
  */
22238
23231
  class ViewContainerRef {
23232
+ /**
23233
+ * @internal
23234
+ * @nocollapse
23235
+ */
23236
+ static { this.__NG_ELEMENT_ID__ = injectViewContainerRef; }
22239
23237
  }
22240
- /**
22241
- * @internal
22242
- * @nocollapse
22243
- */
22244
- ViewContainerRef.__NG_ELEMENT_ID__ = injectViewContainerRef;
22245
23238
  /**
22246
23239
  * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
22247
23240
  * already exists, retrieves the existing ViewContainerRef.
@@ -22553,21 +23546,22 @@ function locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {
22553
23546
  if (lContainer[NATIVE] && lContainer[DEHYDRATED_VIEWS])
22554
23547
  return;
22555
23548
  const hydrationInfo = hostLView[HYDRATION];
22556
- const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock(hostTNode);
23549
+ const noOffsetIndex = hostTNode.index - HEADER_OFFSET;
23550
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock(hostTNode) ||
23551
+ isDisconnectedNode$1(hydrationInfo, noOffsetIndex);
22557
23552
  // Regular creation mode.
22558
23553
  if (isNodeCreationMode) {
22559
23554
  return createAnchorNode(lContainer, hostLView, hostTNode, slotValue);
22560
23555
  }
22561
23556
  // Hydration mode, looking up an anchor node and dehydrated views in DOM.
22562
- const index = hostTNode.index - HEADER_OFFSET;
22563
- const currentRNode = getSegmentHead(hydrationInfo, index);
22564
- const serializedViews = hydrationInfo.data[CONTAINERS]?.[index];
23557
+ const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);
23558
+ const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];
22565
23559
  ngDevMode &&
22566
23560
  assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' +
22567
23561
  'which represents a view container.');
22568
23562
  const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);
22569
23563
  if (ngDevMode) {
22570
- validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, hostTNode);
23564
+ validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, hostTNode, true);
22571
23565
  // Do not throw in case this node is already claimed (thus `false` as a second
22572
23566
  // argument). If this container is created based on an `<ng-template>`, the comment
22573
23567
  // node would be already claimed from the `template` instruction. If an element acts
@@ -23429,7 +24423,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
23429
24423
  ];
23430
24424
  exports.forEach(verifyExportsAreDeclaredOrReExported);
23431
24425
  declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
23432
- declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);
23433
24426
  const ngModule = getAnnotation(moduleType, 'NgModule');
23434
24427
  if (ngModule) {
23435
24428
  ngModule.imports &&
@@ -23439,8 +24432,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
23439
24432
  });
23440
24433
  ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);
23441
24434
  ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);
23442
- ngModule.entryComponents &&
23443
- deepForEach(ngModule.entryComponents, verifyComponentIsPartOfNgModule);
23444
24435
  }
23445
24436
  // Throw Error if any errors were detected.
23446
24437
  if (errors.length) {
@@ -23518,16 +24509,6 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
23518
24509
  `function for bootstrap instead.`);
23519
24510
  }
23520
24511
  }
23521
- function verifyComponentEntryComponentsIsPartOfNgModule(type) {
23522
- type = resolveForwardRef(type);
23523
- if (getComponentDef(type)) {
23524
- // We know we are component
23525
- const component = getAnnotation(type, 'Component');
23526
- if (component && component.entryComponents) {
23527
- deepForEach(component.entryComponents, verifyComponentIsPartOfNgModule);
23528
- }
23529
- }
23530
- }
23531
24512
  function verifySemanticsOfNgModuleImport(type, importingModule) {
23532
24513
  type = resolveForwardRef(type);
23533
24514
  const directiveDef = getComponentDef(type) || getDirectiveDef(type);
@@ -24276,12 +25257,17 @@ const Pipe = makeDecorator('Pipe', (p) => ({ pure: true, ...p }), undefined, und
24276
25257
  * @Annotation
24277
25258
  * @publicApi
24278
25259
  */
24279
- const Input = makePropDecorator('Input', (bindingPropertyName) => ({ bindingPropertyName }));
25260
+ const Input = makePropDecorator('Input', (arg) => {
25261
+ if (!arg) {
25262
+ return {};
25263
+ }
25264
+ return typeof arg === 'string' ? { alias: arg } : arg;
25265
+ });
24280
25266
  /**
24281
25267
  * @Annotation
24282
25268
  * @publicApi
24283
25269
  */
24284
- const Output = makePropDecorator('Output', (bindingPropertyName) => ({ bindingPropertyName }));
25270
+ const Output = makePropDecorator('Output', (alias) => ({ alias }));
24285
25271
  /**
24286
25272
  * @Annotation
24287
25273
  * @publicApi
@@ -24363,7 +25349,7 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
24363
25349
  * Decorator that marks the following class as an NgModule, and supplies
24364
25350
  * configuration metadata for it.
24365
25351
  *
24366
- * * The `declarations` and `entryComponents` options configure the compiler
25352
+ * * The `declarations` option configures the compiler
24367
25353
  * with information about what belongs to the NgModule.
24368
25354
  * * The `providers` options configures the NgModule's injector to provide
24369
25355
  * dependencies the NgModule members.
@@ -24519,9 +25505,9 @@ class ApplicationInitStatus {
24519
25505
  }
24520
25506
  this.initialized = true;
24521
25507
  }
25508
+ static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
25509
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
24522
25510
  }
24523
- ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); };
24524
- ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });
24525
25511
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
24526
25512
  type: Injectable,
24527
25513
  args: [{ providedIn: 'root' }]
@@ -24537,9 +25523,9 @@ class Console {
24537
25523
  // tslint:disable-next-line:no-console
24538
25524
  console.warn(message);
24539
25525
  }
25526
+ static { this.ɵfac = function Console_Factory(t) { return new (t || Console)(); }; }
25527
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' }); }
24540
25528
  }
24541
- Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
24542
- Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });
24543
25529
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
24544
25530
  type: Injectable,
24545
25531
  args: [{ providedIn: 'platform' }]
@@ -24751,8 +25737,8 @@ class ModuleWithComponentFactories {
24751
25737
  */
24752
25738
  class Compiler {
24753
25739
  /**
24754
- * Compiles the given NgModule and all of its components. All templates of the components listed
24755
- * in `entryComponents` have to be inlined.
25740
+ * Compiles the given NgModule and all of its components. All templates of the components
25741
+ * have to be inlined.
24756
25742
  */
24757
25743
  compileModuleSync(moduleType) {
24758
25744
  return new NgModuleFactory(moduleType);
@@ -24797,9 +25783,9 @@ class Compiler {
24797
25783
  getModuleId(moduleType) {
24798
25784
  return undefined;
24799
25785
  }
25786
+ static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
25787
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
24800
25788
  }
24801
- Compiler.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); };
24802
- Compiler.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' });
24803
25789
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
24804
25790
  type: Injectable,
24805
25791
  args: [{ providedIn: 'root' }]
@@ -25614,9 +26600,9 @@ class Testability {
25614
26600
  // TODO(juliemr): implement.
25615
26601
  return [];
25616
26602
  }
26603
+ static { this.ɵfac = function Testability_Factory(t) { return new (t || Testability)(ɵɵinject(NgZone), ɵɵinject(TestabilityRegistry), ɵɵinject(TESTABILITY_GETTER)); }; }
26604
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Testability, factory: Testability.ɵfac }); }
25617
26605
  }
25618
- Testability.ɵfac = function Testability_Factory(t) { return new (t || Testability)(ɵɵinject(NgZone), ɵɵinject(TestabilityRegistry), ɵɵinject(TESTABILITY_GETTER)); };
25619
- Testability.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Testability, factory: Testability.ɵfac });
25620
26606
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Testability, [{
25621
26607
  type: Injectable
25622
26608
  }], function () { return [{ type: NgZone }, { type: TestabilityRegistry }, { type: undefined, decorators: [{
@@ -25681,9 +26667,9 @@ class TestabilityRegistry {
25681
26667
  findTestabilityInTree(elem, findInAncestors = true) {
25682
26668
  return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;
25683
26669
  }
26670
+ static { this.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); }; }
26671
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' }); }
25684
26672
  }
25685
- TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
25686
- TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });
25687
26673
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
25688
26674
  type: Injectable,
25689
26675
  args: [{ providedIn: 'platform' }]
@@ -25697,7 +26683,6 @@ function setTestabilityGetter(getter) {
25697
26683
  }
25698
26684
  let _testabilityGetter;
25699
26685
 
25700
- const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
25701
26686
  let _platformInjector = null;
25702
26687
  /**
25703
26688
  * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
@@ -25828,7 +26813,7 @@ function runPlatformInitializers(injector) {
25828
26813
  */
25829
26814
  function internalCreateApplication(config) {
25830
26815
  const { rootComponent, appProviders, platformProviders } = config;
25831
- if (NG_DEV_MODE && rootComponent !== undefined) {
26816
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
25832
26817
  assertStandaloneComponentType(rootComponent);
25833
26818
  }
25834
26819
  const platformInjector = createOrReusePlatformInjector(platformProviders);
@@ -25842,7 +26827,7 @@ function internalCreateApplication(config) {
25842
26827
  ];
25843
26828
  const envInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
25844
26829
  const exceptionHandler = envInjector.get(ErrorHandler, null);
25845
- if (NG_DEV_MODE && !exceptionHandler) {
26830
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
25846
26831
  throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
25847
26832
  }
25848
26833
  let onErrorSubscription;
@@ -25992,7 +26977,7 @@ class PlatformRef {
25992
26977
  return ngZone.run(() => {
25993
26978
  const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, provideNgZoneChangeDetection(ngZone));
25994
26979
  const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
25995
- if (NG_DEV_MODE && exceptionHandler === null) {
26980
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
25996
26981
  throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
25997
26982
  }
25998
26983
  ngZone.runOutsideAngular(() => {
@@ -26092,9 +27077,9 @@ class PlatformRef {
26092
27077
  get destroyed() {
26093
27078
  return this._destroyed;
26094
27079
  }
27080
+ static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
27081
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
26095
27082
  }
26096
- PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
26097
- PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' });
26098
27083
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
26099
27084
  type: Injectable,
26100
27085
  args: [{ providedIn: 'platform' }]
@@ -26309,7 +27294,7 @@ class ApplicationRef {
26309
27294
  * {@example core/ts/platform/platform.ts region='domNode'}
26310
27295
  */
26311
27296
  bootstrap(componentOrFactory, rootSelectorOrNode) {
26312
- NG_DEV_MODE && this.warnIfDestroyed();
27297
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
26313
27298
  const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
26314
27299
  const initStatus = this._injector.get(ApplicationInitStatus);
26315
27300
  if (!initStatus.done) {
@@ -26317,7 +27302,7 @@ class ApplicationRef {
26317
27302
  const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
26318
27303
  (standalone ? '' :
26319
27304
  ' Bootstrap components in the `ngDoBootstrap` method of the root module.');
26320
- throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, NG_DEV_MODE && errorMessage);
27305
+ throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, (typeof ngDevMode === 'undefined' || ngDevMode) && errorMessage);
26321
27306
  }
26322
27307
  let componentFactory;
26323
27308
  if (isComponentFactory) {
@@ -26358,7 +27343,7 @@ class ApplicationRef {
26358
27343
  * detection pass during which all change detection must complete.
26359
27344
  */
26360
27345
  tick() {
26361
- NG_DEV_MODE && this.warnIfDestroyed();
27346
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
26362
27347
  if (this._runningTick) {
26363
27348
  throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
26364
27349
  }
@@ -26387,7 +27372,7 @@ class ApplicationRef {
26387
27372
  * This will throw if the view is already attached to a ViewContainer.
26388
27373
  */
26389
27374
  attachView(viewRef) {
26390
- NG_DEV_MODE && this.warnIfDestroyed();
27375
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
26391
27376
  const view = viewRef;
26392
27377
  this._views.push(view);
26393
27378
  view.attachToAppRef(this);
@@ -26396,7 +27381,7 @@ class ApplicationRef {
26396
27381
  * Detaches a view from dirty checking again.
26397
27382
  */
26398
27383
  detachView(viewRef) {
26399
- NG_DEV_MODE && this.warnIfDestroyed();
27384
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
26400
27385
  const view = viewRef;
26401
27386
  remove(this._views, view);
26402
27387
  view.detachFromAppRef();
@@ -26444,7 +27429,7 @@ class ApplicationRef {
26444
27429
  * @internal
26445
27430
  */
26446
27431
  onDestroy(callback) {
26447
- NG_DEV_MODE && this.warnIfDestroyed();
27432
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
26448
27433
  this._destroyListeners.push(callback);
26449
27434
  return () => remove(this._destroyListeners, callback);
26450
27435
  }
@@ -26472,13 +27457,13 @@ class ApplicationRef {
26472
27457
  return this._views.length;
26473
27458
  }
26474
27459
  warnIfDestroyed() {
26475
- if (NG_DEV_MODE && this._destroyed) {
27460
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
26476
27461
  console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
26477
27462
  }
26478
27463
  }
27464
+ static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
27465
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
26479
27466
  }
26480
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); };
26481
- ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
26482
27467
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
26483
27468
  type: Injectable,
26484
27469
  args: [{ providedIn: 'root' }]
@@ -26503,7 +27488,7 @@ function _lastDefined(args) {
26503
27488
  * `NgZone` is provided by default today so the default (and only) implementation for this
26504
27489
  * is calling `ErrorHandler.handleError` outside of the Angular zone.
26505
27490
  */
26506
- const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(NG_DEV_MODE ? 'internal error handler' : '', {
27491
+ const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
26507
27492
  providedIn: 'root',
26508
27493
  factory: () => {
26509
27494
  const userErrorHandler = inject(ErrorHandler);
@@ -26535,9 +27520,9 @@ class NgZoneChangeDetectionScheduler {
26535
27520
  ngOnDestroy() {
26536
27521
  this._onMicrotaskEmptySubscription?.unsubscribe();
26537
27522
  }
27523
+ static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
27524
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
26538
27525
  }
26539
- NgZoneChangeDetectionScheduler.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); };
26540
- NgZoneChangeDetectionScheduler.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' });
26541
27526
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
26542
27527
  type: Injectable,
26543
27528
  args: [{ providedIn: 'root' }]
@@ -26550,8 +27535,10 @@ function provideNgZoneChangeDetection(ngZone) {
26550
27535
  multi: true,
26551
27536
  useFactory: () => {
26552
27537
  const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
26553
- if (NG_DEV_MODE && ngZoneChangeDetectionScheduler === null) {
26554
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No NgZoneChangeDetectionScheduler found in the Dependency Injection tree.');
27538
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
27539
+ ngZoneChangeDetectionScheduler === null) {
27540
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
27541
+ 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
26555
27542
  }
26556
27543
  return () => ngZoneChangeDetectionScheduler.initialize();
26557
27544
  },
@@ -26604,19 +27591,21 @@ function enableProdMode() {
26604
27591
  * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
26605
27592
  * is injected in a component or directive, the callbacks run when that component or
26606
27593
  * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.
27594
+ *
27595
+ * @publicApi
26607
27596
  */
26608
27597
  class DestroyRef {
27598
+ /**
27599
+ * @internal
27600
+ * @nocollapse
27601
+ */
27602
+ static { this.__NG_ELEMENT_ID__ = injectDestroyRef; }
27603
+ /**
27604
+ * @internal
27605
+ * @nocollapse
27606
+ */
27607
+ static { this.__NG_ENV_ID__ = (injector) => injector; }
26609
27608
  }
26610
- /**
26611
- * @internal
26612
- * @nocollapse
26613
- */
26614
- DestroyRef.__NG_ELEMENT_ID__ = injectDestroyRef;
26615
- /**
26616
- * @internal
26617
- * @nocollapse
26618
- */
26619
- DestroyRef.__NG_ENV_ID__ = (injector) => injector;
26620
27609
  class NodeInjectorDestroyRef extends DestroyRef {
26621
27610
  constructor(_lView) {
26622
27611
  super();
@@ -26624,6 +27613,7 @@ class NodeInjectorDestroyRef extends DestroyRef {
26624
27613
  }
26625
27614
  onDestroy(callback) {
26626
27615
  storeLViewOnDestroy(this._lView, callback);
27616
+ return () => removeLViewOnDestroy(this._lView, callback);
26627
27617
  }
26628
27618
  }
26629
27619
  function injectDestroyRef() {
@@ -26705,12 +27695,12 @@ function noModuleError(id) {
26705
27695
  * @publicApi
26706
27696
  */
26707
27697
  class ChangeDetectorRef {
27698
+ /**
27699
+ * @internal
27700
+ * @nocollapse
27701
+ */
27702
+ static { this.__NG_ELEMENT_ID__ = injectChangeDetectorRef; }
26708
27703
  }
26709
- /**
26710
- * @internal
26711
- * @nocollapse
26712
- */
26713
- ChangeDetectorRef.__NG_ELEMENT_ID__ = injectChangeDetectorRef;
26714
27704
  /** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
26715
27705
  function injectChangeDetectorRef(flags) {
26716
27706
  return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* InternalInjectFlags.ForPipe */) === 16 /* InternalInjectFlags.ForPipe */);
@@ -28288,6 +29278,8 @@ function defaultIterableDiffersFactory() {
28288
29278
  * @publicApi
28289
29279
  */
28290
29280
  class IterableDiffers {
29281
+ /** @nocollapse */
29282
+ static { this.ɵprov = ɵɵdefineInjectable({ token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory }); }
28291
29283
  constructor(factories) {
28292
29284
  this.factories = factories;
28293
29285
  }
@@ -28342,8 +29334,6 @@ class IterableDiffers {
28342
29334
  }
28343
29335
  }
28344
29336
  }
28345
- /** @nocollapse */
28346
- IterableDiffers.ɵprov = ɵɵdefineInjectable({ token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory });
28347
29337
  function getTypeNameForDebugging(type) {
28348
29338
  return type['name'] || typeof type;
28349
29339
  }
@@ -28357,6 +29347,8 @@ function defaultKeyValueDiffersFactory() {
28357
29347
  * @publicApi
28358
29348
  */
28359
29349
  class KeyValueDiffers {
29350
+ /** @nocollapse */
29351
+ static { this.ɵprov = ɵɵdefineInjectable({ token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory }); }
28360
29352
  constructor(factories) {
28361
29353
  this.factories = factories;
28362
29354
  }
@@ -28408,8 +29400,6 @@ class KeyValueDiffers {
28408
29400
  throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
28409
29401
  }
28410
29402
  }
28411
- /** @nocollapse */
28412
- KeyValueDiffers.ɵprov = ɵɵdefineInjectable({ token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory });
28413
29403
 
28414
29404
  /**
28415
29405
  * Structural diffing for `Object`s and `Map`s.
@@ -28445,10 +29435,10 @@ const platformCore = createPlatformFactory(null, 'core', []);
28445
29435
  class ApplicationModule {
28446
29436
  // Inject ApplicationRef to make it eager...
28447
29437
  constructor(appRef) { }
29438
+ static { this.ɵfac = function ApplicationModule_Factory(t) { return new (t || ApplicationModule)(ɵɵinject(ApplicationRef)); }; }
29439
+ static { this.ɵmod = /*@__PURE__*/ ɵɵdefineNgModule({ type: ApplicationModule }); }
29440
+ static { this.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({}); }
28448
29441
  }
28449
- ApplicationModule.ɵfac = function ApplicationModule_Factory(t) { return new (t || ApplicationModule)(ɵɵinject(ApplicationRef)); };
28450
- ApplicationModule.ɵmod = /*@__PURE__*/ ɵɵdefineNgModule({ type: ApplicationModule });
28451
- ApplicationModule.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({});
28452
29442
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationModule, [{
28453
29443
  type: NgModule
28454
29444
  }], function () { return [{ type: ApplicationRef }]; }, null); })();
@@ -28549,6 +29539,7 @@ function annotateForHydration(appRef, doc) {
28549
29539
  */
28550
29540
  function serializeLContainer(lContainer, context) {
28551
29541
  const views = [];
29542
+ let lastViewAsString = '';
28552
29543
  for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
28553
29544
  let childLView = lContainer[i];
28554
29545
  // If this is a root view, get an LView for the underlying component,
@@ -28574,16 +29565,60 @@ function serializeLContainer(lContainer, context) {
28574
29565
  [NUM_ROOT_NODES]: numRootNodes,
28575
29566
  ...serializeLView(lContainer[i], context),
28576
29567
  };
28577
- views.push(view);
29568
+ // Check if the previous view has the same shape (for example, it was
29569
+ // produced by the *ngFor), in which case bump the counter on the previous
29570
+ // view instead of including the same information again.
29571
+ const currentViewAsString = JSON.stringify(view);
29572
+ if (views.length > 0 && currentViewAsString === lastViewAsString) {
29573
+ const previousView = views[views.length - 1];
29574
+ previousView[MULTIPLIER] ??= 1;
29575
+ previousView[MULTIPLIER]++;
29576
+ }
29577
+ else {
29578
+ // Record this view as most recently added.
29579
+ lastViewAsString = currentViewAsString;
29580
+ views.push(view);
29581
+ }
28578
29582
  }
28579
29583
  return views;
28580
29584
  }
28581
29585
  /**
28582
- * Serializes the lView data into a SerializedView object that will later be added
28583
- * to the TransferState storage and referenced using the `ngh` attribute on a host
28584
- * element.
28585
- *
28586
- * @param lView the lView we are serializing
29586
+ * Helper function to produce a node path (which navigation steps runtime logic
29587
+ * needs to take to locate a node) and stores it in the `NODES` section of the
29588
+ * current serialized view.
29589
+ */
29590
+ function appendSerializedNodePath(ngh, tNode, lView) {
29591
+ const noOffsetIndex = tNode.index - HEADER_OFFSET;
29592
+ ngh[NODES] ??= {};
29593
+ ngh[NODES][noOffsetIndex] = calcPathForNode(tNode, lView);
29594
+ }
29595
+ /**
29596
+ * Helper function to append information about a disconnected node.
29597
+ * This info is needed at runtime to avoid DOM lookups for this element
29598
+ * and instead, the element would be created from scratch.
29599
+ */
29600
+ function appendDisconnectedNodeIndex(ngh, tNode) {
29601
+ const noOffsetIndex = tNode.index - HEADER_OFFSET;
29602
+ ngh[DISCONNECTED_NODES] ??= [];
29603
+ if (!ngh[DISCONNECTED_NODES].includes(noOffsetIndex)) {
29604
+ ngh[DISCONNECTED_NODES].push(noOffsetIndex);
29605
+ }
29606
+ }
29607
+ /**
29608
+ * There is no special TNode type for an i18n block, so we verify
29609
+ * whether the structure that we store at the `TView.data[idx]` position
29610
+ * has the `TI18n` shape.
29611
+ */
29612
+ function isTI18nNode(obj) {
29613
+ const tI18n = obj;
29614
+ return tI18n.hasOwnProperty('create') && tI18n.hasOwnProperty('update');
29615
+ }
29616
+ /**
29617
+ * Serializes the lView data into a SerializedView object that will later be added
29618
+ * to the TransferState storage and referenced using the `ngh` attribute on a host
29619
+ * element.
29620
+ *
29621
+ * @param lView the lView we are serializing
28587
29622
  * @param context the hydration context
28588
29623
  * @returns the `SerializedView` object containing the data to be added to the host node
28589
29624
  */
@@ -28601,11 +29636,59 @@ function serializeLView(lView, context) {
28601
29636
  if (!tNode) {
28602
29637
  continue;
28603
29638
  }
29639
+ // Check if a native node that represents a given TNode is disconnected from the DOM tree.
29640
+ // Such nodes must be excluded from the hydration (since the hydration won't be able to
29641
+ // find them), so the TNode ids are collected and used at runtime to skip the hydration.
29642
+ //
29643
+ // This situation may happen during the content projection, when some nodes don't make it
29644
+ // into one of the content projection slots (for example, when there is no default
29645
+ // <ng-content /> slot in projector component's template).
29646
+ if (isDisconnectedNode(tNode, lView) && isContentProjectedNode(tNode)) {
29647
+ appendDisconnectedNodeIndex(ngh, tNode);
29648
+ continue;
29649
+ }
29650
+ if (Array.isArray(tNode.projection)) {
29651
+ for (const projectionHeadTNode of tNode.projection) {
29652
+ // We may have `null`s in slots with no projected content.
29653
+ if (!projectionHeadTNode)
29654
+ continue;
29655
+ if (!Array.isArray(projectionHeadTNode)) {
29656
+ // If we process re-projected content (i.e. `<ng-content>`
29657
+ // appears at projection location), skip annotations for this content
29658
+ // since all DOM nodes in this projection were handled while processing
29659
+ // a parent lView, which contains those nodes.
29660
+ if (!isProjectionTNode(projectionHeadTNode) &&
29661
+ !isInSkipHydrationBlock(projectionHeadTNode)) {
29662
+ if (isDisconnectedNode(projectionHeadTNode, lView)) {
29663
+ // Check whether this node is connected, since we may have a TNode
29664
+ // in the data structure as a projection segment head, but the
29665
+ // content projection slot might be disabled (e.g.
29666
+ // <ng-content *ngIf="false" />).
29667
+ appendDisconnectedNodeIndex(ngh, projectionHeadTNode);
29668
+ }
29669
+ else {
29670
+ appendSerializedNodePath(ngh, projectionHeadTNode, lView);
29671
+ }
29672
+ }
29673
+ }
29674
+ else {
29675
+ // If a value is an array, it means that we are processing a projection
29676
+ // where projectable nodes were passed in as DOM nodes (for example, when
29677
+ // calling `ViewContainerRef.createComponent(CmpA, {projectableNodes: [...]})`).
29678
+ //
29679
+ // In this scenario, nodes can come from anywhere (either created manually,
29680
+ // accessed via `document.querySelector`, etc) and may be in any state
29681
+ // (attached or detached from the DOM tree). As a result, we can not reliably
29682
+ // restore the state for such cases during hydration.
29683
+ throw unsupportedProjectionOfDomNodes(unwrapRNode(lView[i]));
29684
+ }
29685
+ }
29686
+ }
28604
29687
  if (isLContainer(lView[i])) {
28605
29688
  // Serialize information about a template.
28606
29689
  const embeddedTView = tNode.tView;
28607
29690
  if (embeddedTView !== null) {
28608
- ngh[TEMPLATES] ?? (ngh[TEMPLATES] = {});
29691
+ ngh[TEMPLATES] ??= {};
28609
29692
  ngh[TEMPLATES][noOffsetIndex] = getSsrId(embeddedTView);
28610
29693
  }
28611
29694
  // Serialize views within this LContainer.
@@ -28620,7 +29703,7 @@ function serializeLView(lView, context) {
28620
29703
  annotateHostElementForHydration(targetNode, hostNode, context);
28621
29704
  }
28622
29705
  }
28623
- ngh[CONTAINERS] ?? (ngh[CONTAINERS] = {});
29706
+ ngh[CONTAINERS] ??= {};
28624
29707
  ngh[CONTAINERS][noOffsetIndex] = serializeLContainer(lView[i], context);
28625
29708
  }
28626
29709
  else if (Array.isArray(lView[i])) {
@@ -28630,15 +29713,41 @@ function serializeLView(lView, context) {
28630
29713
  annotateHostElementForHydration(targetNode, lView[i], context);
28631
29714
  }
28632
29715
  }
29716
+ else if (isTI18nNode(tNode)) {
29717
+ // Hydration for i18n nodes is not *yet* supported.
29718
+ // Produce an error message which would also describe possible
29719
+ // solutions (switching back to the "destructive" hydration or
29720
+ // excluding a component from hydration via `ngSkipHydration`).
29721
+ //
29722
+ // TODO(akushnir): we should find a better way to get a hold of the node that has the `i18n`
29723
+ // attribute on it. For now, we either refer to the host element of the component or to the
29724
+ // previous element in the LView.
29725
+ const targetNode = (i === HEADER_OFFSET) ? lView[HOST] : unwrapRNode(lView[i - 1]);
29726
+ throw notYetSupportedI18nBlockError(targetNode);
29727
+ }
28633
29728
  else {
28634
29729
  // <ng-container> case
28635
29730
  if (tNode.type & 8 /* TNodeType.ElementContainer */) {
28636
29731
  // An <ng-container> is represented by the number of
28637
29732
  // top-level nodes. This information is needed to skip over
28638
29733
  // those nodes to reach a corresponding anchor node (comment node).
28639
- ngh[ELEMENT_CONTAINERS] ?? (ngh[ELEMENT_CONTAINERS] = {});
29734
+ ngh[ELEMENT_CONTAINERS] ??= {};
28640
29735
  ngh[ELEMENT_CONTAINERS][noOffsetIndex] = calcNumRootNodes(tView, lView, tNode.child);
28641
29736
  }
29737
+ else if (tNode.type & 16 /* TNodeType.Projection */) {
29738
+ // Current TNode represents an `<ng-content>` slot, thus it has no
29739
+ // DOM elements associated with it, so the **next sibling** node would
29740
+ // not be able to find an anchor. In this case, use full path instead.
29741
+ let nextTNode = tNode.next;
29742
+ // Skip over all `<ng-content>` slots in a row.
29743
+ while (nextTNode !== null && (nextTNode.type & 16 /* TNodeType.Projection */)) {
29744
+ nextTNode = nextTNode.next;
29745
+ }
29746
+ if (nextTNode && !isInSkipHydrationBlock(nextTNode)) {
29747
+ // Handle a tNode after the `<ng-content>` slot.
29748
+ appendSerializedNodePath(ngh, nextTNode, lView);
29749
+ }
29750
+ }
28642
29751
  else {
28643
29752
  // Handle cases where text nodes can be lost after DOM serialization:
28644
29753
  // 1. When there is an *empty text node* in DOM: in this case, this
@@ -28675,6 +29784,13 @@ function serializeLView(lView, context) {
28675
29784
  context.corruptedTextNodes.set(rNode, "ngtns" /* TextNodeMarker.Separator */);
28676
29785
  }
28677
29786
  }
29787
+ if (tNode.projectionNext && tNode.projectionNext !== tNode.next &&
29788
+ !isInSkipHydrationBlock(tNode.projectionNext)) {
29789
+ // Check if projection next is not the same as next, in which case
29790
+ // the node would not be found at creation time at runtime and we
29791
+ // need to provide a location for that node.
29792
+ appendSerializedNodePath(ngh, tNode.projectionNext, lView);
29793
+ }
28678
29794
  }
28679
29795
  }
28680
29796
  }
@@ -28707,6 +29823,96 @@ function insertCorruptedTextNodeMarkers(corruptedTextNodes, doc) {
28707
29823
  textNode.after(doc.createComment(marker));
28708
29824
  }
28709
29825
  }
29826
+ /**
29827
+ * Detects whether a given TNode represents a node that
29828
+ * is being content projected.
29829
+ */
29830
+ function isContentProjectedNode(tNode) {
29831
+ let currentTNode = tNode;
29832
+ while (currentTNode != null) {
29833
+ // If we come across a component host node in parent nodes -
29834
+ // this TNode is in the content projection section.
29835
+ if (isComponentHost(currentTNode)) {
29836
+ return true;
29837
+ }
29838
+ currentTNode = currentTNode.parent;
29839
+ }
29840
+ return false;
29841
+ }
29842
+ /**
29843
+ * Check whether a given node exists, but is disconnected from the DOM.
29844
+ *
29845
+ * Note: we leverage the fact that we have this information available in the DOM emulation
29846
+ * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and
29847
+ * only use internal data structures and state to compute this information.
29848
+ */
29849
+ function isDisconnectedNode(tNode, lView) {
29850
+ return !(tNode.type & 16 /* TNodeType.Projection */) && !!lView[tNode.index] &&
29851
+ !unwrapRNode(lView[tNode.index]).isConnected;
29852
+ }
29853
+
29854
+ /**
29855
+ * *Internal* service that keeps track of pending tasks happening in the system
29856
+ * during the initial rendering. No tasks are tracked after an initial
29857
+ * rendering.
29858
+ *
29859
+ * This information is needed to make sure that the serialization on the server
29860
+ * is delayed until all tasks in the queue (such as an initial navigation or a
29861
+ * pending HTTP request) are completed.
29862
+ */
29863
+ class InitialRenderPendingTasks {
29864
+ get whenAllTasksComplete() {
29865
+ if (this.collection.size > 0) {
29866
+ return this.promise;
29867
+ }
29868
+ return Promise.resolve().then(() => {
29869
+ this.completed = true;
29870
+ });
29871
+ }
29872
+ constructor() {
29873
+ this.taskId = 0;
29874
+ this.collection = new Set();
29875
+ this.ngZone = inject(NgZone);
29876
+ this.completed = false;
29877
+ // Run outside of the Angular zone to avoid triggering
29878
+ // extra change detection cycles.
29879
+ this.ngZone.runOutsideAngular(() => {
29880
+ this.promise = new Promise((resolve) => {
29881
+ this.resolve = resolve;
29882
+ });
29883
+ });
29884
+ }
29885
+ add() {
29886
+ if (this.completed) {
29887
+ // Indicates that the task was added after
29888
+ // the task queue completion, so it's a noop.
29889
+ return -1;
29890
+ }
29891
+ const taskId = this.taskId++;
29892
+ this.collection.add(taskId);
29893
+ return taskId;
29894
+ }
29895
+ remove(taskId) {
29896
+ if (this.completed)
29897
+ return;
29898
+ this.collection.delete(taskId);
29899
+ if (this.collection.size === 0) {
29900
+ // We've removed the last task, resolve the promise.
29901
+ this.completed = true;
29902
+ this.resolve();
29903
+ }
29904
+ }
29905
+ ngOnDestroy() {
29906
+ this.completed = true;
29907
+ this.collection.clear();
29908
+ }
29909
+ static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
29910
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
29911
+ }
29912
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
29913
+ type: Injectable,
29914
+ args: [{ providedIn: 'root' }]
29915
+ }], function () { return []; }, null); })();
28710
29916
 
28711
29917
  /**
28712
29918
  * Indicates whether the hydration-related code was added,
@@ -28813,108 +30019,22 @@ function provideHydrationSupport() {
28813
30019
  // environment. On a server, an application is rendered
28814
30020
  // from scratch, so the host content needs to be empty.
28815
30021
  useFactory: () => isBrowser(),
30022
+ },
30023
+ {
30024
+ provide: APP_BOOTSTRAP_LISTENER,
30025
+ useFactory: () => {
30026
+ if (isBrowser()) {
30027
+ const appRef = inject(ApplicationRef);
30028
+ const pendingTasks = inject(InitialRenderPendingTasks);
30029
+ return () => cleanupDehydratedViews(appRef, pendingTasks);
30030
+ }
30031
+ return () => { }; // noop
30032
+ },
30033
+ multi: true,
28816
30034
  }
28817
30035
  ]);
28818
30036
  }
28819
30037
 
28820
- /** Coerces a value (typically a string) to a boolean. */
28821
- function coerceToBoolean(value) {
28822
- return typeof value === 'boolean' ? value : (value != null && value !== 'false');
28823
- }
28824
-
28825
- /**
28826
- * Compiles a partial directive declaration object into a full directive definition object.
28827
- *
28828
- * @codeGenApi
28829
- */
28830
- function ɵɵngDeclareDirective(decl) {
28831
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'directive', type: decl.type });
28832
- return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
28833
- }
28834
- /**
28835
- * Evaluates the class metadata declaration.
28836
- *
28837
- * @codeGenApi
28838
- */
28839
- function ɵɵngDeclareClassMetadata(decl) {
28840
- setClassMetadata(decl.type, decl.decorators, decl.ctorParameters ?? null, decl.propDecorators ?? null);
28841
- }
28842
- /**
28843
- * Compiles a partial component declaration object into a full component definition object.
28844
- *
28845
- * @codeGenApi
28846
- */
28847
- function ɵɵngDeclareComponent(decl) {
28848
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'component', type: decl.type });
28849
- return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
28850
- }
28851
- /**
28852
- * Compiles a partial pipe declaration object into a full pipe definition object.
28853
- *
28854
- * @codeGenApi
28855
- */
28856
- function ɵɵngDeclareFactory(decl) {
28857
- const compiler = getCompilerFacade({
28858
- usage: 1 /* JitCompilerUsage.PartialDeclaration */,
28859
- kind: getFactoryKind(decl.target),
28860
- type: decl.type
28861
- });
28862
- return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
28863
- }
28864
- function getFactoryKind(target) {
28865
- switch (target) {
28866
- case FactoryTarget.Directive:
28867
- return 'directive';
28868
- case FactoryTarget.Component:
28869
- return 'component';
28870
- case FactoryTarget.Injectable:
28871
- return 'injectable';
28872
- case FactoryTarget.Pipe:
28873
- return 'pipe';
28874
- case FactoryTarget.NgModule:
28875
- return 'NgModule';
28876
- }
28877
- }
28878
- /**
28879
- * Compiles a partial injectable declaration object into a full injectable definition object.
28880
- *
28881
- * @codeGenApi
28882
- */
28883
- function ɵɵngDeclareInjectable(decl) {
28884
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'injectable', type: decl.type });
28885
- return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);
28886
- }
28887
- /**
28888
- * Compiles a partial injector declaration object into a full injector definition object.
28889
- *
28890
- * @codeGenApi
28891
- */
28892
- function ɵɵngDeclareInjector(decl) {
28893
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
28894
- return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);
28895
- }
28896
- /**
28897
- * Compiles a partial NgModule declaration object into a full NgModule definition object.
28898
- *
28899
- * @codeGenApi
28900
- */
28901
- function ɵɵngDeclareNgModule(decl) {
28902
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
28903
- return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);
28904
- }
28905
- /**
28906
- * Compiles a partial pipe declaration object into a full pipe definition object.
28907
- *
28908
- * @codeGenApi
28909
- */
28910
- function ɵɵngDeclarePipe(decl) {
28911
- const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'pipe', type: decl.type });
28912
- return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
28913
- }
28914
-
28915
- // clang-format off
28916
- // clang-format on
28917
-
28918
30038
  /**
28919
30039
  * Symbol used to tell `Signal`s apart from other functions.
28920
30040
  *
@@ -28925,14 +30045,14 @@ const SIGNAL = Symbol('SIGNAL');
28925
30045
  * Checks if the given `value` function is a reactive `Signal`.
28926
30046
  */
28927
30047
  function isSignal(value) {
28928
- return value[SIGNAL] ?? false;
30048
+ return value[SIGNAL] !== undefined;
28929
30049
  }
28930
30050
  /**
28931
30051
  * Converts `fn` into a marked signal function (where `isSignal(fn)` will be `true`), and
28932
30052
  * potentially add some set of extra properties (passed as an object record `extraApi`).
28933
30053
  */
28934
- function createSignalFromFunction(fn, extraApi = {}) {
28935
- fn[SIGNAL] = true;
30054
+ function createSignalFromFunction(node, fn, extraApi = {}) {
30055
+ fn[SIGNAL] = node;
28936
30056
  // Copy properties from `extraApi` to `fn` to complete the desired API of the `Signal`.
28937
30057
  return Object.assign(fn, extraApi);
28938
30058
  }
@@ -28953,125 +30073,18 @@ function defaultEquals(a, b) {
28953
30073
  // as objects (`typeof null === 'object'`).
28954
30074
  return (a === null || typeof a !== 'object') && Object.is(a, b);
28955
30075
  }
28956
-
28957
- /**
28958
- * Tracks the currently active reactive context (or `null` if there is no active
28959
- * context).
28960
- */
28961
- let activeConsumer = null;
28962
- /**
28963
- * Counter tracking the next `ProducerId` or `ConsumerId`.
28964
- */
28965
- let _nextReactiveId = 0;
28966
- /**
28967
- * Get a new `ProducerId` or `ConsumerId`, allocated from the global sequence.
28968
- *
28969
- * The value returned is a type intersection of both branded types, and thus can be assigned to
28970
- * either.
28971
- */
28972
- function nextReactiveId() {
28973
- return _nextReactiveId++;
28974
- }
28975
- /**
28976
- * Set `consumer` as the active reactive context, and return the previous `Consumer`
28977
- * (if any) for later restoration.
28978
- */
28979
- function setActiveConsumer(consumer) {
28980
- const prevConsumer = activeConsumer;
28981
- activeConsumer = consumer;
28982
- return prevConsumer;
28983
- }
28984
- /**
28985
- * Notify all `Consumer`s of the given `Producer` that its value may have changed.
28986
- */
28987
- function producerNotifyConsumers(producer) {
28988
- for (const [consumerId, edge] of producer.consumers) {
28989
- const consumer = edge.consumerRef.deref();
28990
- if (consumer === undefined || consumer.trackingVersion !== edge.atTrackingVersion) {
28991
- producer.consumers.delete(consumerId);
28992
- consumer?.producers.delete(producer.id);
28993
- continue;
28994
- }
28995
- consumer.notify();
28996
- }
28997
- }
28998
- /**
28999
- * Record a dependency on the given `Producer` by the current reactive `Consumer` if
29000
- * one is present.
29001
- */
29002
- function producerAccessed(producer) {
29003
- if (activeConsumer === null) {
29004
- return;
29005
- }
29006
- // Either create or update the dependency `Edge` in both directions.
29007
- let edge = activeConsumer.producers.get(producer.id);
29008
- if (edge === undefined) {
29009
- edge = {
29010
- consumerRef: activeConsumer.ref,
29011
- producerRef: producer.ref,
29012
- seenValueVersion: producer.valueVersion,
29013
- atTrackingVersion: activeConsumer.trackingVersion,
29014
- };
29015
- activeConsumer.producers.set(producer.id, edge);
29016
- producer.consumers.set(activeConsumer.id, edge);
29017
- }
29018
- else {
29019
- edge.seenValueVersion = producer.valueVersion;
29020
- edge.atTrackingVersion = activeConsumer.trackingVersion;
29021
- }
29022
- }
29023
- /**
29024
- * Checks if a `Producer` has a current value which is different than the value
29025
- * last seen at a specific version by a `Consumer` which recorded a dependency on
29026
- * this `Producer`.
29027
- */
29028
- function producerPollStatus(producer, lastSeenValueVersion) {
29029
- // `producer.valueVersion` may be stale, but a mismatch still means that the value
29030
- // last seen by the `Consumer` is also stale.
29031
- if (producer.valueVersion !== lastSeenValueVersion) {
29032
- return true;
29033
- }
29034
- // Trigger the `Producer` to update its `valueVersion` if necessary.
29035
- producer.checkForChangedValue();
29036
- // At this point, we can trust `producer.valueVersion`.
29037
- return producer.valueVersion !== lastSeenValueVersion;
29038
- }
29039
- /**
29040
- * Function called to check the stale status of dependencies (producers) for a given consumer. This
29041
- * is a verification step before refreshing a given consumer: if none of the the dependencies
29042
- * reports a semantically new value, then the `Consumer` has not observed a real dependency change
29043
- * (even though it may have been notified of one).
29044
- */
29045
- function consumerPollValueStatus(consumer) {
29046
- for (const [producerId, edge] of consumer.producers) {
29047
- const producer = edge.producerRef.deref();
29048
- if (producer === undefined || edge.atTrackingVersion !== consumer.trackingVersion) {
29049
- // This dependency edge is stale, so remove it.
29050
- consumer.producers.delete(producerId);
29051
- producer?.consumers.delete(consumer.id);
29052
- continue;
29053
- }
29054
- if (producerPollStatus(producer, edge.seenValueVersion)) {
29055
- // One of the dependencies reports a real value change.
29056
- return true;
29057
- }
29058
- }
29059
- // No dependency reported a real value change, so the `Consumer` has also not been
29060
- // impacted.
29061
- return false;
29062
- }
29063
-
29064
- // tslint:disable-next-line: no-toplevel-property-access
29065
- const WeakRef = _global['WeakRef'];
30076
+ // clang-format on
29066
30077
 
29067
30078
  /**
29068
30079
  * Create a computed `Signal` which derives a reactive value from an expression.
29069
30080
  *
29070
30081
  * @developerPreview
29071
30082
  */
29072
- function computed(computation, equal = defaultEquals) {
29073
- const node = new ComputedImpl(computation, equal);
29074
- return createSignalFromFunction(node.signal.bind(node));
30083
+ function computed(computation, options) {
30084
+ const node = new ComputedImpl(computation, options?.equal ?? defaultEquals);
30085
+ // Casting here is required for g3, as TS inference behavior is slightly different between our
30086
+ // version/options and g3's.
30087
+ return createSignalFromFunction(node, node.signal.bind(node));
29075
30088
  }
29076
30089
  /**
29077
30090
  * A dedicated symbol used before a computed value has been calculated for the first time.
@@ -29093,10 +30106,11 @@ const ERRORED = Symbol('ERRORED');
29093
30106
  /**
29094
30107
  * A computation, which derives a value from a declarative reactive expression.
29095
30108
  *
29096
- * `Computed`s are both `Producer`s and `Consumer`s of reactivity.
30109
+ * `Computed`s are both producers and consumers of reactivity.
29097
30110
  */
29098
- class ComputedImpl {
30111
+ class ComputedImpl extends ReactiveNode {
29099
30112
  constructor(computation, equal) {
30113
+ super();
29100
30114
  this.computation = computation;
29101
30115
  this.equal = equal;
29102
30116
  /**
@@ -29118,20 +30132,25 @@ class ComputedImpl {
29118
30132
  * state can be resolved without recomputing the value.
29119
30133
  */
29120
30134
  this.stale = true;
29121
- this.id = nextReactiveId();
29122
- this.ref = new WeakRef(this);
29123
- this.producers = new Map();
29124
- this.consumers = new Map();
29125
- this.trackingVersion = 0;
29126
- this.valueVersion = 0;
29127
30135
  }
29128
- checkForChangedValue() {
30136
+ onConsumerDependencyMayHaveChanged() {
30137
+ if (this.stale) {
30138
+ // We've already notified consumers that this value has potentially changed.
30139
+ return;
30140
+ }
30141
+ // Record that the currently cached value may be stale.
30142
+ this.stale = true;
30143
+ // Notify any consumers about the potential change.
30144
+ this.producerMayHaveChanged();
30145
+ }
30146
+ onProducerUpdateValueVersion() {
29129
30147
  if (!this.stale) {
29130
30148
  // The current value and its version are already up to date.
29131
30149
  return;
29132
30150
  }
29133
30151
  // The current value is stale. Check whether we need to produce a new one.
29134
- if (this.value !== UNSET && this.value !== COMPUTING && !consumerPollValueStatus(this)) {
30152
+ if (this.value !== UNSET && this.value !== COMPUTING &&
30153
+ !this.consumerPollProducersForChange()) {
29135
30154
  // Even though we were previously notified of a potential dependency update, all of
29136
30155
  // our dependencies report that they have not actually changed in value, so we can
29137
30156
  // resolve the stale state without needing to recompute the current value.
@@ -29174,21 +30193,11 @@ class ComputedImpl {
29174
30193
  this.value = newValue;
29175
30194
  this.valueVersion++;
29176
30195
  }
29177
- notify() {
29178
- if (this.stale) {
29179
- // We've already notified consumers that this value has potentially changed.
29180
- return;
29181
- }
29182
- // Record that the currently cached value may be stale.
29183
- this.stale = true;
29184
- // Notify any consumers about the potential change.
29185
- producerNotifyConsumers(this);
29186
- }
29187
30196
  signal() {
29188
30197
  // Check if the value needs updating before returning it.
29189
- this.checkForChangedValue();
30198
+ this.onProducerUpdateValueVersion();
29190
30199
  // Record that someone looked at this signal.
29191
- producerAccessed(this);
30200
+ this.producerAccessed();
29192
30201
  if (this.value === ERRORED) {
29193
30202
  throw this.error;
29194
30203
  }
@@ -29196,6 +30205,91 @@ class ComputedImpl {
29196
30205
  }
29197
30206
  }
29198
30207
 
30208
+ class WritableSignalImpl extends ReactiveNode {
30209
+ constructor(value, equal) {
30210
+ super();
30211
+ this.value = value;
30212
+ this.equal = equal;
30213
+ }
30214
+ onConsumerDependencyMayHaveChanged() {
30215
+ // This never happens for writable signals as they're not consumers.
30216
+ }
30217
+ onProducerUpdateValueVersion() {
30218
+ // Writable signal value versions are always up to date.
30219
+ }
30220
+ /**
30221
+ * Directly update the value of the signal to a new value, which may or may not be
30222
+ * equal to the previous.
30223
+ *
30224
+ * In the event that `newValue` is semantically equal to the current value, `set` is
30225
+ * a no-op.
30226
+ */
30227
+ set(newValue) {
30228
+ if (!this.equal(this.value, newValue)) {
30229
+ this.value = newValue;
30230
+ this.valueVersion++;
30231
+ this.producerMayHaveChanged();
30232
+ }
30233
+ }
30234
+ /**
30235
+ * Derive a new value for the signal from its current value using the `updater` function.
30236
+ *
30237
+ * This is equivalent to calling `set` on the result of running `updater` on the current
30238
+ * value.
30239
+ */
30240
+ update(updater) {
30241
+ this.set(updater(this.value));
30242
+ }
30243
+ /**
30244
+ * Calls `mutator` on the current value and assumes that it has been mutated.
30245
+ */
30246
+ mutate(mutator) {
30247
+ // Mutate bypasses equality checks as it's by definition changing the value.
30248
+ mutator(this.value);
30249
+ this.valueVersion++;
30250
+ this.producerMayHaveChanged();
30251
+ }
30252
+ signal() {
30253
+ this.producerAccessed();
30254
+ return this.value;
30255
+ }
30256
+ }
30257
+ /**
30258
+ * Create a `Signal` that can be set or updated directly.
30259
+ *
30260
+ * @developerPreview
30261
+ */
30262
+ function signal(initialValue, options) {
30263
+ const signalNode = new WritableSignalImpl(initialValue, options?.equal ?? defaultEquals);
30264
+ // Casting here is required for g3, as TS inference behavior is slightly different between our
30265
+ // version/options and g3's.
30266
+ const signalFn = createSignalFromFunction(signalNode, signalNode.signal.bind(signalNode), {
30267
+ set: signalNode.set.bind(signalNode),
30268
+ update: signalNode.update.bind(signalNode),
30269
+ mutate: signalNode.mutate.bind(signalNode),
30270
+ });
30271
+ return signalFn;
30272
+ }
30273
+
30274
+ /**
30275
+ * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
30276
+ * can, optionally, return a value.
30277
+ *
30278
+ * @developerPreview
30279
+ */
30280
+ function untracked(nonReactiveReadsFn) {
30281
+ const prevConsumer = setActiveConsumer(null);
30282
+ // We are not trying to catch any particular errors here, just making sure that the consumers
30283
+ // stack is restored in case of errors.
30284
+ try {
30285
+ return nonReactiveReadsFn();
30286
+ }
30287
+ finally {
30288
+ setActiveConsumer(prevConsumer);
30289
+ }
30290
+ }
30291
+
30292
+ const NOOP_CLEANUP_FN = () => { };
29199
30293
  /**
29200
30294
  * Watches a reactive expression and allows it to be scheduled to re-run
29201
30295
  * when any dependencies notify of a change.
@@ -29203,15 +30297,13 @@ class ComputedImpl {
29203
30297
  * `Watch` doesn't run reactive expressions itself, but relies on a consumer-
29204
30298
  * provided scheduling operation to coordinate calling `Watch.run()`.
29205
30299
  */
29206
- class Watch {
30300
+ class Watch extends ReactiveNode {
29207
30301
  constructor(watch, schedule) {
30302
+ super();
29208
30303
  this.watch = watch;
29209
30304
  this.schedule = schedule;
29210
- this.id = nextReactiveId();
29211
- this.ref = new WeakRef(this);
29212
- this.producers = new Map();
29213
- this.trackingVersion = 0;
29214
30305
  this.dirty = false;
30306
+ this.cleanupFn = NOOP_CLEANUP_FN;
29215
30307
  }
29216
30308
  notify() {
29217
30309
  if (!this.dirty) {
@@ -29219,6 +30311,12 @@ class Watch {
29219
30311
  }
29220
30312
  this.dirty = true;
29221
30313
  }
30314
+ onConsumerDependencyMayHaveChanged() {
30315
+ this.notify();
30316
+ }
30317
+ onProducerUpdateValueVersion() {
30318
+ // Watches are not producers.
30319
+ }
29222
30320
  /**
29223
30321
  * Execute the reactive expression in the context of this `Watch` consumer.
29224
30322
  *
@@ -29227,60 +30325,156 @@ class Watch {
29227
30325
  */
29228
30326
  run() {
29229
30327
  this.dirty = false;
29230
- if (this.trackingVersion !== 0 && !consumerPollValueStatus(this)) {
30328
+ if (this.trackingVersion !== 0 && !this.consumerPollProducersForChange()) {
29231
30329
  return;
29232
30330
  }
29233
30331
  const prevConsumer = setActiveConsumer(this);
29234
30332
  this.trackingVersion++;
29235
30333
  try {
29236
- this.watch();
30334
+ this.cleanupFn();
30335
+ this.cleanupFn = this.watch() ?? NOOP_CLEANUP_FN;
29237
30336
  }
29238
30337
  finally {
29239
30338
  setActiveConsumer(prevConsumer);
29240
30339
  }
29241
30340
  }
30341
+ cleanup() {
30342
+ this.cleanupFn();
30343
+ }
30344
+ }
30345
+
30346
+ /** Coerces a value (typically a string) to a boolean. */
30347
+ function coerceToBoolean(value) {
30348
+ return typeof value === 'boolean' ? value : (value != null && value !== 'false');
29242
30349
  }
29243
30350
 
29244
30351
  /**
29245
- * Create a global `Effect` for the given reactive function.
30352
+ * Compiles a partial directive declaration object into a full directive definition object.
29246
30353
  *
29247
- * @developerPreview
30354
+ * @codeGenApi
29248
30355
  */
29249
- function effect(effectFn) {
29250
- const watch = new Watch(effectFn, queueWatch);
29251
- globalWatches.add(watch);
29252
- // Effects start dirty.
29253
- watch.notify();
29254
- return {
29255
- consumer: watch,
29256
- schedule: watch.notify.bind(watch),
29257
- destroy: () => {
29258
- queuedWatches.delete(watch);
29259
- globalWatches.delete(watch);
29260
- },
29261
- };
30356
+ function ɵɵngDeclareDirective(decl) {
30357
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'directive', type: decl.type });
30358
+ return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
30359
+ }
30360
+ /**
30361
+ * Evaluates the class metadata declaration.
30362
+ *
30363
+ * @codeGenApi
30364
+ */
30365
+ function ɵɵngDeclareClassMetadata(decl) {
30366
+ setClassMetadata(decl.type, decl.decorators, decl.ctorParameters ?? null, decl.propDecorators ?? null);
30367
+ }
30368
+ /**
30369
+ * Compiles a partial component declaration object into a full component definition object.
30370
+ *
30371
+ * @codeGenApi
30372
+ */
30373
+ function ɵɵngDeclareComponent(decl) {
30374
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'component', type: decl.type });
30375
+ return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
30376
+ }
30377
+ /**
30378
+ * Compiles a partial pipe declaration object into a full pipe definition object.
30379
+ *
30380
+ * @codeGenApi
30381
+ */
30382
+ function ɵɵngDeclareFactory(decl) {
30383
+ const compiler = getCompilerFacade({
30384
+ usage: 1 /* JitCompilerUsage.PartialDeclaration */,
30385
+ kind: getFactoryKind(decl.target),
30386
+ type: decl.type
30387
+ });
30388
+ return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
30389
+ }
30390
+ function getFactoryKind(target) {
30391
+ switch (target) {
30392
+ case FactoryTarget.Directive:
30393
+ return 'directive';
30394
+ case FactoryTarget.Component:
30395
+ return 'component';
30396
+ case FactoryTarget.Injectable:
30397
+ return 'injectable';
30398
+ case FactoryTarget.Pipe:
30399
+ return 'pipe';
30400
+ case FactoryTarget.NgModule:
30401
+ return 'NgModule';
30402
+ }
30403
+ }
30404
+ /**
30405
+ * Compiles a partial injectable declaration object into a full injectable definition object.
30406
+ *
30407
+ * @codeGenApi
30408
+ */
30409
+ function ɵɵngDeclareInjectable(decl) {
30410
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'injectable', type: decl.type });
30411
+ return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);
29262
30412
  }
29263
30413
  /**
29264
- * Get a `Promise` that resolves when any scheduled effects have resolved.
30414
+ * Compiles a partial injector declaration object into a full injector definition object.
30415
+ *
30416
+ * @codeGenApi
29265
30417
  */
29266
- function effectsDone() {
29267
- return watchQueuePromise?.promise ?? Promise.resolve();
30418
+ function ɵɵngDeclareInjector(decl) {
30419
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
30420
+ return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);
29268
30421
  }
29269
30422
  /**
29270
- * Shut down all active effects.
30423
+ * Compiles a partial NgModule declaration object into a full NgModule definition object.
30424
+ *
30425
+ * @codeGenApi
29271
30426
  */
29272
- function resetEffects() {
29273
- queuedWatches.clear();
29274
- globalWatches.clear();
30427
+ function ɵɵngDeclareNgModule(decl) {
30428
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
30429
+ return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);
29275
30430
  }
30431
+ /**
30432
+ * Compiles a partial pipe declaration object into a full pipe definition object.
30433
+ *
30434
+ * @codeGenApi
30435
+ */
30436
+ function ɵɵngDeclarePipe(decl) {
30437
+ const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'pipe', type: decl.type });
30438
+ return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
30439
+ }
30440
+
30441
+ // clang-format off
30442
+ // clang-format on
30443
+
29276
30444
  const globalWatches = new Set();
29277
- const queuedWatches = new Set();
30445
+ const queuedWatches = new Map();
29278
30446
  let watchQueuePromise = null;
29279
- function queueWatch(watch) {
30447
+ /**
30448
+ * Create a global `Effect` for the given reactive function.
30449
+ *
30450
+ * @developerPreview
30451
+ */
30452
+ function effect(effectFn, options) {
30453
+ !options?.injector && assertInInjectionContext(effect);
30454
+ const zone = Zone.current;
30455
+ const watch = new Watch(effectFn, (watch) => queueWatch(watch, zone));
30456
+ const injector = options?.injector ?? inject(Injector);
30457
+ const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
30458
+ globalWatches.add(watch);
30459
+ // Effects start dirty.
30460
+ watch.notify();
30461
+ let unregisterOnDestroy;
30462
+ const destroy = () => {
30463
+ watch.cleanup();
30464
+ unregisterOnDestroy?.();
30465
+ queuedWatches.delete(watch);
30466
+ globalWatches.delete(watch);
30467
+ };
30468
+ unregisterOnDestroy = destroyRef?.onDestroy(destroy);
30469
+ return {
30470
+ destroy,
30471
+ };
30472
+ }
30473
+ function queueWatch(watch, zone) {
29280
30474
  if (queuedWatches.has(watch) || !globalWatches.has(watch)) {
29281
30475
  return;
29282
30476
  }
29283
- queuedWatches.add(watch);
30477
+ queuedWatches.set(watch, zone);
29284
30478
  if (watchQueuePromise === null) {
29285
30479
  Promise.resolve().then(runWatchQueue);
29286
30480
  let resolveFn;
@@ -29294,99 +30488,16 @@ function queueWatch(watch) {
29294
30488
  }
29295
30489
  }
29296
30490
  function runWatchQueue() {
29297
- for (const watch of queuedWatches) {
30491
+ for (const [watch, zone] of queuedWatches) {
29298
30492
  queuedWatches.delete(watch);
29299
- watch.run();
30493
+ zone.run(() => watch.run());
29300
30494
  }
29301
30495
  watchQueuePromise.resolveFn();
29302
30496
  watchQueuePromise = null;
29303
30497
  }
29304
30498
 
29305
- /**
29306
- * Backing type for a `SettableSignal`, a mutable reactive value.
29307
- */
29308
- class SettableSignalImpl {
29309
- constructor(value, equal) {
29310
- this.value = value;
29311
- this.equal = equal;
29312
- this.id = nextReactiveId();
29313
- this.ref = new WeakRef(this);
29314
- this.consumers = new Map();
29315
- this.valueVersion = 0;
29316
- }
29317
- checkForChangedValue() {
29318
- // Settable signals can only change when set, so there's nothing to check here.
29319
- }
29320
- /**
29321
- * Directly update the value of the signal to a new value, which may or may not be
29322
- * equal to the previous.
29323
- *
29324
- * In the event that `newValue` is semantically equal to the current value, `set` is
29325
- * a no-op.
29326
- */
29327
- set(newValue) {
29328
- if (!this.equal(this.value, newValue)) {
29329
- this.value = newValue;
29330
- this.valueVersion++;
29331
- producerNotifyConsumers(this);
29332
- }
29333
- }
29334
- /**
29335
- * Derive a new value for the signal from its current value using the `updater` function.
29336
- *
29337
- * This is equivalent to calling `set` on the result of running `updater` on the current
29338
- * value.
29339
- */
29340
- update(updater) {
29341
- this.set(updater(this.value));
29342
- }
29343
- /**
29344
- * Calls `mutator` on the current value and assumes that it has been mutated.
29345
- */
29346
- mutate(mutator) {
29347
- // Mutate bypasses equality checks as it's by definition changing the value.
29348
- mutator(this.value);
29349
- this.valueVersion++;
29350
- producerNotifyConsumers(this);
29351
- }
29352
- signal() {
29353
- producerAccessed(this);
29354
- return this.value;
29355
- }
29356
- }
29357
- /**
29358
- * Create a `Signal` that can be set or updated directly.
29359
- *
29360
- * @developerPreview
29361
- */
29362
- function signal(initialValue, equal = defaultEquals) {
29363
- const signalNode = new SettableSignalImpl(initialValue, equal);
29364
- // Casting here is required for g3.
29365
- const signalFn = createSignalFromFunction(signalNode.signal.bind(signalNode), {
29366
- set: signalNode.set.bind(signalNode),
29367
- update: signalNode.update.bind(signalNode),
29368
- mutate: signalNode.mutate.bind(signalNode),
29369
- });
29370
- return signalFn;
29371
- }
29372
-
29373
- /**
29374
- * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
29375
- * can, optionally, return a value.
29376
- *
29377
- * @developerPreview
29378
- */
29379
- function untracked(nonReactiveReadsFn) {
29380
- const prevConsumer = setActiveConsumer(null);
29381
- // We are not trying to catch any particular errors here, just making sure that the consumers
29382
- // stack is restored in case of errors.
29383
- try {
29384
- return nonReactiveReadsFn();
29385
- }
29386
- finally {
29387
- setActiveConsumer(prevConsumer);
29388
- }
29389
- }
30499
+ // clang-format off
30500
+ // clang-format on
29390
30501
 
29391
30502
  // This file exists to allow the set of reactivity exports to be modified in g3, as these APIs are
29392
30503
 
@@ -29571,5 +30682,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
29571
30682
  * Generated bundle index. Do not edit.
29572
30683
  */
29573
30684
 
29574
- export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, mergeApplicationConfig, platformCore, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_FEATURE_ENABLED as ɵIS_HYDRATION_FEATURE_ENABLED, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, TransferState as ɵTransferState, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, escapeTransferStateContent as ɵescapeTransferStateContent, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, getComponentDef as ɵgetComponentDef, getDebugNode as ɵgetDebugNode, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, makeDecorator as ɵmakeDecorator, makeStateKey as ɵmakeStateKey, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, provideHydrationSupport as ɵprovideHydrationSupport, provideNgZoneChangeDetection as ɵprovideNgZoneChangeDetection, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unescapeTransferStateContent as ɵunescapeTransferStateContent, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
30685
+ export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertInInjectionContext, assertPlatform, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, platformCore, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_FEATURE_ENABLED as ɵIS_HYDRATION_FEATURE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, escapeTransferStateContent as ɵescapeTransferStateContent, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, getDebugNode as ɵgetDebugNode, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, makeDecorator as ɵmakeDecorator, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, provideHydrationSupport as ɵprovideHydrationSupport, provideNgZoneChangeDetection as ɵprovideNgZoneChangeDetection, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unescapeTransferStateContent as ɵunescapeTransferStateContent, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
29575
30686
  //# sourceMappingURL=core.mjs.map