/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define("@angular/compiler-cli/src/metadata/evaluator", ["require", "exports", "tslib", "typescript", "@angular/compiler-cli/src/metadata/schema"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Evaluator = exports.errorSymbol = exports.sourceInfo = exports.isPrimitive = exports.recordMapEntry = void 0; var tslib_1 = require("tslib"); var ts = require("typescript"); var schema_1 = require("@angular/compiler-cli/src/metadata/schema"); // In TypeScript 2.1 the spread element kind was renamed. var spreadElementSyntaxKind = ts.SyntaxKind.SpreadElement || ts.SyntaxKind.SpreadElementExpression; function isMethodCallOf(callExpression, memberName) { var expression = callExpression.expression; if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) { var propertyAccessExpression = expression; var name = propertyAccessExpression.name; if (name.kind == ts.SyntaxKind.Identifier) { return name.text === memberName; } } return false; } function isCallOf(callExpression, ident) { var expression = callExpression.expression; if (expression.kind === ts.SyntaxKind.Identifier) { var identifier = expression; return identifier.text === ident; } return false; } /* @internal */ function recordMapEntry(entry, node, nodeMap, sourceFile) { if (!nodeMap.has(entry)) { nodeMap.set(entry, node); if (node && (schema_1.isMetadataImportedSymbolReferenceExpression(entry) || schema_1.isMetadataImportDefaultReference(entry)) && entry.line == null) { var info = sourceInfo(node, sourceFile); if (info.line != null) entry.line = info.line; if (info.character != null) entry.character = info.character; } } return entry; } exports.recordMapEntry = recordMapEntry; /** * ts.forEachChild stops iterating children when the callback return a truthy value. * This method inverts this to implement an `every` style iterator. It will return * true if every call to `cb` returns `true`. */ function everyNodeChild(node, cb) { return !ts.forEachChild(node, function (node) { return !cb(node); }); } function isPrimitive(value) { return Object(value) !== value; } exports.isPrimitive = isPrimitive; function isDefined(obj) { return obj !== undefined; } function getSourceFileOfNode(node) { while (node && node.kind != ts.SyntaxKind.SourceFile) { node = node.parent; } return node; } /* @internal */ function sourceInfo(node, sourceFile) { if (node) { sourceFile = sourceFile || getSourceFileOfNode(node); if (sourceFile) { return ts.getLineAndCharacterOfPosition(sourceFile, node.getStart(sourceFile)); } } return {}; } exports.sourceInfo = sourceInfo; /* @internal */ function errorSymbol(message, node, context, sourceFile) { var result = tslib_1.__assign({ __symbolic: 'error', message: message }, sourceInfo(node, sourceFile)); if (context) { result.context = context; } return result; } exports.errorSymbol = errorSymbol; /** * Produce a symbolic representation of an expression folding values into their final value when * possible. */ var Evaluator = /** @class */ (function () { function Evaluator(symbols, nodeMap, options, recordExport) { if (options === void 0) { options = {}; } this.symbols = symbols; this.nodeMap = nodeMap; this.options = options; this.recordExport = recordExport; } Evaluator.prototype.nameOf = function (node) { if (node && node.kind == ts.SyntaxKind.Identifier) { return node.text; } var result = node && this.evaluateNode(node); if (schema_1.isMetadataError(result) || typeof result === 'string') { return result; } else { return errorSymbol('Name expected', node, { received: (node && node.getText()) || '' }); } }; /** * Returns true if the expression represented by `node` can be folded into a literal expression. * * For example, a literal is always foldable. This means that literal expressions such as `1.2` * `"Some value"` `true` `false` are foldable. * * - An object literal is foldable if all the properties in the literal are foldable. * - An array literal is foldable if all the elements are foldable. * - A call is foldable if it is a call to a Array.prototype.concat or a call to CONST_EXPR. * - A property access is foldable if the object is foldable. * - A array index is foldable if index expression is foldable and the array is foldable. * - Binary operator expressions are foldable if the left and right expressions are foldable and * it is one of '+', '-', '*', '/', '%', '||', and '&&'. * - An identifier is foldable if a value can be found for its symbol in the evaluator symbol * table. */ Evaluator.prototype.isFoldable = function (node) { return this.isFoldableWorker(node, new Map()); }; Evaluator.prototype.isFoldableWorker = function (node, folding) { var _this = this; if (node) { switch (node.kind) { case ts.SyntaxKind.ObjectLiteralExpression: return everyNodeChild(node, function (child) { if (child.kind === ts.SyntaxKind.PropertyAssignment) { var propertyAssignment = child; return _this.isFoldableWorker(propertyAssignment.initializer, folding); } return false; }); case ts.SyntaxKind.ArrayLiteralExpression: return everyNodeChild(node, function (child) { return _this.isFoldableWorker(child, folding); }); case ts.SyntaxKind.CallExpression: var callExpression = node; // We can fold a .concat(). if (isMethodCallOf(callExpression, 'concat') && arrayOrEmpty(callExpression.arguments).length === 1) { var arrayNode = callExpression.expression.expression; if (this.isFoldableWorker(arrayNode, folding) && this.isFoldableWorker(callExpression.arguments[0], folding)) { // It needs to be an array. var arrayValue = this.evaluateNode(arrayNode); if (arrayValue && Array.isArray(arrayValue)) { return true; } } } // We can fold a call to CONST_EXPR if (isCallOf(callExpression, 'CONST_EXPR') && arrayOrEmpty(callExpression.arguments).length === 1) return this.isFoldableWorker(callExpression.arguments[0], folding); return false; case ts.SyntaxKind.NoSubstitutionTemplateLiteral: case ts.SyntaxKind.StringLiteral: case ts.SyntaxKind.NumericLiteral: case ts.SyntaxKind.NullKeyword: case ts.SyntaxKind.TrueKeyword: case ts.SyntaxKind.FalseKeyword: case ts.SyntaxKind.TemplateHead: case ts.SyntaxKind.TemplateMiddle: case ts.SyntaxKind.TemplateTail: return true; case ts.SyntaxKind.ParenthesizedExpression: var parenthesizedExpression = node; return this.isFoldableWorker(parenthesizedExpression.expression, folding); case ts.SyntaxKind.BinaryExpression: var binaryExpression = node; switch (binaryExpression.operatorToken.kind) { case ts.SyntaxKind.PlusToken: case ts.SyntaxKind.MinusToken: case ts.SyntaxKind.AsteriskToken: case ts.SyntaxKind.SlashToken: case ts.SyntaxKind.PercentToken: case ts.SyntaxKind.AmpersandAmpersandToken: case ts.SyntaxKind.BarBarToken: return this.isFoldableWorker(binaryExpression.left, folding) && this.isFoldableWorker(binaryExpression.right, folding); default: return false; } case ts.SyntaxKind.PropertyAccessExpression: var propertyAccessExpression = node; return this.isFoldableWorker(propertyAccessExpression.expression, folding); case ts.SyntaxKind.ElementAccessExpression: var elementAccessExpression = node; return this.isFoldableWorker(elementAccessExpression.expression, folding) && this.isFoldableWorker(elementAccessExpression.argumentExpression, folding); case ts.SyntaxKind.Identifier: var identifier = node; var reference = this.symbols.resolve(identifier.text); if (reference !== undefined && isPrimitive(reference)) { return true; } break; case ts.SyntaxKind.TemplateExpression: var templateExpression = node; return templateExpression.templateSpans.every(function (span) { return _this.isFoldableWorker(span.expression, folding); }); } } return false; }; /** * Produce a JSON serialiable object representing `node`. The foldable values in the expression * tree are folded. For example, a node representing `1 + 2` is folded into `3`. */ Evaluator.prototype.evaluateNode = function (node, preferReference) { var _this = this; var t = this; var error; function recordEntry(entry, node) { if (t.options.substituteExpression) { var newEntry = t.options.substituteExpression(entry, node); if (t.recordExport && newEntry != entry && schema_1.isMetadataGlobalReferenceExpression(newEntry)) { t.recordExport(newEntry.name, entry); } entry = newEntry; } return recordMapEntry(entry, node, t.nodeMap); } function isFoldableError(value) { return !t.options.verboseInvalidExpression && schema_1.isMetadataError(value); } var resolveName = function (name, preferReference) { var reference = _this.symbols.resolve(name, preferReference); if (reference === undefined) { // Encode as a global reference. StaticReflector will check the reference. return recordEntry({ __symbolic: 'reference', name: name }, node); } if (reference && schema_1.isMetadataSymbolicReferenceExpression(reference)) { return recordEntry(tslib_1.__assign({}, reference), node); } return reference; }; switch (node.kind) { case ts.SyntaxKind.ObjectLiteralExpression: var obj_1 = {}; var quoted_1 = []; ts.forEachChild(node, function (child) { switch (child.kind) { case ts.SyntaxKind.ShorthandPropertyAssignment: case ts.SyntaxKind.PropertyAssignment: var assignment = child; if (assignment.name.kind == ts.SyntaxKind.StringLiteral) { var name_1 = assignment.name.text; quoted_1.push(name_1); } var propertyName = _this.nameOf(assignment.name); if (isFoldableError(propertyName)) { error = propertyName; return true; } var propertyValue = isPropertyAssignment(assignment) ? _this.evaluateNode(assignment.initializer, /* preferReference */ true) : resolveName(propertyName, /* preferReference */ true); if (isFoldableError(propertyValue)) { error = propertyValue; return true; // Stop the forEachChild. } else { obj_1[propertyName] = isPropertyAssignment(assignment) ? recordEntry(propertyValue, assignment.initializer) : propertyValue; } } }); if (error) return error; if (this.options.quotedNames && quoted_1.length) { obj_1['$quoted$'] = quoted_1; } return recordEntry(obj_1, node); case ts.SyntaxKind.ArrayLiteralExpression: var arr_1 = []; ts.forEachChild(node, function (child) { var e_1, _a; var value = _this.evaluateNode(child, /* preferReference */ true); // Check for error if (isFoldableError(value)) { error = value; return true; // Stop the forEachChild. } // Handle spread expressions if (schema_1.isMetadataSymbolicSpreadExpression(value)) { if (Array.isArray(value.expression)) { try { for (var _b = tslib_1.__values(value.expression), _c = _b.next(); !_c.done; _c = _b.next()) { var spreadValue = _c.value; arr_1.push(spreadValue); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } return; } } arr_1.push(value); }); if (error) return error; return recordEntry(arr_1, node); case spreadElementSyntaxKind: var spreadExpression = this.evaluateNode(node.expression); return recordEntry({ __symbolic: 'spread', expression: spreadExpression }, node); case ts.SyntaxKind.CallExpression: var callExpression = node; if (isCallOf(callExpression, 'forwardRef') && arrayOrEmpty(callExpression.arguments).length === 1) { var firstArgument = callExpression.arguments[0]; if (firstArgument.kind == ts.SyntaxKind.ArrowFunction) { var arrowFunction = firstArgument; return recordEntry(this.evaluateNode(arrowFunction.body), node); } } var args = arrayOrEmpty(callExpression.arguments).map(function (arg) { return _this.evaluateNode(arg); }); if (this.isFoldable(callExpression)) { if (isMethodCallOf(callExpression, 'concat')) { var arrayValue = this.evaluateNode(callExpression.expression.expression); if (isFoldableError(arrayValue)) return arrayValue; return arrayValue.concat(args[0]); } } // Always fold a CONST_EXPR even if the argument is not foldable. if (isCallOf(callExpression, 'CONST_EXPR') && arrayOrEmpty(callExpression.arguments).length === 1) { return recordEntry(args[0], node); } var expression = this.evaluateNode(callExpression.expression); if (isFoldableError(expression)) { return recordEntry(expression, node); } var result = { __symbolic: 'call', expression: expression }; if (args && args.length) { result.arguments = args; } return recordEntry(result, node); case ts.SyntaxKind.NewExpression: var newExpression = node; var newArgs = arrayOrEmpty(newExpression.arguments).map(function (arg) { return _this.evaluateNode(arg); }); var newTarget = this.evaluateNode(newExpression.expression); if (schema_1.isMetadataError(newTarget)) { return recordEntry(newTarget, node); } var call = { __symbolic: 'new', expression: newTarget }; if (newArgs.length) { call.arguments = newArgs; } return recordEntry(call, node); case ts.SyntaxKind.PropertyAccessExpression: { var propertyAccessExpression = node; var expression_1 = this.evaluateNode(propertyAccessExpression.expression); if (isFoldableError(expression_1)) { return recordEntry(expression_1, node); } var member = this.nameOf(propertyAccessExpression.name); if (isFoldableError(member)) { return recordEntry(member, node); } if (expression_1 && this.isFoldable(propertyAccessExpression.expression)) return expression_1[member]; if (schema_1.isMetadataModuleReferenceExpression(expression_1)) { // A select into a module reference and be converted into a reference to the symbol // in the module return recordEntry({ __symbolic: 'reference', module: expression_1.module, name: member }, node); } return recordEntry({ __symbolic: 'select', expression: expression_1, member: member }, node); } case ts.SyntaxKind.ElementAccessExpression: { var elementAccessExpression = node; var expression_2 = this.evaluateNode(elementAccessExpression.expression); if (isFoldableError(expression_2)) { return recordEntry(expression_2, node); } if (!elementAccessExpression.argumentExpression) { return recordEntry(errorSymbol('Expression form not supported', node), node); } var index = this.evaluateNode(elementAccessExpression.argumentExpression); if (isFoldableError(expression_2)) { return recordEntry(expression_2, node); } if (this.isFoldable(elementAccessExpression.expression) && this.isFoldable(elementAccessExpression.argumentExpression)) return expression_2[index]; return recordEntry({ __symbolic: 'index', expression: expression_2, index: index }, node); } case ts.SyntaxKind.Identifier: var identifier = node; var name = identifier.text; return resolveName(name, preferReference); case ts.SyntaxKind.TypeReference: var typeReferenceNode = node; var typeNameNode_1 = typeReferenceNode.typeName; var getReference = function (node) { if (typeNameNode_1.kind === ts.SyntaxKind.QualifiedName) { var qualifiedName = node; var left_1 = _this.evaluateNode(qualifiedName.left); if (schema_1.isMetadataModuleReferenceExpression(left_1)) { return recordEntry({ __symbolic: 'reference', module: left_1.module, name: qualifiedName.right.text }, node); } // Record a type reference to a declared type as a select. return { __symbolic: 'select', expression: left_1, member: qualifiedName.right.text }; } else { var identifier_1 = typeNameNode_1; var symbol = _this.symbols.resolve(identifier_1.text); if (isFoldableError(symbol) || schema_1.isMetadataSymbolicReferenceExpression(symbol)) { return recordEntry(symbol, node); } return recordEntry(errorSymbol('Could not resolve type', node, { typeName: identifier_1.text }), node); } }; var typeReference = getReference(typeNameNode_1); if (isFoldableError(typeReference)) { return recordEntry(typeReference, node); } if (!schema_1.isMetadataModuleReferenceExpression(typeReference) && typeReferenceNode.typeArguments && typeReferenceNode.typeArguments.length) { var args_1 = typeReferenceNode.typeArguments.map(function (element) { return _this.evaluateNode(element); }); // TODO: Remove typecast when upgraded to 2.0 as it will be correctly inferred. // Some versions of 1.9 do not infer this correctly. typeReference.arguments = args_1; } return recordEntry(typeReference, node); case ts.SyntaxKind.UnionType: var unionType = node; // Remove null and undefined from the list of unions. var references = unionType.types .filter(function (n) { return n.kind !== ts.SyntaxKind.UndefinedKeyword && !(ts.isLiteralTypeNode(n) && n.literal.kind === ts.SyntaxKind.NullKeyword); }) .map(function (n) { return _this.evaluateNode(n); }); // The remmaining reference must be the same. If two have type arguments consider them // different even if the type arguments are the same. var candidate = null; for (var i = 0; i < references.length; i++) { var reference = references[i]; if (schema_1.isMetadataSymbolicReferenceExpression(reference)) { if (candidate) { if (reference.name == candidate.name && reference.module == candidate.module && !reference.arguments) { candidate = reference; } } else { candidate = reference; } } else { return reference; } } if (candidate) return candidate; break; case ts.SyntaxKind.NoSubstitutionTemplateLiteral: case ts.SyntaxKind.StringLiteral: case ts.SyntaxKind.TemplateHead: case ts.SyntaxKind.TemplateTail: case ts.SyntaxKind.TemplateMiddle: return node.text; case ts.SyntaxKind.NumericLiteral: return parseFloat(node.text); case ts.SyntaxKind.AnyKeyword: return recordEntry({ __symbolic: 'reference', name: 'any' }, node); case ts.SyntaxKind.StringKeyword: return recordEntry({ __symbolic: 'reference', name: 'string' }, node); case ts.SyntaxKind.NumberKeyword: return recordEntry({ __symbolic: 'reference', name: 'number' }, node); case ts.SyntaxKind.BooleanKeyword: return recordEntry({ __symbolic: 'reference', name: 'boolean' }, node); case ts.SyntaxKind.ArrayType: var arrayTypeNode = node; return recordEntry({ __symbolic: 'reference', name: 'Array', arguments: [this.evaluateNode(arrayTypeNode.elementType)] }, node); case ts.SyntaxKind.NullKeyword: return null; case ts.SyntaxKind.TrueKeyword: return true; case ts.SyntaxKind.FalseKeyword: return false; case ts.SyntaxKind.ParenthesizedExpression: var parenthesizedExpression = node; return this.evaluateNode(parenthesizedExpression.expression); case ts.SyntaxKind.TypeAssertionExpression: var typeAssertion = node; return this.evaluateNode(typeAssertion.expression); case ts.SyntaxKind.PrefixUnaryExpression: var prefixUnaryExpression = node; var operand = this.evaluateNode(prefixUnaryExpression.operand); if (isDefined(operand) && isPrimitive(operand)) { switch (prefixUnaryExpression.operator) { case ts.SyntaxKind.PlusToken: return +operand; case ts.SyntaxKind.MinusToken: return -operand; case ts.SyntaxKind.TildeToken: return ~operand; case ts.SyntaxKind.ExclamationToken: return !operand; } } var operatorText = void 0; switch (prefixUnaryExpression.operator) { case ts.SyntaxKind.PlusToken: operatorText = '+'; break; case ts.SyntaxKind.MinusToken: operatorText = '-'; break; case ts.SyntaxKind.TildeToken: operatorText = '~'; break; case ts.SyntaxKind.ExclamationToken: operatorText = '!'; break; default: return undefined; } return recordEntry({ __symbolic: 'pre', operator: operatorText, operand: operand }, node); case ts.SyntaxKind.BinaryExpression: var binaryExpression = node; var left = this.evaluateNode(binaryExpression.left); var right = this.evaluateNode(binaryExpression.right); if (isDefined(left) && isDefined(right)) { if (isPrimitive(left) && isPrimitive(right)) switch (binaryExpression.operatorToken.kind) { case ts.SyntaxKind.BarBarToken: return left || right; case ts.SyntaxKind.AmpersandAmpersandToken: return left && right; case ts.SyntaxKind.AmpersandToken: return left & right; case ts.SyntaxKind.BarToken: return left | right; case ts.SyntaxKind.CaretToken: return left ^ right; case ts.SyntaxKind.EqualsEqualsToken: return left == right; case ts.SyntaxKind.ExclamationEqualsToken: return left != right; case ts.SyntaxKind.EqualsEqualsEqualsToken: return left === right; case ts.SyntaxKind.ExclamationEqualsEqualsToken: return left !== right; case ts.SyntaxKind.LessThanToken: return left < right; case ts.SyntaxKind.GreaterThanToken: return left > right; case ts.SyntaxKind.LessThanEqualsToken: return left <= right; case ts.SyntaxKind.GreaterThanEqualsToken: return left >= right; case ts.SyntaxKind.LessThanLessThanToken: return left << right; case ts.SyntaxKind.GreaterThanGreaterThanToken: return left >> right; case ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return left >>> right; case ts.SyntaxKind.PlusToken: return left + right; case ts.SyntaxKind.MinusToken: return left - right; case ts.SyntaxKind.AsteriskToken: return left * right; case ts.SyntaxKind.SlashToken: return left / right; case ts.SyntaxKind.PercentToken: return left % right; } return recordEntry({ __symbolic: 'binop', operator: binaryExpression.operatorToken.getText(), left: left, right: right }, node); } break; case ts.SyntaxKind.ConditionalExpression: var conditionalExpression = node; var condition = this.evaluateNode(conditionalExpression.condition); var thenExpression = this.evaluateNode(conditionalExpression.whenTrue); var elseExpression = this.evaluateNode(conditionalExpression.whenFalse); if (isPrimitive(condition)) { return condition ? thenExpression : elseExpression; } return recordEntry({ __symbolic: 'if', condition: condition, thenExpression: thenExpression, elseExpression: elseExpression }, node); case ts.SyntaxKind.FunctionExpression: case ts.SyntaxKind.ArrowFunction: return recordEntry(errorSymbol('Lambda not supported', node), node); case ts.SyntaxKind.TaggedTemplateExpression: return recordEntry(errorSymbol('Tagged template expressions are not supported in metadata', node), node); case ts.SyntaxKind.TemplateExpression: var templateExpression = node; if (this.isFoldable(node)) { return templateExpression.templateSpans.reduce(function (previous, current) { return previous + _this.evaluateNode(current.expression) + _this.evaluateNode(current.literal); }, this.evaluateNode(templateExpression.head)); } else { return templateExpression.templateSpans.reduce(function (previous, current) { var expr = _this.evaluateNode(current.expression); var literal = _this.evaluateNode(current.literal); if (isFoldableError(expr)) return expr; if (isFoldableError(literal)) return literal; if (typeof previous === 'string' && typeof expr === 'string' && typeof literal === 'string') { return previous + expr + literal; } var result = expr; if (previous !== '') { result = { __symbolic: 'binop', operator: '+', left: previous, right: expr }; } if (literal != '') { result = { __symbolic: 'binop', operator: '+', left: result, right: literal }; } return result; }, this.evaluateNode(templateExpression.head)); } case ts.SyntaxKind.AsExpression: var asExpression = node; return this.evaluateNode(asExpression.expression); case ts.SyntaxKind.ClassExpression: return { __symbolic: 'class' }; } return recordEntry(errorSymbol('Expression form not supported', node), node); }; return Evaluator; }()); exports.Evaluator = Evaluator; function isPropertyAssignment(node) { return node.kind == ts.SyntaxKind.PropertyAssignment; } var empty = ts.createNodeArray(); function arrayOrEmpty(v) { return v || empty; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZhbHVhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL3NyYy9tZXRhZGF0YS9ldmFsdWF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUVILCtCQUFpQztJQUdqQyxvRUFBcWQ7SUFLcmQseURBQXlEO0lBQ3pELElBQU0sdUJBQXVCLEdBQ3hCLEVBQUUsQ0FBQyxVQUFrQixDQUFDLGFBQWEsSUFBSyxFQUFFLENBQUMsVUFBa0IsQ0FBQyx1QkFBdUIsQ0FBQztJQUUzRixTQUFTLGNBQWMsQ0FBQyxjQUFpQyxFQUFFLFVBQWtCO1FBQzNFLElBQU0sVUFBVSxHQUFHLGNBQWMsQ0FBQyxVQUFVLENBQUM7UUFDN0MsSUFBSSxVQUFVLENBQUMsSUFBSSxLQUFLLEVBQUUsQ0FBQyxVQUFVLENBQUMsd0JBQXdCLEVBQUU7WUFDOUQsSUFBTSx3QkFBd0IsR0FBZ0MsVUFBVSxDQUFDO1lBQ3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bGQ7XG4gICAgICAgICAgICAgIGlmIChhc3NpZ25tZW50Lm5hbWUua2luZCA9PSB0cy5TeW50YXhLaW5kLlN0cmluZ0xpdGVyYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBuYW1lID0gKGFzc2lnbm1lbnQubmFtZSBhcyB0cy5TdHJpbmdMaXRlcmFsKS50ZXh0O1xuICAgICAgICAgICAgICAgIHF1b3RlZC5wdXNoKG5hbWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnN0IHByb3BlcnR5TmFtZSA9IHRoaXMubmFtZU9mKGFzc2lnbm1lbnQubmFtZSk7XG4gICAgICAgICAgICAgIGlmIChpc0ZvbGRhYmxlRXJyb3IocHJvcGVydHlOYW1lKSkge1xuICAgICAgICAgICAgICAgIGVycm9yID0gcHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnN0IHByb3BlcnR5VmFsdWUgPSBpc1Byb3BlcnR5QXNzaWdubWVudChhc3NpZ25tZW50KSA/XG4gICAgICAgICAgICAgICAgICB0aGlzLmV2YWx1YXRlTm9kZShhc3NpZ25tZW50LmluaXRpYWxpemVyLCAvKiBwcmVmZXJSZWZlcmVuY2UgKi8gdHJ1ZSkgOlxuICAgICAgICAgICAgICAgICAgcmVzb2x2ZU5hbWUocHJvcGVydHlOYW1lLCAvKiBwcmVmZXJSZWZlcmVuY2UgKi8gdHJ1ZSk7XG4gICAgICAgICAgICAgIGlmIChpc0ZvbGRhYmxlRXJyb3IocHJvcGVydHlWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IHByb3BlcnR5VmFsdWU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7ICAvLyBTdG9wIHRoZSBmb3JFYWNoQ2hpbGQuXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW3Byb3BlcnR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4gICAgICAgIGNvbnN0IHR5cGVSZWZlcmVuY2VOb2RlID0gPHRzLlR5cGVSZWZlcmVuY2VOb2RlPm5vZGU7XG4gICAgICAgIGNvbnN0IHR5cGVOYW1lTm9kZSA9IHR5cGVSZWZlcmVuY2VOb2RlLnR5cGVOYW1lO1xuICAgICAgICBjb25zdCBnZXRSZWZlcmVuY2U6ICh0eXBlTmFtZU5vZGU6IHRzLklkZW50aWZpZXJ8dHMuUXVhbGlmaWVkTmFtZSkgPT4gTWV0YWRhdGFWYWx1ZSA9XG4gICAgICAgICAgICBub2RlID0+IHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVOYW1lTm9kZS5raW5kID09PSB0cy5TeW50YXhLaW5kLlF1YWxpZmllZE5hbWUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBxdWFsaWZpZWROYW1lID0gPHRzLlF1YWxpZmllZE5hbWU+bm9kZTtcbiAgICAgICAgICAgICAgICBjb25zdCBsZWZ0ID0gdGhpcy5ldmFsdWF0ZU5vZGUocXVhbGlmaWVkTmFtZS5sZWZ0KTtcbiAgICAgICAgICAgICAgICBpZiAoaXNNZXRhZGF0YU1vZHVsZVJlZmVyZW5jZUV4cHJlc3Npb24obGVmdCkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiByZWNvcmRFbnRyeShcbiAgICAgICAgICAgICAgICAgICAgICA8TWV0YWRhdGFJbXBvcnRlZFN5bWJvbFJlZmVyZW5jZUV4cHJlc3Npb24+e1xuICAgICAgICAgICAgICAgICAgICAgICAgX19zeW1ib2xpYzogJ3JlZmVyZW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGU6IGxlZnQubW9kdWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogcXVhbGlmaWVkTmFtZS5yaWdodC50ZXh0XG4gICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICBub2RlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gUmVjb3JkIGEgdHlwZSByZWZlcmVuY2UgdG8gYSBkZWNsYXJlZCB0eXBlIGFzIGEgc2VsZWN0LlxuICAgICAgICAgICAgICAgIHJldHVybiB7X19zeW1ib2xpYzogJ3NlbGVjdCcsIGV4cHJlc3Npb246IGxlZnQsIG1lbWJlcjogcXVhbGlmaWVkTmFtZS5yaWdodC50ZXh0fTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpZGVudGlmaWVyID0gPHRzLklkZW50aWZpZXI+dHlwZU5hbWVOb2RlO1xuICAgICAgICAgICAgICAgIGNvbnN0IHN5bWJvbCA9IHRoaXMuc3ltYm9scy5yZXNvbHZlKGlkZW50aWZpZXIudGV4dCk7XG4gICAgICAgICAgICAgICAgaWYgKGlzRm9sZGFibGVFcnJvcihzeW1ib2wpIHx8IGlzTWV0YWRhdGFTeW1ib2xpY1JlZmVyZW5jZUV4cHJlc3Npb24oc3ltYm9sKSkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlY29yZEVudHJ5KHN5bWJvbCwgbm9kZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZWNvcmRFbnRyeShcbiAgICAgICAgICAgICAgICAgICAgZXJyb3JTeW1ib2woJ0NvdWxkIG5vdCByZXNvbHZlIHR5cGUnLCBub2RlLCB7dHlwZU5hbWU6IGlkZW50aWZpZXIudGV4dH0pLCBub2RlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgY29uc3QgdHlwZVJlZmVyZW5jZSA9IGdldFJlZmVyZW5jZSh0eXBlTmFtZU5vZGUpO1xuICAgICAgICBpZiAoaXNGb2xkYWJsZUVycm9yKHR5cGVSZWZlcmVuY2UpKSB7XG4gICAgICAgICAgcmV0dXJuIHJlY29yZEVudHJ5KHR5cGVSZWZlcmVuY2UsIG5vZGUpO1xuICAgICAgICB9XG4gICAgICAgIG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uICAgICAgICAgICAgICByZXR1cm4gIW9wZXJhbmQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVyYXRvclRleHQ6ICcrJ3wnLSd8J34nfCchJztcbiAgICAgICAgc3dpdGNoIChwcmVmaXhVbmFyeUV4cHJlc3Npb24ub3BlcmF0b3IpIHtcbiAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuUGx1c1Rva2VuOlxuICAgICAgICAgICAgb3BlcmF0b3JUZXh0ID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLk1pbnVzVG9rZW46XG4gICAgICAgICAgICBvcGVyYXRvclRleHQgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuVGlsZGVUb2tlbjpcbiAgICAgICAgICAgIG9wZXJhdG9yVGV4dCA9ICd+JztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgdHMuU3ludGF4S2luZC5FeGNsYW1hdGlvblRva2VuOlxuICAgICAgICAgICAgb3BlcmF0b3JUZXh0ID0gJyEnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlY29yZEVudHJ5KHtfX3N5bWJvbGljOiAncHJlJywgb3BlcmF0b3I6IG9wZXJhdG9yVGV4dCwgb3BlcmFuZDogb3BlcmFuZH0sIG5vZGUpO1xuICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLkJpbmFyeUV4cHJlc3Npb246XG4gICAgICAgIGNvbnN0IGJpbmFyeUV4cHJlc3Npb24gPSA8dHMuQmluYXJ5RXhwcmVzc2lvbj5ub2RlO1xuICAgICAgICBjb25zdCBsZWZ0ID0gdGhpcy5ldmFsdWF0ZU5vZGUoYmluYXJ5RXhwcmVzc2lvbi5sZWZ0KTtcbiAgICAgICAgY29uc3QgcmlnaHQgPSB0aGlzLmV2YWx1YXRlTm9kZShiaW5hcnlFeHByZXNzaW9uLnJpZ2h0KTtcbiAgICAgICAgaWYgKGlzRGVmaW5lZChsZWZ0KSAmJiBpc0RlZmluZWQocmlnaHQpKSB7XG4gICAgICAgICAgaWYgKGlzUHJpbWl0aXZlKGxlZnQpICYmIGlzUHJpbWl0aXZlKHJpZ2h0KSlcbiAgICAgICAgICAgIHN3aXRjaCAoYmluYXJ5RXhwcmVzc2lvbi5vcGVyYXRvclRva2VuLmtpbmQpIHtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLkJhckJhclRva2VuOlxuICAgICAgICAgICAgICAgIHJldHVybiA8YW55PmxlZnQgfHwgPGFueT5yaWdodDtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLkFtcGVyc2FuZEFtcGVyc2FuZFRva2VuOlxuICAgICAgICAgICAgICAgIHJldHVybiA8YW55PmxlZnQgJiYgPGFueT5yaWdodDtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLkFtcGVyc2FuZFRva2VuOlxuICAgICAgICAgICAgICAgIHJldHVybiA8YW55PmxlZnQgJiA8YW55PnJpZ2h0O1xuICAgICAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuQmFyVG9rZW46XG4gICAgICAgICAgICAgICAgcmV0dXJuIDxhbnk+bGVmdCB8IDxhbnk+cmlnaHQ7XG4gICAgICAgICAgICAgIGNhc2UgdHMuU3ludGF4S2luZC5DYXJldFRva2VuOlxuICAgICAgICAgICAgICAgIHJldHVybiA8YW55PmxlZnQgXiA8YW55PnJpZ2h0O1xuICAgICAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuRXF1YWxzRXF1YWxzVG9rZW46XG4gICAgICAgICAgICAgICAgcmV0dXJuIDxhbnk+bGVmdCA9PSA8YW55PnJpZ2h0O1xuIC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XG4gICAgICAgICAgICAgIGNhc2UgdHMuU3ludGF4S2luZC5HcmVhdGVyVGhhbkdyZWF0ZXJUaGFuVG9rZW46XG4gICAgICAgICAgICAgICAgcmV0dXJuIDxhbnk+bGVmdCA+PiA8YW55PnJpZ2h0O1xuICAgICAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuR3JlYXRlclRoYW5HcmVhdGVyVGhhbkdyZWF0ZXJUaGFuVG9rZW46XG4gICAgICAgICAgICAgICAgcmV0dXJuIDxhbnk+bGVmdCA+Pj4gPGFueT5yaWdodDtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLlBsdXNUb2tlbjpcbiAgICAgICAgICAgICAgICByZXR1cm4gPGFueT5sZWZ0ICsgPGFueT5yaWdodDtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLk1pbnVzVG9rZW46XG4gICAgICAgICAgICAgICAgcmV0dXJuIDxhbnk+bGVmdCAtIDxhbnk+cmlnaHQ7XG4gICAgICAgICAgICAgIGNhc2UgdHMuU3ludGF4S2luZC5Bc3Rlcmlza1Rva2VuOlxuICAgICAgICAgICAgICAgIHJldHVybiA8YW55PmxlZnQgKiA8YW55PnJpZ2h0O1xuICAgICAgICAgICAgICBjYXNlIHRzLlN5bnRheEtpbmQuU2xhc2hUb2tlbjpcbiAgICAgICAgICAgICAgICByZXR1cm4gPGFueT5sZWZ0IC8gPGFueT5yaWdodDtcbiAgICAgICAgICAgICAgY2FzZSB0cy5TeW50YXhLaW5kLlBlcmNlbnRUb2tlbjpcbiAgICAgICAgICAgICAgICByZXR1cm4gPGFueT5sZWZ0ICUgPGFueT5yaWdodDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gcmVjb3JkRW50cnkoXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBfX3N5bWJvbGljOiAnYmlub3AnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiBiaW5hcnlFeHByZXNz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bik7XG4gICAgICAgICAgICBjb25zdCBsaXRlcmFsID0gdGhpcy5ldmFsdWF0ZU5vZGUoY3VycmVudC5saXRlcmFsKTtcbiAgICAgICAgICAgIGlmIChpc0ZvbGRhYmxlRXJyb3IoZXhwcikpIHJldHVybiBleHByO1xuICAgICAgICAgICAgaWYgKGlzRm9sZGFibGVFcnJvcihsaXRlcmFsKSkgcmV0dXJuIGxpdGVyYWw7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByZXZpb3VzID09PSAnc3RyaW5nJyAmJiB0eXBlb2YgZXhwciA9PT0gJ3N0cmluZycgJiZcbiAgICAgICAgICAgICAgICB0eXBlb2YgbGl0ZXJhbCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHByZXZpb3VzICsgZXhwciArIGxpdGVyYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gZXhwcjtcbiAgICAgICAgICAgIGlmIChwcmV2aW91cyAhPT0gJycpIHtcbiAgICAgICAgICAgICAgcmVzdWx0ID0ge19fc3ltYm9saWM6ICdiaW5vcCcsIG9wZXJhdG9yOiAnKycsIGxlZnQ6IHByZXZpb3VzLCByaWdodDogZXhwcn07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobGl0ZXJhbCAhPSAnJykge1xuICAgICAgICAgICAgICByZXN1bHQgPSB7X19zeW1ib2xpYzogJ2Jpbm9wJywgb3BlcmF0b3I6ICcrJywgbGVmdDogcmVzdWx0LCByaWdodDogbGl0ZXJhbH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgIH0sIHRoaXMuZXZhbHVhdGVOb2RlKHRlbXBsYXRlRXhwcmVzc2lvbi5oZWFkKSk7XG4gICAgICAgIH1cbiAgICAgIGNhc2UgdHMuU3ludGF4S2luZC5Bc0V4cHJlc3Npb246XG4gICAgICAgIGNvbnN0IGFzRXhwcmVzc2lvbiA9I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