@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,2384 @@
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
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
26
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
27
+ }) : x)(function(x) {
28
+ if (typeof require !== "undefined")
29
+ return require.apply(this, arguments);
30
+ throw new Error('Dynamic require of "' + x + '" is not supported');
31
+ });
32
+ var __objRest = (source, exclude) => {
33
+ var target = {};
34
+ for (var prop in source)
35
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
36
+ target[prop] = source[prop];
37
+ if (source != null && __getOwnPropSymbols)
38
+ for (var prop of __getOwnPropSymbols(source)) {
39
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
40
+ target[prop] = source[prop];
41
+ }
42
+ return target;
43
+ };
44
+
45
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
46
+ import {
47
+ EOL
48
+ } from "os";
49
+ import ts from "typescript";
50
+
51
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
52
+ var InvalidFileSystem = class {
53
+ exists(path) {
54
+ throw makeError();
55
+ }
56
+ readFile(path) {
57
+ throw makeError();
58
+ }
59
+ readFileBuffer(path) {
60
+ throw makeError();
61
+ }
62
+ writeFile(path, data, exclusive) {
63
+ throw makeError();
64
+ }
65
+ removeFile(path) {
66
+ throw makeError();
67
+ }
68
+ symlink(target, path) {
69
+ throw makeError();
70
+ }
71
+ readdir(path) {
72
+ throw makeError();
73
+ }
74
+ lstat(path) {
75
+ throw makeError();
76
+ }
77
+ stat(path) {
78
+ throw makeError();
79
+ }
80
+ pwd() {
81
+ throw makeError();
82
+ }
83
+ chdir(path) {
84
+ throw makeError();
85
+ }
86
+ extname(path) {
87
+ throw makeError();
88
+ }
89
+ copyFile(from, to) {
90
+ throw makeError();
91
+ }
92
+ moveFile(from, to) {
93
+ throw makeError();
94
+ }
95
+ ensureDir(path) {
96
+ throw makeError();
97
+ }
98
+ removeDeep(path) {
99
+ throw makeError();
100
+ }
101
+ isCaseSensitive() {
102
+ throw makeError();
103
+ }
104
+ resolve(...paths) {
105
+ throw makeError();
106
+ }
107
+ dirname(file) {
108
+ throw makeError();
109
+ }
110
+ join(basePath, ...paths) {
111
+ throw makeError();
112
+ }
113
+ isRoot(path) {
114
+ throw makeError();
115
+ }
116
+ isRooted(path) {
117
+ throw makeError();
118
+ }
119
+ relative(from, to) {
120
+ throw makeError();
121
+ }
122
+ basename(filePath, extension) {
123
+ throw makeError();
124
+ }
125
+ realpath(filePath) {
126
+ throw makeError();
127
+ }
128
+ getDefaultLibLocation() {
129
+ throw makeError();
130
+ }
131
+ normalize(path) {
132
+ throw makeError();
133
+ }
134
+ };
135
+ function makeError() {
136
+ return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
137
+ }
138
+
139
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
140
+ var fs = new InvalidFileSystem();
141
+ var ABSOLUTE_PATH = Symbol("AbsolutePath");
142
+
143
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
144
+ import {
145
+ copyFileSync,
146
+ existsSync,
147
+ lstatSync,
148
+ mkdirSync,
149
+ readFileSync,
150
+ readdirSync,
151
+ realpathSync,
152
+ renameSync,
153
+ rmdirSync,
154
+ statSync,
155
+ symlinkSync,
156
+ unlinkSync,
157
+ writeFileSync
158
+ } from "fs";
159
+ import module from "module";
160
+ import {
161
+ basename,
162
+ dirname as dirname2,
163
+ extname,
164
+ isAbsolute,
165
+ join,
166
+ relative as relative2,
167
+ resolve as resolve2
168
+ } from "path";
169
+ import { fileURLToPath } from "url";
170
+ var NodeJSPathManipulation = class {
171
+ pwd() {
172
+ return this.normalize(process.cwd());
173
+ }
174
+ chdir(dir) {
175
+ process.chdir(dir);
176
+ }
177
+ resolve(...paths) {
178
+ return this.normalize(resolve2(...paths));
179
+ }
180
+ dirname(file) {
181
+ return this.normalize(dirname2(file));
182
+ }
183
+ join(basePath, ...paths) {
184
+ return this.normalize(join(basePath, ...paths));
185
+ }
186
+ isRoot(path) {
187
+ return this.dirname(path) === this.normalize(path);
188
+ }
189
+ isRooted(path) {
190
+ return isAbsolute(path);
191
+ }
192
+ relative(from, to) {
193
+ return this.normalize(relative2(from, to));
194
+ }
195
+ basename(filePath, extension) {
196
+ return basename(filePath, extension);
197
+ }
198
+ extname(path) {
199
+ return extname(path);
200
+ }
201
+ normalize(path) {
202
+ return path.replace(/\\/g, "/");
203
+ }
204
+ };
205
+ var isCommonJS = typeof __filename !== "undefined";
206
+ var currentFileUrl = isCommonJS ? null : __ESM_IMPORT_META_URL__;
207
+ var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
208
+ var NodeJSReadonlyFileSystem = class extends NodeJSPathManipulation {
209
+ constructor() {
210
+ super(...arguments);
211
+ this._caseSensitive = void 0;
212
+ }
213
+ isCaseSensitive() {
214
+ if (this._caseSensitive === void 0) {
215
+ this._caseSensitive = !existsSync(this.normalize(toggleCase(currentFileName)));
216
+ }
217
+ return this._caseSensitive;
218
+ }
219
+ exists(path) {
220
+ return existsSync(path);
221
+ }
222
+ readFile(path) {
223
+ return readFileSync(path, "utf8");
224
+ }
225
+ readFileBuffer(path) {
226
+ return readFileSync(path);
227
+ }
228
+ readdir(path) {
229
+ return readdirSync(path);
230
+ }
231
+ lstat(path) {
232
+ return lstatSync(path);
233
+ }
234
+ stat(path) {
235
+ return statSync(path);
236
+ }
237
+ realpath(path) {
238
+ return this.resolve(realpathSync(path));
239
+ }
240
+ getDefaultLibLocation() {
241
+ const requireFn = isCommonJS ? __require : module.createRequire(currentFileUrl);
242
+ return this.resolve(requireFn.resolve("typescript"), "..");
243
+ }
244
+ };
245
+ var NodeJSFileSystem = class extends NodeJSReadonlyFileSystem {
246
+ writeFile(path, data, exclusive = false) {
247
+ writeFileSync(path, data, exclusive ? { flag: "wx" } : void 0);
248
+ }
249
+ removeFile(path) {
250
+ unlinkSync(path);
251
+ }
252
+ symlink(target, path) {
253
+ symlinkSync(target, path);
254
+ }
255
+ copyFile(from, to) {
256
+ copyFileSync(from, to);
257
+ }
258
+ moveFile(from, to) {
259
+ renameSync(from, to);
260
+ }
261
+ ensureDir(path) {
262
+ const parents = [];
263
+ while (!this.isRoot(path) && !this.exists(path)) {
264
+ parents.push(path);
265
+ path = this.dirname(path);
266
+ }
267
+ while (parents.length) {
268
+ this.safeMkdir(parents.pop());
269
+ }
270
+ }
271
+ removeDeep(path) {
272
+ rmdirSync(path, { recursive: true });
273
+ }
274
+ safeMkdir(path) {
275
+ try {
276
+ mkdirSync(path);
277
+ } catch (err) {
278
+ if (!this.exists(path) || !this.stat(path).isDirectory()) {
279
+ throw err;
280
+ }
281
+ }
282
+ }
283
+ };
284
+ function toggleCase(str) {
285
+ return str.replace(/\w/g, (ch) => ch.toUpperCase() === ch ? ch.toLowerCase() : ch.toUpperCase());
286
+ }
287
+
288
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
289
+ var LogLevel;
290
+ (function(LogLevel2) {
291
+ LogLevel2[LogLevel2["debug"] = 0] = "debug";
292
+ LogLevel2[LogLevel2["info"] = 1] = "info";
293
+ LogLevel2[LogLevel2["warn"] = 2] = "warn";
294
+ LogLevel2[LogLevel2["error"] = 3] = "error";
295
+ })(LogLevel || (LogLevel = {}));
296
+
297
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
298
+ var RESET = "";
299
+ var RED = "";
300
+ var YELLOW = "";
301
+ var BLUE = "";
302
+ var DEBUG = `${BLUE}Debug:${RESET}`;
303
+ var WARN = `${YELLOW}Warning:${RESET}`;
304
+ var ERROR = `${RED}Error:${RESET}`;
305
+ var ConsoleLogger = class {
306
+ constructor(level) {
307
+ this.level = level;
308
+ }
309
+ debug(...args) {
310
+ if (this.level <= LogLevel.debug)
311
+ console.debug(DEBUG, ...args);
312
+ }
313
+ info(...args) {
314
+ if (this.level <= LogLevel.info)
315
+ console.info(...args);
316
+ }
317
+ warn(...args) {
318
+ if (this.level <= LogLevel.warn)
319
+ console.warn(WARN, ...args);
320
+ }
321
+ error(...args) {
322
+ if (this.level <= LogLevel.error)
323
+ console.error(ERROR, ...args);
324
+ }
325
+ };
326
+
327
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
328
+ var FatalLinkerError = class extends Error {
329
+ constructor(node, message) {
330
+ super(message);
331
+ this.node = node;
332
+ this.type = "FatalLinkerError";
333
+ }
334
+ };
335
+ function isFatalLinkerError(e) {
336
+ return e && e.type === "FatalLinkerError";
337
+ }
338
+
339
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
340
+ function assert(node, predicate, expected) {
341
+ if (!predicate(node)) {
342
+ throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
343
+ }
344
+ }
345
+
346
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
347
+ import {
348
+ WrappedNodeExpr
349
+ } from "@angular/compiler";
350
+ var AstObject = class {
351
+ constructor(expression, obj, host) {
352
+ this.expression = expression;
353
+ this.obj = obj;
354
+ this.host = host;
355
+ }
356
+ static parse(expression, host) {
357
+ const obj = host.parseObjectLiteral(expression);
358
+ return new AstObject(expression, obj, host);
359
+ }
360
+ has(propertyName) {
361
+ return this.obj.has(propertyName);
362
+ }
363
+ getNumber(propertyName) {
364
+ return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
365
+ }
366
+ getString(propertyName) {
367
+ return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
368
+ }
369
+ getBoolean(propertyName) {
370
+ return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
371
+ }
372
+ getObject(propertyName) {
373
+ const expr = this.getRequiredProperty(propertyName);
374
+ const obj = this.host.parseObjectLiteral(expr);
375
+ return new AstObject(expr, obj, this.host);
376
+ }
377
+ getArray(propertyName) {
378
+ const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
379
+ return arr.map((entry) => new AstValue(entry, this.host));
380
+ }
381
+ getOpaque(propertyName) {
382
+ return new WrappedNodeExpr(this.getRequiredProperty(propertyName));
383
+ }
384
+ getNode(propertyName) {
385
+ return this.getRequiredProperty(propertyName);
386
+ }
387
+ getValue(propertyName) {
388
+ return new AstValue(this.getRequiredProperty(propertyName), this.host);
389
+ }
390
+ toLiteral(mapper) {
391
+ const result = {};
392
+ for (const [key, expression] of this.obj) {
393
+ result[key] = mapper(new AstValue(expression, this.host));
394
+ }
395
+ return result;
396
+ }
397
+ toMap(mapper) {
398
+ const result = new Map();
399
+ for (const [key, expression] of this.obj) {
400
+ result.set(key, mapper(new AstValue(expression, this.host)));
401
+ }
402
+ return result;
403
+ }
404
+ getRequiredProperty(propertyName) {
405
+ if (!this.obj.has(propertyName)) {
406
+ throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
407
+ }
408
+ return this.obj.get(propertyName);
409
+ }
410
+ };
411
+ var AstValue = class {
412
+ constructor(expression, host) {
413
+ this.expression = expression;
414
+ this.host = host;
415
+ }
416
+ getSymbolName() {
417
+ return this.host.getSymbolName(this.expression);
418
+ }
419
+ isNumber() {
420
+ return this.host.isNumericLiteral(this.expression);
421
+ }
422
+ getNumber() {
423
+ return this.host.parseNumericLiteral(this.expression);
424
+ }
425
+ isString() {
426
+ return this.host.isStringLiteral(this.expression);
427
+ }
428
+ getString() {
429
+ return this.host.parseStringLiteral(this.expression);
430
+ }
431
+ isBoolean() {
432
+ return this.host.isBooleanLiteral(this.expression);
433
+ }
434
+ getBoolean() {
435
+ return this.host.parseBooleanLiteral(this.expression);
436
+ }
437
+ isObject() {
438
+ return this.host.isObjectLiteral(this.expression);
439
+ }
440
+ getObject() {
441
+ return AstObject.parse(this.expression, this.host);
442
+ }
443
+ isArray() {
444
+ return this.host.isArrayLiteral(this.expression);
445
+ }
446
+ getArray() {
447
+ const arr = this.host.parseArrayLiteral(this.expression);
448
+ return arr.map((entry) => new AstValue(entry, this.host));
449
+ }
450
+ isFunction() {
451
+ return this.host.isFunctionExpression(this.expression);
452
+ }
453
+ getFunctionReturnValue() {
454
+ return new AstValue(this.host.parseReturnValue(this.expression), this.host);
455
+ }
456
+ isCallExpression() {
457
+ return this.host.isCallExpression(this.expression);
458
+ }
459
+ getCallee() {
460
+ return new AstValue(this.host.parseCallee(this.expression), this.host);
461
+ }
462
+ getArguments() {
463
+ const args = this.host.parseArguments(this.expression);
464
+ return args.map((arg) => new AstValue(arg, this.host));
465
+ }
466
+ getOpaque() {
467
+ return new WrappedNodeExpr(this.expression);
468
+ }
469
+ getRange() {
470
+ return this.host.getRange(this.expression);
471
+ }
472
+ };
473
+
474
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
475
+ import { ConstantPool } from "@angular/compiler";
476
+
477
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
478
+ var LinkerImportGenerator = class {
479
+ constructor(ngImport) {
480
+ this.ngImport = ngImport;
481
+ }
482
+ generateNamespaceImport(moduleName) {
483
+ this.assertModuleName(moduleName);
484
+ return this.ngImport;
485
+ }
486
+ generateNamedImport(moduleName, originalSymbol) {
487
+ this.assertModuleName(moduleName);
488
+ return { moduleImport: this.ngImport, symbol: originalSymbol };
489
+ }
490
+ assertModuleName(moduleName) {
491
+ if (moduleName !== "@angular/core") {
492
+ throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
493
+ }
494
+ }
495
+ };
496
+
497
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
498
+ var EmitScope = class {
499
+ constructor(ngImport, translator) {
500
+ this.ngImport = ngImport;
501
+ this.translator = translator;
502
+ this.constantPool = new ConstantPool();
503
+ }
504
+ translateDefinition(definition) {
505
+ return this.translator.translateExpression(definition, new LinkerImportGenerator(this.ngImport));
506
+ }
507
+ getConstantStatements() {
508
+ const importGenerator = new LinkerImportGenerator(this.ngImport);
509
+ return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
510
+ }
511
+ };
512
+
513
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope.mjs
514
+ var IifeEmitScope = class extends EmitScope {
515
+ constructor(ngImport, translator, factory) {
516
+ super(ngImport, translator);
517
+ this.factory = factory;
518
+ }
519
+ translateDefinition(definition) {
520
+ const constantStatements = super.getConstantStatements();
521
+ const returnStatement = this.factory.createReturnStatement(super.translateDefinition(definition));
522
+ const body = this.factory.createBlock([...constantStatements, returnStatement]);
523
+ const fn = this.factory.createFunctionExpression(null, [], body);
524
+ return this.factory.createCallExpression(fn, [], false);
525
+ }
526
+ getConstantStatements() {
527
+ throw new Error("BUG - IifeEmitScope should not expose any constant statements");
528
+ }
529
+ };
530
+
531
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
532
+ import semver from "semver";
533
+
534
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
535
+ function createGetSourceFile(sourceUrl, code, loader) {
536
+ if (loader === null) {
537
+ return () => null;
538
+ } else {
539
+ let sourceFile = void 0;
540
+ return () => {
541
+ if (sourceFile === void 0) {
542
+ sourceFile = loader.loadSourceFile(sourceUrl, code);
543
+ }
544
+ return sourceFile;
545
+ };
546
+ }
547
+ }
548
+
549
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
550
+ import { compileClassMetadata } from "@angular/compiler";
551
+ var PartialClassMetadataLinkerVersion1 = class {
552
+ linkPartialDeclaration(constantPool, metaObj) {
553
+ const meta = toR3ClassMetadata(metaObj);
554
+ return compileClassMetadata(meta);
555
+ }
556
+ };
557
+ function toR3ClassMetadata(metaObj) {
558
+ return {
559
+ type: metaObj.getOpaque("type"),
560
+ decorators: metaObj.getOpaque("decorators"),
561
+ ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
562
+ propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
563
+ };
564
+ }
565
+
566
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
567
+ import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, ViewEncapsulation } from "@angular/compiler";
568
+
569
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
570
+ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
571
+
572
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
573
+ import { createR3ProviderExpression, outputAst as o2 } from "@angular/compiler";
574
+ function wrapReference(wrapped) {
575
+ return { value: wrapped, type: wrapped };
576
+ }
577
+ function parseEnum(value, Enum) {
578
+ const symbolName = value.getSymbolName();
579
+ if (symbolName === null) {
580
+ throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
581
+ }
582
+ const enumValue = Enum[symbolName];
583
+ if (enumValue === void 0) {
584
+ throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
585
+ }
586
+ return enumValue;
587
+ }
588
+ function getDependency(depObj) {
589
+ const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
590
+ const token = depObj.getOpaque("token");
591
+ const attributeNameType = isAttribute ? o2.literal("unknown") : null;
592
+ return {
593
+ token,
594
+ attributeNameType,
595
+ host: depObj.has("host") && depObj.getBoolean("host"),
596
+ optional: depObj.has("optional") && depObj.getBoolean("optional"),
597
+ self: depObj.has("self") && depObj.getBoolean("self"),
598
+ skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
599
+ };
600
+ }
601
+ function extractForwardRef(expr) {
602
+ if (!expr.isCallExpression()) {
603
+ return createR3ProviderExpression(expr.getOpaque(), false);
604
+ }
605
+ const callee = expr.getCallee();
606
+ if (callee.getSymbolName() !== "forwardRef") {
607
+ throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
608
+ }
609
+ const args = expr.getArguments();
610
+ if (args.length !== 1) {
611
+ throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
612
+ }
613
+ const wrapperFn = args[0];
614
+ if (!wrapperFn.isFunction()) {
615
+ throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
616
+ }
617
+ return createR3ProviderExpression(wrapperFn.getFunctionReturnValue().getOpaque(), true);
618
+ }
619
+
620
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
621
+ var PartialDirectiveLinkerVersion1 = class {
622
+ constructor(sourceUrl, code) {
623
+ this.sourceUrl = sourceUrl;
624
+ this.code = code;
625
+ }
626
+ linkPartialDeclaration(constantPool, metaObj) {
627
+ const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
628
+ const def = compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
629
+ return def.expression;
630
+ }
631
+ };
632
+ function toR3DirectiveMeta(metaObj, code, sourceUrl) {
633
+ const typeExpr = metaObj.getValue("type");
634
+ const typeName = typeExpr.getSymbolName();
635
+ if (typeName === null) {
636
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
637
+ }
638
+ return {
639
+ typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
640
+ type: wrapReference(typeExpr.getOpaque()),
641
+ typeArgumentCount: 0,
642
+ internalType: metaObj.getOpaque("type"),
643
+ deps: null,
644
+ host: toHostMetadata(metaObj),
645
+ inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
646
+ outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
647
+ queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
648
+ viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
649
+ providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
650
+ fullInheritance: false,
651
+ selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
652
+ exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
653
+ lifecycle: {
654
+ usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
655
+ },
656
+ name: typeName,
657
+ usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false
658
+ };
659
+ }
660
+ function toInputMapping(value) {
661
+ if (value.isString()) {
662
+ return value.getString();
663
+ }
664
+ const values = value.getArray().map((innerValue) => innerValue.getString());
665
+ if (values.length !== 2) {
666
+ throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
667
+ }
668
+ return values;
669
+ }
670
+ function toHostMetadata(metaObj) {
671
+ if (!metaObj.has("host")) {
672
+ return {
673
+ attributes: {},
674
+ listeners: {},
675
+ properties: {},
676
+ specialAttributes: {}
677
+ };
678
+ }
679
+ const host = metaObj.getObject("host");
680
+ const specialAttributes = {};
681
+ if (host.has("styleAttribute")) {
682
+ specialAttributes.styleAttr = host.getString("styleAttribute");
683
+ }
684
+ if (host.has("classAttribute")) {
685
+ specialAttributes.classAttr = host.getString("classAttribute");
686
+ }
687
+ return {
688
+ attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
689
+ listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
690
+ properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
691
+ specialAttributes
692
+ };
693
+ }
694
+ function toQueryMetadata(obj) {
695
+ let predicate;
696
+ const predicateExpr = obj.getValue("predicate");
697
+ if (predicateExpr.isArray()) {
698
+ predicate = predicateExpr.getArray().map((entry) => entry.getString());
699
+ } else {
700
+ predicate = predicateExpr.getOpaque();
701
+ }
702
+ return {
703
+ propertyName: obj.getString("propertyName"),
704
+ first: obj.has("first") ? obj.getBoolean("first") : false,
705
+ predicate,
706
+ descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
707
+ emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
708
+ read: obj.has("read") ? obj.getOpaque("read") : null,
709
+ static: obj.has("static") ? obj.getBoolean("static") : false
710
+ };
711
+ }
712
+ function createSourceSpan(range, code, sourceUrl) {
713
+ const sourceFile = new ParseSourceFile(code, sourceUrl);
714
+ const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
715
+ return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
716
+ }
717
+
718
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
719
+ var PartialComponentLinkerVersion1 = class {
720
+ constructor(getSourceFile2, sourceUrl, code) {
721
+ this.getSourceFile = getSourceFile2;
722
+ this.sourceUrl = sourceUrl;
723
+ this.code = code;
724
+ }
725
+ linkPartialDeclaration(constantPool, metaObj) {
726
+ const meta = this.toR3ComponentMeta(metaObj);
727
+ const def = compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
728
+ return def.expression;
729
+ }
730
+ toR3ComponentMeta(metaObj) {
731
+ const interpolation = parseInterpolationConfig(metaObj);
732
+ const templateSource = metaObj.getValue("template");
733
+ const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
734
+ const templateInfo = this.getTemplateInfo(templateSource, isInline);
735
+ const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
736
+ escapedString: templateInfo.isEscaped,
737
+ interpolationConfig: interpolation,
738
+ range: templateInfo.range,
739
+ enableI18nLegacyMessageIdFormat: false,
740
+ preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
741
+ i18nNormalizeLineEndingsInICUs: isInline
742
+ });
743
+ if (template.errors !== null) {
744
+ const errors = template.errors.map((err) => err.toString()).join("\n");
745
+ throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
746
+ ${errors}`);
747
+ }
748
+ let declarationListEmitMode = 0;
749
+ const collectUsedDirectives = (directives2) => {
750
+ return directives2.map((directive) => {
751
+ const directiveExpr = directive.getObject();
752
+ const type = directiveExpr.getValue("type");
753
+ const selector = directiveExpr.getString("selector");
754
+ const { expression: typeExpr, isForwardRef } = extractForwardRef(type);
755
+ if (isForwardRef) {
756
+ declarationListEmitMode = 1;
757
+ }
758
+ return {
759
+ type: typeExpr,
760
+ selector,
761
+ inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
762
+ outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
763
+ exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
764
+ };
765
+ });
766
+ };
767
+ let directives = [];
768
+ if (metaObj.has("components")) {
769
+ directives.push(...collectUsedDirectives(metaObj.getArray("components")));
770
+ }
771
+ if (metaObj.has("directives")) {
772
+ directives.push(...collectUsedDirectives(metaObj.getArray("directives")));
773
+ }
774
+ let pipes = new Map();
775
+ if (metaObj.has("pipes")) {
776
+ pipes = metaObj.getObject("pipes").toMap((pipe) => {
777
+ const { expression: pipeType, isForwardRef } = extractForwardRef(pipe);
778
+ if (isForwardRef) {
779
+ declarationListEmitMode = 1;
780
+ }
781
+ return pipeType;
782
+ });
783
+ }
784
+ return __spreadProps(__spreadValues({}, toR3DirectiveMeta(metaObj, this.code, this.sourceUrl)), {
785
+ viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
786
+ template: {
787
+ nodes: template.nodes,
788
+ ngContentSelectors: template.ngContentSelectors
789
+ },
790
+ declarationListEmitMode,
791
+ styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
792
+ encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
793
+ interpolation,
794
+ changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
795
+ animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
796
+ relativeContextFilePath: this.sourceUrl,
797
+ i18nUseExternalIds: false,
798
+ pipes,
799
+ directives
800
+ });
801
+ }
802
+ getTemplateInfo(templateNode, isInline) {
803
+ const range = templateNode.getRange();
804
+ if (!isInline) {
805
+ const externalTemplate = this.tryExternalTemplate(range);
806
+ if (externalTemplate !== null) {
807
+ return externalTemplate;
808
+ }
809
+ }
810
+ return this.templateFromPartialCode(templateNode, range);
811
+ }
812
+ tryExternalTemplate(range) {
813
+ const sourceFile = this.getSourceFile();
814
+ if (sourceFile === null) {
815
+ return null;
816
+ }
817
+ const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
818
+ if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
819
+ return null;
820
+ }
821
+ const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
822
+ return {
823
+ code: templateContents,
824
+ sourceUrl: pos.file,
825
+ range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
826
+ isEscaped: false
827
+ };
828
+ }
829
+ templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
830
+ if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
831
+ throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
832
+ }
833
+ return {
834
+ code: this.code,
835
+ sourceUrl: this.sourceUrl,
836
+ range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
837
+ isEscaped: true
838
+ };
839
+ }
840
+ };
841
+ function parseInterpolationConfig(metaObj) {
842
+ if (!metaObj.has("interpolation")) {
843
+ return DEFAULT_INTERPOLATION_CONFIG;
844
+ }
845
+ const interpolationExpr = metaObj.getValue("interpolation");
846
+ const values = interpolationExpr.getArray().map((entry) => entry.getString());
847
+ if (values.length !== 2) {
848
+ throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
849
+ }
850
+ return InterpolationConfig.fromArray(values);
851
+ }
852
+ function parseEncapsulation(encapsulation) {
853
+ const symbolName = encapsulation.getSymbolName();
854
+ if (symbolName === null) {
855
+ throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
856
+ }
857
+ const enumValue = ViewEncapsulation[symbolName];
858
+ if (enumValue === void 0) {
859
+ throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
860
+ }
861
+ return enumValue;
862
+ }
863
+ function parseChangeDetectionStrategy(changeDetectionStrategy) {
864
+ const symbolName = changeDetectionStrategy.getSymbolName();
865
+ if (symbolName === null) {
866
+ throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
867
+ }
868
+ const enumValue = ChangeDetectionStrategy[symbolName];
869
+ if (enumValue === void 0) {
870
+ throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
871
+ }
872
+ return enumValue;
873
+ }
874
+
875
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
876
+ import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
877
+ var PartialFactoryLinkerVersion1 = class {
878
+ linkPartialDeclaration(constantPool, metaObj) {
879
+ const meta = toR3FactoryMeta(metaObj);
880
+ const def = compileFactoryFunction(meta);
881
+ return def.expression;
882
+ }
883
+ };
884
+ function toR3FactoryMeta(metaObj) {
885
+ const typeExpr = metaObj.getValue("type");
886
+ const typeName = typeExpr.getSymbolName();
887
+ if (typeName === null) {
888
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
889
+ }
890
+ return {
891
+ name: typeName,
892
+ type: wrapReference(typeExpr.getOpaque()),
893
+ internalType: metaObj.getOpaque("type"),
894
+ typeArgumentCount: 0,
895
+ target: parseEnum(metaObj.getValue("target"), FactoryTarget),
896
+ deps: getDependencies(metaObj, "deps")
897
+ };
898
+ }
899
+ function getDependencies(metaObj, propName) {
900
+ if (!metaObj.has(propName)) {
901
+ return null;
902
+ }
903
+ const deps = metaObj.getValue(propName);
904
+ if (deps.isArray()) {
905
+ return deps.getArray().map((dep) => getDependency(dep.getObject()));
906
+ }
907
+ if (deps.isString()) {
908
+ return "invalid";
909
+ }
910
+ return null;
911
+ }
912
+
913
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
914
+ import { compileInjectable, createR3ProviderExpression as createR3ProviderExpression2, outputAst as o3 } from "@angular/compiler";
915
+ var PartialInjectableLinkerVersion1 = class {
916
+ linkPartialDeclaration(constantPool, metaObj) {
917
+ const meta = toR3InjectableMeta(metaObj);
918
+ const def = compileInjectable(meta, false);
919
+ return def.expression;
920
+ }
921
+ };
922
+ function toR3InjectableMeta(metaObj) {
923
+ const typeExpr = metaObj.getValue("type");
924
+ const typeName = typeExpr.getSymbolName();
925
+ if (typeName === null) {
926
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
927
+ }
928
+ const meta = {
929
+ name: typeName,
930
+ type: wrapReference(typeExpr.getOpaque()),
931
+ internalType: typeExpr.getOpaque(),
932
+ typeArgumentCount: 0,
933
+ providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createR3ProviderExpression2(o3.literal(null), false)
934
+ };
935
+ if (metaObj.has("useClass")) {
936
+ meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
937
+ }
938
+ if (metaObj.has("useFactory")) {
939
+ meta.useFactory = metaObj.getOpaque("useFactory");
940
+ }
941
+ if (metaObj.has("useExisting")) {
942
+ meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
943
+ }
944
+ if (metaObj.has("useValue")) {
945
+ meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
946
+ }
947
+ if (metaObj.has("deps")) {
948
+ meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
949
+ }
950
+ return meta;
951
+ }
952
+
953
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
954
+ import { compileInjector } from "@angular/compiler";
955
+ var PartialInjectorLinkerVersion1 = class {
956
+ linkPartialDeclaration(constantPool, metaObj) {
957
+ const meta = toR3InjectorMeta(metaObj);
958
+ const def = compileInjector(meta);
959
+ return def.expression;
960
+ }
961
+ };
962
+ function toR3InjectorMeta(metaObj) {
963
+ const typeExpr = metaObj.getValue("type");
964
+ const typeName = typeExpr.getSymbolName();
965
+ if (typeName === null) {
966
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
967
+ }
968
+ return {
969
+ name: typeName,
970
+ type: wrapReference(typeExpr.getOpaque()),
971
+ internalType: metaObj.getOpaque("type"),
972
+ providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
973
+ imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
974
+ };
975
+ }
976
+
977
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
978
+ import { compileNgModule } from "@angular/compiler";
979
+ var PartialNgModuleLinkerVersion1 = class {
980
+ constructor(emitInline) {
981
+ this.emitInline = emitInline;
982
+ }
983
+ linkPartialDeclaration(constantPool, metaObj) {
984
+ const meta = toR3NgModuleMeta(metaObj, this.emitInline);
985
+ const def = compileNgModule(meta);
986
+ return def.expression;
987
+ }
988
+ };
989
+ function toR3NgModuleMeta(metaObj, emitInline) {
990
+ const wrappedType = metaObj.getOpaque("type");
991
+ const meta = {
992
+ type: wrapReference(wrappedType),
993
+ internalType: wrappedType,
994
+ adjacentType: wrappedType,
995
+ bootstrap: [],
996
+ declarations: [],
997
+ imports: [],
998
+ exports: [],
999
+ emitInline,
1000
+ containsForwardDecls: false,
1001
+ schemas: [],
1002
+ id: metaObj.has("id") ? metaObj.getOpaque("id") : null
1003
+ };
1004
+ if (metaObj.has("bootstrap")) {
1005
+ const bootstrap = metaObj.getValue("bootstrap");
1006
+ if (bootstrap.isFunction()) {
1007
+ meta.containsForwardDecls = true;
1008
+ meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
1009
+ } else
1010
+ meta.bootstrap = wrapReferences(bootstrap);
1011
+ }
1012
+ if (metaObj.has("declarations")) {
1013
+ const declarations = metaObj.getValue("declarations");
1014
+ if (declarations.isFunction()) {
1015
+ meta.containsForwardDecls = true;
1016
+ meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
1017
+ } else
1018
+ meta.declarations = wrapReferences(declarations);
1019
+ }
1020
+ if (metaObj.has("imports")) {
1021
+ const imports = metaObj.getValue("imports");
1022
+ if (imports.isFunction()) {
1023
+ meta.containsForwardDecls = true;
1024
+ meta.imports = wrapReferences(unwrapForwardRefs(imports));
1025
+ } else
1026
+ meta.imports = wrapReferences(imports);
1027
+ }
1028
+ if (metaObj.has("exports")) {
1029
+ const exports = metaObj.getValue("exports");
1030
+ if (exports.isFunction()) {
1031
+ meta.containsForwardDecls = true;
1032
+ meta.exports = wrapReferences(unwrapForwardRefs(exports));
1033
+ } else
1034
+ meta.exports = wrapReferences(exports);
1035
+ }
1036
+ if (metaObj.has("schemas")) {
1037
+ const schemas = metaObj.getValue("schemas");
1038
+ meta.schemas = wrapReferences(schemas);
1039
+ }
1040
+ return meta;
1041
+ }
1042
+ function unwrapForwardRefs(field) {
1043
+ return field.getFunctionReturnValue();
1044
+ }
1045
+ function wrapReferences(values) {
1046
+ return values.getArray().map((i) => wrapReference(i.getOpaque()));
1047
+ }
1048
+
1049
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
1050
+ import { compilePipeFromMetadata } from "@angular/compiler";
1051
+ var PartialPipeLinkerVersion1 = class {
1052
+ constructor() {
1053
+ }
1054
+ linkPartialDeclaration(constantPool, metaObj) {
1055
+ const meta = toR3PipeMeta(metaObj);
1056
+ const def = compilePipeFromMetadata(meta);
1057
+ return def.expression;
1058
+ }
1059
+ };
1060
+ function toR3PipeMeta(metaObj) {
1061
+ const typeExpr = metaObj.getValue("type");
1062
+ const typeName = typeExpr.getSymbolName();
1063
+ if (typeName === null) {
1064
+ throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
1065
+ }
1066
+ const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
1067
+ return {
1068
+ name: typeName,
1069
+ type: wrapReference(typeExpr.getOpaque()),
1070
+ internalType: metaObj.getOpaque("type"),
1071
+ typeArgumentCount: 0,
1072
+ deps: null,
1073
+ pipeName: metaObj.getString("name"),
1074
+ pure
1075
+ };
1076
+ }
1077
+
1078
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
1079
+ var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
1080
+ var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
1081
+ var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
1082
+ var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
1083
+ var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
1084
+ var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
1085
+ var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
1086
+ var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
1087
+ function createLinkerMap(environment, sourceUrl, code) {
1088
+ const linkers = new Map();
1089
+ const LATEST_VERSION_RANGE = getRange("<=", "13.0.0-next.10");
1090
+ linkers.set(\u0275\u0275ngDeclareDirective, [
1091
+ { range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
1092
+ ]);
1093
+ linkers.set(\u0275\u0275ngDeclareClassMetadata, [
1094
+ { range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
1095
+ ]);
1096
+ linkers.set(\u0275\u0275ngDeclareComponent, [
1097
+ {
1098
+ range: LATEST_VERSION_RANGE,
1099
+ linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
1100
+ }
1101
+ ]);
1102
+ linkers.set(\u0275\u0275ngDeclareFactory, [
1103
+ { range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
1104
+ ]);
1105
+ linkers.set(\u0275\u0275ngDeclareInjectable, [
1106
+ { range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
1107
+ ]);
1108
+ linkers.set(\u0275\u0275ngDeclareInjector, [
1109
+ { range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
1110
+ ]);
1111
+ linkers.set(\u0275\u0275ngDeclareNgModule, [
1112
+ {
1113
+ range: LATEST_VERSION_RANGE,
1114
+ linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
1115
+ }
1116
+ ]);
1117
+ linkers.set(\u0275\u0275ngDeclarePipe, [
1118
+ { range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
1119
+ ]);
1120
+ return linkers;
1121
+ }
1122
+ var PartialLinkerSelector = class {
1123
+ constructor(linkers, logger, unknownDeclarationVersionHandling) {
1124
+ this.linkers = linkers;
1125
+ this.logger = logger;
1126
+ this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
1127
+ }
1128
+ supportsDeclaration(functionName) {
1129
+ return this.linkers.has(functionName);
1130
+ }
1131
+ getLinker(functionName, minVersion, version) {
1132
+ if (!this.linkers.has(functionName)) {
1133
+ throw new Error(`Unknown partial declaration function ${functionName}.`);
1134
+ }
1135
+ const linkerRanges = this.linkers.get(functionName);
1136
+ if (version === "13.0.0-next.10") {
1137
+ return linkerRanges[linkerRanges.length - 1].linker;
1138
+ }
1139
+ const declarationRange = getRange(">=", minVersion);
1140
+ for (const { range: linkerRange, linker } of linkerRanges) {
1141
+ if (semver.intersects(declarationRange, linkerRange)) {
1142
+ return linker;
1143
+ }
1144
+ }
1145
+ const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
1146
+ Consider upgrading your application to use a more recent version of Angular.`;
1147
+ if (this.unknownDeclarationVersionHandling === "error") {
1148
+ throw new Error(message);
1149
+ } else if (this.unknownDeclarationVersionHandling === "warn") {
1150
+ this.logger.warn(`${message}
1151
+ Attempting to continue using this version of Angular.`);
1152
+ }
1153
+ return linkerRanges[linkerRanges.length - 1].linker;
1154
+ }
1155
+ };
1156
+ function getRange(comparator, versionStr) {
1157
+ const version = new semver.SemVer(versionStr);
1158
+ version.prerelease = [];
1159
+ return new semver.Range(`${comparator}${version.format()}`);
1160
+ }
1161
+
1162
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
1163
+ var FileLinker = class {
1164
+ constructor(linkerEnvironment, sourceUrl, code) {
1165
+ this.linkerEnvironment = linkerEnvironment;
1166
+ this.emitScopes = new Map();
1167
+ this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
1168
+ }
1169
+ isPartialDeclaration(calleeName) {
1170
+ return this.linkerSelector.supportsDeclaration(calleeName);
1171
+ }
1172
+ linkPartialDeclaration(declarationFn, args, declarationScope) {
1173
+ if (args.length !== 1) {
1174
+ throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
1175
+ }
1176
+ const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
1177
+ const ngImport = metaObj.getNode("ngImport");
1178
+ const emitScope = this.getEmitScope(ngImport, declarationScope);
1179
+ const minVersion = metaObj.getString("minVersion");
1180
+ const version = metaObj.getString("version");
1181
+ const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
1182
+ const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
1183
+ return emitScope.translateDefinition(definition);
1184
+ }
1185
+ getConstantStatements() {
1186
+ const results = [];
1187
+ for (const [constantScope, emitScope] of this.emitScopes.entries()) {
1188
+ const statements = emitScope.getConstantStatements();
1189
+ results.push({ constantScope, statements });
1190
+ }
1191
+ return results;
1192
+ }
1193
+ getEmitScope(ngImport, declarationScope) {
1194
+ const constantScope = declarationScope.getConstantScopeRef(ngImport);
1195
+ if (constantScope === null) {
1196
+ return new IifeEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
1197
+ }
1198
+ if (!this.emitScopes.has(constantScope)) {
1199
+ this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
1200
+ }
1201
+ return this.emitScopes.get(constantScope);
1202
+ }
1203
+ };
1204
+
1205
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.mjs
1206
+ var ContentOrigin;
1207
+ (function(ContentOrigin2) {
1208
+ ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
1209
+ ContentOrigin2[ContentOrigin2["Inline"] = 1] = "Inline";
1210
+ ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
1211
+ })(ContentOrigin || (ContentOrigin = {}));
1212
+
1213
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
1214
+ import mapHelpers from "convert-source-map";
1215
+ import { decode, encode } from "sourcemap-codec";
1216
+
1217
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.mjs
1218
+ function compareSegments(a, b) {
1219
+ return a.position - b.position;
1220
+ }
1221
+ function offsetSegment(startOfLinePositions, marker, offset) {
1222
+ if (offset === 0) {
1223
+ return marker;
1224
+ }
1225
+ let line = marker.line;
1226
+ const position = marker.position + offset;
1227
+ while (line < startOfLinePositions.length - 1 && startOfLinePositions[line + 1] <= position) {
1228
+ line++;
1229
+ }
1230
+ while (line > 0 && startOfLinePositions[line] > position) {
1231
+ line--;
1232
+ }
1233
+ const column = position - startOfLinePositions[line];
1234
+ return { line, column, position, next: void 0 };
1235
+ }
1236
+
1237
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
1238
+ function removeSourceMapComments(contents) {
1239
+ return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
1240
+ }
1241
+ var SourceFile = class {
1242
+ constructor(sourcePath, contents, rawMap, sources, fs3) {
1243
+ this.sourcePath = sourcePath;
1244
+ this.contents = contents;
1245
+ this.rawMap = rawMap;
1246
+ this.sources = sources;
1247
+ this.fs = fs3;
1248
+ this.contents = removeSourceMapComments(contents);
1249
+ this.startOfLinePositions = computeStartOfLinePositions(this.contents);
1250
+ this.flattenedMappings = this.flattenMappings();
1251
+ }
1252
+ renderFlattenedSourceMap() {
1253
+ const sources = new IndexedMap();
1254
+ const names = new IndexedSet();
1255
+ const mappings = [];
1256
+ const sourcePathDir = this.fs.dirname(this.sourcePath);
1257
+ const relativeSourcePathCache = new Cache((input) => this.fs.relative(sourcePathDir, input));
1258
+ for (const mapping of this.flattenedMappings) {
1259
+ const sourceIndex = sources.set(relativeSourcePathCache.get(mapping.originalSource.sourcePath), mapping.originalSource.contents);
1260
+ const mappingArray = [
1261
+ mapping.generatedSegment.column,
1262
+ sourceIndex,
1263
+ mapping.originalSegment.line,
1264
+ mapping.originalSegment.column
1265
+ ];
1266
+ if (mapping.name !== void 0) {
1267
+ const nameIndex = names.add(mapping.name);
1268
+ mappingArray.push(nameIndex);
1269
+ }
1270
+ const line = mapping.generatedSegment.line;
1271
+ while (line >= mappings.length) {
1272
+ mappings.push([]);
1273
+ }
1274
+ mappings[line].push(mappingArray);
1275
+ }
1276
+ const sourceMap = {
1277
+ version: 3,
1278
+ file: this.fs.relative(sourcePathDir, this.sourcePath),
1279
+ sources: sources.keys,
1280
+ names: names.values,
1281
+ mappings: encode(mappings),
1282
+ sourcesContent: sources.values
1283
+ };
1284
+ return sourceMap;
1285
+ }
1286
+ getOriginalLocation(line, column) {
1287
+ if (this.flattenedMappings.length === 0) {
1288
+ return null;
1289
+ }
1290
+ let position;
1291
+ if (line < this.startOfLinePositions.length) {
1292
+ position = this.startOfLinePositions[line] + column;
1293
+ } else {
1294
+ position = this.contents.length;
1295
+ }
1296
+ const locationSegment = { line, column, position, next: void 0 };
1297
+ let mappingIndex = findLastMappingIndexBefore(this.flattenedMappings, locationSegment, false, 0);
1298
+ if (mappingIndex < 0) {
1299
+ mappingIndex = 0;
1300
+ }
1301
+ const { originalSegment, originalSource, generatedSegment } = this.flattenedMappings[mappingIndex];
1302
+ const offset = locationSegment.position - generatedSegment.position;
1303
+ const offsetOriginalSegment = offsetSegment(originalSource.startOfLinePositions, originalSegment, offset);
1304
+ return {
1305
+ file: originalSource.sourcePath,
1306
+ line: offsetOriginalSegment.line,
1307
+ column: offsetOriginalSegment.column
1308
+ };
1309
+ }
1310
+ flattenMappings() {
1311
+ const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
1312
+ ensureOriginalSegmentLinks(mappings);
1313
+ const flattenedMappings = [];
1314
+ for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex++) {
1315
+ const aToBmapping = mappings[mappingIndex];
1316
+ const bSource = aToBmapping.originalSource;
1317
+ if (bSource.flattenedMappings.length === 0) {
1318
+ flattenedMappings.push(aToBmapping);
1319
+ continue;
1320
+ }
1321
+ const incomingStart = aToBmapping.originalSegment;
1322
+ const incomingEnd = incomingStart.next;
1323
+ let outgoingStartIndex = findLastMappingIndexBefore(bSource.flattenedMappings, incomingStart, false, 0);
1324
+ if (outgoingStartIndex < 0) {
1325
+ outgoingStartIndex = 0;
1326
+ }
1327
+ const outgoingEndIndex = incomingEnd !== void 0 ? findLastMappingIndexBefore(bSource.flattenedMappings, incomingEnd, true, outgoingStartIndex) : bSource.flattenedMappings.length - 1;
1328
+ for (let bToCmappingIndex = outgoingStartIndex; bToCmappingIndex <= outgoingEndIndex; bToCmappingIndex++) {
1329
+ const bToCmapping = bSource.flattenedMappings[bToCmappingIndex];
1330
+ flattenedMappings.push(mergeMappings(this, aToBmapping, bToCmapping));
1331
+ }
1332
+ }
1333
+ return flattenedMappings;
1334
+ }
1335
+ };
1336
+ function findLastMappingIndexBefore(mappings, marker, exclusive, lowerIndex) {
1337
+ let upperIndex = mappings.length - 1;
1338
+ const test = exclusive ? -1 : 0;
1339
+ if (compareSegments(mappings[lowerIndex].generatedSegment, marker) > test) {
1340
+ return -1;
1341
+ }
1342
+ let matchingIndex = -1;
1343
+ while (lowerIndex <= upperIndex) {
1344
+ const index = upperIndex + lowerIndex >> 1;
1345
+ if (compareSegments(mappings[index].generatedSegment, marker) <= test) {
1346
+ matchingIndex = index;
1347
+ lowerIndex = index + 1;
1348
+ } else {
1349
+ upperIndex = index - 1;
1350
+ }
1351
+ }
1352
+ return matchingIndex;
1353
+ }
1354
+ function mergeMappings(generatedSource, ab, bc) {
1355
+ const name = bc.name || ab.name;
1356
+ const diff = compareSegments(bc.generatedSegment, ab.originalSegment);
1357
+ if (diff > 0) {
1358
+ return {
1359
+ name,
1360
+ generatedSegment: offsetSegment(generatedSource.startOfLinePositions, ab.generatedSegment, diff),
1361
+ originalSource: bc.originalSource,
1362
+ originalSegment: bc.originalSegment
1363
+ };
1364
+ } else {
1365
+ return {
1366
+ name,
1367
+ generatedSegment: ab.generatedSegment,
1368
+ originalSource: bc.originalSource,
1369
+ originalSegment: offsetSegment(bc.originalSource.startOfLinePositions, bc.originalSegment, -diff)
1370
+ };
1371
+ }
1372
+ }
1373
+ function parseMappings(rawMap, sources, generatedSourceStartOfLinePositions) {
1374
+ if (rawMap === null) {
1375
+ return [];
1376
+ }
1377
+ const rawMappings = decode(rawMap.mappings);
1378
+ if (rawMappings === null) {
1379
+ return [];
1380
+ }
1381
+ const mappings = [];
1382
+ for (let generatedLine = 0; generatedLine < rawMappings.length; generatedLine++) {
1383
+ const generatedLineMappings = rawMappings[generatedLine];
1384
+ for (const rawMapping of generatedLineMappings) {
1385
+ if (rawMapping.length >= 4) {
1386
+ const originalSource = sources[rawMapping[1]];
1387
+ if (originalSource === null || originalSource === void 0) {
1388
+ continue;
1389
+ }
1390
+ const generatedColumn = rawMapping[0];
1391
+ const name = rawMapping.length === 5 ? rawMap.names[rawMapping[4]] : void 0;
1392
+ const line = rawMapping[2];
1393
+ const column = rawMapping[3];
1394
+ const generatedSegment = {
1395
+ line: generatedLine,
1396
+ column: generatedColumn,
1397
+ position: generatedSourceStartOfLinePositions[generatedLine] + generatedColumn,
1398
+ next: void 0
1399
+ };
1400
+ const originalSegment = {
1401
+ line,
1402
+ column,
1403
+ position: originalSource.startOfLinePositions[line] + column,
1404
+ next: void 0
1405
+ };
1406
+ mappings.push({ name, generatedSegment, originalSegment, originalSource });
1407
+ }
1408
+ }
1409
+ }
1410
+ return mappings;
1411
+ }
1412
+ function extractOriginalSegments(mappings) {
1413
+ const originalSegments = new Map();
1414
+ for (const mapping of mappings) {
1415
+ const originalSource = mapping.originalSource;
1416
+ if (!originalSegments.has(originalSource)) {
1417
+ originalSegments.set(originalSource, []);
1418
+ }
1419
+ const segments = originalSegments.get(originalSource);
1420
+ segments.push(mapping.originalSegment);
1421
+ }
1422
+ originalSegments.forEach((segmentMarkers) => segmentMarkers.sort(compareSegments));
1423
+ return originalSegments;
1424
+ }
1425
+ function ensureOriginalSegmentLinks(mappings) {
1426
+ const segmentsBySource = extractOriginalSegments(mappings);
1427
+ segmentsBySource.forEach((markers) => {
1428
+ for (let i = 0; i < markers.length - 1; i++) {
1429
+ markers[i].next = markers[i + 1];
1430
+ }
1431
+ });
1432
+ }
1433
+ function computeStartOfLinePositions(str) {
1434
+ const NEWLINE_MARKER_OFFSET = 1;
1435
+ const lineLengths = computeLineLengths(str);
1436
+ const startPositions = [0];
1437
+ for (let i = 0; i < lineLengths.length - 1; i++) {
1438
+ startPositions.push(startPositions[i] + lineLengths[i] + NEWLINE_MARKER_OFFSET);
1439
+ }
1440
+ return startPositions;
1441
+ }
1442
+ function computeLineLengths(str) {
1443
+ return str.split(/\n/).map((s) => s.length);
1444
+ }
1445
+ var IndexedMap = class {
1446
+ constructor() {
1447
+ this.map = new Map();
1448
+ this.keys = [];
1449
+ this.values = [];
1450
+ }
1451
+ set(key, value) {
1452
+ if (this.map.has(key)) {
1453
+ return this.map.get(key);
1454
+ }
1455
+ const index = this.values.push(value) - 1;
1456
+ this.keys.push(key);
1457
+ this.map.set(key, index);
1458
+ return index;
1459
+ }
1460
+ };
1461
+ var IndexedSet = class {
1462
+ constructor() {
1463
+ this.map = new Map();
1464
+ this.values = [];
1465
+ }
1466
+ add(value) {
1467
+ if (this.map.has(value)) {
1468
+ return this.map.get(value);
1469
+ }
1470
+ const index = this.values.push(value) - 1;
1471
+ this.map.set(value, index);
1472
+ return index;
1473
+ }
1474
+ };
1475
+ var Cache = class {
1476
+ constructor(computeFn) {
1477
+ this.computeFn = computeFn;
1478
+ this.map = new Map();
1479
+ }
1480
+ get(input) {
1481
+ if (!this.map.has(input)) {
1482
+ this.map.set(input, this.computeFn(input));
1483
+ }
1484
+ return this.map.get(input);
1485
+ }
1486
+ };
1487
+
1488
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
1489
+ import mapHelpers2 from "convert-source-map";
1490
+ var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
1491
+ var SourceFileLoader = class {
1492
+ constructor(fs3, logger, schemeMap) {
1493
+ this.fs = fs3;
1494
+ this.logger = logger;
1495
+ this.schemeMap = schemeMap;
1496
+ this.currentPaths = [];
1497
+ }
1498
+ loadSourceFile(sourcePath, contents = null, mapAndPath = null) {
1499
+ const contentsOrigin = contents !== null ? ContentOrigin.Provided : ContentOrigin.FileSystem;
1500
+ const sourceMapInfo = mapAndPath && __spreadValues({ origin: ContentOrigin.Provided }, mapAndPath);
1501
+ return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
1502
+ }
1503
+ loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
1504
+ const previousPaths = this.currentPaths.slice();
1505
+ try {
1506
+ if (contents === null) {
1507
+ if (!this.fs.exists(sourcePath)) {
1508
+ return null;
1509
+ }
1510
+ contents = this.readSourceFile(sourcePath);
1511
+ }
1512
+ if (sourceMapInfo === null) {
1513
+ sourceMapInfo = this.loadSourceMap(sourcePath, contents, sourceOrigin);
1514
+ }
1515
+ let sources = [];
1516
+ if (sourceMapInfo !== null) {
1517
+ const basePath = sourceMapInfo.mapPath || sourcePath;
1518
+ sources = this.processSources(basePath, sourceMapInfo);
1519
+ }
1520
+ return new SourceFile(sourcePath, contents, sourceMapInfo, sources, this.fs);
1521
+ } catch (e) {
1522
+ this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1523
+ return null;
1524
+ } finally {
1525
+ this.currentPaths = previousPaths;
1526
+ }
1527
+ }
1528
+ loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
1529
+ const lastLine = this.getLastNonEmptyLine(sourceContents);
1530
+ const inline = mapHelpers2.commentRegex.exec(lastLine);
1531
+ if (inline !== null) {
1532
+ return {
1533
+ map: mapHelpers2.fromComment(inline.pop()).sourcemap,
1534
+ mapPath: null,
1535
+ origin: ContentOrigin.Inline
1536
+ };
1537
+ }
1538
+ if (sourceOrigin === ContentOrigin.Inline) {
1539
+ return null;
1540
+ }
1541
+ const external = mapHelpers2.mapFileCommentRegex.exec(lastLine);
1542
+ if (external) {
1543
+ try {
1544
+ const fileName = external[1] || external[2];
1545
+ const externalMapPath = this.fs.resolve(this.fs.dirname(sourcePath), fileName);
1546
+ return {
1547
+ map: this.readRawSourceMap(externalMapPath),
1548
+ mapPath: externalMapPath,
1549
+ origin: ContentOrigin.FileSystem
1550
+ };
1551
+ } catch (e) {
1552
+ this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1553
+ return null;
1554
+ }
1555
+ }
1556
+ const impliedMapPath = this.fs.resolve(sourcePath + ".map");
1557
+ if (this.fs.exists(impliedMapPath)) {
1558
+ return {
1559
+ map: this.readRawSourceMap(impliedMapPath),
1560
+ mapPath: impliedMapPath,
1561
+ origin: ContentOrigin.FileSystem
1562
+ };
1563
+ }
1564
+ return null;
1565
+ }
1566
+ processSources(basePath, { map, origin: sourceMapOrigin }) {
1567
+ const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
1568
+ return map.sources.map((source, index) => {
1569
+ const path = this.fs.resolve(sourceRoot, this.replaceSchemeWithPath(source));
1570
+ const content = map.sourcesContent && map.sourcesContent[index] || null;
1571
+ const sourceOrigin = content !== null && sourceMapOrigin !== ContentOrigin.Provided ? ContentOrigin.Inline : ContentOrigin.FileSystem;
1572
+ return this.loadSourceFileInternal(path, content, sourceOrigin, null);
1573
+ });
1574
+ }
1575
+ readSourceFile(sourcePath) {
1576
+ this.trackPath(sourcePath);
1577
+ return this.fs.readFile(sourcePath);
1578
+ }
1579
+ readRawSourceMap(mapPath) {
1580
+ this.trackPath(mapPath);
1581
+ return JSON.parse(this.fs.readFile(mapPath));
1582
+ }
1583
+ trackPath(path) {
1584
+ if (this.currentPaths.includes(path)) {
1585
+ throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
1586
+ }
1587
+ this.currentPaths.push(path);
1588
+ }
1589
+ getLastNonEmptyLine(contents) {
1590
+ let trailingWhitespaceIndex = contents.length - 1;
1591
+ while (trailingWhitespaceIndex > 0 && (contents[trailingWhitespaceIndex] === "\n" || contents[trailingWhitespaceIndex] === "\r")) {
1592
+ trailingWhitespaceIndex--;
1593
+ }
1594
+ let lastRealLineIndex = contents.lastIndexOf("\n", trailingWhitespaceIndex - 1);
1595
+ if (lastRealLineIndex === -1) {
1596
+ lastRealLineIndex = 0;
1597
+ }
1598
+ return contents.substr(lastRealLineIndex + 1);
1599
+ }
1600
+ replaceSchemeWithPath(path) {
1601
+ return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
1602
+ }
1603
+ };
1604
+
1605
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
1606
+ var DEFAULT_LINKER_OPTIONS = {
1607
+ sourceMapping: true,
1608
+ linkerJitMode: false,
1609
+ unknownDeclarationVersionHandling: "error"
1610
+ };
1611
+
1612
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
1613
+ var Context = class {
1614
+ constructor(isStatement) {
1615
+ this.isStatement = isStatement;
1616
+ }
1617
+ get withExpressionMode() {
1618
+ return this.isStatement ? new Context(false) : this;
1619
+ }
1620
+ get withStatementMode() {
1621
+ return !this.isStatement ? new Context(true) : this;
1622
+ }
1623
+ };
1624
+
1625
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
1626
+ import ts6 from "typescript";
1627
+
1628
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
1629
+ import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
1630
+
1631
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1632
+ import { ExternalExpr, ExternalReference, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
1633
+ import ts4 from "typescript";
1634
+
1635
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
1636
+ import ts2 from "typescript";
1637
+
1638
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
1639
+ import ts3 from "typescript";
1640
+
1641
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1642
+ var ImportFlags;
1643
+ (function(ImportFlags2) {
1644
+ ImportFlags2[ImportFlags2["None"] = 0] = "None";
1645
+ ImportFlags2[ImportFlags2["ForceNewImport"] = 1] = "ForceNewImport";
1646
+ ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
1647
+ ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
1648
+ })(ImportFlags || (ImportFlags = {}));
1649
+
1650
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
1651
+ var CORE_SUPPORTED_SYMBOLS = new Map([
1652
+ ["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
1653
+ ["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
1654
+ ["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
1655
+ ["\u0275\u0275setNgModuleScope", "\u0275\u0275setNgModuleScope"],
1656
+ ["\u0275\u0275inject", "\u0275\u0275inject"],
1657
+ ["\u0275\u0275FactoryDeclaration", "\u0275\u0275FactoryDeclaration"],
1658
+ ["\u0275setClassMetadata", "setClassMetadata"],
1659
+ ["\u0275\u0275InjectableDeclaration", "\u0275\u0275InjectableDeclaration"],
1660
+ ["\u0275\u0275InjectorDeclaration", "\u0275\u0275InjectorDeclaration"],
1661
+ ["\u0275\u0275NgModuleDeclaration", "\u0275\u0275NgModuleDeclaration"],
1662
+ ["\u0275NgModuleFactory", "NgModuleFactory"],
1663
+ ["\u0275noSideEffects", "\u0275noSideEffects"]
1664
+ ]);
1665
+
1666
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
1667
+ import ts5 from "typescript";
1668
+ var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
1669
+
1670
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
1671
+ import {
1672
+ BinaryOperator,
1673
+ ConditionalExpr,
1674
+ StmtModifier,
1675
+ UnaryOperator
1676
+ } from "@angular/compiler";
1677
+ var UNARY_OPERATORS = new Map([
1678
+ [UnaryOperator.Minus, "-"],
1679
+ [UnaryOperator.Plus, "+"]
1680
+ ]);
1681
+ var BINARY_OPERATORS = new Map([
1682
+ [BinaryOperator.And, "&&"],
1683
+ [BinaryOperator.Bigger, ">"],
1684
+ [BinaryOperator.BiggerEquals, ">="],
1685
+ [BinaryOperator.BitwiseAnd, "&"],
1686
+ [BinaryOperator.Divide, "/"],
1687
+ [BinaryOperator.Equals, "=="],
1688
+ [BinaryOperator.Identical, "==="],
1689
+ [BinaryOperator.Lower, "<"],
1690
+ [BinaryOperator.LowerEquals, "<="],
1691
+ [BinaryOperator.Minus, "-"],
1692
+ [BinaryOperator.Modulo, "%"],
1693
+ [BinaryOperator.Multiply, "*"],
1694
+ [BinaryOperator.NotEquals, "!="],
1695
+ [BinaryOperator.NotIdentical, "!=="],
1696
+ [BinaryOperator.Or, "||"],
1697
+ [BinaryOperator.Plus, "+"],
1698
+ [BinaryOperator.NullishCoalesce, "??"]
1699
+ ]);
1700
+ var ExpressionTranslatorVisitor = class {
1701
+ constructor(factory, imports, options) {
1702
+ this.factory = factory;
1703
+ this.imports = imports;
1704
+ this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
1705
+ this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
1706
+ this.recordWrappedNode = options.recordWrappedNode || (() => {
1707
+ });
1708
+ }
1709
+ visitDeclareVarStmt(stmt, context) {
1710
+ var _a2;
1711
+ const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(StmtModifier.Final) ? "const" : "let";
1712
+ return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a2 = stmt.value) == null ? void 0 : _a2.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
1713
+ }
1714
+ visitDeclareFunctionStmt(stmt, context) {
1715
+ 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);
1716
+ }
1717
+ visitExpressionStmt(stmt, context) {
1718
+ return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
1719
+ }
1720
+ visitReturnStmt(stmt, context) {
1721
+ return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1722
+ }
1723
+ visitDeclareClassStmt(_stmt, _context) {
1724
+ throw new Error("Method not implemented.");
1725
+ }
1726
+ visitIfStmt(stmt, context) {
1727
+ 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);
1728
+ }
1729
+ visitTryCatchStmt(_stmt, _context) {
1730
+ throw new Error("Method not implemented.");
1731
+ }
1732
+ visitThrowStmt(stmt, context) {
1733
+ return this.attachComments(this.factory.createThrowStatement(stmt.error.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1734
+ }
1735
+ visitReadVarExpr(ast, _context) {
1736
+ const identifier = this.factory.createIdentifier(ast.name);
1737
+ this.setSourceMapRange(identifier, ast.sourceSpan);
1738
+ return identifier;
1739
+ }
1740
+ visitWriteVarExpr(expr, context) {
1741
+ const assignment = this.factory.createAssignment(this.setSourceMapRange(this.factory.createIdentifier(expr.name), expr.sourceSpan), expr.value.visitExpression(this, context));
1742
+ return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1743
+ }
1744
+ visitWriteKeyExpr(expr, context) {
1745
+ const exprContext = context.withExpressionMode;
1746
+ const target = this.factory.createElementAccess(expr.receiver.visitExpression(this, exprContext), expr.index.visitExpression(this, exprContext));
1747
+ const assignment = this.factory.createAssignment(target, expr.value.visitExpression(this, exprContext));
1748
+ return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1749
+ }
1750
+ visitWritePropExpr(expr, context) {
1751
+ const target = this.factory.createPropertyAccess(expr.receiver.visitExpression(this, context), expr.name);
1752
+ return this.factory.createAssignment(target, expr.value.visitExpression(this, context));
1753
+ }
1754
+ visitInvokeFunctionExpr(ast, context) {
1755
+ return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
1756
+ }
1757
+ visitTaggedTemplateExpr(ast, context) {
1758
+ return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), {
1759
+ elements: ast.template.elements.map((e) => {
1760
+ var _a2;
1761
+ return createTemplateElement({
1762
+ cooked: e.text,
1763
+ raw: e.rawText,
1764
+ range: (_a2 = e.sourceSpan) != null ? _a2 : ast.sourceSpan
1765
+ });
1766
+ }),
1767
+ expressions: ast.template.expressions.map((e) => e.visitExpression(this, context))
1768
+ }), ast.sourceSpan);
1769
+ }
1770
+ visitInstantiateExpr(ast, context) {
1771
+ return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
1772
+ }
1773
+ visitLiteralExpr(ast, _context) {
1774
+ return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
1775
+ }
1776
+ visitLocalizedString(ast, context) {
1777
+ const elements = [createTemplateElement(ast.serializeI18nHead())];
1778
+ const expressions = [];
1779
+ for (let i = 0; i < ast.expressions.length; i++) {
1780
+ const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
1781
+ expressions.push(placeholder);
1782
+ elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
1783
+ }
1784
+ const localizeTag = this.factory.createIdentifier("$localize");
1785
+ return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
1786
+ }
1787
+ createTaggedTemplateExpression(tag, template) {
1788
+ return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
1789
+ }
1790
+ createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
1791
+ const { moduleImport, symbol } = this.imports.generateNamedImport("tslib", "__makeTemplateObject");
1792
+ const __makeTemplateObjectHelper = moduleImport === null ? this.factory.createIdentifier(symbol) : this.factory.createPropertyAccess(moduleImport, symbol);
1793
+ const cooked = [];
1794
+ const raw = [];
1795
+ for (const element of elements) {
1796
+ cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
1797
+ raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
1798
+ }
1799
+ const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)], false);
1800
+ return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
1801
+ }
1802
+ visitExternalExpr(ast, _context) {
1803
+ if (ast.value.name === null) {
1804
+ if (ast.value.moduleName === null) {
1805
+ throw new Error("Invalid import without name nor moduleName");
1806
+ }
1807
+ return this.imports.generateNamespaceImport(ast.value.moduleName);
1808
+ }
1809
+ if (ast.value.moduleName !== null) {
1810
+ const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
1811
+ if (moduleImport === null) {
1812
+ return this.factory.createIdentifier(symbol);
1813
+ } else {
1814
+ return this.factory.createPropertyAccess(moduleImport, symbol);
1815
+ }
1816
+ } else {
1817
+ return this.factory.createIdentifier(ast.value.name);
1818
+ }
1819
+ }
1820
+ visitConditionalExpr(ast, context) {
1821
+ let cond = ast.condition.visitExpression(this, context);
1822
+ if (ast.condition instanceof ConditionalExpr) {
1823
+ cond = this.factory.createParenthesizedExpression(cond);
1824
+ }
1825
+ return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
1826
+ }
1827
+ visitNotExpr(ast, context) {
1828
+ return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
1829
+ }
1830
+ visitAssertNotNullExpr(ast, context) {
1831
+ return ast.condition.visitExpression(this, context);
1832
+ }
1833
+ visitCastExpr(ast, context) {
1834
+ return ast.value.visitExpression(this, context);
1835
+ }
1836
+ visitFunctionExpr(ast, context) {
1837
+ var _a2;
1838
+ return this.factory.createFunctionExpression((_a2 = ast.name) != null ? _a2 : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
1839
+ }
1840
+ visitBinaryOperatorExpr(ast, context) {
1841
+ if (!BINARY_OPERATORS.has(ast.operator)) {
1842
+ throw new Error(`Unknown binary operator: ${BinaryOperator[ast.operator]}`);
1843
+ }
1844
+ return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
1845
+ }
1846
+ visitReadPropExpr(ast, context) {
1847
+ return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
1848
+ }
1849
+ visitReadKeyExpr(ast, context) {
1850
+ return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
1851
+ }
1852
+ visitLiteralArrayExpr(ast, context) {
1853
+ return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
1854
+ }
1855
+ visitLiteralMapExpr(ast, context) {
1856
+ const properties = ast.entries.map((entry) => {
1857
+ return {
1858
+ propertyName: entry.key,
1859
+ quoted: entry.quoted,
1860
+ value: entry.value.visitExpression(this, context)
1861
+ };
1862
+ });
1863
+ return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
1864
+ }
1865
+ visitCommaExpr(ast, context) {
1866
+ throw new Error("Method not implemented.");
1867
+ }
1868
+ visitWrappedNodeExpr(ast, _context) {
1869
+ this.recordWrappedNode(ast);
1870
+ return ast.node;
1871
+ }
1872
+ visitTypeofExpr(ast, context) {
1873
+ return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
1874
+ }
1875
+ visitUnaryOperatorExpr(ast, context) {
1876
+ if (!UNARY_OPERATORS.has(ast.operator)) {
1877
+ throw new Error(`Unknown unary operator: ${UnaryOperator[ast.operator]}`);
1878
+ }
1879
+ return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
1880
+ }
1881
+ visitStatements(statements, context) {
1882
+ return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== void 0);
1883
+ }
1884
+ setSourceMapRange(ast, span) {
1885
+ return this.factory.setSourceMapRange(ast, createRange(span));
1886
+ }
1887
+ attachComments(statement, leadingComments) {
1888
+ if (leadingComments !== void 0) {
1889
+ this.factory.attachComments(statement, leadingComments);
1890
+ }
1891
+ return statement;
1892
+ }
1893
+ };
1894
+ function createTemplateElement({ cooked, raw, range }) {
1895
+ return { cooked, raw, range: createRange(range) };
1896
+ }
1897
+ function createRange(span) {
1898
+ if (span === null) {
1899
+ return null;
1900
+ }
1901
+ const { start, end } = span;
1902
+ const { url, content } = start.file;
1903
+ if (!url) {
1904
+ return null;
1905
+ }
1906
+ return {
1907
+ url,
1908
+ content,
1909
+ start: { offset: start.offset, line: start.line, column: start.col },
1910
+ end: { offset: end.offset, line: end.line, column: end.col }
1911
+ };
1912
+ }
1913
+
1914
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
1915
+ import {
1916
+ BuiltinTypeName
1917
+ } from "@angular/compiler";
1918
+ import ts7 from "typescript";
1919
+
1920
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
1921
+ import ts8 from "typescript";
1922
+ var PureAnnotation;
1923
+ (function(PureAnnotation2) {
1924
+ PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
1925
+ PureAnnotation2["TERSER"] = "@__PURE__";
1926
+ })(PureAnnotation || (PureAnnotation = {}));
1927
+ var UNARY_OPERATORS2 = {
1928
+ "+": ts8.SyntaxKind.PlusToken,
1929
+ "-": ts8.SyntaxKind.MinusToken,
1930
+ "!": ts8.SyntaxKind.ExclamationToken
1931
+ };
1932
+ var BINARY_OPERATORS2 = {
1933
+ "&&": ts8.SyntaxKind.AmpersandAmpersandToken,
1934
+ ">": ts8.SyntaxKind.GreaterThanToken,
1935
+ ">=": ts8.SyntaxKind.GreaterThanEqualsToken,
1936
+ "&": ts8.SyntaxKind.AmpersandToken,
1937
+ "/": ts8.SyntaxKind.SlashToken,
1938
+ "==": ts8.SyntaxKind.EqualsEqualsToken,
1939
+ "===": ts8.SyntaxKind.EqualsEqualsEqualsToken,
1940
+ "<": ts8.SyntaxKind.LessThanToken,
1941
+ "<=": ts8.SyntaxKind.LessThanEqualsToken,
1942
+ "-": ts8.SyntaxKind.MinusToken,
1943
+ "%": ts8.SyntaxKind.PercentToken,
1944
+ "*": ts8.SyntaxKind.AsteriskToken,
1945
+ "!=": ts8.SyntaxKind.ExclamationEqualsToken,
1946
+ "!==": ts8.SyntaxKind.ExclamationEqualsEqualsToken,
1947
+ "||": ts8.SyntaxKind.BarBarToken,
1948
+ "+": ts8.SyntaxKind.PlusToken,
1949
+ "??": ts8.SyntaxKind.QuestionQuestionToken
1950
+ };
1951
+ var VAR_TYPES = {
1952
+ "const": ts8.NodeFlags.Const,
1953
+ "let": ts8.NodeFlags.Let,
1954
+ "var": ts8.NodeFlags.None
1955
+ };
1956
+
1957
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
1958
+ var Translator = class {
1959
+ constructor(factory) {
1960
+ this.factory = factory;
1961
+ }
1962
+ translateExpression(expression, imports, options = {}) {
1963
+ return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
1964
+ }
1965
+ translateStatement(statement, imports, options = {}) {
1966
+ return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
1967
+ }
1968
+ };
1969
+
1970
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
1971
+ var LinkerEnvironment = class {
1972
+ constructor(fileSystem, logger, host, factory, options) {
1973
+ this.fileSystem = fileSystem;
1974
+ this.logger = logger;
1975
+ this.host = host;
1976
+ this.factory = factory;
1977
+ this.options = options;
1978
+ this.translator = new Translator(this.factory);
1979
+ this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
1980
+ }
1981
+ static create(fileSystem, logger, host, factory, options) {
1982
+ var _a2, _b, _c;
1983
+ return new LinkerEnvironment(fileSystem, logger, host, factory, {
1984
+ sourceMapping: (_a2 = options.sourceMapping) != null ? _a2 : DEFAULT_LINKER_OPTIONS.sourceMapping,
1985
+ linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
1986
+ unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
1987
+ });
1988
+ }
1989
+ };
1990
+
1991
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_core.mjs
1992
+ import * as _babelNamespace from "@babel/core";
1993
+ import _babelDefault from "@babel/core";
1994
+ var _a;
1995
+ var babel = (_a = _babelDefault) != null ? _a : _babelNamespace;
1996
+ var _typesNamespace = _babelNamespace.types;
1997
+ if (_babelDefault !== void 0) {
1998
+ _typesNamespace = _babelDefault.types;
1999
+ }
2000
+ var types = _typesNamespace;
2001
+ var NodePath = babel.NodePath;
2002
+ var transformSync = babel.transformSync;
2003
+ var parse = babel.parse;
2004
+
2005
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/ast/babel_ast_factory.mjs
2006
+ var BabelAstFactory = class {
2007
+ constructor(sourceUrl) {
2008
+ this.sourceUrl = sourceUrl;
2009
+ this.createArrayLiteral = types.arrayExpression;
2010
+ this.createBlock = types.blockStatement;
2011
+ this.createConditional = types.conditionalExpression;
2012
+ this.createExpressionStatement = types.expressionStatement;
2013
+ this.createIdentifier = types.identifier;
2014
+ this.createIfStatement = types.ifStatement;
2015
+ this.createNewExpression = types.newExpression;
2016
+ this.createParenthesizedExpression = types.parenthesizedExpression;
2017
+ this.createReturnStatement = types.returnStatement;
2018
+ this.createThrowStatement = types.throwStatement;
2019
+ this.createUnaryExpression = types.unaryExpression;
2020
+ }
2021
+ attachComments(statement, leadingComments) {
2022
+ for (let i = leadingComments.length - 1; i >= 0; i--) {
2023
+ const comment = leadingComments[i];
2024
+ types.addComment(statement, "leading", comment.toString(), !comment.multiline);
2025
+ }
2026
+ }
2027
+ createAssignment(target, value) {
2028
+ assert(target, isLExpression, "must be a left hand side expression");
2029
+ return types.assignmentExpression("=", target, value);
2030
+ }
2031
+ createBinaryExpression(leftOperand, operator, rightOperand) {
2032
+ switch (operator) {
2033
+ case "&&":
2034
+ case "||":
2035
+ case "??":
2036
+ return types.logicalExpression(operator, leftOperand, rightOperand);
2037
+ default:
2038
+ return types.binaryExpression(operator, leftOperand, rightOperand);
2039
+ }
2040
+ }
2041
+ createCallExpression(callee, args, pure) {
2042
+ const call = types.callExpression(callee, args);
2043
+ if (pure) {
2044
+ types.addComment(call, "leading", " @__PURE__ ", false);
2045
+ }
2046
+ return call;
2047
+ }
2048
+ createElementAccess(expression, element) {
2049
+ return types.memberExpression(expression, element, true);
2050
+ }
2051
+ createFunctionDeclaration(functionName, parameters, body) {
2052
+ assert(body, types.isBlockStatement, "a block");
2053
+ return types.functionDeclaration(types.identifier(functionName), parameters.map((param) => types.identifier(param)), body);
2054
+ }
2055
+ createFunctionExpression(functionName, parameters, body) {
2056
+ assert(body, types.isBlockStatement, "a block");
2057
+ const name = functionName !== null ? types.identifier(functionName) : null;
2058
+ return types.functionExpression(name, parameters.map((param) => types.identifier(param)), body);
2059
+ }
2060
+ createLiteral(value) {
2061
+ if (typeof value === "string") {
2062
+ return types.stringLiteral(value);
2063
+ } else if (typeof value === "number") {
2064
+ return types.numericLiteral(value);
2065
+ } else if (typeof value === "boolean") {
2066
+ return types.booleanLiteral(value);
2067
+ } else if (value === void 0) {
2068
+ return types.identifier("undefined");
2069
+ } else if (value === null) {
2070
+ return types.nullLiteral();
2071
+ } else {
2072
+ throw new Error(`Invalid literal: ${value} (${typeof value})`);
2073
+ }
2074
+ }
2075
+ createObjectLiteral(properties) {
2076
+ return types.objectExpression(properties.map((prop) => {
2077
+ const key = prop.quoted ? types.stringLiteral(prop.propertyName) : types.identifier(prop.propertyName);
2078
+ return types.objectProperty(key, prop.value);
2079
+ }));
2080
+ }
2081
+ createPropertyAccess(expression, propertyName) {
2082
+ return types.memberExpression(expression, types.identifier(propertyName), false);
2083
+ }
2084
+ createTaggedTemplate(tag, template) {
2085
+ const elements = template.elements.map((element, i) => this.setSourceMapRange(types.templateElement(element, i === template.elements.length - 1), element.range));
2086
+ return types.taggedTemplateExpression(tag, types.templateLiteral(elements, template.expressions));
2087
+ }
2088
+ createTypeOfExpression(expression) {
2089
+ return types.unaryExpression("typeof", expression);
2090
+ }
2091
+ createVariableDeclaration(variableName, initializer, type) {
2092
+ return types.variableDeclaration(type, [types.variableDeclarator(types.identifier(variableName), initializer)]);
2093
+ }
2094
+ setSourceMapRange(node, sourceMapRange) {
2095
+ if (sourceMapRange === null) {
2096
+ return node;
2097
+ }
2098
+ node.loc = {
2099
+ filename: sourceMapRange.url !== this.sourceUrl ? sourceMapRange.url : void 0,
2100
+ start: {
2101
+ line: sourceMapRange.start.line + 1,
2102
+ column: sourceMapRange.start.column
2103
+ },
2104
+ end: {
2105
+ line: sourceMapRange.end.line + 1,
2106
+ column: sourceMapRange.end.column
2107
+ }
2108
+ };
2109
+ node.start = sourceMapRange.start.offset;
2110
+ node.end = sourceMapRange.end.offset;
2111
+ return node;
2112
+ }
2113
+ };
2114
+ function isLExpression(expr) {
2115
+ return types.isLVal(expr);
2116
+ }
2117
+
2118
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/ast/babel_ast_host.mjs
2119
+ var BabelAstHost = class {
2120
+ constructor() {
2121
+ this.isStringLiteral = types.isStringLiteral;
2122
+ this.isNumericLiteral = types.isNumericLiteral;
2123
+ this.isArrayLiteral = types.isArrayExpression;
2124
+ this.isObjectLiteral = types.isObjectExpression;
2125
+ this.isCallExpression = types.isCallExpression;
2126
+ }
2127
+ getSymbolName(node) {
2128
+ if (types.isIdentifier(node)) {
2129
+ return node.name;
2130
+ } else if (types.isMemberExpression(node) && types.isIdentifier(node.property)) {
2131
+ return node.property.name;
2132
+ } else {
2133
+ return null;
2134
+ }
2135
+ }
2136
+ parseStringLiteral(str) {
2137
+ assert(str, types.isStringLiteral, "a string literal");
2138
+ return str.value;
2139
+ }
2140
+ parseNumericLiteral(num) {
2141
+ assert(num, types.isNumericLiteral, "a numeric literal");
2142
+ return num.value;
2143
+ }
2144
+ isBooleanLiteral(bool) {
2145
+ return types.isBooleanLiteral(bool) || isMinifiedBooleanLiteral(bool);
2146
+ }
2147
+ parseBooleanLiteral(bool) {
2148
+ if (types.isBooleanLiteral(bool)) {
2149
+ return bool.value;
2150
+ } else if (isMinifiedBooleanLiteral(bool)) {
2151
+ return !bool.argument.value;
2152
+ } else {
2153
+ throw new FatalLinkerError(bool, "Unsupported syntax, expected a boolean literal.");
2154
+ }
2155
+ }
2156
+ parseArrayLiteral(array) {
2157
+ assert(array, types.isArrayExpression, "an array literal");
2158
+ return array.elements.map((element) => {
2159
+ assert(element, isNotEmptyElement, "element in array not to be empty");
2160
+ assert(element, isNotSpreadElement, "element in array not to use spread syntax");
2161
+ return element;
2162
+ });
2163
+ }
2164
+ parseObjectLiteral(obj) {
2165
+ assert(obj, types.isObjectExpression, "an object literal");
2166
+ const result = new Map();
2167
+ for (const property of obj.properties) {
2168
+ assert(property, types.isObjectProperty, "a property assignment");
2169
+ assert(property.value, types.isExpression, "an expression");
2170
+ assert(property.key, isPropertyName, "a property name");
2171
+ const key = types.isIdentifier(property.key) ? property.key.name : property.key.value;
2172
+ result.set(key, property.value);
2173
+ }
2174
+ return result;
2175
+ }
2176
+ isFunctionExpression(node) {
2177
+ return types.isFunction(node);
2178
+ }
2179
+ parseReturnValue(fn) {
2180
+ assert(fn, this.isFunctionExpression, "a function");
2181
+ if (!types.isBlockStatement(fn.body)) {
2182
+ return fn.body;
2183
+ }
2184
+ if (fn.body.body.length !== 1) {
2185
+ throw new FatalLinkerError(fn.body, "Unsupported syntax, expected a function body with a single return statement.");
2186
+ }
2187
+ const stmt = fn.body.body[0];
2188
+ assert(stmt, types.isReturnStatement, "a function body with a single return statement");
2189
+ if (stmt.argument === null) {
2190
+ throw new FatalLinkerError(stmt, "Unsupported syntax, expected function to return a value.");
2191
+ }
2192
+ return stmt.argument;
2193
+ }
2194
+ parseCallee(call) {
2195
+ assert(call, types.isCallExpression, "a call expression");
2196
+ assert(call.callee, types.isExpression, "an expression");
2197
+ return call.callee;
2198
+ }
2199
+ parseArguments(call) {
2200
+ assert(call, types.isCallExpression, "a call expression");
2201
+ return call.arguments.map((arg) => {
2202
+ assert(arg, isNotSpreadArgument, "argument not to use spread syntax");
2203
+ assert(arg, types.isExpression, "argument to be an expression");
2204
+ return arg;
2205
+ });
2206
+ }
2207
+ getRange(node) {
2208
+ if (node.loc == null || node.start === null || node.end === null) {
2209
+ throw new FatalLinkerError(node, "Unable to read range for node - it is missing location information.");
2210
+ }
2211
+ return {
2212
+ startLine: node.loc.start.line - 1,
2213
+ startCol: node.loc.start.column,
2214
+ startPos: node.start,
2215
+ endPos: node.end
2216
+ };
2217
+ }
2218
+ };
2219
+ function isNotEmptyElement(e) {
2220
+ return e !== null;
2221
+ }
2222
+ function isNotSpreadElement(e) {
2223
+ return !types.isSpreadElement(e);
2224
+ }
2225
+ function isPropertyName(e) {
2226
+ return types.isIdentifier(e) || types.isStringLiteral(e) || types.isNumericLiteral(e);
2227
+ }
2228
+ function isNotSpreadArgument(arg) {
2229
+ return !types.isSpreadElement(arg);
2230
+ }
2231
+ function isMinifiedBooleanLiteral(node) {
2232
+ return types.isUnaryExpression(node) && node.prefix && node.operator === "!" && types.isNumericLiteral(node.argument) && (node.argument.value === 0 || node.argument.value === 1);
2233
+ }
2234
+
2235
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_declaration_scope.mjs
2236
+ var BabelDeclarationScope = class {
2237
+ constructor(declarationScope) {
2238
+ this.declarationScope = declarationScope;
2239
+ }
2240
+ getConstantScopeRef(expression) {
2241
+ let bindingExpression = expression;
2242
+ while (types.isMemberExpression(bindingExpression)) {
2243
+ bindingExpression = bindingExpression.object;
2244
+ }
2245
+ if (!types.isIdentifier(bindingExpression)) {
2246
+ return null;
2247
+ }
2248
+ const binding = this.declarationScope.getBinding(bindingExpression.name);
2249
+ if (binding === void 0) {
2250
+ return null;
2251
+ }
2252
+ const path = binding.scope.path;
2253
+ if (!path.isFunctionParent() && !(path.isProgram() && path.node.sourceType === "module")) {
2254
+ return null;
2255
+ }
2256
+ return path;
2257
+ }
2258
+ };
2259
+
2260
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/es2015_linker_plugin.mjs
2261
+ function createEs2015LinkerPlugin(_a2) {
2262
+ var _b = _a2, { fileSystem, logger } = _b, options = __objRest(_b, ["fileSystem", "logger"]);
2263
+ let fileLinker = null;
2264
+ return {
2265
+ visitor: {
2266
+ Program: {
2267
+ enter(path) {
2268
+ var _a3, _b2;
2269
+ assertNull(fileLinker);
2270
+ const file = path.hub.file;
2271
+ const filename = (_a3 = file.opts.filename) != null ? _a3 : file.opts.filenameRelative;
2272
+ if (!filename) {
2273
+ throw new Error("No filename (nor filenameRelative) provided by Babel. This is required for the linking of partially compiled directives and components.");
2274
+ }
2275
+ const sourceUrl = fileSystem.resolve((_b2 = file.opts.cwd) != null ? _b2 : ".", filename);
2276
+ const linkerEnvironment = LinkerEnvironment.create(fileSystem, logger, new BabelAstHost(), new BabelAstFactory(sourceUrl), options);
2277
+ fileLinker = new FileLinker(linkerEnvironment, sourceUrl, file.code);
2278
+ },
2279
+ exit() {
2280
+ assertNotNull(fileLinker);
2281
+ for (const { constantScope, statements } of fileLinker.getConstantStatements()) {
2282
+ insertStatements(constantScope, statements);
2283
+ }
2284
+ fileLinker = null;
2285
+ }
2286
+ },
2287
+ CallExpression(call) {
2288
+ if (fileLinker === null) {
2289
+ return;
2290
+ }
2291
+ try {
2292
+ const calleeName = getCalleeName(call);
2293
+ if (calleeName === null) {
2294
+ return;
2295
+ }
2296
+ const args = call.node.arguments;
2297
+ if (!fileLinker.isPartialDeclaration(calleeName) || !isExpressionArray(args)) {
2298
+ return;
2299
+ }
2300
+ const declarationScope = new BabelDeclarationScope(call.scope);
2301
+ const replacement = fileLinker.linkPartialDeclaration(calleeName, args, declarationScope);
2302
+ call.replaceWith(replacement);
2303
+ } catch (e) {
2304
+ const node = isFatalLinkerError(e) ? e.node : call.node;
2305
+ throw buildCodeFrameError(call.hub.file, e.message, node);
2306
+ }
2307
+ }
2308
+ }
2309
+ };
2310
+ }
2311
+ function insertStatements(path, statements) {
2312
+ if (path.isFunction()) {
2313
+ insertIntoFunction(path, statements);
2314
+ } else if (path.isProgram()) {
2315
+ insertIntoProgram(path, statements);
2316
+ }
2317
+ }
2318
+ function insertIntoFunction(fn, statements) {
2319
+ const body = fn.get("body");
2320
+ body.unshiftContainer("body", statements);
2321
+ }
2322
+ function insertIntoProgram(program, statements) {
2323
+ const body = program.get("body");
2324
+ const importStatements = body.filter((statement) => statement.isImportDeclaration());
2325
+ if (importStatements.length === 0) {
2326
+ program.unshiftContainer("body", statements);
2327
+ } else {
2328
+ importStatements[importStatements.length - 1].insertAfter(statements);
2329
+ }
2330
+ }
2331
+ function getCalleeName(call) {
2332
+ const callee = call.node.callee;
2333
+ if (types.isIdentifier(callee)) {
2334
+ return callee.name;
2335
+ } else if (types.isMemberExpression(callee) && types.isIdentifier(callee.property)) {
2336
+ return callee.property.name;
2337
+ } else if (types.isMemberExpression(callee) && types.isStringLiteral(callee.property)) {
2338
+ return callee.property.value;
2339
+ } else {
2340
+ return null;
2341
+ }
2342
+ }
2343
+ function isExpressionArray(nodes) {
2344
+ return nodes.every((node) => types.isExpression(node));
2345
+ }
2346
+ function assertNull(obj) {
2347
+ if (obj !== null) {
2348
+ throw new Error("BUG - expected `obj` to be null");
2349
+ }
2350
+ }
2351
+ function assertNotNull(obj) {
2352
+ if (obj === null) {
2353
+ throw new Error("BUG - expected `obj` not to be null");
2354
+ }
2355
+ }
2356
+ function buildCodeFrameError(file, message, node) {
2357
+ const filename = file.opts.filename || "(unknown file)";
2358
+ const error = file.buildCodeFrameError(node, message);
2359
+ return `${filename}: ${error.message}`;
2360
+ }
2361
+
2362
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/src/babel_plugin.mjs
2363
+ function defaultLinkerPlugin(api, options) {
2364
+ api.assertVersion(7);
2365
+ return createEs2015LinkerPlugin(__spreadProps(__spreadValues({}, options), {
2366
+ fileSystem: new NodeJSFileSystem(),
2367
+ logger: new ConsoleLogger(LogLevel.info)
2368
+ }));
2369
+ }
2370
+
2371
+ // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/babel/index.mjs
2372
+ var babel_default = defaultLinkerPlugin;
2373
+ export {
2374
+ createEs2015LinkerPlugin,
2375
+ babel_default as default
2376
+ };
2377
+ /**
2378
+ * @license
2379
+ * Copyright Google LLC All Rights Reserved.
2380
+ *
2381
+ * Use of this source code is governed by an MIT-style license that can be
2382
+ * found in the LICENSE file at https://angular.io/license
2383
+ */
2384
+ //# sourceMappingURL=index.js.map