@angular/compiler-cli 13.0.0-next.1 → 13.0.0-next.10

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 (600) hide show
  1. package/bundles/index.js +20414 -0
  2. package/bundles/index.js.map +6 -0
  3. package/bundles/linker/babel/index.js +2384 -0
  4. package/bundles/linker/babel/index.js.map +6 -0
  5. package/bundles/linker/index.js +1849 -0
  6. package/bundles/linker/index.js.map +6 -0
  7. package/bundles/ngcc/index.js +16043 -0
  8. package/bundles/ngcc/index.js.map +6 -0
  9. package/bundles/ngcc/main-ngcc.js +16131 -0
  10. package/bundles/ngcc/main-ngcc.js.map +6 -0
  11. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13855 -0
  12. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +6 -0
  13. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +334 -0
  14. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +6 -0
  15. package/bundles/private/bazel.js +97 -0
  16. package/bundles/private/bazel.js.map +6 -0
  17. package/bundles/private/localize.js +911 -0
  18. package/bundles/private/localize.js.map +6 -0
  19. package/bundles/private/migrations.js +2181 -0
  20. package/bundles/private/migrations.js.map +6 -0
  21. package/bundles/private/tooling.js +942 -0
  22. package/bundles/private/tooling.js.map +6 -0
  23. package/bundles/src/bin/ng_xi18n.js +20466 -0
  24. package/bundles/src/bin/ng_xi18n.js.map +6 -0
  25. package/bundles/src/bin/ngc.js +20468 -0
  26. package/bundles/src/bin/ngc.js.map +6 -0
  27. package/bundles_metadata.json +1 -0
  28. package/import_meta_url.d.ts +14 -0
  29. package/index.d.ts +4 -1
  30. package/linker/babel/src/ast/babel_ast_factory.d.ts +1 -8
  31. package/linker/babel/src/ast/babel_ast_host.d.ts +1 -1
  32. package/linker/babel/src/babel_core.d.ts +36 -0
  33. package/linker/babel/src/babel_declaration_scope.d.ts +1 -1
  34. package/linker/babel/src/babel_plugin.d.ts +1 -8
  35. package/linker/babel/src/es2015_linker_plugin.d.ts +2 -2
  36. package/linker/src/ast/typescript/typescript_ast_host.d.ts +1 -1
  37. package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +1 -2
  38. package/linker/src/file_linker/emit_scopes/iife_emit_scope.d.ts +1 -1
  39. package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.d.ts +1 -2
  40. package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +1 -2
  41. package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +1 -2
  42. package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.d.ts +1 -2
  43. package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.d.ts +1 -2
  44. package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.d.ts +1 -2
  45. package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +1 -2
  46. package/linker/src/file_linker/partial_linkers/partial_linker_selector.d.ts +2 -2
  47. package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.d.ts +1 -2
  48. package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.d.ts +1 -2
  49. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -2
  50. package/ngcc/index.d.ts +15 -0
  51. package/ngcc/src/analysis/decoration_analyzer.d.ts +1 -1
  52. package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +1 -1
  53. package/ngcc/src/analysis/ngcc_references_registry.d.ts +1 -1
  54. package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +1 -1
  55. package/ngcc/src/analysis/private_declarations_analyzer.d.ts +1 -1
  56. package/ngcc/src/analysis/switch_marker_analyzer.d.ts +1 -1
  57. package/ngcc/src/analysis/types.d.ts +1 -1
  58. package/ngcc/src/dependencies/esm_dependency_host.d.ts +1 -1
  59. package/ngcc/src/execution/cluster/api.d.ts +5 -1
  60. package/ngcc/src/execution/cluster/master.d.ts +5 -3
  61. package/{src/ngtsc/logging/testing/index.d.ts → ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts} +2 -2
  62. package/ngcc/src/host/commonjs_host.d.ts +1 -1
  63. package/ngcc/src/host/commonjs_umd_utils.d.ts +1 -1
  64. package/ngcc/src/host/delegating_host.d.ts +2 -2
  65. package/ngcc/src/host/esm2015_host.d.ts +1 -1
  66. package/ngcc/src/host/esm5_host.d.ts +2 -1
  67. package/ngcc/src/host/ngcc_host.d.ts +1 -1
  68. package/ngcc/src/host/umd_host.d.ts +1 -1
  69. package/ngcc/src/host/utils.d.ts +1 -1
  70. package/ngcc/src/locking/lock_file.d.ts +1 -1
  71. package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +2 -0
  72. package/ngcc/src/locking/lock_file_with_child_process/{unlocker.d.ts → ngcc_lock_unlocker.d.ts} +1 -1
  73. package/ngcc/src/migrations/migration.d.ts +1 -1
  74. package/ngcc/src/migrations/missing_injectable_migration.d.ts +1 -1
  75. package/ngcc/src/migrations/undecorated_child_migration.d.ts +1 -1
  76. package/ngcc/src/migrations/undecorated_parent_migration.d.ts +1 -1
  77. package/ngcc/src/migrations/utils.d.ts +1 -1
  78. package/ngcc/src/packages/build_marker.d.ts +1 -1
  79. package/ngcc/src/packages/bundle_program.d.ts +1 -1
  80. package/ngcc/src/packages/configuration.d.ts +41 -4
  81. package/ngcc/src/packages/entry_point_bundle.d.ts +1 -1
  82. package/ngcc/src/packages/ngcc_compiler_host.d.ts +1 -1
  83. package/ngcc/src/packages/source_file_cache.d.ts +1 -1
  84. package/ngcc/src/packages/transformer.d.ts +1 -1
  85. package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
  86. package/ngcc/src/rendering/dts_renderer.d.ts +1 -1
  87. package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +1 -1
  88. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -1
  89. package/ngcc/src/rendering/renderer.d.ts +1 -1
  90. package/ngcc/src/rendering/rendering_formatter.d.ts +1 -1
  91. package/ngcc/src/rendering/source_maps.d.ts +3 -3
  92. package/ngcc/src/rendering/umd_rendering_formatter.d.ts +1 -1
  93. package/ngcc/src/rendering/utils.d.ts +1 -1
  94. package/ngcc/src/utils.d.ts +1 -1
  95. package/package.json +52 -11
  96. package/private/bazel.d.ts +13 -0
  97. package/private/localize.d.ts +15 -0
  98. package/private/migrations.d.ts +16 -0
  99. package/{src → private}/tooling.d.ts +2 -2
  100. package/src/{ngtsc/core/src/config.d.ts → bin/ng_xi18n.d.ts} +3 -2
  101. package/{ngcc/main-ivy-ngcc.d.ts → src/bin/ngc.d.ts} +2 -1
  102. package/src/diagnostics/translate_diagnostics.d.ts +1 -1
  103. package/src/extract_i18n.d.ts +0 -5
  104. package/src/main.d.ts +6 -6
  105. package/src/metadata/bundle_index_host.d.ts +1 -1
  106. package/src/metadata/bundler.d.ts +1 -1
  107. package/src/metadata/collector.d.ts +1 -1
  108. package/src/metadata/evaluator.d.ts +1 -1
  109. package/src/metadata/symbols.d.ts +1 -1
  110. package/src/ngtsc/annotations/src/component.d.ts +16 -1
  111. package/src/ngtsc/annotations/src/diagnostics.d.ts +1 -1
  112. package/src/ngtsc/annotations/src/directive.d.ts +1 -1
  113. package/src/ngtsc/annotations/src/metadata.d.ts +2 -2
  114. package/src/ngtsc/annotations/src/ng_module.d.ts +2 -4
  115. package/src/ngtsc/annotations/src/pipe.d.ts +1 -1
  116. package/src/ngtsc/annotations/src/util.d.ts +2 -4
  117. package/src/ngtsc/core/api/src/adapter.d.ts +1 -1
  118. package/src/ngtsc/core/api/src/interfaces.d.ts +2 -13
  119. package/src/ngtsc/core/api/src/options.d.ts +11 -2
  120. package/src/ngtsc/core/src/compiler.d.ts +13 -8
  121. package/src/ngtsc/core/src/host.d.ts +1 -1
  122. package/src/ngtsc/cycles/src/analyzer.d.ts +1 -1
  123. package/src/ngtsc/cycles/src/imports.d.ts +1 -1
  124. package/src/ngtsc/diagnostics/src/error.d.ts +1 -1
  125. package/src/ngtsc/diagnostics/src/error_code.d.ts +9 -0
  126. package/src/ngtsc/entry_point/src/generator.d.ts +1 -1
  127. package/src/ngtsc/entry_point/src/private_export_checker.d.ts +1 -1
  128. package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -1
  129. package/src/ngtsc/file_system/src/logical.d.ts +1 -1
  130. package/src/ngtsc/file_system/src/util.d.ts +1 -1
  131. package/src/ngtsc/imports/src/alias.d.ts +1 -1
  132. package/src/ngtsc/imports/src/default.d.ts +1 -1
  133. package/src/ngtsc/imports/src/emitter.d.ts +1 -1
  134. package/src/ngtsc/imports/src/find_export.d.ts +1 -1
  135. package/src/ngtsc/imports/src/references.d.ts +1 -1
  136. package/src/ngtsc/imports/src/resolver.d.ts +1 -1
  137. package/src/ngtsc/incremental/api.d.ts +1 -1
  138. package/src/ngtsc/incremental/src/dependency_tracking.d.ts +1 -1
  139. package/src/ngtsc/incremental/src/incremental.d.ts +1 -1
  140. package/src/ngtsc/incremental/src/state.d.ts +1 -1
  141. package/src/ngtsc/incremental/src/strategy.d.ts +1 -1
  142. package/src/ngtsc/indexer/src/api.d.ts +5 -2
  143. package/src/ngtsc/metadata/src/api.d.ts +1 -1
  144. package/src/ngtsc/metadata/src/dts.d.ts +1 -1
  145. package/src/ngtsc/metadata/src/resource_registry.d.ts +1 -1
  146. package/src/ngtsc/metadata/src/util.d.ts +1 -1
  147. package/src/ngtsc/partial_evaluator/index.d.ts +1 -0
  148. package/src/ngtsc/partial_evaluator/src/builtin.d.ts +1 -1
  149. package/src/ngtsc/partial_evaluator/src/diagnostics.d.ts +1 -1
  150. package/src/ngtsc/partial_evaluator/src/dynamic.d.ts +1 -1
  151. package/src/ngtsc/partial_evaluator/src/interface.d.ts +1 -1
  152. package/src/ngtsc/partial_evaluator/src/interpreter.d.ts +1 -1
  153. package/src/ngtsc/partial_evaluator/src/result.d.ts +1 -1
  154. package/src/ngtsc/partial_evaluator/src/ts_helpers.d.ts +1 -1
  155. package/src/ngtsc/program.d.ts +1 -2
  156. package/src/ngtsc/program_driver/src/api.d.ts +1 -1
  157. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +1 -1
  158. package/src/ngtsc/reflection/src/host.d.ts +7 -7
  159. package/src/ngtsc/reflection/src/type_to_value.d.ts +1 -1
  160. package/src/ngtsc/reflection/src/typescript.d.ts +4 -4
  161. package/src/ngtsc/reflection/src/util.d.ts +1 -1
  162. package/src/ngtsc/resource/src/loader.d.ts +1 -1
  163. package/src/ngtsc/scope/src/local.d.ts +1 -1
  164. package/src/ngtsc/scope/src/typecheck.d.ts +1 -1
  165. package/src/ngtsc/shims/api.d.ts +1 -1
  166. package/src/ngtsc/shims/src/adapter.d.ts +1 -1
  167. package/src/ngtsc/shims/src/expando.d.ts +1 -1
  168. package/src/ngtsc/shims/src/factory_generator.d.ts +1 -1
  169. package/src/ngtsc/shims/src/reference_tagger.d.ts +1 -1
  170. package/src/ngtsc/shims/src/summary_generator.d.ts +1 -1
  171. package/src/ngtsc/switch/src/switch.d.ts +1 -1
  172. package/src/ngtsc/transform/src/alias.d.ts +1 -1
  173. package/src/ngtsc/transform/src/api.d.ts +3 -1
  174. package/src/ngtsc/transform/src/compilation.d.ts +3 -1
  175. package/src/ngtsc/transform/src/declaration.d.ts +1 -1
  176. package/src/ngtsc/transform/src/trait.d.ts +1 -1
  177. package/src/ngtsc/transform/src/transform.d.ts +1 -1
  178. package/src/ngtsc/transform/src/utils.d.ts +1 -1
  179. package/src/ngtsc/translator/src/import_manager.d.ts +1 -1
  180. package/src/ngtsc/translator/src/translator.d.ts +0 -1
  181. package/src/ngtsc/translator/src/type_translator.d.ts +1 -2
  182. package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -1
  183. package/src/ngtsc/translator/src/typescript_translator.d.ts +1 -1
  184. package/src/ngtsc/tsc_plugin.d.ts +1 -1
  185. package/src/ngtsc/typecheck/api/api.d.ts +22 -1
  186. package/src/ngtsc/typecheck/api/checker.d.ts +10 -7
  187. package/src/ngtsc/typecheck/api/context.d.ts +1 -1
  188. package/src/ngtsc/typecheck/api/scope.d.ts +1 -1
  189. package/src/ngtsc/typecheck/api/symbols.d.ts +1 -1
  190. package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +2 -16
  191. package/src/ngtsc/typecheck/extended/api/api.d.ts +50 -0
  192. package/src/ngtsc/typecheck/extended/api/extended_template_checker.d.ts +19 -0
  193. package/src/ngtsc/{routing → typecheck/extended/api}/index.d.ts +3 -3
  194. package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +22 -0
  195. package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +23 -0
  196. package/src/ngtsc/typecheck/extended/index.d.ts +9 -0
  197. package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +18 -0
  198. package/src/ngtsc/typecheck/src/checker.d.ts +7 -8
  199. package/src/ngtsc/typecheck/src/comments.d.ts +1 -1
  200. package/src/ngtsc/typecheck/src/completion.d.ts +4 -6
  201. package/src/ngtsc/typecheck/src/context.d.ts +2 -3
  202. package/src/ngtsc/typecheck/src/diagnostics.d.ts +2 -3
  203. package/src/ngtsc/typecheck/src/dom.d.ts +1 -2
  204. package/src/ngtsc/typecheck/src/environment.d.ts +1 -1
  205. package/src/ngtsc/typecheck/src/expression.d.ts +1 -1
  206. package/src/ngtsc/typecheck/src/oob.d.ts +4 -6
  207. package/src/ngtsc/typecheck/src/shim.d.ts +1 -1
  208. package/src/ngtsc/typecheck/src/source.d.ts +1 -1
  209. package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
  210. package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +1 -1
  211. package/src/ngtsc/typecheck/src/ts_util.d.ts +1 -1
  212. package/src/ngtsc/typecheck/src/type_check_block.d.ts +1 -1
  213. package/src/ngtsc/typecheck/src/type_check_file.d.ts +1 -1
  214. package/src/ngtsc/typecheck/src/type_constructor.d.ts +1 -1
  215. package/src/ngtsc/typecheck/src/type_emitter.d.ts +1 -1
  216. package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +2 -2
  217. package/src/ngtsc/util/src/typescript.d.ts +1 -1
  218. package/src/ngtsc/util/src/visitor.d.ts +1 -1
  219. package/src/perform_compile.d.ts +1 -1
  220. package/src/perform_watch.d.ts +1 -1
  221. package/src/transformers/api.d.ts +2 -5
  222. package/src/transformers/compiler_host.d.ts +1 -1
  223. package/src/transformers/{downlevel_decorators_transform.d.ts → downlevel_decorators_transform/downlevel_decorators_transform.d.ts} +3 -3
  224. package/src/transformers/downlevel_decorators_transform/index.d.ts +9 -0
  225. package/src/transformers/{patch_alias_reference_resolution.d.ts → downlevel_decorators_transform/patch_alias_reference_resolution.d.ts} +2 -2
  226. package/src/transformers/i18n.d.ts +1 -1
  227. package/src/transformers/inline_resources.d.ts +1 -1
  228. package/src/transformers/lower_expressions.d.ts +1 -1
  229. package/src/transformers/metadata_cache.d.ts +1 -1
  230. package/src/transformers/node_emitter.d.ts +2 -3
  231. package/src/transformers/node_emitter_transform.d.ts +1 -1
  232. package/src/transformers/program.d.ts +1 -1
  233. package/src/transformers/r3_metadata_transform.d.ts +1 -1
  234. package/src/transformers/r3_transform.d.ts +1 -1
  235. package/src/transformers/util.d.ts +1 -1
  236. package/index.js +0 -40
  237. package/linker/babel/index.js +0 -25
  238. package/linker/babel/src/ast/babel_ast_factory.js +0 -153
  239. package/linker/babel/src/ast/babel_ast_host.js +0 -181
  240. package/linker/babel/src/babel_declaration_scope.js +0 -67
  241. package/linker/babel/src/babel_plugin.js +0 -38
  242. package/linker/babel/src/es2015_linker_plugin.js +0 -183
  243. package/linker/babel/src/linker_plugin_options.js +0 -13
  244. package/linker/index.js +0 -27
  245. package/linker/src/ast/ast_host.js +0 -20
  246. package/linker/src/ast/ast_value.js +0 -299
  247. package/linker/src/ast/typescript/typescript_ast_host.js +0 -183
  248. package/linker/src/ast/utils.js +0 -31
  249. package/linker/src/fatal_linker_error.js +0 -49
  250. package/linker/src/file_linker/declaration_scope.js +0 -20
  251. package/linker/src/file_linker/emit_scopes/emit_scope.js +0 -57
  252. package/linker/src/file_linker/emit_scopes/iife_emit_scope.js +0 -51
  253. package/linker/src/file_linker/file_linker.js +0 -97
  254. package/linker/src/file_linker/get_source_file.js +0 -42
  255. package/linker/src/file_linker/linker_environment.js +0 -38
  256. package/linker/src/file_linker/linker_options.js +0 -29
  257. package/linker/src/file_linker/needs_linking.js +0 -41
  258. package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.js +0 -47
  259. package/linker/src/file_linker/partial_linkers/partial_component_linker_1.js +0 -210
  260. package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.js +0 -154
  261. package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.js +0 -70
  262. package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.js +0 -74
  263. package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.js +0 -56
  264. package/linker/src/file_linker/partial_linkers/partial_linker.js +0 -13
  265. package/linker/src/file_linker/partial_linkers/partial_linker_selector.js +0 -194
  266. package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.js +0 -126
  267. package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.js +0 -59
  268. package/linker/src/file_linker/partial_linkers/util.js +0 -95
  269. package/linker/src/file_linker/translator.js +0 -40
  270. package/linker/src/linker_import_generator.js +0 -43
  271. package/ngcc/index.js +0 -33
  272. package/ngcc/main-ivy-ngcc.js +0 -12
  273. package/ngcc/main-ngcc.js +0 -54
  274. package/ngcc/src/analysis/decoration_analyzer.js +0 -268
  275. package/ngcc/src/analysis/migration_host.js +0 -108
  276. package/ngcc/src/analysis/module_with_providers_analyzer.js +0 -197
  277. package/ngcc/src/analysis/ngcc_references_registry.js +0 -65
  278. package/ngcc/src/analysis/ngcc_trait_compiler.js +0 -117
  279. package/ngcc/src/analysis/private_declarations_analyzer.js +0 -63
  280. package/ngcc/src/analysis/switch_marker_analyzer.js +0 -50
  281. package/ngcc/src/analysis/types.js +0 -15
  282. package/ngcc/src/analysis/util.js +0 -36
  283. package/ngcc/src/command_line_options.js +0 -156
  284. package/ngcc/src/constants.js +0 -23
  285. package/ngcc/src/dependencies/commonjs_dependency_host.js +0 -129
  286. package/ngcc/src/dependencies/dependency_host.js +0 -143
  287. package/ngcc/src/dependencies/dependency_resolver.js +0 -180
  288. package/ngcc/src/dependencies/dts_dependency_host.js +0 -35
  289. package/ngcc/src/dependencies/esm_dependency_host.js +0 -307
  290. package/ngcc/src/dependencies/module_resolver.js +0 -269
  291. package/ngcc/src/dependencies/umd_dependency_host.js +0 -53
  292. package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.js +0 -70
  293. package/ngcc/src/entry_point_finder/entry_point_collector.js +0 -157
  294. package/ngcc/src/entry_point_finder/interface.js +0 -13
  295. package/ngcc/src/entry_point_finder/program_based_entry_point_finder.js +0 -132
  296. package/ngcc/src/entry_point_finder/targeted_entry_point_finder.js +0 -268
  297. package/ngcc/src/entry_point_finder/tracing_entry_point_finder.js +0 -78
  298. package/ngcc/src/entry_point_finder/utils.js +0 -234
  299. package/ngcc/src/execution/analyze_entry_points.js +0 -197
  300. package/ngcc/src/execution/api.js +0 -13
  301. package/ngcc/src/execution/cluster/api.js +0 -20
  302. package/ngcc/src/execution/cluster/executor.js +0 -52
  303. package/ngcc/src/execution/cluster/master.js +0 -311
  304. package/ngcc/src/execution/cluster/package_json_updater.js +0 -79
  305. package/ngcc/src/execution/cluster/utils.js +0 -77
  306. package/ngcc/src/execution/cluster/worker.js +0 -123
  307. package/ngcc/src/execution/create_compile_function.js +0 -76
  308. package/ngcc/src/execution/single_process_executor.js +0 -91
  309. package/ngcc/src/execution/tasks/api.js +0 -35
  310. package/ngcc/src/execution/tasks/completion.js +0 -79
  311. package/ngcc/src/execution/tasks/queues/base_task_queue.js +0 -120
  312. package/ngcc/src/execution/tasks/queues/parallel_task_queue.js +0 -87
  313. package/ngcc/src/execution/tasks/queues/serial_task_queue.js +0 -49
  314. package/ngcc/src/execution/tasks/utils.js +0 -167
  315. package/ngcc/src/host/commonjs_host.js +0 -261
  316. package/ngcc/src/host/commonjs_umd_utils.js +0 -210
  317. package/ngcc/src/host/delegating_host.js +0 -156
  318. package/ngcc/src/host/esm2015_host.js +0 -2441
  319. package/ngcc/src/host/esm5_host.js +0 -744
  320. package/ngcc/src/host/ngcc_host.js +0 -29
  321. package/ngcc/src/host/umd_host.js +0 -539
  322. package/ngcc/src/host/utils.js +0 -26
  323. package/ngcc/src/locking/async_locker.js +0 -121
  324. package/ngcc/src/locking/lock_file.js +0 -18
  325. package/ngcc/src/locking/lock_file_with_child_process/index.js +0 -93
  326. package/ngcc/src/locking/lock_file_with_child_process/unlocker.js +0 -46
  327. package/ngcc/src/locking/lock_file_with_child_process/util.js +0 -43
  328. package/ngcc/src/locking/sync_locker.js +0 -67
  329. package/ngcc/src/main.js +0 -163
  330. package/ngcc/src/migrations/migration.js +0 -13
  331. package/ngcc/src/migrations/missing_injectable_migration.js +0 -227
  332. package/ngcc/src/migrations/undecorated_child_migration.js +0 -90
  333. package/ngcc/src/migrations/undecorated_parent_migration.js +0 -103
  334. package/ngcc/src/migrations/utils.js +0 -137
  335. package/ngcc/src/ngcc_options.js +0 -135
  336. package/ngcc/src/packages/build_marker.js +0 -124
  337. package/ngcc/src/packages/bundle_program.js +0 -80
  338. package/ngcc/src/packages/configuration.js +0 -277
  339. package/ngcc/src/packages/entry_point.js +0 -267
  340. package/ngcc/src/packages/entry_point_bundle.js +0 -96
  341. package/ngcc/src/packages/entry_point_manifest.js +0 -207
  342. package/ngcc/src/packages/ngcc_compiler_host.js +0 -101
  343. package/ngcc/src/packages/patch_ts_expando_initializer.js +0 -174
  344. package/ngcc/src/packages/source_file_cache.js +0 -207
  345. package/ngcc/src/packages/transformer.js +0 -157
  346. package/ngcc/src/path_mappings.js +0 -27
  347. package/ngcc/src/rendering/commonjs_rendering_formatter.js +0 -106
  348. package/ngcc/src/rendering/dts_renderer.js +0 -170
  349. package/ngcc/src/rendering/esm5_rendering_formatter.js +0 -70
  350. package/ngcc/src/rendering/esm_rendering_formatter.js +0 -291
  351. package/ngcc/src/rendering/ngcc_import_rewriter.js +0 -49
  352. package/ngcc/src/rendering/renderer.js +0 -204
  353. package/ngcc/src/rendering/rendering_formatter.js +0 -15
  354. package/ngcc/src/rendering/source_maps.js +0 -68
  355. package/ngcc/src/rendering/umd_rendering_formatter.js +0 -326
  356. package/ngcc/src/rendering/utils.js +0 -35
  357. package/ngcc/src/utils.js +0 -182
  358. package/ngcc/src/writing/cleaning/cleaning_strategies.js +0 -80
  359. package/ngcc/src/writing/cleaning/package_cleaner.js +0 -126
  360. package/ngcc/src/writing/cleaning/utils.js +0 -30
  361. package/ngcc/src/writing/file_writer.js +0 -13
  362. package/ngcc/src/writing/in_place_file_writer.js +0 -90
  363. package/ngcc/src/writing/new_entry_point_file_writer.js +0 -214
  364. package/ngcc/src/writing/package_json_updater.js +0 -182
  365. package/src/diagnostics/translate_diagnostics.js +0 -61
  366. package/src/diagnostics/typescript_version.js +0 -96
  367. package/src/extract_i18n.js +0 -62
  368. package/src/language_services.js +0 -34
  369. package/src/main.js +0 -210
  370. package/src/metadata/bundle_index_host.js +0 -133
  371. package/src/metadata/bundler.js +0 -624
  372. package/src/metadata/collector.js +0 -799
  373. package/src/metadata/evaluator.js +0 -677
  374. package/src/metadata/index.js +0 -24
  375. package/src/metadata/index_writer.js +0 -80
  376. package/src/metadata/schema.js +0 -136
  377. package/src/metadata/symbols.js +0 -149
  378. package/src/ngtsc/annotations/index.js +0 -35
  379. package/src/ngtsc/annotations/src/api.js +0 -20
  380. package/src/ngtsc/annotations/src/component.js +0 -1283
  381. package/src/ngtsc/annotations/src/diagnostics.js +0 -174
  382. package/src/ngtsc/annotations/src/directive.js +0 -724
  383. package/src/ngtsc/annotations/src/factory.js +0 -32
  384. package/src/ngtsc/annotations/src/injectable.js +0 -277
  385. package/src/ngtsc/annotations/src/metadata.js +0 -159
  386. package/src/ngtsc/annotations/src/ng_module.js +0 -677
  387. package/src/ngtsc/annotations/src/pipe.js +0 -171
  388. package/src/ngtsc/annotations/src/references_registry.js +0 -38
  389. package/src/ngtsc/annotations/src/util.js +0 -566
  390. package/src/ngtsc/core/api/index.js +0 -25
  391. package/src/ngtsc/core/api/src/adapter.js +0 -20
  392. package/src/ngtsc/core/api/src/interfaces.js +0 -20
  393. package/src/ngtsc/core/api/src/options.js +0 -20
  394. package/src/ngtsc/core/api/src/public_options.js +0 -20
  395. package/src/ngtsc/core/index.js +0 -25
  396. package/src/ngtsc/core/src/compiler.js +0 -1077
  397. package/src/ngtsc/core/src/config.js +0 -28
  398. package/src/ngtsc/core/src/host.js +0 -273
  399. package/src/ngtsc/cycles/index.js +0 -26
  400. package/src/ngtsc/cycles/src/analyzer.js +0 -163
  401. package/src/ngtsc/cycles/src/imports.js +0 -175
  402. package/src/ngtsc/diagnostics/index.js +0 -33
  403. package/src/ngtsc/diagnostics/src/error.js +0 -69
  404. package/src/ngtsc/diagnostics/src/error_code.js +0 -226
  405. package/src/ngtsc/diagnostics/src/util.js +0 -35
  406. package/src/ngtsc/entry_point/index.js +0 -29
  407. package/src/ngtsc/entry_point/src/generator.js +0 -45
  408. package/src/ngtsc/entry_point/src/logic.js +0 -61
  409. package/src/ngtsc/entry_point/src/private_export_checker.js +0 -137
  410. package/src/ngtsc/entry_point/src/reference_graph.js +0 -91
  411. package/src/ngtsc/file_system/index.js +0 -45
  412. package/src/ngtsc/file_system/src/compiler_host.js +0 -80
  413. package/src/ngtsc/file_system/src/helpers.js +0 -135
  414. package/src/ngtsc/file_system/src/invalid_file_system.js +0 -120
  415. package/src/ngtsc/file_system/src/logical.js +0 -100
  416. package/src/ngtsc/file_system/src/node_js_file_system.js +0 -179
  417. package/src/ngtsc/file_system/src/types.js +0 -20
  418. package/src/ngtsc/file_system/src/util.js +0 -38
  419. package/src/ngtsc/file_system/testing/index.d.ts +0 -13
  420. package/src/ngtsc/file_system/testing/index.js +0 -32
  421. package/src/ngtsc/file_system/testing/src/mock_file_system.d.ts +0 -72
  422. package/src/ngtsc/file_system/testing/src/mock_file_system.js +0 -333
  423. package/src/ngtsc/file_system/testing/src/mock_file_system_native.d.ts +0 -16
  424. package/src/ngtsc/file_system/testing/src/mock_file_system_native.js +0 -85
  425. package/src/ngtsc/file_system/testing/src/mock_file_system_posix.d.ts +0 -13
  426. package/src/ngtsc/file_system/testing/src/mock_file_system_posix.js +0 -68
  427. package/src/ngtsc/file_system/testing/src/mock_file_system_windows.d.ts +0 -13
  428. package/src/ngtsc/file_system/testing/src/mock_file_system_windows.js +0 -68
  429. package/src/ngtsc/file_system/testing/src/test_helper.d.ts +0 -17
  430. package/src/ngtsc/file_system/testing/src/test_helper.js +0 -142
  431. package/src/ngtsc/imports/index.js +0 -43
  432. package/src/ngtsc/imports/src/alias.js +0 -158
  433. package/src/ngtsc/imports/src/core.js +0 -98
  434. package/src/ngtsc/imports/src/default.js +0 -153
  435. package/src/ngtsc/imports/src/emitter.js +0 -317
  436. package/src/ngtsc/imports/src/find_export.js +0 -82
  437. package/src/ngtsc/imports/src/reexport.js +0 -20
  438. package/src/ngtsc/imports/src/references.js +0 -171
  439. package/src/ngtsc/imports/src/resolver.js +0 -39
  440. package/src/ngtsc/incremental/api.js +0 -20
  441. package/src/ngtsc/incremental/index.js +0 -29
  442. package/src/ngtsc/incremental/semantic_graph/index.js +0 -34
  443. package/src/ngtsc/incremental/semantic_graph/src/api.js +0 -51
  444. package/src/ngtsc/incremental/semantic_graph/src/graph.js +0 -302
  445. package/src/ngtsc/incremental/semantic_graph/src/type_parameters.js +0 -55
  446. package/src/ngtsc/incremental/semantic_graph/src/util.js +0 -111
  447. package/src/ngtsc/incremental/src/dependency_tracking.js +0 -165
  448. package/src/ngtsc/incremental/src/incremental.js +0 -393
  449. package/src/ngtsc/incremental/src/noop.js +0 -26
  450. package/src/ngtsc/incremental/src/state.js +0 -30
  451. package/src/ngtsc/incremental/src/strategy.js +0 -99
  452. package/src/ngtsc/indexer/index.js +0 -27
  453. package/src/ngtsc/indexer/src/api.js +0 -45
  454. package/src/ngtsc/indexer/src/context.js +0 -40
  455. package/src/ngtsc/indexer/src/template.js +0 -328
  456. package/src/ngtsc/indexer/src/transform.js +0 -66
  457. package/src/ngtsc/logging/index.js +0 -25
  458. package/src/ngtsc/logging/src/console_logger.js +0 -75
  459. package/src/ngtsc/logging/src/logger.js +0 -28
  460. package/src/ngtsc/logging/testing/index.js +0 -23
  461. package/src/ngtsc/logging/testing/src/mock_logger.d.ts +0 -20
  462. package/src/ngtsc/logging/testing/src/mock_logger.js +0 -64
  463. package/src/ngtsc/metadata/index.js +0 -39
  464. package/src/ngtsc/metadata/src/api.js +0 -26
  465. package/src/ngtsc/metadata/src/dts.js +0 -168
  466. package/src/ngtsc/metadata/src/inheritance.js +0 -122
  467. package/src/ngtsc/metadata/src/property_mapping.js +0 -244
  468. package/src/ngtsc/metadata/src/registry.js +0 -133
  469. package/src/ngtsc/metadata/src/resource_registry.js +0 -109
  470. package/src/ngtsc/metadata/src/util.js +0 -275
  471. package/src/ngtsc/partial_evaluator/index.js +0 -31
  472. package/src/ngtsc/partial_evaluator/src/builtin.js +0 -125
  473. package/src/ngtsc/partial_evaluator/src/diagnostics.js +0 -193
  474. package/src/ngtsc/partial_evaluator/src/dynamic.js +0 -109
  475. package/src/ngtsc/partial_evaluator/src/interface.js +0 -42
  476. package/src/ngtsc/partial_evaluator/src/interpreter.js +0 -780
  477. package/src/ngtsc/partial_evaluator/src/known_declaration.js +0 -57
  478. package/src/ngtsc/partial_evaluator/src/result.js +0 -72
  479. package/src/ngtsc/partial_evaluator/src/ts_helpers.js +0 -121
  480. package/src/ngtsc/perf/index.js +0 -28
  481. package/src/ngtsc/perf/src/api.js +0 -291
  482. package/src/ngtsc/perf/src/clock.js +0 -30
  483. package/src/ngtsc/perf/src/noop.js +0 -37
  484. package/src/ngtsc/perf/src/recorder.js +0 -143
  485. package/src/ngtsc/program.js +0 -361
  486. package/src/ngtsc/program_driver/index.js +0 -25
  487. package/src/ngtsc/program_driver/src/api.js +0 -36
  488. package/src/ngtsc/program_driver/src/ts_create_program_driver.js +0 -200
  489. package/src/ngtsc/reflection/index.js +0 -36
  490. package/src/ngtsc/reflection/src/host.js +0 -88
  491. package/src/ngtsc/reflection/src/type_to_value.js +0 -259
  492. package/src/ngtsc/reflection/src/typescript.js +0 -641
  493. package/src/ngtsc/reflection/src/util.js +0 -37
  494. package/src/ngtsc/resource/index.js +0 -23
  495. package/src/ngtsc/resource/src/loader.js +0 -285
  496. package/src/ngtsc/routing/index.js +0 -26
  497. package/src/ngtsc/routing/src/analyzer.d.ts +0 -37
  498. package/src/ngtsc/routing/src/analyzer.js +0 -82
  499. package/src/ngtsc/routing/src/lazy.d.ts +0 -19
  500. package/src/ngtsc/routing/src/lazy.js +0 -239
  501. package/src/ngtsc/routing/src/route.d.ts +0 -23
  502. package/src/ngtsc/routing/src/route.js +0 -77
  503. package/src/ngtsc/scope/index.js +0 -29
  504. package/src/ngtsc/scope/src/api.js +0 -20
  505. package/src/ngtsc/scope/src/component_scope.js +0 -69
  506. package/src/ngtsc/scope/src/dependency.js +0 -201
  507. package/src/ngtsc/scope/src/local.js +0 -665
  508. package/src/ngtsc/scope/src/typecheck.js +0 -120
  509. package/src/ngtsc/shims/api.js +0 -13
  510. package/src/ngtsc/shims/index.js +0 -39
  511. package/src/ngtsc/shims/src/adapter.js +0 -266
  512. package/src/ngtsc/shims/src/expando.js +0 -147
  513. package/src/ngtsc/shims/src/factory_generator.js +0 -292
  514. package/src/ngtsc/shims/src/reference_tagger.js +0 -94
  515. package/src/ngtsc/shims/src/summary_generator.js +0 -101
  516. package/src/ngtsc/shims/src/util.js +0 -41
  517. package/src/ngtsc/sourcemaps/index.js +0 -27
  518. package/src/ngtsc/sourcemaps/src/content_origin.js +0 -48
  519. package/src/ngtsc/sourcemaps/src/raw_source_map.js +0 -13
  520. package/src/ngtsc/sourcemaps/src/segment_marker.js +0 -55
  521. package/src/ngtsc/sourcemaps/src/source_file.js +0 -519
  522. package/src/ngtsc/sourcemaps/src/source_file_loader.js +0 -234
  523. package/src/ngtsc/switch/index.js +0 -23
  524. package/src/ngtsc/switch/src/switch.js +0 -141
  525. package/src/ngtsc/transform/index.js +0 -36
  526. package/src/ngtsc/transform/src/alias.js +0 -46
  527. package/src/ngtsc/transform/src/api.js +0 -76
  528. package/src/ngtsc/transform/src/compilation.js +0 -820
  529. package/src/ngtsc/transform/src/declaration.js +0 -234
  530. package/src/ngtsc/transform/src/trait.js +0 -111
  531. package/src/ngtsc/transform/src/transform.js +0 -333
  532. package/src/ngtsc/transform/src/utils.js +0 -73
  533. package/src/ngtsc/translator/index.js +0 -37
  534. package/src/ngtsc/translator/src/api/ast_factory.js +0 -20
  535. package/src/ngtsc/translator/src/api/import_generator.js +0 -20
  536. package/src/ngtsc/translator/src/context.js +0 -47
  537. package/src/ngtsc/translator/src/import_manager.js +0 -77
  538. package/src/ngtsc/translator/src/translator.js +0 -353
  539. package/src/ngtsc/translator/src/type_translator.js +0 -223
  540. package/src/ngtsc/translator/src/typescript_ast_factory.js +0 -251
  541. package/src/ngtsc/translator/src/typescript_translator.js +0 -34
  542. package/src/ngtsc/tsc_plugin.js +0 -129
  543. package/src/ngtsc/typecheck/api/api.js +0 -20
  544. package/src/ngtsc/typecheck/api/checker.js +0 -44
  545. package/src/ngtsc/typecheck/api/completion.js +0 -29
  546. package/src/ngtsc/typecheck/api/context.js +0 -20
  547. package/src/ngtsc/typecheck/api/index.js +0 -27
  548. package/src/ngtsc/typecheck/api/scope.js +0 -20
  549. package/src/ngtsc/typecheck/api/symbols.js +0 -35
  550. package/src/ngtsc/typecheck/diagnostics/index.js +0 -23
  551. package/src/ngtsc/typecheck/diagnostics/src/diagnostic.js +0 -141
  552. package/src/ngtsc/typecheck/diagnostics/src/id.js +0 -37
  553. package/src/ngtsc/typecheck/index.js +0 -29
  554. package/src/ngtsc/typecheck/src/checker.js +0 -763
  555. package/src/ngtsc/typecheck/src/comments.js +0 -181
  556. package/src/ngtsc/typecheck/src/completion.js +0 -232
  557. package/src/ngtsc/typecheck/src/context.js +0 -424
  558. package/src/ngtsc/typecheck/src/diagnostics.js +0 -114
  559. package/src/ngtsc/typecheck/src/dom.js +0 -87
  560. package/src/ngtsc/typecheck/src/environment.js +0 -160
  561. package/src/ngtsc/typecheck/src/expression.js +0 -441
  562. package/src/ngtsc/typecheck/src/line_mappings.js +0 -77
  563. package/src/ngtsc/typecheck/src/oob.js +0 -181
  564. package/src/ngtsc/typecheck/src/shim.js +0 -52
  565. package/src/ngtsc/typecheck/src/source.js +0 -91
  566. package/src/ngtsc/typecheck/src/tcb_util.js +0 -165
  567. package/src/ngtsc/typecheck/src/template_semantics.js +0 -52
  568. package/src/ngtsc/typecheck/src/template_symbol_builder.js +0 -546
  569. package/src/ngtsc/typecheck/src/ts_util.js +0 -202
  570. package/src/ngtsc/typecheck/src/type_check_block.js +0 -2210
  571. package/src/ngtsc/typecheck/src/type_check_file.js +0 -115
  572. package/src/ngtsc/typecheck/src/type_constructor.js +0 -255
  573. package/src/ngtsc/typecheck/src/type_emitter.js +0 -164
  574. package/src/ngtsc/typecheck/src/type_parameter_emitter.js +0 -111
  575. package/src/ngtsc/util/src/path.js +0 -33
  576. package/src/ngtsc/util/src/typescript.js +0 -176
  577. package/src/ngtsc/util/src/visitor.js +0 -119
  578. package/src/ngtsc/xi18n/index.js +0 -22
  579. package/src/ngtsc/xi18n/src/context.js +0 -20
  580. package/src/perform_compile.js +0 -322
  581. package/src/perform_watch.js +0 -263
  582. package/src/tooling.js +0 -47
  583. package/src/transformers/api.js +0 -42
  584. package/src/transformers/compiler_host.js +0 -623
  585. package/src/transformers/downlevel_decorators_transform.js +0 -618
  586. package/src/transformers/entry_points.js +0 -25
  587. package/src/transformers/i18n.js +0 -76
  588. package/src/transformers/inline_resources.js +0 -287
  589. package/src/transformers/lower_expressions.js +0 -365
  590. package/src/transformers/metadata_cache.js +0 -96
  591. package/src/transformers/metadata_reader.js +0 -120
  592. package/src/transformers/node_emitter.js +0 -643
  593. package/src/transformers/node_emitter_transform.js +0 -88
  594. package/src/transformers/patch_alias_reference_resolution.js +0 -129
  595. package/src/transformers/program.js +0 -1000
  596. package/src/transformers/r3_metadata_transform.js +0 -73
  597. package/src/transformers/r3_transform.js +0 -44
  598. package/src/transformers/util.js +0 -122
  599. package/src/typescript_support.js +0 -74
  600. package/src/version.js +0 -28
@@ -0,0 +1,1849 @@
1
+
2
+ import {createRequire as __cjsCompatRequire} from 'module';
3
+ const require = __cjsCompatRequire(import.meta.url);
4
+ const __ESM_IMPORT_META_URL__ = import.meta.url;
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __defProps = Object.defineProperties;
8
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+
26
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
27
+ var FatalLinkerError = class extends Error {
28
+ constructor(node, message) {
29
+ super(message);
30
+ this.node = node;
31
+ this.type = "FatalLinkerError";
32
+ }
33
+ };
34
+ function isFatalLinkerError(e) {
35
+ return e && e.type === "FatalLinkerError";
36
+ }
37
+
38
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
39
+ function assert(node, predicate, expected) {
40
+ if (!predicate(node)) {
41
+ throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
42
+ }
43
+ }
44
+
45
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
46
+ import {
47
+ WrappedNodeExpr
48
+ } from "@angular/compiler";
49
+ var AstObject = class {
50
+ constructor(expression, obj, host) {
51
+ this.expression = expression;
52
+ this.obj = obj;
53
+ this.host = host;
54
+ }
55
+ static parse(expression, host) {
56
+ const obj = host.parseObjectLiteral(expression);
57
+ return new AstObject(expression, obj, host);
58
+ }
59
+ has(propertyName) {
60
+ return this.obj.has(propertyName);
61
+ }
62
+ getNumber(propertyName) {
63
+ return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
64
+ }
65
+ getString(propertyName) {
66
+ return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
67
+ }
68
+ getBoolean(propertyName) {
69
+ return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
70
+ }
71
+ getObject(propertyName) {
72
+ const expr = this.getRequiredProperty(propertyName);
73
+ const obj = this.host.parseObjectLiteral(expr);
74
+ return new AstObject(expr, obj, this.host);
75
+ }
76
+ getArray(propertyName) {
77
+ const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
78
+ return arr.map((entry) => new AstValue(entry, this.host));
79
+ }
80
+ getOpaque(propertyName) {
81
+ return new WrappedNodeExpr(this.getRequiredProperty(propertyName));
82
+ }
83
+ getNode(propertyName) {
84
+ return this.getRequiredProperty(propertyName);
85
+ }
86
+ getValue(propertyName) {
87
+ return new AstValue(this.getRequiredProperty(propertyName), this.host);
88
+ }
89
+ toLiteral(mapper) {
90
+ const result = {};
91
+ for (const [key, expression] of this.obj) {
92
+ result[key] = mapper(new AstValue(expression, this.host));
93
+ }
94
+ return result;
95
+ }
96
+ toMap(mapper) {
97
+ const result = new Map();
98
+ for (const [key, expression] of this.obj) {
99
+ result.set(key, mapper(new AstValue(expression, this.host)));
100
+ }
101
+ return result;
102
+ }
103
+ getRequiredProperty(propertyName) {
104
+ if (!this.obj.has(propertyName)) {
105
+ throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
106
+ }
107
+ return this.obj.get(propertyName);
108
+ }
109
+ };
110
+ var AstValue = class {
111
+ constructor(expression, host) {
112
+ this.expression = expression;
113
+ this.host = host;
114
+ }
115
+ getSymbolName() {
116
+ return this.host.getSymbolName(this.expression);
117
+ }
118
+ isNumber() {
119
+ return this.host.isNumericLiteral(this.expression);
120
+ }
121
+ getNumber() {
122
+ return this.host.parseNumericLiteral(this.expression);
123
+ }
124
+ isString() {
125
+ return this.host.isStringLiteral(this.expression);
126
+ }
127
+ getString() {
128
+ return this.host.parseStringLiteral(this.expression);
129
+ }
130
+ isBoolean() {
131
+ return this.host.isBooleanLiteral(this.expression);
132
+ }
133
+ getBoolean() {
134
+ return this.host.parseBooleanLiteral(this.expression);
135
+ }
136
+ isObject() {
137
+ return this.host.isObjectLiteral(this.expression);
138
+ }
139
+ getObject() {
140
+ return AstObject.parse(this.expression, this.host);
141
+ }
142
+ isArray() {
143
+ return this.host.isArrayLiteral(this.expression);
144
+ }
145
+ getArray() {
146
+ const arr = this.host.parseArrayLiteral(this.expression);
147
+ return arr.map((entry) => new AstValue(entry, this.host));
148
+ }
149
+ isFunction() {
150
+ return this.host.isFunctionExpression(this.expression);
151
+ }
152
+ getFunctionReturnValue() {
153
+ return new AstValue(this.host.parseReturnValue(this.expression), this.host);
154
+ }
155
+ isCallExpression() {
156
+ return this.host.isCallExpression(this.expression);
157
+ }
158
+ getCallee() {
159
+ return new AstValue(this.host.parseCallee(this.expression), this.host);
160
+ }
161
+ getArguments() {
162
+ const args = this.host.parseArguments(this.expression);
163
+ return args.map((arg) => new AstValue(arg, this.host));
164
+ }
165
+ getOpaque() {
166
+ return new WrappedNodeExpr(this.expression);
167
+ }
168
+ getRange() {
169
+ return this.host.getRange(this.expression);
170
+ }
171
+ };
172
+
173
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
174
+ import { ConstantPool } from "@angular/compiler";
175
+
176
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
177
+ var LinkerImportGenerator = class {
178
+ constructor(ngImport) {
179
+ this.ngImport = ngImport;
180
+ }
181
+ generateNamespaceImport(moduleName) {
182
+ this.assertModuleName(moduleName);
183
+ return this.ngImport;
184
+ }
185
+ generateNamedImport(moduleName, originalSymbol) {
186
+ this.assertModuleName(moduleName);
187
+ return { moduleImport: this.ngImport, symbol: originalSymbol };
188
+ }
189
+ assertModuleName(moduleName) {
190
+ if (moduleName !== "@angular/core") {
191
+ throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
192
+ }
193
+ }
194
+ };
195
+
196
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
197
+ var EmitScope = class {
198
+ constructor(ngImport, translator) {
199
+ this.ngImport = ngImport;
200
+ this.translator = translator;
201
+ this.constantPool = new ConstantPool();
202
+ }
203
+ translateDefinition(definition) {
204
+ return this.translator.translateExpression(definition, new LinkerImportGenerator(this.ngImport));
205
+ }
206
+ getConstantStatements() {
207
+ const importGenerator = new LinkerImportGenerator(this.ngImport);
208
+ return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
209
+ }
210
+ };
211
+
212
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope.mjs
213
+ var IifeEmitScope = class extends EmitScope {
214
+ constructor(ngImport, translator, factory) {
215
+ super(ngImport, translator);
216
+ this.factory = factory;
217
+ }
218
+ translateDefinition(definition) {
219
+ const constantStatements = super.getConstantStatements();
220
+ const returnStatement = this.factory.createReturnStatement(super.translateDefinition(definition));
221
+ const body = this.factory.createBlock([...constantStatements, returnStatement]);
222
+ const fn = this.factory.createFunctionExpression(null, [], body);
223
+ return this.factory.createCallExpression(fn, [], false);
224
+ }
225
+ getConstantStatements() {
226
+ throw new Error("BUG - IifeEmitScope should not expose any constant statements");
227
+ }
228
+ };
229
+
230
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
231
+ import semver from "semver";
232
+
233
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
234
+ function createGetSourceFile(sourceUrl, code, loader) {
235
+ if (loader === null) {
236
+ return () => null;
237
+ } else {
238
+ let sourceFile = void 0;
239
+ return () => {
240
+ if (sourceFile === void 0) {
241
+ sourceFile = loader.loadSourceFile(sourceUrl, code);
242
+ }
243
+ return sourceFile;
244
+ };
245
+ }
246
+ }
247
+
248
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
249
+ import { compileClassMetadata } from "@angular/compiler";
250
+ var PartialClassMetadataLinkerVersion1 = class {
251
+ linkPartialDeclaration(constantPool, metaObj) {
252
+ const meta = toR3ClassMetadata(metaObj);
253
+ return compileClassMetadata(meta);
254
+ }
255
+ };
256
+ function toR3ClassMetadata(metaObj) {
257
+ return {
258
+ type: metaObj.getOpaque("type"),
259
+ decorators: metaObj.getOpaque("decorators"),
260
+ ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
261
+ propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
262
+ };
263
+ }
264
+
265
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
266
+ import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, ViewEncapsulation } from "@angular/compiler";
267
+
268
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
269
+ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
270
+
271
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
272
+ import { createR3ProviderExpression, outputAst as o2 } from "@angular/compiler";
273
+ function wrapReference(wrapped) {
274
+ return { value: wrapped, type: wrapped };
275
+ }
276
+ function parseEnum(value, Enum) {
277
+ const symbolName = value.getSymbolName();
278
+ if (symbolName === null) {
279
+ throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
280
+ }
281
+ const enumValue = Enum[symbolName];
282
+ if (enumValue === void 0) {
283
+ throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
284
+ }
285
+ return enumValue;
286
+ }
287
+ function getDependency(depObj) {
288
+ const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
289
+ const token = depObj.getOpaque("token");
290
+ const attributeNameType = isAttribute ? o2.literal("unknown") : null;
291
+ return {
292
+ token,
293
+ attributeNameType,
294
+ host: depObj.has("host") && depObj.getBoolean("host"),
295
+ optional: depObj.has("optional") && depObj.getBoolean("optional"),
296
+ self: depObj.has("self") && depObj.getBoolean("self"),
297
+ skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
298
+ };
299
+ }
300
+ function extractForwardRef(expr) {
301
+ if (!expr.isCallExpression()) {
302
+ return createR3ProviderExpression(expr.getOpaque(), false);
303
+ }
304
+ const callee = expr.getCallee();
305
+ if (callee.getSymbolName() !== "forwardRef") {
306
+ throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
307
+ }
308
+ const args = expr.getArguments();
309
+ if (args.length !== 1) {
310
+ throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
311
+ }
312
+ const wrapperFn = args[0];
313
+ if (!wrapperFn.isFunction()) {
314
+ throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
315
+ }
316
+ return createR3ProviderExpression(wrapperFn.getFunctionReturnValue().getOpaque(), true);
317
+ }
318
+
319
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
320
+ var PartialDirectiveLinkerVersion1 = class {
321
+ constructor(sourceUrl, code) {
322
+ this.sourceUrl = sourceUrl;
323
+ this.code = code;
324
+ }
325
+ linkPartialDeclaration(constantPool, metaObj) {
326
+ const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
327
+ const def = compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
328
+ return def.expression;
329
+ }
330
+ };
331
+ function toR3DirectiveMeta(metaObj, code, sourceUrl) {
332
+ const typeExpr = metaObj.getValue("type");
333
+ const typeName = typeExpr.getSymbolName();
334
+ if (typeName === null) {
335
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
336
+ }
337
+ return {
338
+ typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
339
+ type: wrapReference(typeExpr.getOpaque()),
340
+ typeArgumentCount: 0,
341
+ internalType: metaObj.getOpaque("type"),
342
+ deps: null,
343
+ host: toHostMetadata(metaObj),
344
+ inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
345
+ outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
346
+ queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
347
+ viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
348
+ providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
349
+ fullInheritance: false,
350
+ selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
351
+ exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
352
+ lifecycle: {
353
+ usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
354
+ },
355
+ name: typeName,
356
+ usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false
357
+ };
358
+ }
359
+ function toInputMapping(value) {
360
+ if (value.isString()) {
361
+ return value.getString();
362
+ }
363
+ const values = value.getArray().map((innerValue) => innerValue.getString());
364
+ if (values.length !== 2) {
365
+ throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
366
+ }
367
+ return values;
368
+ }
369
+ function toHostMetadata(metaObj) {
370
+ if (!metaObj.has("host")) {
371
+ return {
372
+ attributes: {},
373
+ listeners: {},
374
+ properties: {},
375
+ specialAttributes: {}
376
+ };
377
+ }
378
+ const host = metaObj.getObject("host");
379
+ const specialAttributes = {};
380
+ if (host.has("styleAttribute")) {
381
+ specialAttributes.styleAttr = host.getString("styleAttribute");
382
+ }
383
+ if (host.has("classAttribute")) {
384
+ specialAttributes.classAttr = host.getString("classAttribute");
385
+ }
386
+ return {
387
+ attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
388
+ listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
389
+ properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
390
+ specialAttributes
391
+ };
392
+ }
393
+ function toQueryMetadata(obj) {
394
+ let predicate;
395
+ const predicateExpr = obj.getValue("predicate");
396
+ if (predicateExpr.isArray()) {
397
+ predicate = predicateExpr.getArray().map((entry) => entry.getString());
398
+ } else {
399
+ predicate = predicateExpr.getOpaque();
400
+ }
401
+ return {
402
+ propertyName: obj.getString("propertyName"),
403
+ first: obj.has("first") ? obj.getBoolean("first") : false,
404
+ predicate,
405
+ descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
406
+ emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
407
+ read: obj.has("read") ? obj.getOpaque("read") : null,
408
+ static: obj.has("static") ? obj.getBoolean("static") : false
409
+ };
410
+ }
411
+ function createSourceSpan(range, code, sourceUrl) {
412
+ const sourceFile = new ParseSourceFile(code, sourceUrl);
413
+ const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
414
+ return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
415
+ }
416
+
417
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
418
+ var PartialComponentLinkerVersion1 = class {
419
+ constructor(getSourceFile2, sourceUrl, code) {
420
+ this.getSourceFile = getSourceFile2;
421
+ this.sourceUrl = sourceUrl;
422
+ this.code = code;
423
+ }
424
+ linkPartialDeclaration(constantPool, metaObj) {
425
+ const meta = this.toR3ComponentMeta(metaObj);
426
+ const def = compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
427
+ return def.expression;
428
+ }
429
+ toR3ComponentMeta(metaObj) {
430
+ const interpolation = parseInterpolationConfig(metaObj);
431
+ const templateSource = metaObj.getValue("template");
432
+ const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
433
+ const templateInfo = this.getTemplateInfo(templateSource, isInline);
434
+ const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
435
+ escapedString: templateInfo.isEscaped,
436
+ interpolationConfig: interpolation,
437
+ range: templateInfo.range,
438
+ enableI18nLegacyMessageIdFormat: false,
439
+ preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
440
+ i18nNormalizeLineEndingsInICUs: isInline
441
+ });
442
+ if (template.errors !== null) {
443
+ const errors = template.errors.map((err) => err.toString()).join("\n");
444
+ throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
445
+ ${errors}`);
446
+ }
447
+ let declarationListEmitMode = 0;
448
+ const collectUsedDirectives = (directives2) => {
449
+ return directives2.map((directive) => {
450
+ const directiveExpr = directive.getObject();
451
+ const type = directiveExpr.getValue("type");
452
+ const selector = directiveExpr.getString("selector");
453
+ const { expression: typeExpr, isForwardRef } = extractForwardRef(type);
454
+ if (isForwardRef) {
455
+ declarationListEmitMode = 1;
456
+ }
457
+ return {
458
+ type: typeExpr,
459
+ selector,
460
+ inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
461
+ outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
462
+ exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
463
+ };
464
+ });
465
+ };
466
+ let directives = [];
467
+ if (metaObj.has("components")) {
468
+ directives.push(...collectUsedDirectives(metaObj.getArray("components")));
469
+ }
470
+ if (metaObj.has("directives")) {
471
+ directives.push(...collectUsedDirectives(metaObj.getArray("directives")));
472
+ }
473
+ let pipes = new Map();
474
+ if (metaObj.has("pipes")) {
475
+ pipes = metaObj.getObject("pipes").toMap((pipe) => {
476
+ const { expression: pipeType, isForwardRef } = extractForwardRef(pipe);
477
+ if (isForwardRef) {
478
+ declarationListEmitMode = 1;
479
+ }
480
+ return pipeType;
481
+ });
482
+ }
483
+ return __spreadProps(__spreadValues({}, toR3DirectiveMeta(metaObj, this.code, this.sourceUrl)), {
484
+ viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
485
+ template: {
486
+ nodes: template.nodes,
487
+ ngContentSelectors: template.ngContentSelectors
488
+ },
489
+ declarationListEmitMode,
490
+ styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
491
+ encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
492
+ interpolation,
493
+ changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
494
+ animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
495
+ relativeContextFilePath: this.sourceUrl,
496
+ i18nUseExternalIds: false,
497
+ pipes,
498
+ directives
499
+ });
500
+ }
501
+ getTemplateInfo(templateNode, isInline) {
502
+ const range = templateNode.getRange();
503
+ if (!isInline) {
504
+ const externalTemplate = this.tryExternalTemplate(range);
505
+ if (externalTemplate !== null) {
506
+ return externalTemplate;
507
+ }
508
+ }
509
+ return this.templateFromPartialCode(templateNode, range);
510
+ }
511
+ tryExternalTemplate(range) {
512
+ const sourceFile = this.getSourceFile();
513
+ if (sourceFile === null) {
514
+ return null;
515
+ }
516
+ const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
517
+ if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
518
+ return null;
519
+ }
520
+ const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
521
+ return {
522
+ code: templateContents,
523
+ sourceUrl: pos.file,
524
+ range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
525
+ isEscaped: false
526
+ };
527
+ }
528
+ templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
529
+ if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
530
+ throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
531
+ }
532
+ return {
533
+ code: this.code,
534
+ sourceUrl: this.sourceUrl,
535
+ range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
536
+ isEscaped: true
537
+ };
538
+ }
539
+ };
540
+ function parseInterpolationConfig(metaObj) {
541
+ if (!metaObj.has("interpolation")) {
542
+ return DEFAULT_INTERPOLATION_CONFIG;
543
+ }
544
+ const interpolationExpr = metaObj.getValue("interpolation");
545
+ const values = interpolationExpr.getArray().map((entry) => entry.getString());
546
+ if (values.length !== 2) {
547
+ throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
548
+ }
549
+ return InterpolationConfig.fromArray(values);
550
+ }
551
+ function parseEncapsulation(encapsulation) {
552
+ const symbolName = encapsulation.getSymbolName();
553
+ if (symbolName === null) {
554
+ throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
555
+ }
556
+ const enumValue = ViewEncapsulation[symbolName];
557
+ if (enumValue === void 0) {
558
+ throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
559
+ }
560
+ return enumValue;
561
+ }
562
+ function parseChangeDetectionStrategy(changeDetectionStrategy) {
563
+ const symbolName = changeDetectionStrategy.getSymbolName();
564
+ if (symbolName === null) {
565
+ throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
566
+ }
567
+ const enumValue = ChangeDetectionStrategy[symbolName];
568
+ if (enumValue === void 0) {
569
+ throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
570
+ }
571
+ return enumValue;
572
+ }
573
+
574
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
575
+ import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
576
+ var PartialFactoryLinkerVersion1 = class {
577
+ linkPartialDeclaration(constantPool, metaObj) {
578
+ const meta = toR3FactoryMeta(metaObj);
579
+ const def = compileFactoryFunction(meta);
580
+ return def.expression;
581
+ }
582
+ };
583
+ function toR3FactoryMeta(metaObj) {
584
+ const typeExpr = metaObj.getValue("type");
585
+ const typeName = typeExpr.getSymbolName();
586
+ if (typeName === null) {
587
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
588
+ }
589
+ return {
590
+ name: typeName,
591
+ type: wrapReference(typeExpr.getOpaque()),
592
+ internalType: metaObj.getOpaque("type"),
593
+ typeArgumentCount: 0,
594
+ target: parseEnum(metaObj.getValue("target"), FactoryTarget),
595
+ deps: getDependencies(metaObj, "deps")
596
+ };
597
+ }
598
+ function getDependencies(metaObj, propName) {
599
+ if (!metaObj.has(propName)) {
600
+ return null;
601
+ }
602
+ const deps = metaObj.getValue(propName);
603
+ if (deps.isArray()) {
604
+ return deps.getArray().map((dep) => getDependency(dep.getObject()));
605
+ }
606
+ if (deps.isString()) {
607
+ return "invalid";
608
+ }
609
+ return null;
610
+ }
611
+
612
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
613
+ import { compileInjectable, createR3ProviderExpression as createR3ProviderExpression2, outputAst as o3 } from "@angular/compiler";
614
+ var PartialInjectableLinkerVersion1 = class {
615
+ linkPartialDeclaration(constantPool, metaObj) {
616
+ const meta = toR3InjectableMeta(metaObj);
617
+ const def = compileInjectable(meta, false);
618
+ return def.expression;
619
+ }
620
+ };
621
+ function toR3InjectableMeta(metaObj) {
622
+ const typeExpr = metaObj.getValue("type");
623
+ const typeName = typeExpr.getSymbolName();
624
+ if (typeName === null) {
625
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
626
+ }
627
+ const meta = {
628
+ name: typeName,
629
+ type: wrapReference(typeExpr.getOpaque()),
630
+ internalType: typeExpr.getOpaque(),
631
+ typeArgumentCount: 0,
632
+ providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createR3ProviderExpression2(o3.literal(null), false)
633
+ };
634
+ if (metaObj.has("useClass")) {
635
+ meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
636
+ }
637
+ if (metaObj.has("useFactory")) {
638
+ meta.useFactory = metaObj.getOpaque("useFactory");
639
+ }
640
+ if (metaObj.has("useExisting")) {
641
+ meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
642
+ }
643
+ if (metaObj.has("useValue")) {
644
+ meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
645
+ }
646
+ if (metaObj.has("deps")) {
647
+ meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
648
+ }
649
+ return meta;
650
+ }
651
+
652
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
653
+ import { compileInjector } from "@angular/compiler";
654
+ var PartialInjectorLinkerVersion1 = class {
655
+ linkPartialDeclaration(constantPool, metaObj) {
656
+ const meta = toR3InjectorMeta(metaObj);
657
+ const def = compileInjector(meta);
658
+ return def.expression;
659
+ }
660
+ };
661
+ function toR3InjectorMeta(metaObj) {
662
+ const typeExpr = metaObj.getValue("type");
663
+ const typeName = typeExpr.getSymbolName();
664
+ if (typeName === null) {
665
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
666
+ }
667
+ return {
668
+ name: typeName,
669
+ type: wrapReference(typeExpr.getOpaque()),
670
+ internalType: metaObj.getOpaque("type"),
671
+ providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
672
+ imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
673
+ };
674
+ }
675
+
676
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
677
+ import { compileNgModule } from "@angular/compiler";
678
+ var PartialNgModuleLinkerVersion1 = class {
679
+ constructor(emitInline) {
680
+ this.emitInline = emitInline;
681
+ }
682
+ linkPartialDeclaration(constantPool, metaObj) {
683
+ const meta = toR3NgModuleMeta(metaObj, this.emitInline);
684
+ const def = compileNgModule(meta);
685
+ return def.expression;
686
+ }
687
+ };
688
+ function toR3NgModuleMeta(metaObj, emitInline) {
689
+ const wrappedType = metaObj.getOpaque("type");
690
+ const meta = {
691
+ type: wrapReference(wrappedType),
692
+ internalType: wrappedType,
693
+ adjacentType: wrappedType,
694
+ bootstrap: [],
695
+ declarations: [],
696
+ imports: [],
697
+ exports: [],
698
+ emitInline,
699
+ containsForwardDecls: false,
700
+ schemas: [],
701
+ id: metaObj.has("id") ? metaObj.getOpaque("id") : null
702
+ };
703
+ if (metaObj.has("bootstrap")) {
704
+ const bootstrap = metaObj.getValue("bootstrap");
705
+ if (bootstrap.isFunction()) {
706
+ meta.containsForwardDecls = true;
707
+ meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
708
+ } else
709
+ meta.bootstrap = wrapReferences(bootstrap);
710
+ }
711
+ if (metaObj.has("declarations")) {
712
+ const declarations = metaObj.getValue("declarations");
713
+ if (declarations.isFunction()) {
714
+ meta.containsForwardDecls = true;
715
+ meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
716
+ } else
717
+ meta.declarations = wrapReferences(declarations);
718
+ }
719
+ if (metaObj.has("imports")) {
720
+ const imports = metaObj.getValue("imports");
721
+ if (imports.isFunction()) {
722
+ meta.containsForwardDecls = true;
723
+ meta.imports = wrapReferences(unwrapForwardRefs(imports));
724
+ } else
725
+ meta.imports = wrapReferences(imports);
726
+ }
727
+ if (metaObj.has("exports")) {
728
+ const exports = metaObj.getValue("exports");
729
+ if (exports.isFunction()) {
730
+ meta.containsForwardDecls = true;
731
+ meta.exports = wrapReferences(unwrapForwardRefs(exports));
732
+ } else
733
+ meta.exports = wrapReferences(exports);
734
+ }
735
+ if (metaObj.has("schemas")) {
736
+ const schemas = metaObj.getValue("schemas");
737
+ meta.schemas = wrapReferences(schemas);
738
+ }
739
+ return meta;
740
+ }
741
+ function unwrapForwardRefs(field) {
742
+ return field.getFunctionReturnValue();
743
+ }
744
+ function wrapReferences(values) {
745
+ return values.getArray().map((i) => wrapReference(i.getOpaque()));
746
+ }
747
+
748
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
749
+ import { compilePipeFromMetadata } from "@angular/compiler";
750
+ var PartialPipeLinkerVersion1 = class {
751
+ constructor() {
752
+ }
753
+ linkPartialDeclaration(constantPool, metaObj) {
754
+ const meta = toR3PipeMeta(metaObj);
755
+ const def = compilePipeFromMetadata(meta);
756
+ return def.expression;
757
+ }
758
+ };
759
+ function toR3PipeMeta(metaObj) {
760
+ const typeExpr = metaObj.getValue("type");
761
+ const typeName = typeExpr.getSymbolName();
762
+ if (typeName === null) {
763
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
764
+ }
765
+ const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
766
+ return {
767
+ name: typeName,
768
+ type: wrapReference(typeExpr.getOpaque()),
769
+ internalType: metaObj.getOpaque("type"),
770
+ typeArgumentCount: 0,
771
+ deps: null,
772
+ pipeName: metaObj.getString("name"),
773
+ pure
774
+ };
775
+ }
776
+
777
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
778
+ var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
779
+ var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
780
+ var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
781
+ var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
782
+ var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
783
+ var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
784
+ var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
785
+ var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
786
+ var declarationFunctions = [
787
+ \u0275\u0275ngDeclareDirective,
788
+ \u0275\u0275ngDeclareClassMetadata,
789
+ \u0275\u0275ngDeclareComponent,
790
+ \u0275\u0275ngDeclareFactory,
791
+ \u0275\u0275ngDeclareInjectable,
792
+ \u0275\u0275ngDeclareInjector,
793
+ \u0275\u0275ngDeclareNgModule,
794
+ \u0275\u0275ngDeclarePipe
795
+ ];
796
+ function createLinkerMap(environment, sourceUrl, code) {
797
+ const linkers = new Map();
798
+ const LATEST_VERSION_RANGE = getRange("<=", "13.0.0-next.10");
799
+ linkers.set(\u0275\u0275ngDeclareDirective, [
800
+ { range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
801
+ ]);
802
+ linkers.set(\u0275\u0275ngDeclareClassMetadata, [
803
+ { range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
804
+ ]);
805
+ linkers.set(\u0275\u0275ngDeclareComponent, [
806
+ {
807
+ range: LATEST_VERSION_RANGE,
808
+ linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
809
+ }
810
+ ]);
811
+ linkers.set(\u0275\u0275ngDeclareFactory, [
812
+ { range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
813
+ ]);
814
+ linkers.set(\u0275\u0275ngDeclareInjectable, [
815
+ { range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
816
+ ]);
817
+ linkers.set(\u0275\u0275ngDeclareInjector, [
818
+ { range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
819
+ ]);
820
+ linkers.set(\u0275\u0275ngDeclareNgModule, [
821
+ {
822
+ range: LATEST_VERSION_RANGE,
823
+ linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
824
+ }
825
+ ]);
826
+ linkers.set(\u0275\u0275ngDeclarePipe, [
827
+ { range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
828
+ ]);
829
+ return linkers;
830
+ }
831
+ var PartialLinkerSelector = class {
832
+ constructor(linkers, logger, unknownDeclarationVersionHandling) {
833
+ this.linkers = linkers;
834
+ this.logger = logger;
835
+ this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
836
+ }
837
+ supportsDeclaration(functionName) {
838
+ return this.linkers.has(functionName);
839
+ }
840
+ getLinker(functionName, minVersion, version) {
841
+ if (!this.linkers.has(functionName)) {
842
+ throw new Error(`Unknown partial declaration function ${functionName}.`);
843
+ }
844
+ const linkerRanges = this.linkers.get(functionName);
845
+ if (version === "13.0.0-next.10") {
846
+ return linkerRanges[linkerRanges.length - 1].linker;
847
+ }
848
+ const declarationRange = getRange(">=", minVersion);
849
+ for (const { range: linkerRange, linker } of linkerRanges) {
850
+ if (semver.intersects(declarationRange, linkerRange)) {
851
+ return linker;
852
+ }
853
+ }
854
+ const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
855
+ Consider upgrading your application to use a more recent version of Angular.`;
856
+ if (this.unknownDeclarationVersionHandling === "error") {
857
+ throw new Error(message);
858
+ } else if (this.unknownDeclarationVersionHandling === "warn") {
859
+ this.logger.warn(`${message}
860
+ Attempting to continue using this version of Angular.`);
861
+ }
862
+ return linkerRanges[linkerRanges.length - 1].linker;
863
+ }
864
+ };
865
+ function getRange(comparator, versionStr) {
866
+ const version = new semver.SemVer(versionStr);
867
+ version.prerelease = [];
868
+ return new semver.Range(`${comparator}${version.format()}`);
869
+ }
870
+
871
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
872
+ var FileLinker = class {
873
+ constructor(linkerEnvironment, sourceUrl, code) {
874
+ this.linkerEnvironment = linkerEnvironment;
875
+ this.emitScopes = new Map();
876
+ this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
877
+ }
878
+ isPartialDeclaration(calleeName) {
879
+ return this.linkerSelector.supportsDeclaration(calleeName);
880
+ }
881
+ linkPartialDeclaration(declarationFn, args, declarationScope) {
882
+ if (args.length !== 1) {
883
+ throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
884
+ }
885
+ const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
886
+ const ngImport = metaObj.getNode("ngImport");
887
+ const emitScope = this.getEmitScope(ngImport, declarationScope);
888
+ const minVersion = metaObj.getString("minVersion");
889
+ const version = metaObj.getString("version");
890
+ const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
891
+ const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
892
+ return emitScope.translateDefinition(definition);
893
+ }
894
+ getConstantStatements() {
895
+ const results = [];
896
+ for (const [constantScope, emitScope] of this.emitScopes.entries()) {
897
+ const statements = emitScope.getConstantStatements();
898
+ results.push({ constantScope, statements });
899
+ }
900
+ return results;
901
+ }
902
+ getEmitScope(ngImport, declarationScope) {
903
+ const constantScope = declarationScope.getConstantScopeRef(ngImport);
904
+ if (constantScope === null) {
905
+ return new IifeEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
906
+ }
907
+ if (!this.emitScopes.has(constantScope)) {
908
+ this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
909
+ }
910
+ return this.emitScopes.get(constantScope);
911
+ }
912
+ };
913
+
914
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.mjs
915
+ var ContentOrigin;
916
+ (function(ContentOrigin2) {
917
+ ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
918
+ ContentOrigin2[ContentOrigin2["Inline"] = 1] = "Inline";
919
+ ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
920
+ })(ContentOrigin || (ContentOrigin = {}));
921
+
922
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
923
+ import mapHelpers from "convert-source-map";
924
+ import { decode, encode } from "sourcemap-codec";
925
+
926
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.mjs
927
+ function compareSegments(a, b) {
928
+ return a.position - b.position;
929
+ }
930
+ function offsetSegment(startOfLinePositions, marker, offset) {
931
+ if (offset === 0) {
932
+ return marker;
933
+ }
934
+ let line = marker.line;
935
+ const position = marker.position + offset;
936
+ while (line < startOfLinePositions.length - 1 && startOfLinePositions[line + 1] <= position) {
937
+ line++;
938
+ }
939
+ while (line > 0 && startOfLinePositions[line] > position) {
940
+ line--;
941
+ }
942
+ const column = position - startOfLinePositions[line];
943
+ return { line, column, position, next: void 0 };
944
+ }
945
+
946
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
947
+ function removeSourceMapComments(contents) {
948
+ return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
949
+ }
950
+ var SourceFile = class {
951
+ constructor(sourcePath, contents, rawMap, sources, fs3) {
952
+ this.sourcePath = sourcePath;
953
+ this.contents = contents;
954
+ this.rawMap = rawMap;
955
+ this.sources = sources;
956
+ this.fs = fs3;
957
+ this.contents = removeSourceMapComments(contents);
958
+ this.startOfLinePositions = computeStartOfLinePositions(this.contents);
959
+ this.flattenedMappings = this.flattenMappings();
960
+ }
961
+ renderFlattenedSourceMap() {
962
+ const sources = new IndexedMap();
963
+ const names = new IndexedSet();
964
+ const mappings = [];
965
+ const sourcePathDir = this.fs.dirname(this.sourcePath);
966
+ const relativeSourcePathCache = new Cache((input) => this.fs.relative(sourcePathDir, input));
967
+ for (const mapping of this.flattenedMappings) {
968
+ const sourceIndex = sources.set(relativeSourcePathCache.get(mapping.originalSource.sourcePath), mapping.originalSource.contents);
969
+ const mappingArray = [
970
+ mapping.generatedSegment.column,
971
+ sourceIndex,
972
+ mapping.originalSegment.line,
973
+ mapping.originalSegment.column
974
+ ];
975
+ if (mapping.name !== void 0) {
976
+ const nameIndex = names.add(mapping.name);
977
+ mappingArray.push(nameIndex);
978
+ }
979
+ const line = mapping.generatedSegment.line;
980
+ while (line >= mappings.length) {
981
+ mappings.push([]);
982
+ }
983
+ mappings[line].push(mappingArray);
984
+ }
985
+ const sourceMap = {
986
+ version: 3,
987
+ file: this.fs.relative(sourcePathDir, this.sourcePath),
988
+ sources: sources.keys,
989
+ names: names.values,
990
+ mappings: encode(mappings),
991
+ sourcesContent: sources.values
992
+ };
993
+ return sourceMap;
994
+ }
995
+ getOriginalLocation(line, column) {
996
+ if (this.flattenedMappings.length === 0) {
997
+ return null;
998
+ }
999
+ let position;
1000
+ if (line < this.startOfLinePositions.length) {
1001
+ position = this.startOfLinePositions[line] + column;
1002
+ } else {
1003
+ position = this.contents.length;
1004
+ }
1005
+ const locationSegment = { line, column, position, next: void 0 };
1006
+ let mappingIndex = findLastMappingIndexBefore(this.flattenedMappings, locationSegment, false, 0);
1007
+ if (mappingIndex < 0) {
1008
+ mappingIndex = 0;
1009
+ }
1010
+ const { originalSegment, originalSource, generatedSegment } = this.flattenedMappings[mappingIndex];
1011
+ const offset = locationSegment.position - generatedSegment.position;
1012
+ const offsetOriginalSegment = offsetSegment(originalSource.startOfLinePositions, originalSegment, offset);
1013
+ return {
1014
+ file: originalSource.sourcePath,
1015
+ line: offsetOriginalSegment.line,
1016
+ column: offsetOriginalSegment.column
1017
+ };
1018
+ }
1019
+ flattenMappings() {
1020
+ const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
1021
+ ensureOriginalSegmentLinks(mappings);
1022
+ const flattenedMappings = [];
1023
+ for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex++) {
1024
+ const aToBmapping = mappings[mappingIndex];
1025
+ const bSource = aToBmapping.originalSource;
1026
+ if (bSource.flattenedMappings.length === 0) {
1027
+ flattenedMappings.push(aToBmapping);
1028
+ continue;
1029
+ }
1030
+ const incomingStart = aToBmapping.originalSegment;
1031
+ const incomingEnd = incomingStart.next;
1032
+ let outgoingStartIndex = findLastMappingIndexBefore(bSource.flattenedMappings, incomingStart, false, 0);
1033
+ if (outgoingStartIndex < 0) {
1034
+ outgoingStartIndex = 0;
1035
+ }
1036
+ const outgoingEndIndex = incomingEnd !== void 0 ? findLastMappingIndexBefore(bSource.flattenedMappings, incomingEnd, true, outgoingStartIndex) : bSource.flattenedMappings.length - 1;
1037
+ for (let bToCmappingIndex = outgoingStartIndex; bToCmappingIndex <= outgoingEndIndex; bToCmappingIndex++) {
1038
+ const bToCmapping = bSource.flattenedMappings[bToCmappingIndex];
1039
+ flattenedMappings.push(mergeMappings(this, aToBmapping, bToCmapping));
1040
+ }
1041
+ }
1042
+ return flattenedMappings;
1043
+ }
1044
+ };
1045
+ function findLastMappingIndexBefore(mappings, marker, exclusive, lowerIndex) {
1046
+ let upperIndex = mappings.length - 1;
1047
+ const test = exclusive ? -1 : 0;
1048
+ if (compareSegments(mappings[lowerIndex].generatedSegment, marker) > test) {
1049
+ return -1;
1050
+ }
1051
+ let matchingIndex = -1;
1052
+ while (lowerIndex <= upperIndex) {
1053
+ const index = upperIndex + lowerIndex >> 1;
1054
+ if (compareSegments(mappings[index].generatedSegment, marker) <= test) {
1055
+ matchingIndex = index;
1056
+ lowerIndex = index + 1;
1057
+ } else {
1058
+ upperIndex = index - 1;
1059
+ }
1060
+ }
1061
+ return matchingIndex;
1062
+ }
1063
+ function mergeMappings(generatedSource, ab, bc) {
1064
+ const name = bc.name || ab.name;
1065
+ const diff = compareSegments(bc.generatedSegment, ab.originalSegment);
1066
+ if (diff > 0) {
1067
+ return {
1068
+ name,
1069
+ generatedSegment: offsetSegment(generatedSource.startOfLinePositions, ab.generatedSegment, diff),
1070
+ originalSource: bc.originalSource,
1071
+ originalSegment: bc.originalSegment
1072
+ };
1073
+ } else {
1074
+ return {
1075
+ name,
1076
+ generatedSegment: ab.generatedSegment,
1077
+ originalSource: bc.originalSource,
1078
+ originalSegment: offsetSegment(bc.originalSource.startOfLinePositions, bc.originalSegment, -diff)
1079
+ };
1080
+ }
1081
+ }
1082
+ function parseMappings(rawMap, sources, generatedSourceStartOfLinePositions) {
1083
+ if (rawMap === null) {
1084
+ return [];
1085
+ }
1086
+ const rawMappings = decode(rawMap.mappings);
1087
+ if (rawMappings === null) {
1088
+ return [];
1089
+ }
1090
+ const mappings = [];
1091
+ for (let generatedLine = 0; generatedLine < rawMappings.length; generatedLine++) {
1092
+ const generatedLineMappings = rawMappings[generatedLine];
1093
+ for (const rawMapping of generatedLineMappings) {
1094
+ if (rawMapping.length >= 4) {
1095
+ const originalSource = sources[rawMapping[1]];
1096
+ if (originalSource === null || originalSource === void 0) {
1097
+ continue;
1098
+ }
1099
+ const generatedColumn = rawMapping[0];
1100
+ const name = rawMapping.length === 5 ? rawMap.names[rawMapping[4]] : void 0;
1101
+ const line = rawMapping[2];
1102
+ const column = rawMapping[3];
1103
+ const generatedSegment = {
1104
+ line: generatedLine,
1105
+ column: generatedColumn,
1106
+ position: generatedSourceStartOfLinePositions[generatedLine] + generatedColumn,
1107
+ next: void 0
1108
+ };
1109
+ const originalSegment = {
1110
+ line,
1111
+ column,
1112
+ position: originalSource.startOfLinePositions[line] + column,
1113
+ next: void 0
1114
+ };
1115
+ mappings.push({ name, generatedSegment, originalSegment, originalSource });
1116
+ }
1117
+ }
1118
+ }
1119
+ return mappings;
1120
+ }
1121
+ function extractOriginalSegments(mappings) {
1122
+ const originalSegments = new Map();
1123
+ for (const mapping of mappings) {
1124
+ const originalSource = mapping.originalSource;
1125
+ if (!originalSegments.has(originalSource)) {
1126
+ originalSegments.set(originalSource, []);
1127
+ }
1128
+ const segments = originalSegments.get(originalSource);
1129
+ segments.push(mapping.originalSegment);
1130
+ }
1131
+ originalSegments.forEach((segmentMarkers) => segmentMarkers.sort(compareSegments));
1132
+ return originalSegments;
1133
+ }
1134
+ function ensureOriginalSegmentLinks(mappings) {
1135
+ const segmentsBySource = extractOriginalSegments(mappings);
1136
+ segmentsBySource.forEach((markers) => {
1137
+ for (let i = 0; i < markers.length - 1; i++) {
1138
+ markers[i].next = markers[i + 1];
1139
+ }
1140
+ });
1141
+ }
1142
+ function computeStartOfLinePositions(str) {
1143
+ const NEWLINE_MARKER_OFFSET = 1;
1144
+ const lineLengths = computeLineLengths(str);
1145
+ const startPositions = [0];
1146
+ for (let i = 0; i < lineLengths.length - 1; i++) {
1147
+ startPositions.push(startPositions[i] + lineLengths[i] + NEWLINE_MARKER_OFFSET);
1148
+ }
1149
+ return startPositions;
1150
+ }
1151
+ function computeLineLengths(str) {
1152
+ return str.split(/\n/).map((s) => s.length);
1153
+ }
1154
+ var IndexedMap = class {
1155
+ constructor() {
1156
+ this.map = new Map();
1157
+ this.keys = [];
1158
+ this.values = [];
1159
+ }
1160
+ set(key, value) {
1161
+ if (this.map.has(key)) {
1162
+ return this.map.get(key);
1163
+ }
1164
+ const index = this.values.push(value) - 1;
1165
+ this.keys.push(key);
1166
+ this.map.set(key, index);
1167
+ return index;
1168
+ }
1169
+ };
1170
+ var IndexedSet = class {
1171
+ constructor() {
1172
+ this.map = new Map();
1173
+ this.values = [];
1174
+ }
1175
+ add(value) {
1176
+ if (this.map.has(value)) {
1177
+ return this.map.get(value);
1178
+ }
1179
+ const index = this.values.push(value) - 1;
1180
+ this.map.set(value, index);
1181
+ return index;
1182
+ }
1183
+ };
1184
+ var Cache = class {
1185
+ constructor(computeFn) {
1186
+ this.computeFn = computeFn;
1187
+ this.map = new Map();
1188
+ }
1189
+ get(input) {
1190
+ if (!this.map.has(input)) {
1191
+ this.map.set(input, this.computeFn(input));
1192
+ }
1193
+ return this.map.get(input);
1194
+ }
1195
+ };
1196
+
1197
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
1198
+ import mapHelpers2 from "convert-source-map";
1199
+ var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
1200
+ var SourceFileLoader = class {
1201
+ constructor(fs3, logger, schemeMap) {
1202
+ this.fs = fs3;
1203
+ this.logger = logger;
1204
+ this.schemeMap = schemeMap;
1205
+ this.currentPaths = [];
1206
+ }
1207
+ loadSourceFile(sourcePath, contents = null, mapAndPath = null) {
1208
+ const contentsOrigin = contents !== null ? ContentOrigin.Provided : ContentOrigin.FileSystem;
1209
+ const sourceMapInfo = mapAndPath && __spreadValues({ origin: ContentOrigin.Provided }, mapAndPath);
1210
+ return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
1211
+ }
1212
+ loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
1213
+ const previousPaths = this.currentPaths.slice();
1214
+ try {
1215
+ if (contents === null) {
1216
+ if (!this.fs.exists(sourcePath)) {
1217
+ return null;
1218
+ }
1219
+ contents = this.readSourceFile(sourcePath);
1220
+ }
1221
+ if (sourceMapInfo === null) {
1222
+ sourceMapInfo = this.loadSourceMap(sourcePath, contents, sourceOrigin);
1223
+ }
1224
+ let sources = [];
1225
+ if (sourceMapInfo !== null) {
1226
+ const basePath = sourceMapInfo.mapPath || sourcePath;
1227
+ sources = this.processSources(basePath, sourceMapInfo);
1228
+ }
1229
+ return new SourceFile(sourcePath, contents, sourceMapInfo, sources, this.fs);
1230
+ } catch (e) {
1231
+ this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1232
+ return null;
1233
+ } finally {
1234
+ this.currentPaths = previousPaths;
1235
+ }
1236
+ }
1237
+ loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
1238
+ const lastLine = this.getLastNonEmptyLine(sourceContents);
1239
+ const inline = mapHelpers2.commentRegex.exec(lastLine);
1240
+ if (inline !== null) {
1241
+ return {
1242
+ map: mapHelpers2.fromComment(inline.pop()).sourcemap,
1243
+ mapPath: null,
1244
+ origin: ContentOrigin.Inline
1245
+ };
1246
+ }
1247
+ if (sourceOrigin === ContentOrigin.Inline) {
1248
+ return null;
1249
+ }
1250
+ const external = mapHelpers2.mapFileCommentRegex.exec(lastLine);
1251
+ if (external) {
1252
+ try {
1253
+ const fileName = external[1] || external[2];
1254
+ const externalMapPath = this.fs.resolve(this.fs.dirname(sourcePath), fileName);
1255
+ return {
1256
+ map: this.readRawSourceMap(externalMapPath),
1257
+ mapPath: externalMapPath,
1258
+ origin: ContentOrigin.FileSystem
1259
+ };
1260
+ } catch (e) {
1261
+ this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1262
+ return null;
1263
+ }
1264
+ }
1265
+ const impliedMapPath = this.fs.resolve(sourcePath + ".map");
1266
+ if (this.fs.exists(impliedMapPath)) {
1267
+ return {
1268
+ map: this.readRawSourceMap(impliedMapPath),
1269
+ mapPath: impliedMapPath,
1270
+ origin: ContentOrigin.FileSystem
1271
+ };
1272
+ }
1273
+ return null;
1274
+ }
1275
+ processSources(basePath, { map, origin: sourceMapOrigin }) {
1276
+ const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
1277
+ return map.sources.map((source, index) => {
1278
+ const path = this.fs.resolve(sourceRoot, this.replaceSchemeWithPath(source));
1279
+ const content = map.sourcesContent && map.sourcesContent[index] || null;
1280
+ const sourceOrigin = content !== null && sourceMapOrigin !== ContentOrigin.Provided ? ContentOrigin.Inline : ContentOrigin.FileSystem;
1281
+ return this.loadSourceFileInternal(path, content, sourceOrigin, null);
1282
+ });
1283
+ }
1284
+ readSourceFile(sourcePath) {
1285
+ this.trackPath(sourcePath);
1286
+ return this.fs.readFile(sourcePath);
1287
+ }
1288
+ readRawSourceMap(mapPath) {
1289
+ this.trackPath(mapPath);
1290
+ return JSON.parse(this.fs.readFile(mapPath));
1291
+ }
1292
+ trackPath(path) {
1293
+ if (this.currentPaths.includes(path)) {
1294
+ throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
1295
+ }
1296
+ this.currentPaths.push(path);
1297
+ }
1298
+ getLastNonEmptyLine(contents) {
1299
+ let trailingWhitespaceIndex = contents.length - 1;
1300
+ while (trailingWhitespaceIndex > 0 && (contents[trailingWhitespaceIndex] === "\n" || contents[trailingWhitespaceIndex] === "\r")) {
1301
+ trailingWhitespaceIndex--;
1302
+ }
1303
+ let lastRealLineIndex = contents.lastIndexOf("\n", trailingWhitespaceIndex - 1);
1304
+ if (lastRealLineIndex === -1) {
1305
+ lastRealLineIndex = 0;
1306
+ }
1307
+ return contents.substr(lastRealLineIndex + 1);
1308
+ }
1309
+ replaceSchemeWithPath(path) {
1310
+ return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
1311
+ }
1312
+ };
1313
+
1314
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
1315
+ var DEFAULT_LINKER_OPTIONS = {
1316
+ sourceMapping: true,
1317
+ linkerJitMode: false,
1318
+ unknownDeclarationVersionHandling: "error"
1319
+ };
1320
+
1321
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
1322
+ var Context = class {
1323
+ constructor(isStatement) {
1324
+ this.isStatement = isStatement;
1325
+ }
1326
+ get withExpressionMode() {
1327
+ return this.isStatement ? new Context(false) : this;
1328
+ }
1329
+ get withStatementMode() {
1330
+ return !this.isStatement ? new Context(true) : this;
1331
+ }
1332
+ };
1333
+
1334
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
1335
+ import ts6 from "typescript";
1336
+
1337
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
1338
+ import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
1339
+
1340
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1341
+ import { ExternalExpr, ExternalReference, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
1342
+ import ts4 from "typescript";
1343
+
1344
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
1345
+ import {
1346
+ EOL
1347
+ } from "os";
1348
+ import ts from "typescript";
1349
+
1350
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
1351
+ var InvalidFileSystem = class {
1352
+ exists(path) {
1353
+ throw makeError();
1354
+ }
1355
+ readFile(path) {
1356
+ throw makeError();
1357
+ }
1358
+ readFileBuffer(path) {
1359
+ throw makeError();
1360
+ }
1361
+ writeFile(path, data, exclusive) {
1362
+ throw makeError();
1363
+ }
1364
+ removeFile(path) {
1365
+ throw makeError();
1366
+ }
1367
+ symlink(target, path) {
1368
+ throw makeError();
1369
+ }
1370
+ readdir(path) {
1371
+ throw makeError();
1372
+ }
1373
+ lstat(path) {
1374
+ throw makeError();
1375
+ }
1376
+ stat(path) {
1377
+ throw makeError();
1378
+ }
1379
+ pwd() {
1380
+ throw makeError();
1381
+ }
1382
+ chdir(path) {
1383
+ throw makeError();
1384
+ }
1385
+ extname(path) {
1386
+ throw makeError();
1387
+ }
1388
+ copyFile(from, to) {
1389
+ throw makeError();
1390
+ }
1391
+ moveFile(from, to) {
1392
+ throw makeError();
1393
+ }
1394
+ ensureDir(path) {
1395
+ throw makeError();
1396
+ }
1397
+ removeDeep(path) {
1398
+ throw makeError();
1399
+ }
1400
+ isCaseSensitive() {
1401
+ throw makeError();
1402
+ }
1403
+ resolve(...paths) {
1404
+ throw makeError();
1405
+ }
1406
+ dirname(file) {
1407
+ throw makeError();
1408
+ }
1409
+ join(basePath, ...paths) {
1410
+ throw makeError();
1411
+ }
1412
+ isRoot(path) {
1413
+ throw makeError();
1414
+ }
1415
+ isRooted(path) {
1416
+ throw makeError();
1417
+ }
1418
+ relative(from, to) {
1419
+ throw makeError();
1420
+ }
1421
+ basename(filePath, extension) {
1422
+ throw makeError();
1423
+ }
1424
+ realpath(filePath) {
1425
+ throw makeError();
1426
+ }
1427
+ getDefaultLibLocation() {
1428
+ throw makeError();
1429
+ }
1430
+ normalize(path) {
1431
+ throw makeError();
1432
+ }
1433
+ };
1434
+ function makeError() {
1435
+ return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
1436
+ }
1437
+
1438
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
1439
+ var fs = new InvalidFileSystem();
1440
+ var ABSOLUTE_PATH = Symbol("AbsolutePath");
1441
+
1442
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
1443
+ import {
1444
+ copyFileSync,
1445
+ existsSync,
1446
+ lstatSync,
1447
+ mkdirSync,
1448
+ readFileSync,
1449
+ readdirSync,
1450
+ realpathSync,
1451
+ renameSync,
1452
+ rmdirSync,
1453
+ statSync,
1454
+ symlinkSync,
1455
+ unlinkSync,
1456
+ writeFileSync
1457
+ } from "fs";
1458
+ import module from "module";
1459
+ import {
1460
+ basename,
1461
+ dirname as dirname2,
1462
+ extname,
1463
+ isAbsolute,
1464
+ join,
1465
+ relative as relative2,
1466
+ resolve as resolve2
1467
+ } from "path";
1468
+ import { fileURLToPath } from "url";
1469
+ var isCommonJS = typeof __filename !== "undefined";
1470
+ var currentFileUrl = isCommonJS ? null : __ESM_IMPORT_META_URL__;
1471
+ var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
1472
+
1473
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
1474
+ import ts2 from "typescript";
1475
+
1476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
1477
+ import ts3 from "typescript";
1478
+
1479
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1480
+ var ImportFlags;
1481
+ (function(ImportFlags2) {
1482
+ ImportFlags2[ImportFlags2["None"] = 0] = "None";
1483
+ ImportFlags2[ImportFlags2["ForceNewImport"] = 1] = "ForceNewImport";
1484
+ ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
1485
+ ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
1486
+ })(ImportFlags || (ImportFlags = {}));
1487
+
1488
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
1489
+ var CORE_SUPPORTED_SYMBOLS = new Map([
1490
+ ["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
1491
+ ["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
1492
+ ["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
1493
+ ["\u0275\u0275setNgModuleScope", "\u0275\u0275setNgModuleScope"],
1494
+ ["\u0275\u0275inject", "\u0275\u0275inject"],
1495
+ ["\u0275\u0275FactoryDeclaration", "\u0275\u0275FactoryDeclaration"],
1496
+ ["\u0275setClassMetadata", "setClassMetadata"],
1497
+ ["\u0275\u0275InjectableDeclaration", "\u0275\u0275InjectableDeclaration"],
1498
+ ["\u0275\u0275InjectorDeclaration", "\u0275\u0275InjectorDeclaration"],
1499
+ ["\u0275\u0275NgModuleDeclaration", "\u0275\u0275NgModuleDeclaration"],
1500
+ ["\u0275NgModuleFactory", "NgModuleFactory"],
1501
+ ["\u0275noSideEffects", "\u0275noSideEffects"]
1502
+ ]);
1503
+
1504
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
1505
+ import ts5 from "typescript";
1506
+ var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
1507
+
1508
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
1509
+ import {
1510
+ BinaryOperator,
1511
+ ConditionalExpr,
1512
+ StmtModifier,
1513
+ UnaryOperator
1514
+ } from "@angular/compiler";
1515
+ var UNARY_OPERATORS = new Map([
1516
+ [UnaryOperator.Minus, "-"],
1517
+ [UnaryOperator.Plus, "+"]
1518
+ ]);
1519
+ var BINARY_OPERATORS = new Map([
1520
+ [BinaryOperator.And, "&&"],
1521
+ [BinaryOperator.Bigger, ">"],
1522
+ [BinaryOperator.BiggerEquals, ">="],
1523
+ [BinaryOperator.BitwiseAnd, "&"],
1524
+ [BinaryOperator.Divide, "/"],
1525
+ [BinaryOperator.Equals, "=="],
1526
+ [BinaryOperator.Identical, "==="],
1527
+ [BinaryOperator.Lower, "<"],
1528
+ [BinaryOperator.LowerEquals, "<="],
1529
+ [BinaryOperator.Minus, "-"],
1530
+ [BinaryOperator.Modulo, "%"],
1531
+ [BinaryOperator.Multiply, "*"],
1532
+ [BinaryOperator.NotEquals, "!="],
1533
+ [BinaryOperator.NotIdentical, "!=="],
1534
+ [BinaryOperator.Or, "||"],
1535
+ [BinaryOperator.Plus, "+"],
1536
+ [BinaryOperator.NullishCoalesce, "??"]
1537
+ ]);
1538
+ var ExpressionTranslatorVisitor = class {
1539
+ constructor(factory, imports, options) {
1540
+ this.factory = factory;
1541
+ this.imports = imports;
1542
+ this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
1543
+ this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
1544
+ this.recordWrappedNode = options.recordWrappedNode || (() => {
1545
+ });
1546
+ }
1547
+ visitDeclareVarStmt(stmt, context) {
1548
+ var _a;
1549
+ const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(StmtModifier.Final) ? "const" : "let";
1550
+ return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a = stmt.value) == null ? void 0 : _a.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
1551
+ }
1552
+ visitDeclareFunctionStmt(stmt, context) {
1553
+ return this.attachComments(this.factory.createFunctionDeclaration(stmt.name, stmt.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(stmt.statements, context.withStatementMode))), stmt.leadingComments);
1554
+ }
1555
+ visitExpressionStmt(stmt, context) {
1556
+ return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
1557
+ }
1558
+ visitReturnStmt(stmt, context) {
1559
+ return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1560
+ }
1561
+ visitDeclareClassStmt(_stmt, _context) {
1562
+ throw new Error("Method not implemented.");
1563
+ }
1564
+ visitIfStmt(stmt, context) {
1565
+ return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
1566
+ }
1567
+ visitTryCatchStmt(_stmt, _context) {
1568
+ throw new Error("Method not implemented.");
1569
+ }
1570
+ visitThrowStmt(stmt, context) {
1571
+ return this.attachComments(this.factory.createThrowStatement(stmt.error.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1572
+ }
1573
+ visitReadVarExpr(ast, _context) {
1574
+ const identifier = this.factory.createIdentifier(ast.name);
1575
+ this.setSourceMapRange(identifier, ast.sourceSpan);
1576
+ return identifier;
1577
+ }
1578
+ visitWriteVarExpr(expr, context) {
1579
+ const assignment = this.factory.createAssignment(this.setSourceMapRange(this.factory.createIdentifier(expr.name), expr.sourceSpan), expr.value.visitExpression(this, context));
1580
+ return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1581
+ }
1582
+ visitWriteKeyExpr(expr, context) {
1583
+ const exprContext = context.withExpressionMode;
1584
+ const target = this.factory.createElementAccess(expr.receiver.visitExpression(this, exprContext), expr.index.visitExpression(this, exprContext));
1585
+ const assignment = this.factory.createAssignment(target, expr.value.visitExpression(this, exprContext));
1586
+ return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1587
+ }
1588
+ visitWritePropExpr(expr, context) {
1589
+ const target = this.factory.createPropertyAccess(expr.receiver.visitExpression(this, context), expr.name);
1590
+ return this.factory.createAssignment(target, expr.value.visitExpression(this, context));
1591
+ }
1592
+ visitInvokeFunctionExpr(ast, context) {
1593
+ return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
1594
+ }
1595
+ visitTaggedTemplateExpr(ast, context) {
1596
+ return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), {
1597
+ elements: ast.template.elements.map((e) => {
1598
+ var _a;
1599
+ return createTemplateElement({
1600
+ cooked: e.text,
1601
+ raw: e.rawText,
1602
+ range: (_a = e.sourceSpan) != null ? _a : ast.sourceSpan
1603
+ });
1604
+ }),
1605
+ expressions: ast.template.expressions.map((e) => e.visitExpression(this, context))
1606
+ }), ast.sourceSpan);
1607
+ }
1608
+ visitInstantiateExpr(ast, context) {
1609
+ return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
1610
+ }
1611
+ visitLiteralExpr(ast, _context) {
1612
+ return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
1613
+ }
1614
+ visitLocalizedString(ast, context) {
1615
+ const elements = [createTemplateElement(ast.serializeI18nHead())];
1616
+ const expressions = [];
1617
+ for (let i = 0; i < ast.expressions.length; i++) {
1618
+ const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
1619
+ expressions.push(placeholder);
1620
+ elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
1621
+ }
1622
+ const localizeTag = this.factory.createIdentifier("$localize");
1623
+ return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
1624
+ }
1625
+ createTaggedTemplateExpression(tag, template) {
1626
+ return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
1627
+ }
1628
+ createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
1629
+ const { moduleImport, symbol } = this.imports.generateNamedImport("tslib", "__makeTemplateObject");
1630
+ const __makeTemplateObjectHelper = moduleImport === null ? this.factory.createIdentifier(symbol) : this.factory.createPropertyAccess(moduleImport, symbol);
1631
+ const cooked = [];
1632
+ const raw = [];
1633
+ for (const element of elements) {
1634
+ cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
1635
+ raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
1636
+ }
1637
+ const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)], false);
1638
+ return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
1639
+ }
1640
+ visitExternalExpr(ast, _context) {
1641
+ if (ast.value.name === null) {
1642
+ if (ast.value.moduleName === null) {
1643
+ throw new Error("Invalid import without name nor moduleName");
1644
+ }
1645
+ return this.imports.generateNamespaceImport(ast.value.moduleName);
1646
+ }
1647
+ if (ast.value.moduleName !== null) {
1648
+ const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
1649
+ if (moduleImport === null) {
1650
+ return this.factory.createIdentifier(symbol);
1651
+ } else {
1652
+ return this.factory.createPropertyAccess(moduleImport, symbol);
1653
+ }
1654
+ } else {
1655
+ return this.factory.createIdentifier(ast.value.name);
1656
+ }
1657
+ }
1658
+ visitConditionalExpr(ast, context) {
1659
+ let cond = ast.condition.visitExpression(this, context);
1660
+ if (ast.condition instanceof ConditionalExpr) {
1661
+ cond = this.factory.createParenthesizedExpression(cond);
1662
+ }
1663
+ return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
1664
+ }
1665
+ visitNotExpr(ast, context) {
1666
+ return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
1667
+ }
1668
+ visitAssertNotNullExpr(ast, context) {
1669
+ return ast.condition.visitExpression(this, context);
1670
+ }
1671
+ visitCastExpr(ast, context) {
1672
+ return ast.value.visitExpression(this, context);
1673
+ }
1674
+ visitFunctionExpr(ast, context) {
1675
+ var _a;
1676
+ return this.factory.createFunctionExpression((_a = ast.name) != null ? _a : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
1677
+ }
1678
+ visitBinaryOperatorExpr(ast, context) {
1679
+ if (!BINARY_OPERATORS.has(ast.operator)) {
1680
+ throw new Error(`Unknown binary operator: ${BinaryOperator[ast.operator]}`);
1681
+ }
1682
+ return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
1683
+ }
1684
+ visitReadPropExpr(ast, context) {
1685
+ return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
1686
+ }
1687
+ visitReadKeyExpr(ast, context) {
1688
+ return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
1689
+ }
1690
+ visitLiteralArrayExpr(ast, context) {
1691
+ return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
1692
+ }
1693
+ visitLiteralMapExpr(ast, context) {
1694
+ const properties = ast.entries.map((entry) => {
1695
+ return {
1696
+ propertyName: entry.key,
1697
+ quoted: entry.quoted,
1698
+ value: entry.value.visitExpression(this, context)
1699
+ };
1700
+ });
1701
+ return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
1702
+ }
1703
+ visitCommaExpr(ast, context) {
1704
+ throw new Error("Method not implemented.");
1705
+ }
1706
+ visitWrappedNodeExpr(ast, _context) {
1707
+ this.recordWrappedNode(ast);
1708
+ return ast.node;
1709
+ }
1710
+ visitTypeofExpr(ast, context) {
1711
+ return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
1712
+ }
1713
+ visitUnaryOperatorExpr(ast, context) {
1714
+ if (!UNARY_OPERATORS.has(ast.operator)) {
1715
+ throw new Error(`Unknown unary operator: ${UnaryOperator[ast.operator]}`);
1716
+ }
1717
+ return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
1718
+ }
1719
+ visitStatements(statements, context) {
1720
+ return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== void 0);
1721
+ }
1722
+ setSourceMapRange(ast, span) {
1723
+ return this.factory.setSourceMapRange(ast, createRange(span));
1724
+ }
1725
+ attachComments(statement, leadingComments) {
1726
+ if (leadingComments !== void 0) {
1727
+ this.factory.attachComments(statement, leadingComments);
1728
+ }
1729
+ return statement;
1730
+ }
1731
+ };
1732
+ function createTemplateElement({ cooked, raw, range }) {
1733
+ return { cooked, raw, range: createRange(range) };
1734
+ }
1735
+ function createRange(span) {
1736
+ if (span === null) {
1737
+ return null;
1738
+ }
1739
+ const { start, end } = span;
1740
+ const { url, content } = start.file;
1741
+ if (!url) {
1742
+ return null;
1743
+ }
1744
+ return {
1745
+ url,
1746
+ content,
1747
+ start: { offset: start.offset, line: start.line, column: start.col },
1748
+ end: { offset: end.offset, line: end.line, column: end.col }
1749
+ };
1750
+ }
1751
+
1752
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
1753
+ import {
1754
+ BuiltinTypeName
1755
+ } from "@angular/compiler";
1756
+ import ts7 from "typescript";
1757
+
1758
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
1759
+ import ts8 from "typescript";
1760
+ var PureAnnotation;
1761
+ (function(PureAnnotation2) {
1762
+ PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
1763
+ PureAnnotation2["TERSER"] = "@__PURE__";
1764
+ })(PureAnnotation || (PureAnnotation = {}));
1765
+ var UNARY_OPERATORS2 = {
1766
+ "+": ts8.SyntaxKind.PlusToken,
1767
+ "-": ts8.SyntaxKind.MinusToken,
1768
+ "!": ts8.SyntaxKind.ExclamationToken
1769
+ };
1770
+ var BINARY_OPERATORS2 = {
1771
+ "&&": ts8.SyntaxKind.AmpersandAmpersandToken,
1772
+ ">": ts8.SyntaxKind.GreaterThanToken,
1773
+ ">=": ts8.SyntaxKind.GreaterThanEqualsToken,
1774
+ "&": ts8.SyntaxKind.AmpersandToken,
1775
+ "/": ts8.SyntaxKind.SlashToken,
1776
+ "==": ts8.SyntaxKind.EqualsEqualsToken,
1777
+ "===": ts8.SyntaxKind.EqualsEqualsEqualsToken,
1778
+ "<": ts8.SyntaxKind.LessThanToken,
1779
+ "<=": ts8.SyntaxKind.LessThanEqualsToken,
1780
+ "-": ts8.SyntaxKind.MinusToken,
1781
+ "%": ts8.SyntaxKind.PercentToken,
1782
+ "*": ts8.SyntaxKind.AsteriskToken,
1783
+ "!=": ts8.SyntaxKind.ExclamationEqualsToken,
1784
+ "!==": ts8.SyntaxKind.ExclamationEqualsEqualsToken,
1785
+ "||": ts8.SyntaxKind.BarBarToken,
1786
+ "+": ts8.SyntaxKind.PlusToken,
1787
+ "??": ts8.SyntaxKind.QuestionQuestionToken
1788
+ };
1789
+ var VAR_TYPES = {
1790
+ "const": ts8.NodeFlags.Const,
1791
+ "let": ts8.NodeFlags.Let,
1792
+ "var": ts8.NodeFlags.None
1793
+ };
1794
+
1795
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
1796
+ var Translator = class {
1797
+ constructor(factory) {
1798
+ this.factory = factory;
1799
+ }
1800
+ translateExpression(expression, imports, options = {}) {
1801
+ return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
1802
+ }
1803
+ translateStatement(statement, imports, options = {}) {
1804
+ return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
1805
+ }
1806
+ };
1807
+
1808
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
1809
+ var LinkerEnvironment = class {
1810
+ constructor(fileSystem, logger, host, factory, options) {
1811
+ this.fileSystem = fileSystem;
1812
+ this.logger = logger;
1813
+ this.host = host;
1814
+ this.factory = factory;
1815
+ this.options = options;
1816
+ this.translator = new Translator(this.factory);
1817
+ this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
1818
+ }
1819
+ static create(fileSystem, logger, host, factory, options) {
1820
+ var _a, _b, _c;
1821
+ return new LinkerEnvironment(fileSystem, logger, host, factory, {
1822
+ sourceMapping: (_a = options.sourceMapping) != null ? _a : DEFAULT_LINKER_OPTIONS.sourceMapping,
1823
+ linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
1824
+ unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
1825
+ });
1826
+ }
1827
+ };
1828
+
1829
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/needs_linking.mjs
1830
+ function needsLinking(path, source) {
1831
+ return declarationFunctions.some((fn) => source.includes(fn));
1832
+ }
1833
+ export {
1834
+ DEFAULT_LINKER_OPTIONS,
1835
+ FatalLinkerError,
1836
+ FileLinker,
1837
+ LinkerEnvironment,
1838
+ assert,
1839
+ isFatalLinkerError,
1840
+ needsLinking
1841
+ };
1842
+ /**
1843
+ * @license
1844
+ * Copyright Google LLC All Rights Reserved.
1845
+ *
1846
+ * Use of this source code is governed by an MIT-style license that can be
1847
+ * found in the LICENSE file at https://angular.io/license
1848
+ */
1849
+ //# sourceMappingURL=index.js.map