chunk-JVASWB7F.js 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. import {createRequire as __cjsCompatRequire} from 'module';
  2. const require = __cjsCompatRequire(import.meta.url);
  3. import {
  4. Context,
  5. ExpressionTranslatorVisitor
  6. } from "./chunk-JCLVSACV.js";
  7. import {
  8. SourceFileLoader
  9. } from "./chunk-OULZQUKT.js";
  10. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
  11. var FatalLinkerError = class extends Error {
  12. constructor(node, message) {
  13. super(message);
  14. this.node = node;
  15. this.type = "FatalLinkerError";
  16. }
  17. };
  18. function isFatalLinkerError(e) {
  19. return e && e.type === "FatalLinkerError";
  20. }
  21. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
  22. function assert(node, predicate, expected) {
  23. if (!predicate(node)) {
  24. throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
  25. }
  26. }
  27. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
  28. import * as o from "@angular/compiler";
  29. var AstObject = class {
  30. static parse(expression, host) {
  31. const obj = host.parseObjectLiteral(expression);
  32. return new AstObject(expression, obj, host);
  33. }
  34. constructor(expression, obj, host) {
  35. this.expression = expression;
  36. this.obj = obj;
  37. this.host = host;
  38. }
  39. has(propertyName) {
  40. return this.obj.has(propertyName);
  41. }
  42. getNumber(propertyName) {
  43. return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
  44. }
  45. getString(propertyName) {
  46. return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
  47. }
  48. getBoolean(propertyName) {
  49. return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
  50. }
  51. getObject(propertyName) {
  52. const expr = this.getRequiredProperty(propertyName);
  53. const obj = this.host.parseObjectLiteral(expr);
  54. return new AstObject(expr, obj, this.host);
  55. }
  56. getArray(propertyName) {
  57. const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
  58. return arr.map((entry) => new AstValue(entry, this.host));
  59. }
  60. getOpaque(propertyName) {
  61. return new o.WrappedNodeExpr(this.getRequiredProperty(propertyName));
  62. }
  63. getNode(propertyName) {
  64. return this.getRequiredProperty(propertyName);
  65. }
  66. getValue(propertyName) {
  67. return new AstValue(this.getRequiredProperty(propertyName), this.host);
  68. }
  69. toLiteral(mapper) {
  70. const result = {};
  71. for (const [key, expression] of this.obj) {
  72. result[key] = mapper(new AstValue(expression, this.host), key);
  73. }
  74. return result;
  75. }
  76. toMap(mapper) {
  77. const result = /* @__PURE__ */ new Map();
  78. for (const [key, expression] of this.obj) {
  79. result.set(key, mapper(new AstValue(expression, this.host)));
  80. }
  81. return result;
  82. }
  83. getRequiredProperty(propertyName) {
  84. if (!this.obj.has(propertyName)) {
  85. throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
  86. }
  87. return this.obj.get(propertyName);
  88. }
  89. };
  90. var AstValue = class {
  91. constructor(expression, host) {
  92. this.expression = expression;
  93. this.host = host;
  94. }
  95. getSymbolName() {
  96. return this.host.getSymbolName(this.expression);
  97. }
  98. isNumber() {
  99. return this.host.isNumericLiteral(this.expression);
  100. }
  101. getNumber() {
  102. return this.host.parseNumericLiteral(this.expression);
  103. }
  104. isString() {
  105. return this.host.isStringLiteral(this.expression);
  106. }
  107. getString() {
  108. return this.host.parseStringLiteral(this.expression);
  109. }
  110. isBoolean() {
  111. return this.host.isBooleanLiteral(this.expression);
  112. }
  113. getBoolean() {
  114. return this.host.parseBooleanLiteral(this.expression);
  115. }
  116. isObject() {
  117. return this.host.isObjectLiteral(this.expression);
  118. }
  119. getObject() {
  120. return AstObject.parse(this.expression, this.host);
  121. }
  122. isArray() {
  123. return this.host.isArrayLiteral(this.expression);
  124. }
  125. getArray() {
  126. const arr = this.host.parseArrayLiteral(this.expression);
  127. return arr.map((entry) => new AstValue(entry, this.host));
  128. }
  129. isFunction() {
  130. return this.host.isFunctionExpression(this.expression);
  131. }
  132. getFunctionReturnValue() {
  133. return new AstValue(this.host.parseReturnValue(this.expression), this.host);
  134. }
  135. isCallExpression() {
  136. return this.host.isCallExpression(this.expression);
  137. }
  138. getCallee() {
  139. return new AstValue(this.host.parseCallee(this.expression), this.host);
  140. }
  141. getArguments() {
  142. const args = this.host.parseArguments(this.expression);
  143. return args.map((arg) => new AstValue(arg, this.host));
  144. }
  145. getOpaque() {
  146. return new o.WrappedNodeExpr(this.expression);
  147. }
  148. getRange() {
  149. return this.host.getRange(this.expression);
  150. }
  151. };
  152. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
  153. import { ConstantPool } from "@angular/compiler";
  154. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
  155. var LinkerImportGenerator = class {
  156. constructor(ngImport) {
  157. this.ngImport = ngImport;
  158. }
  159. generateNamespaceImport(moduleName) {
  160. this.assertModuleName(moduleName);
  161. return this.ngImport;
  162. }
  163. generateNamedImport(moduleName, originalSymbol) {
  164. this.assertModuleName(moduleName);
  165. return { moduleImport: this.ngImport, symbol: originalSymbol };
  166. }
  167. assertModuleName(moduleName) {
  168. if (moduleName !== "@angular/core") {
  169. throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
  170. }
  171. }
  172. };
  173. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
  174. var EmitScope = class {
  175. constructor(ngImport, translator, factory) {
  176. this.ngImport = ngImport;
  177. this.translator = translator;
  178. this.factory = factory;
  179. this.constantPool = new ConstantPool();
  180. }
  181. translateDefinition(definition) {
  182. const expression = this.translator.translateExpression(definition.expression, new LinkerImportGenerator(this.ngImport));
  183. if (definition.statements.length > 0) {
  184. const importGenerator = new LinkerImportGenerator(this.ngImport);
  185. return this.wrapInIifeWithStatements(expression, definition.statements.map((statement) => this.translator.translateStatement(statement, importGenerator)));
  186. } else {
  187. return expression;
  188. }
  189. }
  190. getConstantStatements() {
  191. const importGenerator = new LinkerImportGenerator(this.ngImport);
  192. return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
  193. }
  194. wrapInIifeWithStatements(expression, statements) {
  195. const returnStatement = this.factory.createReturnStatement(expression);
  196. const body = this.factory.createBlock([...statements, returnStatement]);
  197. const fn = this.factory.createFunctionExpression(null, [], body);
  198. return this.factory.createCallExpression(fn, [], false);
  199. }
  200. };
  201. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/local_emit_scope.mjs
  202. var LocalEmitScope = class extends EmitScope {
  203. translateDefinition(definition) {
  204. return super.translateDefinition({
  205. expression: definition.expression,
  206. statements: [...this.constantPool.statements, ...definition.statements]
  207. });
  208. }
  209. getConstantStatements() {
  210. throw new Error("BUG - LocalEmitScope should not expose any constant statements");
  211. }
  212. };
  213. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
  214. import semver from "semver";
  215. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
  216. function createGetSourceFile(sourceUrl, code, loader) {
  217. if (loader === null) {
  218. return () => null;
  219. } else {
  220. let sourceFile = void 0;
  221. return () => {
  222. if (sourceFile === void 0) {
  223. sourceFile = loader.loadSourceFile(sourceUrl, code);
  224. }
  225. return sourceFile;
  226. };
  227. }
  228. }
  229. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
  230. import { compileClassMetadata } from "@angular/compiler";
  231. var PartialClassMetadataLinkerVersion1 = class {
  232. linkPartialDeclaration(constantPool, metaObj) {
  233. const meta = toR3ClassMetadata(metaObj);
  234. return {
  235. expression: compileClassMetadata(meta),
  236. statements: []
  237. };
  238. }
  239. };
  240. function toR3ClassMetadata(metaObj) {
  241. return {
  242. type: metaObj.getOpaque("type"),
  243. decorators: metaObj.getOpaque("decorators"),
  244. ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
  245. propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
  246. };
  247. }
  248. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
  249. import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, R3TemplateDependencyKind, ViewEncapsulation } from "@angular/compiler";
  250. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
  251. import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
  252. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
  253. import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
  254. function wrapReference(wrapped) {
  255. return { value: wrapped, type: wrapped };
  256. }
  257. function parseEnum(value, Enum) {
  258. const symbolName = value.getSymbolName();
  259. if (symbolName === null) {
  260. throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
  261. }
  262. const enumValue = Enum[symbolName];
  263. if (enumValue === void 0) {
  264. throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
  265. }
  266. return enumValue;
  267. }
  268. function getDependency(depObj) {
  269. const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
  270. const token = depObj.getOpaque("token");
  271. const attributeNameType = isAttribute ? o2.literal("unknown") : null;
  272. return {
  273. token,
  274. attributeNameType,
  275. host: depObj.has("host") && depObj.getBoolean("host"),
  276. optional: depObj.has("optional") && depObj.getBoolean("optional"),
  277. self: depObj.has("self") && depObj.getBoolean("self"),
  278. skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
  279. };
  280. }
  281. function extractForwardRef(expr) {
  282. if (!expr.isCallExpression()) {
  283. return createMayBeForwardRefExpression(expr.getOpaque(), 0);
  284. }
  285. const callee = expr.getCallee();
  286. if (callee.getSymbolName() !== "forwardRef") {
  287. throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
  288. }
  289. const args = expr.getArguments();
  290. if (args.length !== 1) {
  291. throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
  292. }
  293. const wrapperFn = args[0];
  294. if (!wrapperFn.isFunction()) {
  295. throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
  296. }
  297. return createMayBeForwardRefExpression(wrapperFn.getFunctionReturnValue().getOpaque(), 2);
  298. }
  299. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
  300. var PartialDirectiveLinkerVersion1 = class {
  301. constructor(sourceUrl, code) {
  302. this.sourceUrl = sourceUrl;
  303. this.code = code;
  304. }
  305. linkPartialDeclaration(constantPool, metaObj) {
  306. const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
  307. return compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
  308. }
  309. };
  310. function toR3DirectiveMeta(metaObj, code, sourceUrl) {
  311. const typeExpr = metaObj.getValue("type");
  312. const typeName = typeExpr.getSymbolName();
  313. if (typeName === null) {
  314. throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
  315. }
  316. return {
  317. typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
  318. type: wrapReference(typeExpr.getOpaque()),
  319. typeArgumentCount: 0,
  320. deps: null,
  321. host: toHostMetadata(metaObj),
  322. inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
  323. outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
  324. queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
  325. viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
  326. providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
  327. fullInheritance: false,
  328. selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
  329. exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
  330. lifecycle: {
  331. usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
  332. },
  333. name: typeName,
  334. usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false,
  335. isStandalone: metaObj.has("isStandalone") ? metaObj.getBoolean("isStandalone") : false,
  336. hostDirectives: metaObj.has("hostDirectives") ? toHostDirectivesMetadata(metaObj.getValue("hostDirectives")) : null
  337. };
  338. }
  339. function toInputMapping(value, key) {
  340. if (value.isString()) {
  341. return { bindingPropertyName: value.getString(), classPropertyName: key, required: false };
  342. }
  343. const values = value.getArray().map((innerValue) => innerValue.getString());
  344. if (values.length !== 2) {
  345. throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
  346. }
  347. return { bindingPropertyName: values[0], classPropertyName: values[1], required: false };
  348. }
  349. function toHostMetadata(metaObj) {
  350. if (!metaObj.has("host")) {
  351. return {
  352. attributes: {},
  353. listeners: {},
  354. properties: {},
  355. specialAttributes: {}
  356. };
  357. }
  358. const host = metaObj.getObject("host");
  359. const specialAttributes = {};
  360. if (host.has("styleAttribute")) {
  361. specialAttributes.styleAttr = host.getString("styleAttribute");
  362. }
  363. if (host.has("classAttribute")) {
  364. specialAttributes.classAttr = host.getString("classAttribute");
  365. }
  366. return {
  367. attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
  368. listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
  369. properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
  370. specialAttributes
  371. };
  372. }
  373. function toQueryMetadata(obj) {
  374. let predicate;
  375. const predicateExpr = obj.getValue("predicate");
  376. if (predicateExpr.isArray()) {
  377. predicate = predicateExpr.getArray().map((entry) => entry.getString());
  378. } else {
  379. predicate = extractForwardRef(predicateExpr);
  380. }
  381. return {
  382. propertyName: obj.getString("propertyName"),
  383. first: obj.has("first") ? obj.getBoolean("first") : false,
  384. predicate,
  385. descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
  386. emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
  387. read: obj.has("read") ? obj.getOpaque("read") : null,
  388. static: obj.has("static") ? obj.getBoolean("static") : false
  389. };
  390. }
  391. function toHostDirectivesMetadata(hostDirectives) {
  392. return hostDirectives.getArray().map((hostDirective) => {
  393. const hostObject = hostDirective.getObject();
  394. const type = extractForwardRef(hostObject.getValue("directive"));
  395. const meta = {
  396. directive: wrapReference(type.expression),
  397. isForwardReference: type.forwardRef !== 0,
  398. inputs: hostObject.has("inputs") ? getHostDirectiveBindingMapping(hostObject.getArray("inputs")) : null,
  399. outputs: hostObject.has("outputs") ? getHostDirectiveBindingMapping(hostObject.getArray("outputs")) : null
  400. };
  401. return meta;
  402. });
  403. }
  404. function getHostDirectiveBindingMapping(array) {
  405. let result = null;
  406. for (let i = 1; i < array.length; i += 2) {
  407. result = result || {};
  408. result[array[i - 1].getString()] = array[i].getString();
  409. }
  410. return result;
  411. }
  412. function createSourceSpan(range, code, sourceUrl) {
  413. const sourceFile = new ParseSourceFile(code, sourceUrl);
  414. const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
  415. return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
  416. }
  417. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
  418. function makeDirectiveMetadata(directiveExpr, typeExpr, isComponentByDefault = null) {
  419. return {
  420. kind: R3TemplateDependencyKind.Directive,
  421. isComponent: isComponentByDefault || directiveExpr.has("kind") && directiveExpr.getString("kind") === "component",
  422. type: typeExpr,
  423. selector: directiveExpr.getString("selector"),
  424. inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
  425. outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
  426. exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
  427. };
  428. }
  429. var PartialComponentLinkerVersion1 = class {
  430. constructor(getSourceFile, sourceUrl, code) {
  431. this.getSourceFile = getSourceFile;
  432. this.sourceUrl = sourceUrl;
  433. this.code = code;
  434. }
  435. linkPartialDeclaration(constantPool, metaObj) {
  436. const meta = this.toR3ComponentMeta(metaObj);
  437. return compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
  438. }
  439. toR3ComponentMeta(metaObj) {
  440. const interpolation = parseInterpolationConfig(metaObj);
  441. const templateSource = metaObj.getValue("template");
  442. const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
  443. const templateInfo = this.getTemplateInfo(templateSource, isInline);
  444. const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
  445. escapedString: templateInfo.isEscaped,
  446. interpolationConfig: interpolation,
  447. range: templateInfo.range,
  448. enableI18nLegacyMessageIdFormat: false,
  449. preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
  450. i18nNormalizeLineEndingsInICUs: isInline
  451. });
  452. if (template.errors !== null) {
  453. const errors = template.errors.map((err) => err.toString()).join("\n");
  454. throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
  455. ${errors}`);
  456. }
  457. let declarationListEmitMode = 0;
  458. const extractDeclarationTypeExpr = (type) => {
  459. const { expression, forwardRef } = extractForwardRef(type);
  460. if (forwardRef === 2) {
  461. declarationListEmitMode = 1;
  462. }
  463. return expression;
  464. };
  465. let declarations = [];
  466. if (metaObj.has("components")) {
  467. declarations.push(...metaObj.getArray("components").map((dir) => {
  468. const dirExpr = dir.getObject();
  469. const typeExpr = extractDeclarationTypeExpr(dirExpr.getValue("type"));
  470. return makeDirectiveMetadata(dirExpr, typeExpr, true);
  471. }));
  472. }
  473. if (metaObj.has("directives")) {
  474. declarations.push(...metaObj.getArray("directives").map((dir) => {
  475. const dirExpr = dir.getObject();
  476. const typeExpr = extractDeclarationTypeExpr(dirExpr.getValue("type"));
  477. return makeDirectiveMetadata(dirExpr, typeExpr);
  478. }));
  479. }
  480. if (metaObj.has("pipes")) {
  481. const pipes = metaObj.getObject("pipes").toMap((pipe) => pipe);
  482. for (const [name, type] of pipes) {
  483. const typeExpr = extractDeclarationTypeExpr(type);
  484. declarations.push({
  485. kind: R3TemplateDependencyKind.Pipe,
  486. name,
  487. type: typeExpr
  488. });
  489. }
  490. }
  491. if (metaObj.has("dependencies")) {
  492. for (const dep of metaObj.getArray("dependencies")) {
  493. const depObj = dep.getObject();
  494. const typeExpr = extractDeclarationTypeExpr(depObj.getValue("type"));
  495. switch (depObj.getString("kind")) {
  496. case "directive":
  497. case "component":
  498. declarations.push(makeDirectiveMetadata(depObj, typeExpr));
  499. break;
  500. case "pipe":
  501. const pipeObj = depObj;
  502. declarations.push({
  503. kind: R3TemplateDependencyKind.Pipe,
  504. name: pipeObj.getString("name"),
  505. type: typeExpr
  506. });
  507. break;
  508. case "ngmodule":
  509. declarations.push({
  510. kind: R3TemplateDependencyKind.NgModule,
  511. type: typeExpr
  512. });
  513. break;
  514. default:
  515. continue;
  516. }
  517. }
  518. }
  519. return {
  520. ...toR3DirectiveMeta(metaObj, this.code, this.sourceUrl),
  521. viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
  522. template: {
  523. nodes: template.nodes,
  524. ngContentSelectors: template.ngContentSelectors
  525. },
  526. declarationListEmitMode,
  527. styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
  528. encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
  529. interpolation,
  530. changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
  531. animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
  532. relativeContextFilePath: this.sourceUrl,
  533. i18nUseExternalIds: false,
  534. declarations
  535. };
  536. }
  537. getTemplateInfo(templateNode, isInline) {
  538. const range = templateNode.getRange();
  539. if (!isInline) {
  540. const externalTemplate = this.tryExternalTemplate(range);
  541. if (externalTemplate !== null) {
  542. return externalTemplate;
  543. }
  544. }
  545. return this.templateFromPartialCode(templateNode, range);
  546. }
  547. tryExternalTemplate(range) {
  548. const sourceFile = this.getSourceFile();
  549. if (sourceFile === null) {
  550. return null;
  551. }
  552. const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
  553. if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
  554. return null;
  555. }
  556. const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
  557. return {
  558. code: templateContents,
  559. sourceUrl: pos.file,
  560. range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
  561. isEscaped: false
  562. };
  563. }
  564. templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
  565. if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
  566. throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
  567. }
  568. return {
  569. code: this.code,
  570. sourceUrl: this.sourceUrl,
  571. range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
  572. isEscaped: true
  573. };
  574. }
  575. };
  576. function parseInterpolationConfig(metaObj) {
  577. if (!metaObj.has("interpolation")) {
  578. return DEFAULT_INTERPOLATION_CONFIG;
  579. }
  580. const interpolationExpr = metaObj.getValue("interpolation");
  581. const values = interpolationExpr.getArray().map((entry) => entry.getString());
  582. if (values.length !== 2) {
  583. throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
  584. }
  585. return InterpolationConfig.fromArray(values);
  586. }
  587. function parseEncapsulation(encapsulation) {
  588. const symbolName = encapsulation.getSymbolName();
  589. if (symbolName === null) {
  590. throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
  591. }
  592. const enumValue = ViewEncapsulation[symbolName];
  593. if (enumValue === void 0) {
  594. throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
  595. }
  596. return enumValue;
  597. }
  598. function parseChangeDetectionStrategy(changeDetectionStrategy) {
  599. const symbolName = changeDetectionStrategy.getSymbolName();
  600. if (symbolName === null) {
  601. throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
  602. }
  603. const enumValue = ChangeDetectionStrategy[symbolName];
  604. if (enumValue === void 0) {
  605. throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
  606. }
  607. return enumValue;
  608. }
  609. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
  610. import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
  611. var PartialFactoryLinkerVersion1 = class {
  612. linkPartialDeclaration(constantPool, metaObj) {
  613. const meta = toR3FactoryMeta(metaObj);
  614. return compileFactoryFunction(meta);
  615. }
  616. };
  617. function toR3FactoryMeta(metaObj) {
  618. const typeExpr = metaObj.getValue("type");
  619. const typeName = typeExpr.getSymbolName();
  620. if (typeName === null) {
  621. throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
  622. }
  623. return {
  624. name: typeName,
  625. type: wrapReference(typeExpr.getOpaque()),
  626. typeArgumentCount: 0,
  627. target: parseEnum(metaObj.getValue("target"), FactoryTarget),
  628. deps: getDependencies(metaObj, "deps")
  629. };
  630. }
  631. function getDependencies(metaObj, propName) {
  632. if (!metaObj.has(propName)) {
  633. return null;
  634. }
  635. const deps = metaObj.getValue(propName);
  636. if (deps.isArray()) {
  637. return deps.getArray().map((dep) => getDependency(dep.getObject()));
  638. }
  639. if (deps.isString()) {
  640. return "invalid";
  641. }
  642. return null;
  643. }
  644. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
  645. import { compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, outputAst as o3 } from "@angular/compiler";
  646. var PartialInjectableLinkerVersion1 = class {
  647. linkPartialDeclaration(constantPool, metaObj) {
  648. const meta = toR3InjectableMeta(metaObj);
  649. return compileInjectable(meta, false);
  650. }
  651. };
  652. function toR3InjectableMeta(metaObj) {
  653. const typeExpr = metaObj.getValue("type");
  654. const typeName = typeExpr.getSymbolName();
  655. if (typeName === null) {
  656. throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
  657. }
  658. const meta = {
  659. name: typeName,
  660. type: wrapReference(typeExpr.getOpaque()),
  661. typeArgumentCount: 0,
  662. providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createMayBeForwardRefExpression2(o3.literal(null), 0)
  663. };
  664. if (metaObj.has("useClass")) {
  665. meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
  666. }
  667. if (metaObj.has("useFactory")) {
  668. meta.useFactory = metaObj.getOpaque("useFactory");
  669. }
  670. if (metaObj.has("useExisting")) {
  671. meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
  672. }
  673. if (metaObj.has("useValue")) {
  674. meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
  675. }
  676. if (metaObj.has("deps")) {
  677. meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
  678. }
  679. return meta;
  680. }
  681. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
  682. import { compileInjector } from "@angular/compiler";
  683. var PartialInjectorLinkerVersion1 = class {
  684. linkPartialDeclaration(constantPool, metaObj) {
  685. const meta = toR3InjectorMeta(metaObj);
  686. return compileInjector(meta);
  687. }
  688. };
  689. function toR3InjectorMeta(metaObj) {
  690. const typeExpr = metaObj.getValue("type");
  691. const typeName = typeExpr.getSymbolName();
  692. if (typeName === null) {
  693. throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
  694. }
  695. return {
  696. name: typeName,
  697. type: wrapReference(typeExpr.getOpaque()),
  698. providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
  699. imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
  700. };
  701. }
  702. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
  703. import { compileNgModule, R3SelectorScopeMode } from "@angular/compiler";
  704. var PartialNgModuleLinkerVersion1 = class {
  705. constructor(emitInline) {
  706. this.emitInline = emitInline;
  707. }
  708. linkPartialDeclaration(constantPool, metaObj) {
  709. const meta = toR3NgModuleMeta(metaObj, this.emitInline);
  710. return compileNgModule(meta);
  711. }
  712. };
  713. function toR3NgModuleMeta(metaObj, supportJit) {
  714. const wrappedType = metaObj.getOpaque("type");
  715. const meta = {
  716. type: wrapReference(wrappedType),
  717. bootstrap: [],
  718. declarations: [],
  719. publicDeclarationTypes: null,
  720. includeImportTypes: true,
  721. imports: [],
  722. exports: [],
  723. selectorScopeMode: supportJit ? R3SelectorScopeMode.Inline : R3SelectorScopeMode.Omit,
  724. containsForwardDecls: false,
  725. schemas: [],
  726. id: metaObj.has("id") ? metaObj.getOpaque("id") : null
  727. };
  728. if (metaObj.has("bootstrap")) {
  729. const bootstrap = metaObj.getValue("bootstrap");
  730. if (bootstrap.isFunction()) {
  731. meta.containsForwardDecls = true;
  732. meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
  733. } else
  734. meta.bootstrap = wrapReferences(bootstrap);
  735. }
  736. if (metaObj.has("declarations")) {
  737. const declarations = metaObj.getValue("declarations");
  738. if (declarations.isFunction()) {
  739. meta.containsForwardDecls = true;
  740. meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
  741. } else
  742. meta.declarations = wrapReferences(declarations);
  743. }
  744. if (metaObj.has("imports")) {
  745. const imports = metaObj.getValue("imports");
  746. if (imports.isFunction()) {
  747. meta.containsForwardDecls = true;
  748. meta.imports = wrapReferences(unwrapForwardRefs(imports));
  749. } else
  750. meta.imports = wrapReferences(imports);
  751. }
  752. if (metaObj.has("exports")) {
  753. const exports = metaObj.getValue("exports");
  754. if (exports.isFunction()) {
  755. meta.containsForwardDecls = true;
  756. meta.exports = wrapReferences(unwrapForwardRefs(exports));
  757. } else
  758. meta.exports = wrapReferences(exports);
  759. }
  760. if (metaObj.has("schemas")) {
  761. const schemas = metaObj.getValue("schemas");
  762. meta.schemas = wrapReferences(schemas);
  763. }
  764. return meta;
  765. }
  766. function unwrapForwardRefs(field) {
  767. return field.getFunctionReturnValue();
  768. }
  769. function wrapReferences(values) {
  770. return values.getArray().map((i) => wrapReference(i.getOpaque()));
  771. }
  772. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
  773. import { compilePipeFromMetadata } from "@angular/compiler";
  774. var PartialPipeLinkerVersion1 = class {
  775. constructor() {
  776. }
  777. linkPartialDeclaration(constantPool, metaObj) {
  778. const meta = toR3PipeMeta(metaObj);
  779. return compilePipeFromMetadata(meta);
  780. }
  781. };
  782. function toR3PipeMeta(metaObj) {
  783. const typeExpr = metaObj.getValue("type");
  784. const typeName = typeExpr.getSymbolName();
  785. if (typeName === null) {
  786. throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
  787. }
  788. const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
  789. const isStandalone = metaObj.has("isStandalone") ? metaObj.getBoolean("isStandalone") : false;
  790. return {
  791. name: typeName,
  792. type: wrapReference(typeExpr.getOpaque()),
  793. typeArgumentCount: 0,
  794. deps: null,
  795. pipeName: metaObj.getString("name"),
  796. pure,
  797. isStandalone
  798. };
  799. }
  800. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
  801. var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
  802. var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
  803. var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
  804. var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
  805. var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
  806. var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
  807. var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
  808. var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
  809. var declarationFunctions = [
  810. \u0275\u0275ngDeclareDirective,
  811. \u0275\u0275ngDeclareClassMetadata,
  812. \u0275\u0275ngDeclareComponent,
  813. \u0275\u0275ngDeclareFactory,
  814. \u0275\u0275ngDeclareInjectable,
  815. \u0275\u0275ngDeclareInjector,
  816. \u0275\u0275ngDeclareNgModule,
  817. \u0275\u0275ngDeclarePipe
  818. ];
  819. function createLinkerMap(environment, sourceUrl, code) {
  820. const linkers = /* @__PURE__ */ new Map();
  821. const LATEST_VERSION_RANGE = getRange("<=", "16.0.4");
  822. linkers.set(\u0275\u0275ngDeclareDirective, [
  823. { range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
  824. ]);
  825. linkers.set(\u0275\u0275ngDeclareClassMetadata, [
  826. { range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
  827. ]);
  828. linkers.set(\u0275\u0275ngDeclareComponent, [
  829. {
  830. range: LATEST_VERSION_RANGE,
  831. linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
  832. }
  833. ]);
  834. linkers.set(\u0275\u0275ngDeclareFactory, [
  835. { range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
  836. ]);
  837. linkers.set(\u0275\u0275ngDeclareInjectable, [
  838. { range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
  839. ]);
  840. linkers.set(\u0275\u0275ngDeclareInjector, [
  841. { range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
  842. ]);
  843. linkers.set(\u0275\u0275ngDeclareNgModule, [
  844. {
  845. range: LATEST_VERSION_RANGE,
  846. linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
  847. }
  848. ]);
  849. linkers.set(\u0275\u0275ngDeclarePipe, [
  850. { range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
  851. ]);
  852. return linkers;
  853. }
  854. var PartialLinkerSelector = class {
  855. constructor(linkers, logger, unknownDeclarationVersionHandling) {
  856. this.linkers = linkers;
  857. this.logger = logger;
  858. this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
  859. }
  860. supportsDeclaration(functionName) {
  861. return this.linkers.has(functionName);
  862. }
  863. getLinker(functionName, minVersion, version) {
  864. if (!this.linkers.has(functionName)) {
  865. throw new Error(`Unknown partial declaration function ${functionName}.`);
  866. }
  867. const linkerRanges = this.linkers.get(functionName);
  868. if (version === "16.0.4") {
  869. return linkerRanges[linkerRanges.length - 1].linker;
  870. }
  871. const declarationRange = getRange(">=", minVersion);
  872. for (const { range: linkerRange, linker } of linkerRanges) {
  873. if (semver.intersects(declarationRange, linkerRange)) {
  874. return linker;
  875. }
  876. }
  877. const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
  878. Consider upgrading your application to use a more recent version of Angular.`;
  879. if (this.unknownDeclarationVersionHandling === "error") {
  880. throw new Error(message);
  881. } else if (this.unknownDeclarationVersionHandling === "warn") {
  882. this.logger.warn(`${message}
  883. Attempting to continue using this version of Angular.`);
  884. }
  885. return linkerRanges[linkerRanges.length - 1].linker;
  886. }
  887. };
  888. function getRange(comparator, versionStr) {
  889. const version = new semver.SemVer(versionStr);
  890. version.prerelease = [];
  891. return new semver.Range(`${comparator}${version.format()}`);
  892. }
  893. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
  894. var FileLinker = class {
  895. constructor(linkerEnvironment, sourceUrl, code) {
  896. this.linkerEnvironment = linkerEnvironment;
  897. this.emitScopes = /* @__PURE__ */ new Map();
  898. this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
  899. }
  900. isPartialDeclaration(calleeName) {
  901. return this.linkerSelector.supportsDeclaration(calleeName);
  902. }
  903. linkPartialDeclaration(declarationFn, args, declarationScope) {
  904. if (args.length !== 1) {
  905. throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
  906. }
  907. const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
  908. const ngImport = metaObj.getNode("ngImport");
  909. const emitScope = this.getEmitScope(ngImport, declarationScope);
  910. const minVersion = metaObj.getString("minVersion");
  911. const version = metaObj.getString("version");
  912. const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
  913. const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
  914. return emitScope.translateDefinition(definition);
  915. }
  916. getConstantStatements() {
  917. const results = [];
  918. for (const [constantScope, emitScope] of this.emitScopes.entries()) {
  919. const statements = emitScope.getConstantStatements();
  920. results.push({ constantScope, statements });
  921. }
  922. return results;
  923. }
  924. getEmitScope(ngImport, declarationScope) {
  925. const constantScope = declarationScope.getConstantScopeRef(ngImport);
  926. if (constantScope === null) {
  927. return new LocalEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
  928. }
  929. if (!this.emitScopes.has(constantScope)) {
  930. this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory));
  931. }
  932. return this.emitScopes.get(constantScope);
  933. }
  934. };
  935. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
  936. var DEFAULT_LINKER_OPTIONS = {
  937. sourceMapping: true,
  938. linkerJitMode: false,
  939. unknownDeclarationVersionHandling: "error"
  940. };
  941. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
  942. var Translator = class {
  943. constructor(factory) {
  944. this.factory = factory;
  945. }
  946. translateExpression(expression, imports, options = {}) {
  947. return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
  948. }
  949. translateStatement(statement, imports, options = {}) {
  950. return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
  951. }
  952. };
  953. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
  954. var LinkerEnvironment = class {
  955. constructor(fileSystem, logger, host, factory, options) {
  956. this.fileSystem = fileSystem;
  957. this.logger = logger;
  958. this.host = host;
  959. this.factory = factory;
  960. this.options = options;
  961. this.translator = new Translator(this.factory);
  962. this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
  963. }
  964. static create(fileSystem, logger, host, factory, options) {
  965. var _a, _b, _c;
  966. return new LinkerEnvironment(fileSystem, logger, host, factory, {
  967. sourceMapping: (_a = options.sourceMapping) != null ? _a : DEFAULT_LINKER_OPTIONS.sourceMapping,
  968. linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
  969. unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
  970. });
  971. }
  972. };
  973. // bazel-out/darwin-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/needs_linking.mjs
  974. function needsLinking(path, source) {
  975. return declarationFunctions.some((fn) => source.includes(fn));
  976. }
  977. export {
  978. FatalLinkerError,
  979. isFatalLinkerError,
  980. assert,
  981. FileLinker,
  982. DEFAULT_LINKER_OPTIONS,
  983. LinkerEnvironment,
  984. needsLinking
  985. };
  986. /**
  987. * @license
  988. * Copyright Google LLC All Rights Reserved.
  989. *
  990. * Use of this source code is governed by an MIT-style license that can be
  991. * found in the LICENSE file at https://angular.io/license
  992. */
  993. //# sourceMappingURL=chunk-JVASWB7F.js.map