/** * @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 */ import * as cdAst from '../expression_parser/ast'; import * as o from '../output/output_ast'; import { ParseSourceSpan } from '../parse_util'; export class EventHandlerVars { static { this.event = o.variable('$event'); } } /** * Converts the given expression AST into an executable output AST, assuming the expression is * used in an action binding (e.g. an event handler). */ export function convertActionBinding(localResolver, implicitReceiver, action, bindingId, baseSourceSpan, implicitReceiverAccesses, globals) { if (!localResolver) { localResolver = new DefaultLocalResolver(globals); } const actionWithoutBuiltins = convertPropertyBindingBuiltins({ createLiteralArrayConverter: (argCount) => { // Note: no caching for literal arrays in actions. return (args) => o.literalArr(args); }, createLiteralMapConverter: (keys) => { // Note: no caching for literal maps in actions. return (values) => { const entries = keys.map((k, i) => ({ key: k.key, value: values[i], quoted: k.quoted, })); return o.literalMap(entries); }; }, createPipeConverter: (name) => { throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`); } }, action); const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false, baseSourceSpan, implicitReceiverAccesses); const actionStmts = []; flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts); prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts); if (visitor.usesImplicitReceiver) { localResolver.notifyImplicitReceiverUse(); } const lastIndex = actionStmts.length - 1; if (lastIndex >= 0) { const lastStatement = actionStmts[lastIndex]; // Ensure that the value of the last expression statement is returned if (lastStatement instanceof o.ExpressionStatement) { actionStmts[lastIndex] = new o.ReturnStatement(lastStatement.expr); } } return actionStmts; } export function convertPropertyBindingBuiltins(converterFactory, ast) { return convertBuiltins(converterFactory, ast); } export class ConvertPropertyBindingResult { constructor(stmts, currValExpr) { this.stmts = stmts; this.currValExpr = currValExpr; } } /** * Converts the given expression AST into an executable output AST, assuming the expression * is used in property binding. The expression has to be preprocessed via * `convertPropertyBindingBuiltins`. */ export function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) { if (!localResolver) { localResolver = new DefaultLocalResolver(); } const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false); const outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression); const stmts = getStatementsFromVisitor(visitor, bindingId); if (visitor.usesImplicitReceiver) { localResolver.notifyImplicitReceiverUse(); } return new ConvertPropertyBindingResult(stmts, outputExpr); } /** * Given some expression, such as a binding or interpolation expression, and a context expression to * look values up on, visit each facet of the given expression resolving values from the context * expression such that a list of arguments can be derived from the found values that can be used as * arguments to an external update instruction. * * @param localResolver The resolver to use to look up expressions by name appropriately * @param contextVariableExpression The expression representing the context variable used to create * the final argument expressions * @param expressionWithArgumentsToExtract The expression to visit to figure out what values need to * be resolved and what arguments list to build. * @param bindingId A name prefix used to create temporary variable names if they're needed for the * arguments generated * @returns An array of expressions that can be passed as arguments to instruction expressions like * `o.importExpr(R3.propertyInterpolate).callFn(result)` */ export function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) { const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, /* supportsInterpolation */ true); const outputExpr = visitor.visitInterpolation(expressionWithArgumentsToExtract, _Mode.Expression); if (visitor.usesImplicitReceiver) { localResolver.notifyImplicitReceiverUse(); } const stmts = getStatementsFromVisitor(visitor, bindingId); const args = outputExpr.args; return { stmts, args }; } function getStatementsFromVisitor(visitor, bindingId) { const stmts = []; for (let i = 0; i < visitor.temporaryCount; i++) { stmts.push(temporaryDeclaration(bindingId, i)); } return stmts; } function convertBuiltins(converterFactory, ast) { const visitor = new _BuiltinAstConverter(converterFactory); return ast.visit(visitor); } function temporaryName(bindingId, temporaryNumber) { return `tmp_${bindingId}_${temporaryNumber}`; } function temporaryDeclaration(bindingId, temporaryNumber) { return new o.DeclareVarStmt(temporaryName(bindingId, temporaryNumber)); } function prependTemporaryDecls(temporaryCount, bindingId, statements) { for (let i = temporaryCount - 1; i >= 0; i--) { statements.unshift(temporaryDeclaration(bindingId, i)); } } var _Mode; (function (_Mode) { _Mode[_Mode["Statement"] = 0] = "Statement"; _Mode[_Mode["Expression"] = 1] = "Expression"; })(_Mode || (_Mode = {})); function ensureStatementMode(mode, ast) { if (mode !== _Mode.Statement) { throw new Error(`Expected a statement, but saw ${ast}`); } } function ensureExpressionMode(mode, ast) { if (mode !== _Mode.Expression) { throw new Error(`Expected an expression, but saw ${ast}`); } } function convertToStatementIfNeeded(mode, expr) { if (mode === _Mode.Statement) { return expr.toStmt(); } else { return expr; } } class _BuiltinAstConverter extends cdAst.AstTransformer { constructor(_converterFactory) { super(); this._converterFactory = _converterFactory; } visitPipe(ast, context) { const args = [ast.exp, ...ast.args].map(ast => ast.visit(this, context)); return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createPipeConverter(ast.name, args.length)); } visitLiteralArray(ast, context) { const args = ast.expressions.map(ast => ast.visit(this, context)); return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createLiteralArrayConverter(ast.expressions.length)); } visitLiteralMap(ast, context) { const args = ast.values.map(ast => ast.visit(this, context)); return new BuiltinFunctionCall(ast.span, ast.sourceSpan, args, this._converterFactory.createLiteralMapConverter(ast.keys)); } } class _AstToIrVisitor { constructor(_localResolver, _implicitReceiver, bindingId, supportsInterpolation, baseSourceSpan, implicitReceiverAccesses) { this._localResolver = _localResolver; this._implicitReceiver = _implicitReceiver; this.bindingId = bindingId; this.supportsInterpolation = supportsInterpolation; this.baseSourceSpan = baseSourceSpan; this.implicitReceiverAccesses = implicitReceiverAccesses; this._nodeMap = new Map(); this._resultMap = new Map(); this._currentTemporary = 0; this.temporaryCount = 0; this.usesImplicitReceiver = false; } visitUnary(ast, mode) { let op; switch (ast.operator) { case '+': op = o.UnaryOperator.Plus; break; case '-': op = o.UnaryOperator.Minus; break; default: throw new Error(`Unsupported operator ${ast.operator}`); } return convertToStatementIfNeeded(mode, new o.UnaryOperatorExpr(op, this._visit(ast.expr, _Mode.Expression), undefined, this.convertSourceSpan(ast.span))); } visitBinary(ast, mode) { let op; switch (ast.operation) { case '+': op = o.BinaryOperator.Plus; break; case '-': op = o.BinaryOperator.Minus; break; case '*': op = o.BinaryOperator.Multiply; break; case '/': op = o.BinaryOperator.Divide; break; case '%': op = o.BinaryOperator.Modulo; break; case '&&': op = o.BinaryOperator.And; break; case '||': op = o.BinaryOperator.Or; break; case '==': op = o.BinaryOperator.Equals; break; case '!=': op = o.BinaryOperator.NotEquals; break; case '===': op = o.BinaryOperator.Identical; break; case '!==': op = o.BinaryOperator.NotIdentical; break; case '<': op = o.BinaryOperator.Lower; break; case '>': op = o.BinaryOperator.Bigger; break; case '<=': op = o.BinaryOperator.LowerEquals; break; case '>=': op = o.BinaryOperator.BiggerEquals; break; case '??': return this.convertNullishCoalesce(ast, mode); default: throw new Error(`Unsupported operation ${ast.operation}`); } return convertToStatementIfNeeded(mode, new o.BinaryOperatorExpr(op, this._visit(ast.left, _Mode.Expression), this._visit(ast.right, _Mode.Expression), undefined, this.convertSourceSpan(ast.span))); } visitChain(ast, mode) { ensureStatementMode(mode, ast); return this.visitAll(ast.expressions, mode); } visitConditional(ast, mode) { const value = this._visit(ast.condition, _Mode.Expression); return convertToStatementIfNeeded(mode, value.conditional(this._visit(ast.trueExp, _Mode.Expression), this._visit(ast.falseExp, _Mode.Expression), this.convertSourceSpan(ast.span))); } visitPipe(ast, mode) { throw new Error(`Illegal state: Pipes should have been converted into functions. Pipe: ${ast.name}`); } visitImplicitReceiver(ast, mode) { ensureExpressionMode(mode, ast); this.usesImplicitReceiver = true; return this._implicitReceiver; } visitThisReceiver(ast, mode) { return this.visitImplicitReceiver(ast, mode); } visitInterpolation(ast, mode) { if (!this.supportsInterpolation) { throw new Error('Unexpected interpolation'); } ensureExpressionMode(mode, ast); let args = []; for (let i = 0; i < ast.strings.length - 1; i++) { args.push(o.literal(ast.strings[i])); args.push(this._visit(ast.expressions[i], _Mode.Expression)); } args.push(o.literal(ast.strings[ast.strings.length - 1])); // If we're dealing with an interpolation of 1 value with an empty prefix and suffix, reduce the // args returned to just the value, because we're going to pass it to a special instruction. const strings = ast.strings; if (strings.length === 2 && strings[0] === '' && strings[1] === '') { // Single argument interpolate instructions. args = [args[1]]; } else if (ast.expressions.length >= 9) { // 9 or more arguments must be passed to the `interpolateV`-style instructions, which accept // an array of arguments args = [o.literalArr(args)]; } return new InterpolationExpression(args); } visitKeyedRead(ast, mode) { const leftMostSafe = this.leftMostSafeNode(ast); if (leftMostSafe) { return this.convertSafeAccess(ast, leftMostSafe, mode); } else { return convertToStatementIfNeeded(mode, this._visit(ast.receiver, _Mode.Expression).key(this._visit(ast.key, _Mode.Expression))); } } visitKeyedWrite(ast, mode) { const obj = this._visit(ast.receiver, _Mode.Expression); const key = this._visit(ast.key, _Mode.Expression); const value = this._visit(ast.value, _Mode.Expression); if (obj === this._implicitReceiver) { this._localResolver.maybeRestoreView(); } return convertToStatementIfNeeded(mode, obj.key(key).set(value)); } visitLiteralArray(ast, mode) { throw new Error(`Illegal State: literal arrays should have been converted into functions`); } visitLiteralMap(ast, mode) { throw new Error(`Illegal State: literal maps should have been converted into functions`); } visitLiteralPrimitive(ast, mode) { // For literal values of null, undefined, true, or false allow type interference // to infer the type. const type = ast.value === null || ast.value === undefined || ast.value === true || ast.value === true ? o.INFERRED_TYPE : undefined; return convertToStatementIfNeeded(mode, o.literal(ast.value, type, this.convertSourceSpan(ast.span))); } _getLocal(name, receiver) { if (this._localResolver.globals?.has(name) && receiver instanceof cdAst.ThisReceiver) { return null; } return this._localResolver.getLocal(name); } visitPrefixNot(ast, mode) { return convertToStatementIfNeeded(mode, o.not(this._visit(ast.expression, _Mode.Expression))); } visitNonNullAssert(ast, mode) { return convertToStatementIfNeeded(mode, this._visit(ast.expression, _Mode.Expression)); } visitPropertyRead(ast, mode) { const leftMostSafe = this.leftMostSafeNode(ast); if (leftMostSafe) { return this.convertSafeAccess(ast, leftMostSafe, mode); } else { let result = null; const prevUsesImplicitReceiver = this.usesImplicitReceiver; const receiver = this._visit(ast.receiver, _Mode.Expression); if (receiver === this._implicitReceiver) { result = this._getLocal(ast.name, ast.receiver); if (result) { // Restore the previous "usesImplicitReceiver" state since the implicit // receiver has been replaced with a resolved local expression. this.usesImplicitReceiver = prevUsesImplicitReceiver; this.addImplicitReceiverAccess(ast.name); } } if (result == null) { result = receiver.prop(ast.name, this.convertSourceSpan(ast.span)); } return convertToStatementIfNeeded(mode, result); } } visitPropertyWrite(ast, mode) { const receiver = this._visit(ast.receiver, _Mode.Expression); const prevUsesImplicitReceiver = this.usesImplicitReceiver; let varExpr = null; if (receiver === this._implicitReceiver) { const localExpr = this._getLocal(ast.name, ast.receiver); if (localExpr) { if (localExpr instanceof o.ReadPropExpr) { // If the local variable is a property read expression, it's a reference // to a 'context.property' value and will be used as the target of the // write expression. varExpr = localExpr; // Restore the previous "usesImplicitReceiver" state since the implicit // receiver has been replaced with a resolved local expression. this.usesImplicitReceiver = prevUsesImplicitReceiver; this.addImplicitReceiverAccess(ast.name); } else { // Otherwise it's an error. const receiver = ast.name; const value = (ast.value instanceof cdAst.PropertyRead) ? ast.value.name : undefined; throw new Error(`Cannot assign value "${value}" to template variable "${receiver}". Template variables are read-only.`); } } } // If no local expression could be produced, use the original receiver's // property as the target. if (varExpr === null) { varExpr = receiver.prop(ast.name, this.convertSourceSpan(ast.span)); } return convertToStatementIfNeeded(mode, varExpr.set(this._visit(ast.value, _Mode.Expression))); } visitSafePropertyRead(ast, mode) { return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode); } visitSafeKeyedRead(ast, mode) { return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode); } visitAll(asts, mode) { return asts.map(ast => this._visit(ast, mode)); } visitCall(ast, mode) { const leftMostSafe = this.leftMostSafeNode(ast); if (leftMostSafe) { return this.convertSafeAccess(ast, leftMostSafe, mode); } const convertedArgs = this.visitAll(ast.args, _Mode.Expression); if (ast instanceof BuiltinFunctionCall) { return convertToStatementIfNeeded(mode, ast.converter(convertedArgs)); } const receiver = ast.receiver; if (receiver instanceof cdAst.PropertyRead && receiver.receiver instanceof cdAst.ImplicitReceiver && !(receiver.receiver instanceof cdAst.ThisReceiver) && receiver.name === '$any') { if (convertedArgs.length !== 1) { throw new Error(`Invalid call to $any, expected 1 argument but received ${convertedArgs.length || 'none'}`); } return convertToStatementIfNeeded(mode, convertedArgs[0]); } const call = this._visit(receiver, _Mode.Expression) .callFn(convertedArgs, this.convertSourceSpan(ast.span)); return convertToStatementIfNeeded(mode, call); } visitSafeCall(ast, mode) { return this.convertSafeAccess(ast, this.leftMostSafeNode(ast), mode); } _visit(ast, mode) { const result = this._resultMap.get(ast); if (result) return result; return (this._nodeMap.get(ast) || ast).visit(this, mode); } convertSafeAccess(ast, leftMostSafe, mode) { // If the expression contains a safe access node on the left it needs to be converted to // an expression that guards the access to the member by checking the receiver for blank. As // execution proceeds from left to right, the left most part of the expression must be guarded // first but, because member access is left associative, the right side of the expression is at // the top of the AST. The desired result requires lifting a copy of the left part of the // expression up to test it for blank before generating the unguarded version. // Consider, for example the following expression: a?.b.c?.d.e // This results in the ast: // . // / \ // ?. e // / \ // . d // / \ // ?. c // / \ // a b // The following tree should be generated: // // /---- ? ----\ // / | \ // a /--- ? ---\ null // / | \ // . . null // / \ / \ // . c . e // / \ / \ // a b . d // / \ // . c // / \ // a b // // Notice that the first guard condition is the left hand of the left most safe access node // which comes in as leftMostSafe to this routine. let guardedExpression = this._visit(leftMostSafe.receiver, _Mode.Expression); let temporary = undefined; if (this.needsTemporaryInSafeAccess(leftMostSafe.receiver)) { // If the expression has method calls or pipes then we need to save the result into a // temporary variable to avoid calling stateful or impure code more than once. temporary = this.allocateTemporary(); // Preserve the result in the temporary variable guardedExpression = temporary.set(guardedExpression); // Ensure all further references to the guarded expression refer to the temporary instead. this._resultMap.set(leftMostSafe.receiver, temporary); } const condition = guardedExpression.isBlank(); // Convert the ast to an unguarded access to the receiver's member. The map will substitute // leftMostNode with its unguarded version in the call to `this.visit()`. if (leftMostSafe instanceof cdAst.SafeCall) { this._nodeMap.set(leftMostSafe, new cdAst.Call(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.receiver, leftMostSafe.args, leftMostSafe.argumentSpan)); } else if (leftMostSafe instanceof cdAst.SafeKeyedRead) { this._nodeMap.set(leftMostSafe, new cdAst.KeyedRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.receiver, leftMostSafe.key)); } else { this._nodeMap.set(leftMostSafe, new cdAst.PropertyRead(leftMostSafe.span, leftMostSafe.sourceSpan, leftMostSafe.nameSpan, leftMostSafe.receiver, leftMostSafe.name)); } // Recursively convert the node now without the guarded member access. const access = this._visit(ast, _Mode.Expression); // Remove the mapping. This is not strictly required as the converter only traverses each node // once but is safer if the conversion is changed to traverse the nodes more than once. this._nodeMap.delete(leftMostSafe); // If we allocated a temporary, release it. if (temporary) { this.releaseTemporary(temporary); } // Produce the conditional return convertToStatementIfNeeded(mode, condition.conditional(o.NULL_EXPR, access)); } convertNullishCoalesce(ast, mode) { const left = this._visit(ast.left, _Mode.Expression); const right = this._visit(ast.right, _Mode.Expression); const temporary = this.allocateTemporary(); this.releaseTemporary(temporary); // Generate the following expression. It is identical to how TS // transpiles binary expressions with a nullish coalescing operator. // let temp; // (temp = a) !== null && temp !== undefined ? temp : b; return convertToStatementIfNeeded(mode, temporary.set(left) .notIdentical(o.NULL_EXPR) .and(temporary.notIdentical(o.literal(undefined))) .conditional(temporary, right)); } // Given an expression of the form a?.b.c?.d.e then the left most safe node is // the (a?.b). The . and ?. are left associative thus can be rewritten as: // ((((a?.c).b).c)?.d).e. This returns the most deeply nested safe read or // safe method call as this needs to be transformed initially to: // a == null ? null : a.c.b.c?.d.e // then to: // a == null ? null : a.b.c == null ? null : a.b.c.d.e leftMostSafeNode(ast) { const visit = (visitor, ast) => { return (this._nodeMap.get(ast) || ast).visit(visitor); }; return ast.visit({ visitUnary(ast) { return null; }, visitBinary(ast) { return null; }, visitChain(ast) { return null; }, visitConditional(ast) { return null; }, visitCall(ast) { return visit(this, ast.receiver); }, visitSafeCall(ast) { return visit(this, ast.receiver) || ast; }, visitImplicitReceiver(ast) { return null; }, visitThisReceiver(ast) { return null; }, visitInterpolation(ast) { return null; }, visitKeyedRead(ast) { return visit(this, ast.receiver); }, visitKeyedWrite(ast) { return null; }, visitLiteralArray(ast) { return null; }, visitLiteralMap(ast) { return null; }, visitLiteralPrimitive(ast) { return null; }, visitPipe(ast) { return null; }, visitPrefixNot(ast) { return null; }, visitNonNullAssert(ast) { return visit(this, ast.expression); }, visitPropertyRead(ast) { return visit(this, ast.receiver); }, visitPropertyWrite(ast) { return null; }, visitSafePropertyRead(ast) { return visit(this, ast.receiver) || ast; }, visitSafeKeyedRead(ast) { return visit(this, ast.receiver) || ast; } }); } // Returns true of the AST includes a method or a pipe indicating that, if the // expression is used as the target of a safe property or method access then // the expression should be stored into a temporary variable. needsTemporaryInSafeAccess(ast) { const visit = (visitor, ast) => { return ast && (this._nodeMap.get(ast) || ast).visit(visitor); }; const visitSome = (visitor, ast) => { return ast.some(ast => visit(visitor, ast)); }; return ast.visit({ visitUnary(ast) { return visit(this, ast.expr); }, visitBinary(ast) { return visit(this, ast.left) || visit(this, ast.right); }, visitChain(ast) { return false; }, visitConditional(ast) { return visit(this, ast.condition) || visit(this, ast.trueExp) || visit(this, ast.falseExp); }, visitCall(ast) { return true; }, visitSafeCall(ast) { return true; }, visitImplicitReceiver(ast) { return false; }, visitThisReceiver(ast) { return false; }, visitInterpolation(ast) { return visitSome(this, ast.expressions); }, visitKeyedRead(ast) { return false; }, visitKeyedWrite(ast) { return false; }, visitLiteralArray(ast) { return true; }, visitLiteralMap(ast) { return true; }, visitLiteralPrimitive(ast) { return false; }, visitPipe(ast) { return true; }, visitPrefixNot(ast) { return visit(this, ast.expression); }, visitNonNullAssert(ast) { return visit(this, ast.expression); }, visitPropertyRead(ast) { return false; }, visitPropertyWrite(ast) { return false; }, visitSafePropertyRead(ast) { return false; }, visitSafeKeyedRead(ast) { return false; } }); } allocateTemporary() { const tempNumber = this._currentTemporary++; this.temporaryCount = Math.max(this._currentTemporary, this.temporaryCount); return new o.ReadVarExpr(temporaryName(this.bindingId, tempNumber)); } releaseTemporary(temporary) { this._currentTemporary--; if (temporary.name != temporaryName(this.bindingId, this._currentTemporary)) { throw new Error(`Temporary ${temporary.name} released out of order`); } } /** * Creates an absolute `ParseSourceSpan` from the relative `ParseSpan`. * * `ParseSpan` objects are relative to the start of the expression. * This method converts these to full `ParseSourceSpan` objects that * show where the span is within the overall source file. * * @param span the relative span to convert. * @returns a `ParseSourceSpan` for the given span or null if no * `baseSourceSpan` was provided to this class. */ convertSourceSpan(span) { if (this.baseSourceSpan) { const start = this.baseSourceSpan.start.moveBy(span.start); const end = this.baseSourceSpan.start.moveBy(span.end); const fullStart = this.baseSourceSpan.fullStart.moveBy(span.start); return new ParseSourceSpan(start, end, fullStart); } else { return null; } } /** Adds the name of an AST to the list of implicit receiver accesses. */ addImplicitReceiverAccess(name) { if (this.implicitReceiverAccesses) { this.implicitReceiverAccesses.add(name); } } } function flattenStatements(arg, output) { if (Array.isArray(arg)) { arg.forEach((entry) => flattenStatements(entry, output)); } else { output.push(arg); } } function unsupported() { throw new Error('Unsupported operation'); } class InterpolationExpression extends o.Expression { constructor(args) { super(null, null); this.args = args; this.isConstant = unsupported; this.isEquivalent = unsupported; this.visitExpression = unsupported; this.clone = unsupported; } } class DefaultLocalResolver { constructor(globals) { this.globals = globals; } notifyImplicitReceiverUse() { } maybeRestoreView() { } getLocal(name) { if (name === EventHandlerVars.event.name) { return EventHandlerVars.event; } return null; } } export class BuiltinFunctionCall extends cdAst.Call { constructor(span, sourceSpan, args, converter) { super(span, sourceSpan, new cdAst.EmptyExpr(span, sourceSpan), args, null); this.converter = converter; } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhwcmVzc2lvbl9jb252ZXJ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wgbWFwcyBpbiBhY3Rpb25zLlxuICAgICAgICAgIHJldHVybiAodmFsdWVzOiBvLkV4cHJlc3Npb25bXSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgZW50cmllcyA9IGtleXMubWFwKChrLCBpKSA9PiAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrLmtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZXNbaV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdW90ZWQ6IGsucXVvdGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIHJldHVybiBvLmxpdGVyYWxNYXAoZW50cmllcyk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgY3JlYXRlUGlwZUNvbnZlcnRlcjogKG5hbWU6IHN0cmluZykgPT4ge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSWxsZWdhbCBTdGF0ZTogQWN0aW9ucyBhcmUgbm90IGFsbG93ZWQgdG8gY29udGFpbiBwaXBlcy4gUGlwZTogJHtuYW1lfWApO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgYWN0aW9uKTtcblxuICBjb25zdCB2aXNpdG9yID0gbmV3IF9Bc3RUb0lyVmlzaXRvcihcbiAgICAgIGxvY2FsUmVzb2x2ZXIsIGltcGxpY2l0UmVjZWl2ZXIsIGJpbmRpbmdJZCwgLyogc3VwcG9ydHNJbnRlcnBvbGF0aW9uICovIGZhbHNlLCBiYXNlU291cmNlU3BhbixcbiAgICAgIGltcGxpY2l0UmVjZWl2ZXJBY2Nlc3Nlcyk7XG4gIGNvbnN0IGFjdGlvblN0bXRzOiBvLlN0YXRlbWVudFtdID0gW107XG4gIGZsYXR0ZW5TdGF0ZW1lbnRzKGFjdGlvbldpdGhvdXRCdWlsdGlucy52aXNpdCh2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