source: trip-planner-front/node_modules/@angular/compiler/src/aot/static_reflector.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 157.1 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler/src/aot/static_reflector", ["require", "exports", "tslib", "@angular/compiler/src/compile_metadata", "@angular/compiler/src/core", "@angular/compiler/src/parse_util", "@angular/compiler/src/aot/formatted_error", "@angular/compiler/src/aot/static_symbol"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.StaticReflector = void 0;
20 var tslib_1 = require("tslib");
21 var compile_metadata_1 = require("@angular/compiler/src/compile_metadata");
22 var core_1 = require("@angular/compiler/src/core");
23 var parse_util_1 = require("@angular/compiler/src/parse_util");
24 var formatted_error_1 = require("@angular/compiler/src/aot/formatted_error");
25 var static_symbol_1 = require("@angular/compiler/src/aot/static_symbol");
26 var ANGULAR_CORE = '@angular/core';
27 var ANGULAR_ROUTER = '@angular/router';
28 var HIDDEN_KEY = /^\$.*\$$/;
29 var IGNORE = {
30 __symbolic: 'ignore'
31 };
32 var USE_VALUE = 'useValue';
33 var PROVIDE = 'provide';
34 var REFERENCE_SET = new Set([USE_VALUE, 'useFactory', 'data', 'id', 'loadChildren']);
35 var TYPEGUARD_POSTFIX = 'TypeGuard';
36 var USE_IF = 'UseIf';
37 function shouldIgnore(value) {
38 return value && value.__symbolic == 'ignore';
39 }
40 /**
41 * A static reflector implements enough of the Reflector API that is necessary to compile
42 * templates statically.
43 */
44 var StaticReflector = /** @class */ (function () {
45 function StaticReflector(summaryResolver, symbolResolver, knownMetadataClasses, knownMetadataFunctions, errorRecorder) {
46 var _this = this;
47 if (knownMetadataClasses === void 0) { knownMetadataClasses = []; }
48 if (knownMetadataFunctions === void 0) { knownMetadataFunctions = []; }
49 this.summaryResolver = summaryResolver;
50 this.symbolResolver = symbolResolver;
51 this.errorRecorder = errorRecorder;
52 this.annotationCache = new Map();
53 this.shallowAnnotationCache = new Map();
54 this.propertyCache = new Map();
55 this.parameterCache = new Map();
56 this.methodCache = new Map();
57 this.staticCache = new Map();
58 this.conversionMap = new Map();
59 this.resolvedExternalReferences = new Map();
60 this.annotationForParentClassWithSummaryKind = new Map();
61 this.initializeConversionMap();
62 knownMetadataClasses.forEach(function (kc) { return _this._registerDecoratorOrConstructor(_this.getStaticSymbol(kc.filePath, kc.name), kc.ctor); });
63 knownMetadataFunctions.forEach(function (kf) { return _this._registerFunction(_this.getStaticSymbol(kf.filePath, kf.name), kf.fn); });
64 this.annotationForParentClassWithSummaryKind.set(compile_metadata_1.CompileSummaryKind.Directive, [core_1.createDirective, core_1.createComponent]);
65 this.annotationForParentClassWithSummaryKind.set(compile_metadata_1.CompileSummaryKind.Pipe, [core_1.createPipe]);
66 this.annotationForParentClassWithSummaryKind.set(compile_metadata_1.CompileSummaryKind.NgModule, [core_1.createNgModule]);
67 this.annotationForParentClassWithSummaryKind.set(compile_metadata_1.CompileSummaryKind.Injectable, [core_1.createInjectable, core_1.createPipe, core_1.createDirective, core_1.createComponent, core_1.createNgModule]);
68 }
69 StaticReflector.prototype.componentModuleUrl = function (typeOrFunc) {
70 var staticSymbol = this.findSymbolDeclaration(typeOrFunc);
71 return this.symbolResolver.getResourcePath(staticSymbol);
72 };
73 /**
74 * Invalidate the specified `symbols` on program change.
75 * @param symbols
76 */
77 StaticReflector.prototype.invalidateSymbols = function (symbols) {
78 var e_1, _a;
79 try {
80 for (var symbols_1 = tslib_1.__values(symbols), symbols_1_1 = symbols_1.next(); !symbols_1_1.done; symbols_1_1 = symbols_1.next()) {
81 var symbol = symbols_1_1.value;
82 this.annotationCache.delete(symbol);
83 this.shallowAnnotationCache.delete(symbol);
84 this.propertyCache.delete(symbol);
85 this.parameterCache.delete(symbol);
86 this.methodCache.delete(symbol);
87 this.staticCache.delete(symbol);
88 this.conversionMap.delete(symbol);
89 }
90 }
91 catch (e_1_1) { e_1 = { error: e_1_1 }; }
92 finally {
93 try {
94 if (symbols_1_1 && !symbols_1_1.done && (_a = symbols_1.return)) _a.call(symbols_1);
95 }
96 finally { if (e_1) throw e_1.error; }
97 }
98 };
99 StaticReflector.prototype.resolveExternalReference = function (ref, containingFile) {
100 var key = undefined;
101 if (!containingFile) {
102 key = ref.moduleName + ":" + ref.name;
103 var declarationSymbol_1 = this.resolvedExternalReferences.get(key);
104 if (declarationSymbol_1)
105 return declarationSymbol_1;
106 }
107 var refSymbol = this.symbolResolver.getSymbolByModule(ref.moduleName, ref.name, containingFile);
108 var declarationSymbol = this.findSymbolDeclaration(refSymbol);
109 if (!containingFile) {
110 this.symbolResolver.recordModuleNameForFileName(refSymbol.filePath, ref.moduleName);
111 this.symbolResolver.recordImportAs(declarationSymbol, refSymbol);
112 }
113 if (key) {
114 this.resolvedExternalReferences.set(key, declarationSymbol);
115 }
116 return declarationSymbol;
117 };
118 StaticReflector.prototype.findDeclaration = function (moduleUrl, name, containingFile) {
119 return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));
120 };
121 StaticReflector.prototype.tryFindDeclaration = function (moduleUrl, name, containingFile) {
122 var _this = this;
123 return this.symbolResolver.ignoreErrorsFor(function () { return _this.findDeclaration(moduleUrl, name, containingFile); });
124 };
125 StaticReflector.prototype.findSymbolDeclaration = function (symbol) {
126 var resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
127 if (resolvedSymbol) {
128 var resolvedMetadata = resolvedSymbol.metadata;
129 if (resolvedMetadata && resolvedMetadata.__symbolic === 'resolved') {
130 resolvedMetadata = resolvedMetadata.symbol;
131 }
132 if (resolvedMetadata instanceof static_symbol_1.StaticSymbol) {
133 return this.findSymbolDeclaration(resolvedSymbol.metadata);
134 }
135 }
136 return symbol;
137 };
138 StaticReflector.prototype.tryAnnotations = function (type) {
139 var originalRecorder = this.errorRecorder;
140 this.errorRecorder = function (error, fileName) { };
141 try {
142 return this.annotations(type);
143 }
144 finally {
145 this.errorRecorder = originalRecorder;
146 }
147 };
148 StaticReflector.prototype.annotations = function (type) {
149 var _this = this;
150 return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators); }, this.annotationCache);
151 };
152 StaticReflector.prototype.shallowAnnotations = function (type) {
153 var _this = this;
154 return this._annotations(type, function (type, decorators) { return _this.simplify(type, decorators, true); }, this.shallowAnnotationCache);
155 };
156 StaticReflector.prototype._annotations = function (type, simplify, annotationCache) {
157 var annotations = annotationCache.get(type);
158 if (!annotations) {
159 annotations = [];
160 var classMetadata = this.getTypeMetadata(type);
161 var parentType = this.findParentType(type, classMetadata);
162 if (parentType) {
163 var parentAnnotations = this.annotations(parentType);
164 annotations.push.apply(annotations, tslib_1.__spreadArray([], tslib_1.__read(parentAnnotations)));
165 }
166 var ownAnnotations_1 = [];
167 if (classMetadata['decorators']) {
168 ownAnnotations_1 = simplify(type, classMetadata['decorators']);
169 if (ownAnnotations_1) {
170 annotations.push.apply(annotations, tslib_1.__spreadArray([], tslib_1.__read(ownAnnotations_1)));
171 }
172 }
173 if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
174 this.summaryResolver.isLibraryFile(parentType.filePath)) {
175 var summary = this.summaryResolver.resolveSummary(parentType);
176 if (summary && summary.type) {
177 var requiredAnnotationTypes = this.annotationForParentClassWithSummaryKind.get(summary.type.summaryKind);
178 var typeHasRequiredAnnotation = requiredAnnotationTypes.some(function (requiredType) { return ownAnnotations_1.some(function (ann) { return requiredType.isTypeOf(ann); }); });
179 if (!typeHasRequiredAnnotation) {
180 this.reportError(formatMetadataError(metadataError("Class " + type.name + " in " + type.filePath + " extends from a " + compile_metadata_1.CompileSummaryKind[summary.type.summaryKind] + " in another compilation unit without duplicating the decorator",
181 /* summary */ undefined, "Please add a " + requiredAnnotationTypes.map(function (type) { return type.ngMetadataName; })
182 .join(' or ') + " decorator to the class"), type), type);
183 }
184 }
185 }
186 annotationCache.set(type, annotations.filter(function (ann) { return !!ann; }));
187 }
188 return annotations;
189 };
190 StaticReflector.prototype.propMetadata = function (type) {
191 var _this = this;
192 var propMetadata = this.propertyCache.get(type);
193 if (!propMetadata) {
194 var classMetadata = this.getTypeMetadata(type);
195 propMetadata = {};
196 var parentType = this.findParentType(type, classMetadata);
197 if (parentType) {
198 var parentPropMetadata_1 = this.propMetadata(parentType);
199 Object.keys(parentPropMetadata_1).forEach(function (parentProp) {
200 propMetadata[parentProp] = parentPropMetadata_1[parentProp];
201 });
202 }
203 var members_1 = classMetadata['members'] || {};
204 Object.keys(members_1).forEach(function (propName) {
205 var propData = members_1[propName];
206 var prop = propData
207 .find(function (a) { return a['__symbolic'] == 'property' || a['__symbolic'] == 'method'; });
208 var decorators = [];
209 // hasOwnProperty() is used here to make sure we do not look up methods
210 // on `Object.prototype`.
211 if (propMetadata === null || propMetadata === void 0 ? void 0 : propMetadata.hasOwnProperty(propName)) {
212 decorators.push.apply(decorators, tslib_1.__spreadArray([], tslib_1.__read(propMetadata[propName])));
213 }
214 propMetadata[propName] = decorators;
215 if (prop && prop['decorators']) {
216 decorators.push.apply(decorators, tslib_1.__spreadArray([], tslib_1.__read(_this.simplify(type, prop['decorators']))));
217 }
218 });
219 this.propertyCache.set(type, propMetadata);
220 }
221 return propMetadata;
222 };
223 StaticReflector.prototype.parameters = function (type) {
224 var _this = this;
225 if (!(type instanceof static_symbol_1.StaticSymbol)) {
226 this.reportError(new Error("parameters received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
227 return [];
228 }
229 try {
230 var parameters_1 = this.parameterCache.get(type);
231 if (!parameters_1) {
232 var classMetadata = this.getTypeMetadata(type);
233 var parentType = this.findParentType(type, classMetadata);
234 var members = classMetadata ? classMetadata['members'] : null;
235 var ctorData = members ? members['__ctor__'] : null;
236 if (ctorData) {
237 var ctor = ctorData.find(function (a) { return a['__symbolic'] == 'constructor'; });
238 var rawParameterTypes = ctor['parameters'] || [];
239 var parameterDecorators_1 = this.simplify(type, ctor['parameterDecorators'] || []);
240 parameters_1 = [];
241 rawParameterTypes.forEach(function (rawParamType, index) {
242 var nestedResult = [];
243 var paramType = _this.trySimplify(type, rawParamType);
244 if (paramType)
245 nestedResult.push(paramType);
246 var decorators = parameterDecorators_1 ? parameterDecorators_1[index] : null;
247 if (decorators) {
248 nestedResult.push.apply(nestedResult, tslib_1.__spreadArray([], tslib_1.__read(decorators)));
249 }
250 parameters_1.push(nestedResult);
251 });
252 }
253 else if (parentType) {
254 parameters_1 = this.parameters(parentType);
255 }
256 if (!parameters_1) {
257 parameters_1 = [];
258 }
259 this.parameterCache.set(type, parameters_1);
260 }
261 return parameters_1;
262 }
263 catch (e) {
264 console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
265 throw e;
266 }
267 };
268 StaticReflector.prototype._methodNames = function (type) {
269 var methodNames = this.methodCache.get(type);
270 if (!methodNames) {
271 var classMetadata = this.getTypeMetadata(type);
272 methodNames = {};
273 var parentType = this.findParentType(type, classMetadata);
274 if (parentType) {
275 var parentMethodNames_1 = this._methodNames(parentType);
276 Object.keys(parentMethodNames_1).forEach(function (parentProp) {
277 methodNames[parentProp] = parentMethodNames_1[parentProp];
278 });
279 }
280 var members_2 = classMetadata['members'] || {};
281 Object.keys(members_2).forEach(function (propName) {
282 var propData = members_2[propName];
283 var isMethod = propData.some(function (a) { return a['__symbolic'] == 'method'; });
284 methodNames[propName] = methodNames[propName] || isMethod;
285 });
286 this.methodCache.set(type, methodNames);
287 }
288 return methodNames;
289 };
290 StaticReflector.prototype._staticMembers = function (type) {
291 var staticMembers = this.staticCache.get(type);
292 if (!staticMembers) {
293 var classMetadata = this.getTypeMetadata(type);
294 var staticMemberData = classMetadata['statics'] || {};
295 staticMembers = Object.keys(staticMemberData);
296 this.staticCache.set(type, staticMembers);
297 }
298 return staticMembers;
299 };
300 StaticReflector.prototype.findParentType = function (type, classMetadata) {
301 var parentType = this.trySimplify(type, classMetadata['extends']);
302 if (parentType instanceof static_symbol_1.StaticSymbol) {
303 return parentType;
304 }
305 };
306 StaticReflector.prototype.hasLifecycleHook = function (type, lcProperty) {
307 if (!(type instanceof static_symbol_1.StaticSymbol)) {
308 this.reportError(new Error("hasLifecycleHook received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
309 }
310 try {
311 return !!this._methodNames(type)[lcProperty];
312 }
313 catch (e) {
314 console.error("Failed on type " + JSON.stringify(type) + " with error " + e);
315 throw e;
316 }
317 };
318 StaticReflector.prototype.guards = function (type) {
319 var e_2, _a;
320 if (!(type instanceof static_symbol_1.StaticSymbol)) {
321 this.reportError(new Error("guards received " + JSON.stringify(type) + " which is not a StaticSymbol"), type);
322 return {};
323 }
324 var staticMembers = this._staticMembers(type);
325 var result = {};
326 try {
327 for (var staticMembers_1 = tslib_1.__values(staticMembers), staticMembers_1_1 = staticMembers_1.next(); !staticMembers_1_1.done; staticMembers_1_1 = staticMembers_1.next()) {
328 var name_1 = staticMembers_1_1.value;
329 if (name_1.endsWith(TYPEGUARD_POSTFIX)) {
330 var property = name_1.substr(0, name_1.length - TYPEGUARD_POSTFIX.length);
331 var value = void 0;
332 if (property.endsWith(USE_IF)) {
333 property = name_1.substr(0, property.length - USE_IF.length);
334 value = USE_IF;
335 }
336 else {
337 value = this.getStaticSymbol(type.filePath, type.name, [name_1]);
338 }
339 result[property] = value;
340 }
341 }
342 }
343 catch (e_2_1) { e_2 = { error: e_2_1 }; }
344 finally {
345 try {
346 if (staticMembers_1_1 && !staticMembers_1_1.done && (_a = staticMembers_1.return)) _a.call(staticMembers_1);
347 }
348 finally { if (e_2) throw e_2.error; }
349 }
350 return result;
351 };
352 StaticReflector.prototype._registerDecoratorOrConstructor = function (type, ctor) {
353 this.conversionMap.set(type, function (context, args) { return new (ctor.bind.apply(ctor, tslib_1.__spreadArray([void 0], tslib_1.__read(args))))(); });
354 };
355 StaticReflector.prototype._registerFunction = function (type, fn) {
356 this.conversionMap.set(type, function (context, args) { return fn.apply(undefined, args); });
357 };
358 StaticReflector.prototype.initializeConversionMap = function () {
359 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), core_1.createInjectable);
360 this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');
361 this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');
362 this.ROUTES = this.tryFindDeclaration(ANGULAR_ROUTER, 'ROUTES');
363 this.ANALYZE_FOR_ENTRY_COMPONENTS =
364 this.findDeclaration(ANGULAR_CORE, 'ANALYZE_FOR_ENTRY_COMPONENTS');
365 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), core_1.createHost);
366 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), core_1.createSelf);
367 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), core_1.createSkipSelf);
368 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), core_1.createInject);
369 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), core_1.createOptional);
370 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), core_1.createAttribute);
371 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), core_1.createContentChild);
372 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), core_1.createContentChildren);
373 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), core_1.createViewChild);
374 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), core_1.createViewChildren);
375 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), core_1.createInput);
376 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), core_1.createOutput);
377 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), core_1.createPipe);
378 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), core_1.createHostBinding);
379 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), core_1.createHostListener);
380 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), core_1.createDirective);
381 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), core_1.createComponent);
382 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), core_1.createNgModule);
383 // Note: Some metadata classes can be used directly with Provider.deps.
384 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), core_1.createHost);
385 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), core_1.createSelf);
386 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), core_1.createSkipSelf);
387 this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), core_1.createOptional);
388 };
389 /**
390 * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
391 * All types passed to the StaticResolver should be pseudo-types returned by this method.
392 *
393 * @param declarationFile the absolute path of the file where the symbol is declared
394 * @param name the name of the type.
395 */
396 StaticReflector.prototype.getStaticSymbol = function (declarationFile, name, members) {
397 return this.symbolResolver.getStaticSymbol(declarationFile, name, members);
398 };
399 /**
400 * Simplify but discard any errors
401 */
402 StaticReflector.prototype.trySimplify = function (context, value) {
403 var originalRecorder = this.errorRecorder;
404 this.errorRecorder = function (error, fileName) { };
405 var result = this.simplify(context, value);
406 this.errorRecorder = originalRecorder;
407 return result;
408 };
409 /** @internal */
410 StaticReflector.prototype.simplify = function (context, value, lazy) {
411 if (lazy === void 0) { lazy = false; }
412 var self = this;
413 var scope = BindingScope.empty;
414 var calling = new Map();
415 var rootContext = context;
416 function simplifyInContext(context, value, depth, references) {
417 function resolveReferenceValue(staticSymbol) {
418 var resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);
419 return resolvedSymbol ? resolvedSymbol.metadata : null;
420 }
421 function simplifyEagerly(value) {
422 return simplifyInContext(context, value, depth, 0);
423 }
424 function simplifyLazily(value) {
425 return simplifyInContext(context, value, depth, references + 1);
426 }
427 function simplifyNested(nestedContext, value) {
428 if (nestedContext === context) {
429 // If the context hasn't changed let the exception propagate unmodified.
430 return simplifyInContext(nestedContext, value, depth + 1, references);
431 }
432 try {
433 return simplifyInContext(nestedContext, value, depth + 1, references);
434 }
435 catch (e) {
436 if (isMetadataError(e)) {
437 // Propagate the message text up but add a message to the chain that explains how we got
438 // here.
439 // e.chain implies e.symbol
440 var summaryMsg = e.chain ? 'references \'' + e.symbol.name + '\'' : errorSummary(e);
441 var summary = "'" + nestedContext.name + "' " + summaryMsg;
442 var chain = { message: summary, position: e.position, next: e.chain };
443 // TODO(chuckj): retrieve the position information indirectly from the collectors node
444 // map if the metadata is from a .ts file.
445 self.error({
446 message: e.message,
447 advise: e.advise,
448 context: e.context,
449 chain: chain,
450 symbol: nestedContext
451 }, context);
452 }
453 else {
454 // It is probably an internal error.
455 throw e;
456 }
457 }
458 }
459 function simplifyCall(functionSymbol, targetFunction, args, targetExpression) {
460 if (targetFunction && targetFunction['__symbolic'] == 'function') {
461 if (calling.get(functionSymbol)) {
462 self.error({
463 message: 'Recursion is not supported',
464 summary: "called '" + functionSymbol.name + "' recursively",
465 value: targetFunction
466 }, functionSymbol);
467 }
468 try {
469 var value_1 = targetFunction['value'];
470 if (value_1 && (depth != 0 || value_1.__symbolic != 'error')) {
471 var parameters = targetFunction['parameters'];
472 var defaults = targetFunction.defaults;
473 args = args.map(function (arg) { return simplifyNested(context, arg); })
474 .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
475 if (defaults && defaults.length > args.length) {
476 args.push.apply(args, tslib_1.__spreadArray([], tslib_1.__read(defaults.slice(args.length).map(function (value) { return simplify(value); }))));
477 }
478 calling.set(functionSymbol, true);
479 var functionScope = BindingScope.build();
480 for (var i = 0; i < parameters.length; i++) {
481 functionScope.define(parameters[i], args[i]);
482 }
483 var oldScope = scope;
484 var result_1;
485 try {
486 scope = functionScope.done();
487 result_1 = simplifyNested(functionSymbol, value_1);
488 }
489 finally {
490 scope = oldScope;
491 }
492 return result_1;
493 }
494 }
495 finally {
496 calling.delete(functionSymbol);
497 }
498 }
499 if (depth === 0) {
500 // If depth is 0 we are evaluating the top level expression that is describing element
501 // decorator. In this case, it is a decorator we don't understand, such as a custom
502 // non-angular decorator, and we should just ignore it.
503 return IGNORE;
504 }
505 var position = undefined;
506 if (targetExpression && targetExpression.__symbolic == 'resolved') {
507 var line = targetExpression.line;
508 var character = targetExpression.character;
509 var fileName = targetExpression.fileName;
510 if (fileName != null && line != null && character != null) {
511 position = { fileName: fileName, line: line, column: character };
512 }
513 }
514 self.error({
515 message: FUNCTION_CALL_NOT_SUPPORTED,
516 context: functionSymbol,
517 value: targetFunction,
518 position: position
519 }, context);
520 }
521 function simplify(expression) {
522 var e_3, _a, e_4, _b;
523 if (isPrimitive(expression)) {
524 return expression;
525 }
526 if (Array.isArray(expression)) {
527 var result_2 = [];
528 try {
529 for (var _c = tslib_1.__values(expression), _d = _c.next(); !_d.done; _d = _c.next()) {
530 var item = _d.value;
531 // Check for a spread expression
532 if (item && item.__symbolic === 'spread') {
533 // We call with references as 0 because we require the actual value and cannot
534 // tolerate a reference here.
535 var spreadArray = simplifyEagerly(item.expression);
536 if (Array.isArray(spreadArray)) {
537 try {
538 for (var spreadArray_1 = (e_4 = void 0, tslib_1.__values(spreadArray)), spreadArray_1_1 = spreadArray_1.next(); !spreadArray_1_1.done; spreadArray_1_1 = spreadArray_1.next()) {
539 var spreadItem = spreadArray_1_1.value;
540 result_2.push(spreadItem);
541 }
542 }
543 catch (e_4_1) { e_4 = { error: e_4_1 }; }
544 finally {
545 try {
546 if (spreadArray_1_1 && !spreadArray_1_1.done && (_b = spreadArray_1.return)) _b.call(spreadArray_1);
547 }
548 finally { if (e_4) throw e_4.error; }
549 }
550 continue;
551 }
552 }
553 var value_2 = simplify(item);
554 if (shouldIgnore(value_2)) {
555 continue;
556 }
557 result_2.push(value_2);
558 }
559 }
560 catch (e_3_1) { e_3 = { error: e_3_1 }; }
561 finally {
562 try {
563 if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
564 }
565 finally { if (e_3) throw e_3.error; }
566 }
567 return result_2;
568 }
569 if (expression instanceof static_symbol_1.StaticSymbol) {
570 // Stop simplification at builtin symbols or if we are in a reference context and
571 // the symbol doesn't have members.
572 if (expression === self.injectionToken || self.conversionMap.has(expression) ||
573 (references > 0 && !expression.members.length)) {
574 return expression;
575 }
576 else {
577 var staticSymbol = expression;
578 var declarationValue = resolveReferenceValue(staticSymbol);
579 if (declarationValue != null) {
580 return simplifyNested(staticSymbol, declarationValue);
581 }
582 else {
583 return staticSymbol;
584 }
585 }
586 }
587 if (expression) {
588 if (expression['__symbolic']) {
589 var staticSymbol = void 0;
590 switch (expression['__symbolic']) {
591 case 'binop':
592 var left = simplify(expression['left']);
593 if (shouldIgnore(left))
594 return left;
595 var right = simplify(expression['right']);
596 if (shouldIgnore(right))
597 return right;
598 switch (expression['operator']) {
599 case '&&':
600 return left && right;
601 case '||':
602 return left || right;
603 case '|':
604 return left | right;
605 case '^':
606 return left ^ right;
607 case '&':
608 return left & right;
609 case '==':
610 return left == right;
611 case '!=':
612 return left != right;
613 case '===':
614 return left === right;
615 case '!==':
616 return left !== right;
617 case '<':
618 return left < right;
619 case '>':
620 return left > right;
621 case '<=':
622 return left <= right;
623 case '>=':
624 return left >= right;
625 case '<<':
626 return left << right;
627 case '>>':
628 return left >> right;
629 case '+':
630 return left + right;
631 case '-':
632 return left - right;
633 case '*':
634 return left * right;
635 case '/':
636 return left / right;
637 case '%':
638 return left % right;
639 case '??':
640 return left !== null && left !== void 0 ? left : right;
641 }
642 return null;
643 case 'if':
644 var condition = simplify(expression['condition']);
645 return condition ? simplify(expression['thenExpression']) :
646 simplify(expression['elseExpression']);
647 case 'pre':
648 var operand = simplify(expression['operand']);
649 if (shouldIgnore(operand))
650 return operand;
651 switch (expression['operator']) {
652 case '+':
653 return operand;
654 case '-':
655 return -operand;
656 case '!':
657 return !operand;
658 case '~':
659 return ~operand;
660 }
661 return null;
662 case 'index':
663 var indexTarget = simplifyEagerly(expression['expression']);
664 var index = simplifyEagerly(expression['index']);
665 if (indexTarget && isPrimitive(index))
666 return indexTarget[index];
667 return null;
668 case 'select':
669 var member = expression['member'];
670 var selectContext = context;
671 var selectTarget = simplify(expression['expression']);
672 if (selectTarget instanceof static_symbol_1.StaticSymbol) {
673 var members = selectTarget.members.concat(member);
674 selectContext =
675 self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);
676 var declarationValue = resolveReferenceValue(selectContext);
677 if (declarationValue != null) {
678 return simplifyNested(selectContext, declarationValue);
679 }
680 else {
681 return selectContext;
682 }
683 }
684 if (selectTarget && isPrimitive(member))
685 return simplifyNested(selectContext, selectTarget[member]);
686 return null;
687 case 'reference':
688 // Note: This only has to deal with variable references, as symbol references have
689 // been converted into 'resolved'
690 // in the StaticSymbolResolver.
691 var name_2 = expression['name'];
692 var localValue = scope.resolve(name_2);
693 if (localValue != BindingScope.missing) {
694 return localValue;
695 }
696 break;
697 case 'resolved':
698 try {
699 return simplify(expression.symbol);
700 }
701 catch (e) {
702 // If an error is reported evaluating the symbol record the position of the
703 // reference in the error so it can
704 // be reported in the error message generated from the exception.
705 if (isMetadataError(e) && expression.fileName != null &&
706 expression.line != null && expression.character != null) {
707 e.position = {
708 fileName: expression.fileName,
709 line: expression.line,
710 column: expression.character
711 };
712 }
713 throw e;
714 }
715 case 'class':
716 return context;
717 case 'function':
718 return context;
719 case 'new':
720 case 'call':
721 // Determine if the function is a built-in conversion
722 staticSymbol = simplifyInContext(context, expression['expression'], depth + 1, /* references */ 0);
723 if (staticSymbol instanceof static_symbol_1.StaticSymbol) {
724 if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {
725 // if somebody calls new InjectionToken, don't create an InjectionToken,
726 // but rather return the symbol to which the InjectionToken is assigned to.
727 // OpaqueToken is supported too as it is required by the language service to
728 // support v4 and prior versions of Angular.
729 return context;
730 }
731 var argExpressions = expression['arguments'] || [];
732 var converter = self.conversionMap.get(staticSymbol);
733 if (converter) {
734 var args = argExpressions.map(function (arg) { return simplifyNested(context, arg); })
735 .map(function (arg) { return shouldIgnore(arg) ? undefined : arg; });
736 return converter(context, args);
737 }
738 else {
739 // Determine if the function is one we can simplify.
740 var targetFunction = resolveReferenceValue(staticSymbol);
741 return simplifyCall(staticSymbol, targetFunction, argExpressions, expression['expression']);
742 }
743 }
744 return IGNORE;
745 case 'error':
746 var message = expression.message;
747 if (expression['line'] != null) {
748 self.error({
749 message: message,
750 context: expression.context,
751 value: expression,
752 position: {
753 fileName: expression['fileName'],
754 line: expression['line'],
755 column: expression['character']
756 }
757 }, context);
758 }
759 else {
760 self.error({ message: message, context: expression.context }, context);
761 }
762 return IGNORE;
763 case 'ignore':
764 return expression;
765 }
766 return null;
767 }
768 return mapStringMap(expression, function (value, name) {
769 if (REFERENCE_SET.has(name)) {
770 if (name === USE_VALUE && PROVIDE in expression) {
771 // If this is a provider expression, check for special tokens that need the value
772 // during analysis.
773 var provide = simplify(expression.provide);
774 if (provide === self.ROUTES || provide == self.ANALYZE_FOR_ENTRY_COMPONENTS) {
775 return simplify(value);
776 }
777 }
778 return simplifyLazily(value);
779 }
780 return simplify(value);
781 });
782 }
783 return IGNORE;
784 }
785 return simplify(value);
786 }
787 var result;
788 try {
789 result = simplifyInContext(context, value, 0, lazy ? 1 : 0);
790 }
791 catch (e) {
792 if (this.errorRecorder) {
793 this.reportError(e, context);
794 }
795 else {
796 throw formatMetadataError(e, context);
797 }
798 }
799 if (shouldIgnore(result)) {
800 return undefined;
801 }
802 return result;
803 };
804 StaticReflector.prototype.getTypeMetadata = function (type) {
805 var resolvedSymbol = this.symbolResolver.resolveSymbol(type);
806 return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :
807 { __symbolic: 'class' };
808 };
809 StaticReflector.prototype.reportError = function (error, context, path) {
810 if (this.errorRecorder) {
811 this.errorRecorder(formatMetadataError(error, context), (context && context.filePath) || path);
812 }
813 else {
814 throw error;
815 }
816 };
817 StaticReflector.prototype.error = function (_a, reportingContext) {
818 var message = _a.message, summary = _a.summary, advise = _a.advise, position = _a.position, context = _a.context, value = _a.value, symbol = _a.symbol, chain = _a.chain;
819 this.reportError(metadataError(message, summary, advise, position, symbol, context, chain), reportingContext);
820 };
821 return StaticReflector;
822 }());
823 exports.StaticReflector = StaticReflector;
824 var METADATA_ERROR = 'ngMetadataError';
825 function metadataError(message, summary, advise, position, symbol, context, chain) {
826 var error = parse_util_1.syntaxError(message);
827 error[METADATA_ERROR] = true;
828 if (advise)
829 error.advise = advise;
830 if (position)
831 error.position = position;
832 if (summary)
833 error.summary = summary;
834 if (context)
835 error.context = context;
836 if (chain)
837 error.chain = chain;
838 if (symbol)
839 error.symbol = symbol;
840 return error;
841 }
842 function isMetadataError(error) {
843 return !!error[METADATA_ERROR];
844 }
845 var REFERENCE_TO_NONEXPORTED_CLASS = 'Reference to non-exported class';
846 var VARIABLE_NOT_INITIALIZED = 'Variable not initialized';
847 var DESTRUCTURE_NOT_SUPPORTED = 'Destructuring not supported';
848 var COULD_NOT_RESOLVE_TYPE = 'Could not resolve type';
849 var FUNCTION_CALL_NOT_SUPPORTED = 'Function call not supported';
850 var REFERENCE_TO_LOCAL_SYMBOL = 'Reference to a local symbol';
851 var LAMBDA_NOT_SUPPORTED = 'Lambda not supported';
852 function expandedMessage(message, context) {
853 switch (message) {
854 case REFERENCE_TO_NONEXPORTED_CLASS:
855 if (context && context.className) {
856 return "References to a non-exported class are not supported in decorators but " + context.className + " was referenced.";
857 }
858 break;
859 case VARIABLE_NOT_INITIALIZED:
860 return 'Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler';
861 case DESTRUCTURE_NOT_SUPPORTED:
862 return 'Referencing an exported destructured variable or constant is not supported in decorators and this value is needed by the template compiler';
863 case COULD_NOT_RESOLVE_TYPE:
864 if (context && context.typeName) {
865 return "Could not resolve type " + context.typeName;
866 }
867 break;
868 case FUNCTION_CALL_NOT_SUPPORTED:
869 if (context && context.name) {
870 return "Function calls are not supported in decorators but '" + context.name + "' was called";
871 }
872 return 'Function calls are not supported in decorators';
873 case REFERENCE_TO_LOCAL_SYMBOL:
874 if (context && context.name) {
875 return "Reference to a local (non-exported) symbols are not supported in decorators but '" + context.name + "' was referenced";
876 }
877 break;
878 case LAMBDA_NOT_SUPPORTED:
879 return "Function expressions are not supported in decorators";
880 }
881 return message;
882 }
883 function messageAdvise(message, context) {
884 switch (message) {
885 case REFERENCE_TO_NONEXPORTED_CLASS:
886 if (context && context.className) {
887 return "Consider exporting '" + context.className + "'";
888 }
889 break;
890 case DESTRUCTURE_NOT_SUPPORTED:
891 return 'Consider simplifying to avoid destructuring';
892 case REFERENCE_TO_LOCAL_SYMBOL:
893 if (context && context.name) {
894 return "Consider exporting '" + context.name + "'";
895 }
896 break;
897 case LAMBDA_NOT_SUPPORTED:
898 return "Consider changing the function expression into an exported function";
899 }
900 return undefined;
901 }
902 function errorSummary(error) {
903 if (error.summary) {
904 return error.summary;
905 }
906 switch (error.message) {
907 case REFERENCE_TO_NONEXPORTED_CLASS:
908 if (error.context && error.context.className) {
909 return "references non-exported class " + error.context.className;
910 }
911 break;
912 case VARIABLE_NOT_INITIALIZED:
913 return 'is not initialized';
914 case DESTRUCTURE_NOT_SUPPORTED:
915 return 'is a destructured variable';
916 case COULD_NOT_RESOLVE_TYPE:
917 return 'could not be resolved';
918 case FUNCTION_CALL_NOT_SUPPORTED:
919 if (error.context && error.context.name) {
920 return "calls '" + error.context.name + "'";
921 }
922 return "calls a function";
923 case REFERENCE_TO_LOCAL_SYMBOL:
924 if (error.context && error.context.name) {
925 return "references local variable " + error.context.name;
926 }
927 return "references a local variable";
928 }
929 return 'contains the error';
930 }
931 function mapStringMap(input, transform) {
932 if (!input)
933 return {};
934 var result = {};
935 Object.keys(input).forEach(function (key) {
936 var value = transform(input[key], key);
937 if (!shouldIgnore(value)) {
938 if (HIDDEN_KEY.test(key)) {
939 Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });
940 }
941 else {
942 result[key] = value;
943 }
944 }
945 });
946 return result;
947 }
948 function isPrimitive(o) {
949 return o === null || (typeof o !== 'function' && typeof o !== 'object');
950 }
951 var BindingScope = /** @class */ (function () {
952 function BindingScope() {
953 }
954 BindingScope.build = function () {
955 var current = new Map();
956 return {
957 define: function (name, value) {
958 current.set(name, value);
959 return this;
960 },
961 done: function () {
962 return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;
963 }
964 };
965 };
966 BindingScope.missing = {};
967 BindingScope.empty = { resolve: function (name) { return BindingScope.missing; } };
968 return BindingScope;
969 }());
970 var PopulatedScope = /** @class */ (function (_super) {
971 tslib_1.__extends(PopulatedScope, _super);
972 function PopulatedScope(bindings) {
973 var _this = _super.call(this) || this;
974 _this.bindings = bindings;
975 return _this;
976 }
977 PopulatedScope.prototype.resolve = function (name) {
978 return this.bindings.has(name) ? this.bindings.get(name) : BindingScope.missing;
979 };
980 return PopulatedScope;
981 }(BindingScope));
982 function formatMetadataMessageChain(chain, advise) {
983 var expanded = expandedMessage(chain.message, chain.context);
984 var nesting = chain.symbol ? " in '" + chain.symbol.name + "'" : '';
985 var message = "" + expanded + nesting;
986 var position = chain.position;
987 var next = chain.next ?
988 formatMetadataMessageChain(chain.next, advise) :
989 advise ? { message: advise } : undefined;
990 return { message: message, position: position, next: next ? [next] : undefined };
991 }
992 function formatMetadataError(e, context) {
993 if (isMetadataError(e)) {
994 // Produce a formatted version of the and leaving enough information in the original error
995 // to recover the formatting information to eventually produce a diagnostic error message.
996 var position = e.position;
997 var chain = {
998 message: "Error during template compile of '" + context.name + "'",
999 position: position,
1000 next: { message: e.message, next: e.chain, context: e.context, symbol: e.symbol }
1001 };
1002 var advise = e.advise || messageAdvise(e.message, e.context);
1003 return formatted_error_1.formattedError(formatMetadataMessageChain(chain, advise));
1004 }
1005 return e;
1006 }
1007});
1008//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGljX3JlZmxlY3Rvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy9hb3Qvc3RhdGljX3JlZmxlY3Rvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7O0lBRUgsMkVBQXVEO0lBRXZELG1EQUFpVztJQUVqVywrREFBMEM7SUFHMUMsNkVBQXdFO0lBQ3hFLHlFQUE2QztJQUc3QyxJQUFNLFlBQVksR0FBRyxlQUFlLENBQUM7SUFDckMsSUFBTSxjQUFjLEdBQUcsaUJBQWlCLENBQUM7SUFFekMsSUFBTSxVQUFVLEdBQUcsVUFBVSxDQUFDO0lBRTlCLElBQU0sTUFBTSxHQUFHO1FBQ2IsVUFBVSxFQUFFLFFBQVE7S0FDckIsQ0FBQztJQUVGLElBQU0sU0FBUyxHQUFHLFVBQVUsQ0FBQztJQUM3QixJQUFNLE9BQU8sR0FBRyxTQUFTLENBQUM7SUFDMUIsSUFBTSxhQUFhLEdBQUcsSUFBSSxHQUFHLENBQUMsQ0FBQyxTQUFTLEVBQUUsWUFBWSxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsY0FBYyxDQUFDLENBQUMsQ0FBQztJQUN2RixJQUFNLGlCQUFpQixHQUFHLFdBQVcsQ0FBQztJQUN0QyxJQUFNLE1BQU0sR0FBRyxPQUFPLENBQUM7SUFFdkIsU0FB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WdlIHRvIHRoZSBjaGFpbiB0aGF0IGV4cGxhaW5zIGhvdyB3ZSBnb3RcbiAgICAgICAgICAgIC8vIGhlcmUuXG4gICAgICAgICAgICAvLyBlLmNoYWluIGltcGxpZXMgZS5zeW1ib2xcbiAgICAgICAgICAgIGNvbnN0IHN1bW1hcnlNc2cgPSBlLmNoYWluID8gJ3JlZmVyZW5jZXMgXFwnJyArIGUuc3ltYm9sIS5uYW1lICsgJ1xcJycgOiBlcnJvclN1bW1hcnkoZSk7XG4gICAgICAgICAgICBjb25zdCBzdW1tYXJ5ID0gYCcke25lc3RlZENvbnRleHQubmFtZX0nICR7c3VtbWFyeU1zZ31gO1xuICAgICAgICAgICAgY29uc3QgY2hhaW4gPSB7bWVzc2FnZTogc3VtbWFyeSwgcG9zaXRpb246IGUucG9zaXRpb24sIG5leHQ6IGUuY2hhaW59O1xuICAgICAgICAgICAgLy8gVE9ETyhjaHVja2opOiByZXRyaWV2ZSB0aGUgcG9zaXRpb24gaW5mb3JtYXRpb24gaW5kaXJlY3RseSBmcm9tIHRoZSBjb2xsZWN0b3JzIG5vZGVcbiAgICAgICAgICAgIC8vIG1hcCBpZiB0aGUgbWV0YWRhdGEgaXMgZnJvbSBhIC50cyBmaWxlLlxuICAgICAgICAgICAgc2VsZi5lcnJvcihcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICBtZXNzYWdlOiBlLm1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICBhZHZpc2U6IGUuYWR2aXNlLFxuICAgICAgICAgICAgICAgICAgY29udGV4dDogZS5jb250ZXh0LFxuICAgICAgICAgICAgICAgICAgY2hhaW4sXG4gICAgICAgICAgICAgICAgICBzeW1ib2w6IG5lc3RlZENvbnRleHRcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGNvbnRleHQpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBJdCBpcyBwcm9iYWJseSBhbiBpbnRlcm5hbC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xsICYmIGxpbmUgIT0gbnVsbCAmJiBjaGFyYWN0ZXIgIT0gbnVsbCkge1xuICAgICAgICAgICAgcG9zaXRpb24gPSB7ZmlsZU5hbWUsIGxpbmUsIGNvbHVtbjogY2hhcmFjdGVyfTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc2VsZi5lcnJvcihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgbWVzc2FnZTogRlVOQ1RJT05fQ0FMTF9OT1RfU1VQUE9SVEVELFxuICAgICAgICAgICAgICBjb250ZXh0OiBmdW5jdGlvblN5bWJvbCxcbiAgICAgICAgICAgICAgdmFsdWU6IHRhcmdldEZ1bmN0aW9uLFxuICAgICAgICAgICAgICBwb3NpdGlvblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbnRleHQpO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBzaW1wbGlmeShleHByZXNzaW9uOiBhbnkpOiBhbnkge1xuICAgICAgICBpZiAoaXNQcmltaXRpdmUoZXhwcmVzc2lvbikpIHtcbiAgICAgICAgICByZXR1cm4gZXhwcmVzc2lvbjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShleHByZXNzaW9uKSkge1xuICAgICAgICAgIGNvbnN0IHJlc3VsdDogYW55W10gPSBbXTtcbiAgICAgICAgICBmb3IgKGNvbnN0IGl0ZW0gb2YgKDxhbnk+ZXhwcmVzc2lvbikpIHtcbiAgICAgICAgICAgIC8vIENoZWNrIGZvciBhIHNwcmVhZCBleHByZXNzaW9uXG4gICAgICAgICAgICBpZiAoaXRlbSAmJiBpdGVtLl9fc3ltYm9saWMgPT09ICdzcHJlYWQnKSB7XG4gICAgICAgICAgICAgIC8vIFdlIGNhbGwgd2l0aCByZWZlcmVuY2VzIGFzIDAgYmVjYXVzZSB3ZSByZXF1aXJlIHRoZSBhY3R1YWwgdmFsdWUgYW5kIGNhbm5vdFxuICAgICAgICAgICAgICAvLyB0b2xlcmF0ZSBhIHJlZmVyZW5jZSBoZXJlLlxuICAgICAgICAgICAgICBjb25zdCBzcHJlYWRBcnJheSA9IHNpbXBsaWZ5RWFnZXJseShpdGVtLmV4cHJlc3Npb24pO1xuICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzcHJlYWRBcnJheSkpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHNwcmVhZEl0ZW0gb2Ygc3ByZWFkQXJyYXkpIHtcbiAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKHNwcmVhZEl0ZW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBzaW1wbGlmeShpdGVtKTtcbiAgICAgICAgICAgIGlmIChzaG91bGRJZ25vcmUodmFsdWUpKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2godmFsdWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG4gICAgICAgIGlmIChleHByZXNzaW9uIGluc3RhbmNlb2YgU3RhdGljU3ltYm9sKSB7XG4gICAgICAgICAgLy8gU3RvcCBzaW1wbGlmaWNhdGlvbiBhdCBidWlsdGluIHN5bWJvbHMgb3IgaWYgd2UgYXJlIGluIGEgcmVmZXJlbmNlIGNvbnRleHQgYW5kXG4gICAgICAgICAgLy8gdGhlIHN5bWJvbCBkb2Vzbid0IGhhdmUgbWVtYmVycy5cbiAgICAgICAgICBpZiAoZXhwcmVzc2lvbiA9PT0gc2VsZi5pbmplY3Rpb25Ub2tlbiB8fCBzZWxmLmNvbnZlcnNpb25NYXAuaGFzKGV4cHJlc3Npb24pIHx8XG4gICAgICAgICAgICAgIChyZWZlcmVuY2VzID4gMCAmJiAhZXhwcmVzc2lvbi5tZW1iZXJzLmxlbmd0aCkpIHtcbiAgICAgICAgICAgIHJldHVybiBleHByZXNzaW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25zdCBzdGF0aWNTeW1ib2wgPSBleHByZXNzaW9uO1xuICAgICAgICAgICAgY29uc3QgZGVjbGFyYXRpb25WYWx1ZSA9IHJlc29sdmVSZWZlcmVuY2VWYWx1ZShzdGF0aWNTeW1ib2wpO1xuICAgICAgICAgICAgaWYgKGRlY2xhcmF0aW9uVmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICByZXR1cm4gc2ltcGxpZnlOZXN0ZWQoc3RhdGljU3ltYm9sLCBkZWNsYXJhdGlvblZhbHVlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBzdGF0aWNTeW1ib2w7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHByZXNzaW9uKSB7XG4gICAgICAgICAgaWYgKGV4cHJlc3Npb25bJ19fc3ltYm9saWMnXSkge1xuICAgICAgICAgICAgbGV0IHN0YXRpY1N5bWJvbDogU3RhdGljU3ltYm9sO1xuICAgICAgICAgICAgc3dpdGNoIChleHByZXNzaW9uWydfX3N5bWJvbGljJ10pIHtcbiAgICAgICAgICAgICAgY2FzZSAnYmlub3AnOlxuICAgICAgICAgICAgICAgIGxldCBsZWZ0ID0gc2ltcGxpZnkoZXhwcmVzc2lvblsnbGVmdCddKTtcbiAgICAgICAgICAgICAgICBpZiAoc2hvdWxkSWdub3JlKGxlZnQpKSByZXR1cm4gbGVmdDtcbiAgICAgICAgICAgICAgICBsZXQgcmlnaHQgPSBzaW1wbGlmeShleHByZXNzaW9uWydyaWdodCddKTtcbiAgICAgICAgICAgICAgICBpZiAoc2hvdWxkSWdub3JlKHJpZ2h0KSkgcmV0dXJuIHJpZ2h0O1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoZXhwcmVzc2lvblsnb3BlcmF0b3InXSkge1xuICAgICAgICAgICAgICAgICAgY2FzZSAnJiYnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCAmJiByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJ3x8JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgfHwgcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICd8JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgfCByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJ14nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCBeIHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnJic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICYgcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICc9PSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ID09IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnIT0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCAhPSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJz09PSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ID09PSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJyE9PSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICE9PSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJzwnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCA8IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ID4gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICc8PSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0IDw9IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPj0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCA+PSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJzw8JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPDwgcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICc+Pic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ID4+IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnKyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICsgcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICctJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgLSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJyonOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCAqIHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnLyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0IC8gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICclJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgJSByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJz8/JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPz8gcmlnaHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICBjYXNlICdpZic6XG4gICAgICAgICAgICAgICAgbGV0IGNvbmRpdGlvbiA9IHNpbXBsaWZ5KGV4cHJlc3Npb25bJ2NvbmRpdGlvbiddKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY29uZGl0aW9uID8gc2ltcGxpZnkoZXhwcmVzc2lvblsndGhlbkV4cHJlc3Npb24nXSkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW1wbGlmeShleHByZXNzaW9uWydlbHNlRXhwcmVzc2lvbiddKTtcbiAgICAgICAgICAgICAgY2FzZSAncHJlJzpcbiAgICAgICAgICAgICAgICBsZXQgb3BlcmFuZCA9IHNpbXBsaWZ5KGV4cHJlc3Npb25bJ29wZXJhbmQnXSk7XG4gICAgICAgICAgICAgICAgaWYgKHNob3VsZElnbm9yZShvcGVyYW5kKSkgcmV0dXJuIG9wZXJhbmQ7XG4gICAgICAgICAgICAgICAgc3dpdGNoIChleHByZXNzaW9uWydvcGVyYXRvciddKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlICcrJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZXJhbmQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICctJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1vcGVyYW5kO1xuICAgICAgICAgICAgICAgICAgY2FzZSAnISc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhb3BlcmFuZDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJ34nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gfm9wZXJhbmQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICBjYXNlICdpbmRleCc6XG4gICAgICAgICAgICAgICAgbGV0IGluZGV4VGFyZ2V0ID0gc2ltcGxpZnlFYWdlcmx5KGV4cHJlc3Npb25bJ2V4cHJlc3Npb24nXSk7XG4gICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gc2ltcGxpZnlFYWdlcmx5KGV4cHJlc3Npb25bJ2luZGV4J10pO1xuICAgICAgICAgICAgICAgIGlmIChpbmRleFRhcmdldCAmJiBpc1ByaW1pdGl2ZShpbmRleCkpIHJldHVybiBpbmRleFRhcmdldFtpbmRleF07XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgIGNhc2UgJ3NlbGVjdCc6XG4gICAgICAgICAgICAgICAgY29uc3QgbWVtYmVyID0gZXhwcmVzc2lvblsnbWVtYmVyJ107XG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdENvbnRleHQgPSBjb250ZXh0O1xuICAgICAgICAgICAgICAgIGxldCBzZWxlY3RUYXJnZXQgPSBzaW1wbGlmeShleHByZXNzaW9uWydleHByZXNzaW9uJ10pO1xuICAgICAgICAgICAgICAgIGlmIChzZWxlY3RUYXJnZXQgaW5zdGFuY2VvZiBTdGF0aWNTeW1ib2wpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG1lbWJlcnMgPSBzZWxlY3RUYXJnZXQubWVtYmVycy5jb25jYXQobWVtYmVyKTtcbiAgICAgICAgICAgICAgICAgIHNlbGVjdENvbnRleHQgPVxuICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZ2V0U3RhdGljU3ltYm9sKHNlbGVjdFRhcmdldC5maWxlUGF0aCwgc2VsZWN0VGFyZ2V0Lm5hbWUsIG1lbWJlcnMpO1xuICAgICAgICAgICAgICAgICAgY29uc3QgZGVjbGFyYXRpb25WYWx1ZSA9IHJlc29sdmVSZWZlcmVuY2VWYWx1ZShzZWxlY3RDb250ZXh0KTtcbiAgICAgICAgICAgICAgICAgIGlmIChkZWNsYXJhdGlvblZhbHVlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpbXBsaWZ5TmVzdGVkKHNlbGVjdENvbnRleHQsIGRlY2xhcmF0aW9uVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENvbnRleHQ7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzZWxlY3RUYXJnZXQgJiYgaXNQcmltaXRpdmUobWVtYmVyKSlcbiAgICAgICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeU5lc3RlZChzZWxlY3RDb250ZXh0LCBzZWxlY3RUYXJnZXRbbWVtYmVyXSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgIGNhc2UgJ3JlZmVyZW5jZSc6XG4gICAgICAgICAgICAgICAgLy8gTm90ZTogVGhpcyBvbmx5IGhhcyB0byBkZWFsIHdpdGggdmFyaWFibGUgcmVmZXJlbmNlcywgYXMgc3ltYm9sIHJlZmVyZW5jZXMgaGF2ZVxuICAgICAgICAgICAgICAgIC8vIGJlZW4gY29udmVydGVkIGludG8gJ3Jlc29sdmVkJ1xuICAgICAgICAgICAgICAgIC8vIGluIHRoZSBTdGF0aWNTeW1ib2xSZXNvbHZlci5cbiAgICAgICAgICAgICAgICBjb25zdCBuYW1lOiBzdHJpbmcgPSBleHByZXNzaW9uWyduYW1lJ107XG4gICAgICAgICAgICAgICAgY29uc3QgbG9jYWxWYWx1ZSA9IHNjb3BlLnJlc29sdmUobmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKGxvY2FsVmFsdWUgIT0gQmluZGluZ1Njb3BlLm1pc3NpbmcpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhbFZhbHVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAncmVzb2x2ZWQnOlxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gc2ltcGxpZnkoZXhwcmVzc2lvbi5zeW1ib2wpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgIC8vIElmIGFuIGVycm9yIGlzIHJlcG9ydGVkIGV2YWx1YXRpbmcgdGhlIHN5bWJvbCByZWNvcmQgdGhlIHBvc2l0aW9uIG9mIHRoZVxuICAgICAgICAgICAgICAgICAgLy8gcmVmZXJlbmNlIGluIHRoZSBlcnJvciBzbyBpdCBjYW5cbiAgICAgICAgICAgICAgICAgIC8vIGJlIHJlcG9ydGVkIGluIHRoZSBlcnJvciBtZXNzYWdlIGdlbmVyYXRlZCBmcm9tIHRoZSBleGNlcHRpb24uXG4gICAgICAgICAgICAgICAgICBpZiAoaXNNZXRhZGF0YUVycm9yKGUpICYmIGV4cHJlc3Npb24uZmlsZU5hbWUgIT0gbnVsbCAmJlxuICAgICAgICAgICAgICAgICAgICAgIGV4cHJlc3Npb24ubGluZSAhPSBudWxsICYmIGV4cHJlc3Npb24uY2hhcmFjdGVyICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZS5wb3NpdGlvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogZXhwcmVzc2lvbi5maWxlTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBsaW5lOiBleHByZXNzaW9uLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBleHByZXNzaW9uLmNoYXJhY3RlclxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNhc2UgJ2NsYXNzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dDtcbiAgICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0O1xuICAgICAgICAgICAgICBjYXNlICduZXcnOlxuICAgICAgICAgICAgICBjYXNlICdjYWxsJzpcbiAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgaWYgdGhlIGZ1bmN0aW9uIGlzIGEgYnVpbHQtaW4gY29udmVyc2lvblxuICAgICAgICAgICAgICAgIHN0YXRpY1N5bWJvbCA9IHNpbXBsaWZ5SW5Db250ZXh0KFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LCBleHByZXNzaW9uWydleHByZXNzaW9uJ10sIGRlcHRoICsgMSwgLyogcmVmZXJlbmNlcyAqLyAwKTtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGljU3ltYm9sIGluc3RhbmNlb2YgU3RhdGljU3ltYm9sKSB7XG4gICAgICAgICAgICAgICAgICBpZiAoc3RhdGljU3ltYm9sID09PSBzZWxmLmluamVjdGlvblRva2VuIHx8IHN0YXRpY1N5bWJvbCA9PT0gc2VsZi5vcGFxdWVUb2tlbikge1xuICAgICAgICAgICAgICAgICAgICAvLyBpZiBzb21lYm9keSBjYWxscyBuZXcgSW5qZWN0aW9uVG9rZW4sIGRvbid0IGNyZWF0ZSBhbiBJbmplY3Rpb25Ub2tlbixcbiAgICAgICAgICAgICAgICAgICAgLy8gYnV0IHJhdGhlciByZXR1cm4gdGhlIHN5bWJvbCB0byB3aGljaCB0aGUgSW5qZWN0aW9uVG9rZW4gaXMgYXNzaWduZWQgdG8uXG5cbiAgICAgICAgICAgICAgICAgICAgLy8gT3BhcXVlVG9rZW4gaXMgc3VwcG9ydGVkIHRvbyBhcyBpdCBpcyByZXF1aXJlZCBieSB0aGUgbGFuZ3VhZ2Ugc2VydmljZSB0b1xuICAgICAgICAgICAgICAgICAgICAvLyBzdXBwb3J0IHY0IGFuZCBwcmlvciB2ZXJzaW9ucyBvZiBBbmd1bGFyLlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGFyZ0V4cHJlc3Npb25zOiBhbnlbXSA9IGV4cHJlc3Npb25bJ2FyZ3VtZW50cyddIHx8IFtdO1xuICAgICAgICAgICAgICAgICAgbGV0IGNvbnZlcnRlciA9IHNlbGYuY29udmVyc2lvbk1hcC5nZXQoc3RhdGljU3ltYm9sKTtcbiAgICAgICAgICAgICAgICAgIGlmIChjb252ZXJ0ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYXJncyA9IGFyZ0V4cHJlc3Npb25zLm1hcChhcmcgPT4gc2ltcGxpZnlOZXN0ZWQoY29udGV4dCwgYXJnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKGFyZyA9PiBzaG91bGRJZ25vcmUoYXJnKSA/IHVuZGVmaW5lZCA6IGFyZyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb252ZXJ0ZXIoY29udGV4dCwgYXJncyk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgaWYgdGhlIGZ1bmN0aW9uIGlzIG9uZSB3ZSBjYW4gc2ltcGxpZnkuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldEZ1bmN0aW9uID0gcmVzb2x2ZVJlZmVyZW5jZVZhbHVlKHN0YXRpY1N5bWJvbCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeUNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNTeW1ib2wsIHRhcmdldEZ1bmN0aW9uLCBhcmdFeHByZXNzaW9ucywgZXhwcmVzc2lvblsnZXhwcmVzc2lvbiddKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIElHTk9SRTtcbiAgICAgICAgICAgICAgY2FzZSAnZXJyb3InOlxuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gZXhwcmVzc2lvbi5tZXNzYWdlO1xuICAgICAgICAgICAgICAgIGlmIChleHByZXNzaW9uWydsaW5lJ10gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgc2VsZi5lcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDogZXhwcmVzc2lvbi5jb250ZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGV4cHJlc3Npb24sXG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogZXhwcmVzc2lvblsnZmlsZU5hbWUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogZXhwcmVzc2lvblsnbGluZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGV4cHJlc3Npb25bJ2NoYXJhY3RlciddXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgc2VsZi5lcnJvcih7bWVzc2FnZSwgY29udGV4dDogZXhwcmVzc2lvbi5jb250ZXh0fSwgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBJR05PUkU7XG4gICAgICAgICAgICAgIGNhc2UgJ2lnbm9yZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGV4cHJlc3Npb247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIG1hcFN0cmluZ01hcChleHByZXNzaW9uLCAodmFsdWUsIG5hbWUpID0+IHtcbiAgICAgICAgICAgIGlmIChSRUZFUkVOQ0VfU0VULmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgICBpZiAobmFtZSA9PT0gVVNFX1ZBTFVFICYmIFBST1ZJREUgaW4gZXhwcmVzc2lvbikge1xuICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgaXMgYSBwcm92aWRlciBleHByZXNzaW9uLCBjaGVjayBmb3Igc3BlY2lhbCB0b2tlbnMgdGhhdCBuZWVkIHRoZSB2YWx1ZVxuICAgICAgICAgICAgICAgIC8vIGR1cmluZyBhbmFseXNpcy5cbiAgICAgICAgICAgICAgICBjb25zdCBwcm92aWRlID0gc2ltcGxpZnkoZXhwcmVzc2lvbi5wcm92aWRlKTtcbiAgICAgICAgICAgICAgICBpZiAocHJvdmlkZSA9PT0gc2VsZi5ST1VURVMgfHwgcHJvdmlkZSA9PSBzZWxmLkFOQUxZWkVfRk9SX0VOVFJZX0NPTVBPTkVOVFMpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeUxhemlseSh2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gc2ltcGxpZnkodmFsdWUpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBJR05PUkU7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBzaW1wbGlmeSh2YWx1ZSk7XG4gICAgfVxuXG4gICAgbGV0IHJlc3VsdDogYW55O1xuICAgIHRyeSB7XG4gICAgICByZXN1bHQgPSBzaW1wbGlmeUluQ29udGV4dChjb250ZXh0LCB2YWx1ZSwgMCwgbGF6eSA/IDEgOiAwKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBpZiAodGhpcy5lcnJvclJlY29yZGVyKSB7XG4gICAgICAgIHRoaXMucmVwb3J0RXJyb3IoZSwgY29udGV4dCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aHJvdyBmb3JtYXRNZXRhZGF0YUVycm9yKGUsIGNvbnRleHQpO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoc2hvdWxkSWdub3JlKHJlc3VsdCkpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cblxuICBwcml2YXRlIGdldFR5cGVNZXRhZGF0YSh0eXBlOiBTd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