1 | /**
|
2 | * @license
|
3 | * Copyright 2018 Google LLC. All Rights Reserved.
|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | * you may not use this file except in compliance with the License.
|
6 | * You may obtain a copy of the License at
|
7 | *
|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
9 | *
|
10 | * Unless required by applicable law or agreed to in writing, software
|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 | * See the License for the specific language governing permissions and
|
14 | * limitations under the License.
|
15 | * =============================================================================
|
16 | */
|
17 | import { env } from '@tensorflow/tfjs-core';
|
18 | import * as tensorflow from '../data/compiled_api';
|
19 | import { getRegisteredOp } from './custom_op/register';
|
20 | import { getNodeNameAndIndex } from './executors/utils';
|
21 | import * as arithmetic from './op_list/arithmetic';
|
22 | import * as basicMath from './op_list/basic_math';
|
23 | import * as control from './op_list/control';
|
24 | import * as convolution from './op_list/convolution';
|
25 | import * as creation from './op_list/creation';
|
26 | import * as dynamic from './op_list/dynamic';
|
27 | import * as evaluation from './op_list/evaluation';
|
28 | import * as graph from './op_list/graph';
|
29 | import * as hashTable from './op_list/hash_table';
|
30 | import * as image from './op_list/image';
|
31 | import * as logical from './op_list/logical';
|
32 | import * as matrices from './op_list/matrices';
|
33 | import * as normalization from './op_list/normalization';
|
34 | import * as reduction from './op_list/reduction';
|
35 | import * as sliceJoin from './op_list/slice_join';
|
36 | import * as sparse from './op_list/sparse';
|
37 | import * as spectral from './op_list/spectral';
|
38 | import * as string from './op_list/string';
|
39 | import * as transformation from './op_list/transformation';
|
40 | export class OperationMapper {
|
41 | // Singleton instance for the mapper
|
42 | static get Instance() {
|
43 | return this._instance || (this._instance = new this());
|
44 | }
|
45 | // Loads the op mapping from the JSON file.
|
46 | constructor() {
|
47 | const ops = [
|
48 | arithmetic, basicMath, control, convolution, creation, dynamic,
|
49 | evaluation, graph, hashTable, image, logical, matrices, normalization,
|
50 | reduction, sliceJoin, sparse, spectral, string, transformation
|
51 | ];
|
52 | const mappersJson = [].concat(...ops.map(op => op.json));
|
53 | this.opMappers = mappersJson.reduce((map, mapper) => {
|
54 | map[mapper.tfOpName] = mapper;
|
55 | return map;
|
56 | }, {});
|
57 | }
|
58 | // Converts the model inference graph from Tensorflow GraphDef to local
|
59 | // representation for TensorFlow.js API
|
60 | transformGraph(graph, signature = {}) {
|
61 | const tfNodes = graph.node;
|
62 | const placeholders = [];
|
63 | const weights = [];
|
64 | const initNodes = [];
|
65 | const nodes = tfNodes.reduce((map, node) => {
|
66 | map[node.name] = this.mapNode(node);
|
67 | if (node.op.startsWith('Placeholder')) {
|
68 | placeholders.push(map[node.name]);
|
69 | }
|
70 | else if (node.op === 'Const') {
|
71 | weights.push(map[node.name]);
|
72 | }
|
73 | else if (node.input == null || node.input.length === 0) {
|
74 | initNodes.push(map[node.name]);
|
75 | }
|
76 | return map;
|
77 | }, {});
|
78 | let inputs = [];
|
79 | const outputs = [];
|
80 | let inputNodeNameToKey = {};
|
81 | let outputNodeNameToKey = {};
|
82 | if (signature != null) {
|
83 | inputNodeNameToKey = this.mapSignatureEntries(signature.inputs);
|
84 | outputNodeNameToKey = this.mapSignatureEntries(signature.outputs);
|
85 | }
|
86 | const allNodes = Object.keys(nodes);
|
87 | allNodes.forEach(key => {
|
88 | const node = nodes[key];
|
89 | node.inputNames.forEach((name, index) => {
|
90 | const [nodeName, , outputName] = getNodeNameAndIndex(name);
|
91 | const inputNode = nodes[nodeName];
|
92 | if (inputNode.outputs != null) {
|
93 | const outputIndex = inputNode.outputs.indexOf(outputName);
|
94 | if (outputIndex !== -1) {
|
95 | const inputName = `${nodeName}:${outputIndex}`;
|
96 | // update the input name to use the mapped output index directly.
|
97 | node.inputNames[index] = inputName;
|
98 | }
|
99 | }
|
100 | node.inputs.push(inputNode);
|
101 | inputNode.children.push(node);
|
102 | });
|
103 | });
|
104 | // if signature has not outputs set, add any node that does not have
|
105 | // outputs.
|
106 | if (Object.keys(outputNodeNameToKey).length === 0) {
|
107 | allNodes.forEach(key => {
|
108 | const node = nodes[key];
|
109 | if (node.children.length === 0) {
|
110 | outputs.push(node);
|
111 | }
|
112 | });
|
113 | }
|
114 | else {
|
115 | Object.keys(outputNodeNameToKey).forEach(name => {
|
116 | const [nodeName,] = getNodeNameAndIndex(name);
|
117 | const node = nodes[nodeName];
|
118 | if (node != null) {
|
119 | node.signatureKey = outputNodeNameToKey[name];
|
120 | outputs.push(node);
|
121 | }
|
122 | });
|
123 | }
|
124 | if (Object.keys(inputNodeNameToKey).length > 0) {
|
125 | Object.keys(inputNodeNameToKey).forEach(name => {
|
126 | const [nodeName,] = getNodeNameAndIndex(name);
|
127 | const node = nodes[nodeName];
|
128 | if (node) {
|
129 | node.signatureKey = inputNodeNameToKey[name];
|
130 | inputs.push(node);
|
131 | }
|
132 | });
|
133 | }
|
134 | else {
|
135 | inputs = placeholders;
|
136 | }
|
137 | let functions = {};
|
138 | if (graph.library != null && graph.library.function != null) {
|
139 | functions = graph.library.function.reduce((functions, func) => {
|
140 | functions[func.signature.name] = this.mapFunction(func);
|
141 | return functions;
|
142 | }, {});
|
143 | }
|
144 | const result = { nodes, inputs, outputs, weights, placeholders, signature, functions };
|
145 | if (initNodes.length > 0) {
|
146 | result.initNodes = initNodes;
|
147 | }
|
148 | return result;
|
149 | }
|
150 | mapSignatureEntries(entries) {
|
151 | return Object.keys(entries || {})
|
152 | .reduce((prev, curr) => {
|
153 | prev[entries[curr].name] = curr;
|
154 | return prev;
|
155 | }, {});
|
156 | }
|
157 | mapNode(node) {
|
158 | // Unsupported ops will cause an error at run-time (not parse time), since
|
159 | // they may not be used by the actual execution subgraph.
|
160 | const mapper = getRegisteredOp(node.op) || this.opMappers[node.op] || {};
|
161 | if (node.attr == null) {
|
162 | node.attr = {};
|
163 | }
|
164 | const newNode = {
|
165 | name: node.name,
|
166 | op: node.op,
|
167 | category: mapper.category,
|
168 | inputNames: (node.input ||
|
169 | []).map(input => input.startsWith('^') ? input.slice(1) : input),
|
170 | inputs: [],
|
171 | children: [],
|
172 | inputParams: {},
|
173 | attrParams: {},
|
174 | rawAttrs: node.attr,
|
175 | outputs: mapper.outputs
|
176 | };
|
177 | if (mapper.inputs != null) {
|
178 | newNode.inputParams =
|
179 | mapper.inputs.reduce((map, param) => {
|
180 | map[param.name] = {
|
181 | type: param.type,
|
182 | inputIndexStart: param.start,
|
183 | inputIndexEnd: param.end
|
184 | };
|
185 | return map;
|
186 | }, {});
|
187 | }
|
188 | if (mapper.attrs != null) {
|
189 | newNode.attrParams =
|
190 | mapper.attrs.reduce((map, param) => {
|
191 | const type = param.type;
|
192 | let value = undefined;
|
193 | switch (param.type) {
|
194 | case 'string':
|
195 | value = getStringParam(node.attr, param.tfName, param.defaultValue);
|
196 | if (value === undefined && !!param.tfDeprecatedName) {
|
197 | value = getStringParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
198 | }
|
199 | break;
|
200 | case 'string[]':
|
201 | value = getStringArrayParam(node.attr, param.tfName, param.defaultValue);
|
202 | if (value === undefined && !!param.tfDeprecatedName) {
|
203 | value = getStringArrayParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
204 | }
|
205 | break;
|
206 | case 'number':
|
207 | value = getNumberParam(node.attr, param.tfName, (param.defaultValue || 0));
|
208 | if (value === undefined && !!param.tfDeprecatedName) {
|
209 | value = getNumberParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
210 | }
|
211 | break;
|
212 | case 'number[]':
|
213 | value = getNumericArrayParam(node.attr, param.tfName, param.defaultValue);
|
214 | if (value === undefined && !!param.tfDeprecatedName) {
|
215 | value = getNumericArrayParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
216 | }
|
217 | break;
|
218 | case 'bool':
|
219 | value = getBoolParam(node.attr, param.tfName, param.defaultValue);
|
220 | if (value === undefined && !!param.tfDeprecatedName) {
|
221 | value = getBoolParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
222 | }
|
223 | break;
|
224 | case 'bool[]':
|
225 | value = getBoolArrayParam(node.attr, param.tfName, param.defaultValue);
|
226 | if (value === undefined && !!param.tfDeprecatedName) {
|
227 | value = getBoolArrayParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
228 | }
|
229 | break;
|
230 | case 'shape':
|
231 | value = getTensorShapeParam(node.attr, param.tfName, param.defaultValue);
|
232 | if (value === undefined && !!param.tfDeprecatedName) {
|
233 | value = getTensorShapeParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
234 | }
|
235 | break;
|
236 | case 'shape[]':
|
237 | value = getTensorShapeArrayParam(node.attr, param.tfName, param.defaultValue);
|
238 | if (value === undefined && !!param.tfDeprecatedName) {
|
239 | value = getTensorShapeArrayParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
240 | }
|
241 | break;
|
242 | case 'dtype':
|
243 | value = getDtypeParam(node.attr, param.tfName, param.defaultValue);
|
244 | if (value === undefined && !!param.tfDeprecatedName) {
|
245 | value = getDtypeParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
246 | }
|
247 | break;
|
248 | case 'dtype[]':
|
249 | value = getDtypeArrayParam(node.attr, param.tfName, param.defaultValue);
|
250 | if (value === undefined && !!param.tfDeprecatedName) {
|
251 | value = getDtypeArrayParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
252 | }
|
253 | break;
|
254 | case 'func':
|
255 | value = getFuncParam(node.attr, param.tfName, param.defaultValue);
|
256 | if (value === undefined && !!param.tfDeprecatedName) {
|
257 | value = getFuncParam(node.attr, param.tfDeprecatedName, param.defaultValue);
|
258 | }
|
259 | break;
|
260 | case 'tensor':
|
261 | case 'tensors':
|
262 | break;
|
263 | default:
|
264 | throw new Error(`Unsupported param type: ${param.type} for op: ${node.op}`);
|
265 | }
|
266 | map[param.name] = { value, type };
|
267 | return map;
|
268 | }, {});
|
269 | }
|
270 | return newNode;
|
271 | }
|
272 | // map the TFunctionDef to TFJS graph object
|
273 | mapFunction(functionDef) {
|
274 | const tfNodes = functionDef.nodeDef;
|
275 | const placeholders = [];
|
276 | const weights = [];
|
277 | let nodes = {};
|
278 | if (tfNodes != null) {
|
279 | nodes = tfNodes.reduce((map, node) => {
|
280 | map[node.name] = this.mapNode(node);
|
281 | if (node.op === 'Const') {
|
282 | weights.push(map[node.name]);
|
283 | }
|
284 | return map;
|
285 | }, {});
|
286 | }
|
287 | const inputs = [];
|
288 | const outputs = [];
|
289 | functionDef.signature.inputArg.forEach(arg => {
|
290 | const [nodeName,] = getNodeNameAndIndex(arg.name);
|
291 | const node = {
|
292 | name: nodeName,
|
293 | op: 'Placeholder',
|
294 | inputs: [],
|
295 | inputNames: [],
|
296 | category: 'graph',
|
297 | inputParams: {},
|
298 | attrParams: { dtype: { value: parseDtypeParam(arg.type), type: 'dtype' } },
|
299 | children: []
|
300 | };
|
301 | node.signatureKey = arg.name;
|
302 | inputs.push(node);
|
303 | nodes[nodeName] = node;
|
304 | });
|
305 | const allNodes = Object.keys(nodes);
|
306 | allNodes.forEach(key => {
|
307 | const node = nodes[key];
|
308 | node.inputNames.forEach((name, index) => {
|
309 | const [nodeName, , outputName] = getNodeNameAndIndex(name);
|
310 | const inputNode = nodes[nodeName];
|
311 | if (inputNode.outputs != null) {
|
312 | const outputIndex = inputNode.outputs.indexOf(outputName);
|
313 | if (outputIndex !== -1) {
|
314 | const inputName = `${nodeName}:${outputIndex}`;
|
315 | // update the input name to use the mapped output index directly.
|
316 | node.inputNames[index] = inputName;
|
317 | }
|
318 | }
|
319 | node.inputs.push(inputNode);
|
320 | inputNode.children.push(node);
|
321 | });
|
322 | });
|
323 | const returnNodeMap = functionDef.ret;
|
324 | functionDef.signature.outputArg.forEach(output => {
|
325 | const [nodeName, index] = getNodeNameAndIndex(returnNodeMap[output.name]);
|
326 | const node = nodes[nodeName];
|
327 | if (node != null) {
|
328 | node.defaultOutput = index;
|
329 | outputs.push(node);
|
330 | }
|
331 | });
|
332 | const signature = this.mapArgsToSignature(functionDef);
|
333 | return { nodes, inputs, outputs, weights, placeholders, signature };
|
334 | }
|
335 | mapArgsToSignature(functionDef) {
|
336 | return {
|
337 | methodName: functionDef.signature.name,
|
338 | inputs: functionDef.signature.inputArg.reduce((map, arg) => {
|
339 | map[arg.name] = this.mapArgToTensorInfo(arg);
|
340 | return map;
|
341 | }, {}),
|
342 | outputs: functionDef.signature.outputArg.reduce((map, arg) => {
|
343 | map[arg.name] = this.mapArgToTensorInfo(arg, functionDef.ret);
|
344 | return map;
|
345 | }, {}),
|
346 | };
|
347 | }
|
348 | mapArgToTensorInfo(arg, nameMap) {
|
349 | let name = arg.name;
|
350 | if (nameMap != null) {
|
351 | name = nameMap[name];
|
352 | }
|
353 | return { name, dtype: arg.type };
|
354 | }
|
355 | }
|
356 | export function decodeBase64(text) {
|
357 | const global = env().global;
|
358 | if (typeof global.atob !== 'undefined') {
|
359 | return global.atob(text);
|
360 | }
|
361 | else if (typeof Buffer !== 'undefined') {
|
362 | return new Buffer(text, 'base64').toString();
|
363 | }
|
364 | else {
|
365 | throw new Error('Unable to decode base64 in this environment. ' +
|
366 | 'Missing built-in atob() or Buffer()');
|
367 | }
|
368 | }
|
369 | export function parseStringParam(s, keepCase) {
|
370 | const value = Array.isArray(s) ? String.fromCharCode.apply(null, s) : decodeBase64(s);
|
371 | return keepCase ? value : value.toLowerCase();
|
372 | }
|
373 | export function getStringParam(attrs, name, def, keepCase = false) {
|
374 | const param = attrs[name];
|
375 | if (param != null) {
|
376 | return parseStringParam(param.s, keepCase);
|
377 | }
|
378 | return def;
|
379 | }
|
380 | export function getBoolParam(attrs, name, def) {
|
381 | const param = attrs[name];
|
382 | return param ? param.b : def;
|
383 | }
|
384 | export function getNumberParam(attrs, name, def) {
|
385 | const param = attrs[name] || {};
|
386 | const value = param['i'] != null ? param['i'] : (param['f'] != null ? param['f'] : def);
|
387 | return (typeof value === 'number') ? value : parseInt(value, 10);
|
388 | }
|
389 | export function parseDtypeParam(value) {
|
390 | if (typeof (value) === 'string') {
|
391 | // tslint:disable-next-line:no-any
|
392 | value = tensorflow.DataType[value];
|
393 | }
|
394 | switch (value) {
|
395 | case tensorflow.DataType.DT_FLOAT:
|
396 | case tensorflow.DataType.DT_HALF:
|
397 | return 'float32';
|
398 | case tensorflow.DataType.DT_INT32:
|
399 | case tensorflow.DataType.DT_INT64:
|
400 | case tensorflow.DataType.DT_INT8:
|
401 | case tensorflow.DataType.DT_UINT8:
|
402 | return 'int32';
|
403 | case tensorflow.DataType.DT_BOOL:
|
404 | return 'bool';
|
405 | case tensorflow.DataType.DT_DOUBLE:
|
406 | return 'float32';
|
407 | case tensorflow.DataType.DT_STRING:
|
408 | return 'string';
|
409 | case tensorflow.DataType.DT_COMPLEX64:
|
410 | case tensorflow.DataType.DT_COMPLEX128:
|
411 | return 'complex64';
|
412 | default:
|
413 | // Unknown dtype error will happen at runtime (instead of parse time),
|
414 | // since these nodes might not be used by the actual subgraph execution.
|
415 | return null;
|
416 | }
|
417 | }
|
418 | export function getFuncParam(attrs, name, def) {
|
419 | const param = attrs[name];
|
420 | if (param && param.func) {
|
421 | return param.func.name;
|
422 | }
|
423 | return def;
|
424 | }
|
425 | export function getDtypeParam(attrs, name, def) {
|
426 | const param = attrs[name];
|
427 | if (param && param.type) {
|
428 | return parseDtypeParam(param.type);
|
429 | }
|
430 | return def;
|
431 | }
|
432 | export function getDtypeArrayParam(attrs, name, def) {
|
433 | const param = attrs[name];
|
434 | if (param && param.list && param.list.type) {
|
435 | return param.list.type.map(v => parseDtypeParam(v));
|
436 | }
|
437 | return def;
|
438 | }
|
439 | export function parseTensorShapeParam(shape) {
|
440 | if (shape.unknownRank) {
|
441 | return undefined;
|
442 | }
|
443 | if (shape.dim != null) {
|
444 | return shape.dim.map(dim => (typeof dim.size === 'number') ? dim.size : parseInt(dim.size, 10));
|
445 | }
|
446 | return [];
|
447 | }
|
448 | export function getTensorShapeParam(attrs, name, def) {
|
449 | const param = attrs[name];
|
450 | if (param && param.shape) {
|
451 | return parseTensorShapeParam(param.shape);
|
452 | }
|
453 | return def;
|
454 | }
|
455 | export function getNumericArrayParam(attrs, name, def) {
|
456 | const param = attrs[name];
|
457 | if (param) {
|
458 | return ((param.list.f && param.list.f.length ? param.list.f :
|
459 | param.list.i) ||
|
460 | [])
|
461 | .map(v => (typeof v === 'number') ? v : parseInt(v, 10));
|
462 | }
|
463 | return def;
|
464 | }
|
465 | export function getStringArrayParam(attrs, name, def, keepCase = false) {
|
466 | const param = attrs[name];
|
467 | if (param && param.list && param.list.s) {
|
468 | return param.list.s.map((v) => {
|
469 | return parseStringParam(v, keepCase);
|
470 | });
|
471 | }
|
472 | return def;
|
473 | }
|
474 | export function getTensorShapeArrayParam(attrs, name, def) {
|
475 | const param = attrs[name];
|
476 | if (param && param.list && param.list.shape) {
|
477 | return param.list.shape.map((v) => {
|
478 | return parseTensorShapeParam(v);
|
479 | });
|
480 | }
|
481 | return def;
|
482 | }
|
483 | export function getBoolArrayParam(attrs, name, def) {
|
484 | const param = attrs[name];
|
485 | if (param && param.list && param.list.b) {
|
486 | return param.list.b;
|
487 | }
|
488 | return def;
|
489 | }
|
490 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlcmF0aW9uX21hcHBlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3RmanMtY29udmVydGVyL3NyYy9vcGVyYXRpb25zL29wZXJhdGlvbl9tYXBwZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7OztHQWVHO0FBRUgsT0FBTyxFQUFXLEdBQUcsRUFBQyxNQUFNLHVCQUF1QixDQUFDO0FBRXBELE9BQU8sS0FBSyxVQUFVLE1BQU0sc0JBQXNCLENBQUM7QUFFbkQsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBQ3JELE9BQU8sRUFBQyxtQkFBbUIsRUFBQyxNQUFNLG1CQUF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QYXJhbXM6IHt9LFxuICAgICAgcmF3QXR0cnM6IG5vZGUuYXR0cixcbiAgICAgIG91dHB1dHM6IG1hcHBlci5vdXRwdXRzXG4gICAgfTtcblxuICAgIGlmIChtYXBwZXIuaW5wdXRzICE9IG51bGwpIHtcbiAgICAgIG5ld05vZGUuaW5wdXRQYXJhbXMgPVxuICAgICAgICAgIG1hcHBlci5pbnB1dHMucmVkdWNlPHtba2V5OiBzdHJpbmddOiBJbnB1dFBhcmFtVmFsdWV9PihcbiAgICAgICAgICAgICAgKG1hcCwgcGFyYW0pID0+IHtcbiAgICAgICAgICAgICAgICBtYXBbcGFyYW0ubmFtZV0gPSB7XG4gICAgICAgICAgICAgICAgICB0eXBlOiBwYXJhbS50eXBlLFxuICAgICAgICAgICAgICAgICAgaW5wdXRJbmRleFN0YXJ0OiBwYXJhbS5zdGFydCxcbiAgICAgICAgICAgICAgICAgIGlucHV0SW5kZXhFbmQ6IHBhcmFtLmVuZFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcDtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAge30pO1xuICAgIH1cbiAgICBpZiAobWFwcGVyLmF0dHJzICE9IG51bGwpIHtcbiAgICAgIG5ld05vZGUuYXR0clBhcmFtcyA9XG4gICAgICAgICAgbWFwcGVyLmF0dHJzLnJlZHVjZTx7W2tleTogc3RyaW5nXTogUGFyYW1WYWx1ZX0+KChtYXAsIHBhcmFtKSA9PiB7XG4gICAgICAgICAgICBjb25zdCB0eXBlID0gcGFyYW0udHlwZTtcbiAgICAgICAgICAgIGxldCB2YWx1ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIHN3aXRjaCAocGFyYW0udHlwZSkge1xuICAgICAgICAgICAgICBjYXNlICdzdHJpbmcnOlxuICAgICAgICAgICAgICAgIHZhbHVlID0gZ2V0U3RyaW5nUGFyYW0oXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZOYW1lLCBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgc3RyaW5nKTtcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkICYmICEhcGFyYW0udGZEZXByZWNhdGVkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRTdHJpbmdQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmRGVwcmVjYXRlZE5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIHN0cmluZyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlICdzdHJpbmdbXSc6XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRTdHJpbmdBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmTmFtZSwgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIHN0cmluZ1tdKTtcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkICYmICEhcGFyYW0udGZEZXByZWNhdGVkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRTdHJpbmdBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZEZXByZWNhdGVkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgc3RyaW5nW10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnbnVtYmVyJzpcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldE51bWJlclBhcmFtKFxuICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgKHBhcmFtLmRlZmF1bHRWYWx1ZSB8fCAwKSBhcyBudW1iZXIpO1xuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkICYmICEhcGFyYW0udGZEZXByZWNhdGVkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgdmFsdWUgPSBnZXROdW1iZXJQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmRGVwcmVjYXRlZE5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIG51bWJlcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlICdudW1iZXJbXSc6XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBnZXROdW1lcmljQXJyYXlQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50Zk5hbWUsIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBudW1iZXJbXSk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgISFwYXJhbS50ZkRlcHJlY2F0ZWROYW1lKSB7XG4gICAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldE51bWVyaWNBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZEZXByZWNhdGVkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgbnVtYmVyW10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnYm9vbCc6XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRCb29sUGFyYW0oXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZOYW1lLCBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgYm9vbGVhbik7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgISFwYXJhbS50ZkRlcHJlY2F0ZWROYW1lKSB7XG4gICAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldEJvb2xQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmRGVwcmVjYXRlZE5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIGJvb2xlYW4pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnYm9vbFtdJzpcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldEJvb2xBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmTmFtZSwgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIGJvb2xlYW5bXSk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgISFwYXJhbS50ZkRlcHJlY2F0ZWROYW1lKSB7XG4gICAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldEJvb2xBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZEZXByZWNhdGVkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgYm9vbGVhbltdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGNhc2UgJ3NoYXBlJzpcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldFRlbnNvclNoYXBlUGFyYW0oXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZOYW1lLCBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgbnVtYmVyW10pO1xuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkICYmICEhcGFyYW0udGZEZXByZWNhdGVkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRUZW5zb3JTaGFwZVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZEZXByZWNhdGVkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgbnVtYmVyW10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnc2hhcGVbXSc6XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRUZW5zb3JTaGFwZUFycmF5UGFyYW0oXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZOYW1lLCBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgbnVtYmVyW11bXSk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgISFwYXJhbS50ZkRlcHJlY2F0ZWROYW1lKSB7XG4gICAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldFRlbnNvclNoYXBlQXJyYXlQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgICBub2RlLmF0dHIsIHBhcmFtLnRmRGVwcmVjYXRlZE5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgcGFyYW0uZGVmYXVsdFZhbHVlIGFzIG51bWJlcltdW10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnZHR5cGUnOlxuICAgICAgICAgICAgICAgIHZhbHVlID0gZ2V0RHR5cGVQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50Zk5hbWUsIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBEYXRhVHlwZSk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgISFwYXJhbS50ZkRlcHJlY2F0ZWROYW1lKSB7XG4gICAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldER0eXBlUGFyYW0oXG4gICAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50ZkRlcHJlY2F0ZWROYW1lLFxuICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBEYXRhVHlwZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlICdkdHlwZVtdJzpcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldER0eXBlQXJyYXlQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50Zk5hbWUsIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBEYXRhVHlwZVtdKTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhIXBhcmFtLnRmRGVwcmVjYXRlZE5hbWUpIHtcbiAgICAgICAgICAgICAgICAgIHZhbHVlID0gZ2V0RHR5cGVBcnJheVBhcmFtKFxuICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXR0ciwgcGFyYW0udGZEZXByZWNhdGVkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5kZWZhdWx0VmFsdWUgYXMgRGF0YVR5cGVbXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlICdmdW5jJzpcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGdldEZ1bmNQYXJhbShcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50Zk5hbWUsIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBzdHJpbmcpO1xuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkICYmICEhcGFyYW0udGZEZXByZWNhdGVkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgdmFsdWUgPSBnZXRGdW5jUGFyYW0oXG4gICAgICAgICAgICAgICAgICAgICAgbm9kZS5hdHRyLCBwYXJhbS50ZkRlcHJlY2F0ZWROYW1lLFxuICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmRlZmF1bHRWYWx1ZSBhcyBzdHJpbmcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAndGVuc29yJzpcbiAgICAgICAgICAgICAgY2FzZSAndGVuc29ycyc6XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICBgVW5zdXBwb3J0ZWQgcGFyYW0gdHlwZTogJHtwYXJhbS50eXBlfSBmb3Igb3A6ICR7bm9kZS5vcH1gKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1hcFtwYXJhbS5uYW1lXSA9IHt2YWx1ZSwgdHlwZX07XG4gICAgICAgICAgICByZXR1cm4gbWFwO1xuICAgICAgICAgIH0sIHt9KTtcbiAgICB9XG4gICAgcmV0dXJuIG5ld05vZGU7XG4gIH1cblxuICAvLyBtYXAgdGhlIFRGdW5jdGlvbkRlZiB0byBURkpTIGdyYXBoIG9iamVjdFxuICBwcml2YXRlIG1hcEZ1bmN0aW9uKGZ1bmN0aW9uRGVmOiB0ZW5zb3JmbG93LklGdW5jdGlvbkRlZik6IEdyYXBoIHtcbiAgICBjb25zdCB0Zk5vZGVzID0gZnVuY3Rpb25EZWYubm9kZURlZjtcbiAgICBjb25z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