@fluid-experimental/property-changeset 2.74.0-370705 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ajvFactory.cjs +2 -0
- package/dist/ajvFactory.cjs.map +1 -1
- package/dist/ajvFactory.d.cts.map +1 -1
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js +1 -1
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/lib/ajvFactory.cjs +2 -0
- package/lib/ajvFactory.cjs.map +1 -1
- package/lib/ajvFactory.d.cts.map +1 -1
- package/lib/changeset.d.ts.map +1 -1
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.d.ts.map +1 -1
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/templateValidator.d.ts.map +1 -1
- package/lib/templateValidator.js +1 -1
- package/lib/templateValidator.js.map +1 -1
- package/lib/test/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -0
- package/lib/utils.js.map +1 -1
- package/package.json +10 -9
package/dist/utils.js.map
CHANGED
|
@@ -1 +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AQ,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;gBACxD,CAAC;gBAED,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC;oBAClC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;gBACvD,CAAC;YACF,CAAC;SACD,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;IApBe,+BAAyB,4BAoBxC,CAAA;AACF,CAAC,EA72EgB,KAAK,qBAAL,KAAK,QA62ErB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// @ts-ignore\nimport { constants, ConsoleUtils } from \"@fluid-experimental/property-common\";\n\nimport { ErrorCallback, eachOfSeries, eachSeries, series, timesSeries, whilst } from \"async\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport each from \"lodash/each.js\";\nimport extend from \"lodash/extend.js\";\nimport find from \"lodash/find.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isNumber from \"lodash/isNumber.js\";\nimport isString from \"lodash/isString.js\";\n\nimport { SerializedChangeSet } from \"./changeset.js\";\nimport { ArrayChangeSetIterator } from \"./changeset_operations/arrayChangesetIterator.js\";\nimport { ArrayIteratorOperationTypes } from \"./changeset_operations/operationTypes.js\";\nimport { ExtractedContext, TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { isReservedKeyword } from \"./isReservedKeyword.js\";\nimport { PathHelper, PathTree } from \"./pathHelper.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\ntype NextFn = (err?: Error | null | undefined | string, result?: unknown) => void;\n\n/**\n * Utils\n * @alias property-changeset.Utils\n * @class\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Utils {\n\t/**\n\t * @internal\n\t */\n\texport type OperationType = \"modify\" | \"insert\" | \"remove\";\n\t/**\n\t * @internal\n\t */\n\texport type PropertyContainerType =\n\t\t| \"array\"\n\t\t| \"map\"\n\t\t| \"set\"\n\t\t| \"root\"\n\t\t| \"NodeProperty\"\n\t\t| \"template\";\n\n\tinterface TraversalOptions {\n\t\t/**\n\t\t * The(pre-order) callback function that is invoked for each property\n\t\t */\n\t\tpreCallback?: (context: TraversalContext) => any;\n\t\t/**\n\t\t * The (post-order) callback function that is invoked for each property\n\t\t */\n\t\tpostCallback?: (context: TraversalContext) => any;\n\t\t/**\n\t\t * An optional object that is passed to all invocations of the callback via the\n\t\t */\n\t\tuserData?: { [key: string]: any };\n\t\t/**\n\t\t * The operation that has been applied to the root of the ChangeSet (either 'insert' or 'modify')\n\t\t */\n\t\trootOperation?: OperationType;\n\t\t/**\n\t\t * The full typeid for the Property at the root of the ChangeSet\n\t\t */\n\t\trootTypeid?: string;\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes the callback for each visited property.\n\t *\n\t * @param in_preCallback - The (pre-order) callback function that is invoked for each property\n\t * @param in_postCallback - The (post-order) callback function that is invoked for each property\n\t * @param in_context - The traversal context for the currently processed property\n\t * @param in_levelCallback - A callback for when a node is reached\n\t */\n\tfunction _traverseChangeSetRecursivelyAsync(\n\t\tin_preCallback: (\n\t\t\tcontext: TraversalContext,\n\t\t\tnext: (err?: Error | null | undefined | string, result?: unknown) => void,\n\t\t) => any,\n\t\tin_postCallback: (\n\t\t\tcontext: TraversalContext,\n\t\t\tnext: (err?: Error | null | undefined | string, result?: unknown) => void,\n\t\t) => any,\n\t\tin_context: TraversalContext,\n\t\tin_levelCallback: (param?: any) => any,\n\t) {\n\t\tlet pathSeparator;\n\t\tlet currentPath;\n\t\tlet currentPostPath;\n\t\tlet nestedChangeSet;\n\t\tlet postOrderContext;\n\n\t\t// Call the callback function for this ChangeSet\n\t\tin_context._traversalStopped = false;\n\t\tconst typeid = in_context.getTypeid();\n\t\tlet splitTypeId = typeid !== undefined ? TypeIdHelper.extractContext(typeid) : undefined;\n\t\tin_context.setSplitTypeID(splitTypeId!);\n\n\t\tlet currentUserData;\n\n\t\tseries(\n\t\t\t[\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tif (in_preCallback !== undefined) {\n\t\t\t\t\t\tin_preCallback(in_context, next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext();\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tpathSeparator = in_context.getFullPath() !== \"\" ? PROPERTY_PATH_DELIMITER : \"\";\n\t\t\t\t\tcurrentPath = in_context.getFullPath();\n\t\t\t\t\tcurrentPostPath = in_context.getFullPostPath();\n\t\t\t\t\tnestedChangeSet = in_context.getNestedChangeSet();\n\n\t\t\t\t\tconst _typeid = in_context.getTypeid();\n\t\t\t\t\t// Call the callback function for this ChangeSet\n\t\t\t\t\tin_context._traversalStopped = false;\n\t\t\t\t\tsplitTypeId =\n\t\t\t\t\t\t_typeid !== undefined ? TypeIdHelper.extractContext(_typeid) : undefined;\n\t\t\t\t\tin_context.setSplitTypeID(splitTypeId!);\n\n\t\t\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\t\t\t// TODO: this duplicates the context object putting stress on the GC.\n\t\t\t\t\t\tpostOrderContext = in_context.clone();\n\t\t\t\t\t}\n\t\t\t\t\tcurrentUserData = in_context.getUserData();\n\t\t\t\t\tif (\n\t\t\t\t\t\t!in_context.isTraversing() ||\n\t\t\t\t\t\tin_context.getOperationType() === \"remove\" ||\n\t\t\t\t\t\tTypeIdHelper.isPrimitiveType(in_context.getSplitTypeID().typeid) ||\n\t\t\t\t\t\tin_context.getSplitTypeID().isEnum\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\t\t\t\tin_postCallback(postOrderContext, function () {\n\t\t\t\t\t\t\t\tnext(\"break\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnext(\"break\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext();\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tconst currentTypeIdContext = in_context._splitTypeId.context;\n\n\t\t\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\n\t\t\t\t\t// Process an individual change recursively, by preparing the traversal context and invoking\n\t\t\t\t\t// _traverseChangeSetRecursively\n\t\t\t\t\tconst processChange = function (\n\t\t\t\t\t\tin_segment: string | number,\n\t\t\t\t\t\tin_subChangeSet: SerializedChangeSet,\n\t\t\t\t\t\tin_nestedTypeid: string,\n\t\t\t\t\t\tin_escape: boolean,\n\t\t\t\t\t\tin_parentPropertyType: PropertyContainerType,\n\t\t\t\t\t\tin_arrayOperationIndex: number,\n\t\t\t\t\t\tin_arrayLocalIndex: number,\n\t\t\t\t\t\tin_arrayOperationOffset: number,\n\t\t\t\t\t\tin_arrayIteratorOffset: number,\n\t\t\t\t\t\tin_callback: (param: any) => any,\n\t\t\t\t\t) {\n\t\t\t\t\t\tseries(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tfunction (n2) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t// Update the path\n\t\t\t\t\t\t\t\t\t\tin_context._lastSegment = in_segment;\n\t\t\t\t\t\t\t\t\t\tconst escapedSegment =\n\t\t\t\t\t\t\t\t\t\t\tin_escape && isString(in_segment)\n\t\t\t\t\t\t\t\t\t\t\t\t? PathHelper.quotePathSegmentIfNeeded(in_segment)\n\t\t\t\t\t\t\t\t\t\t\t\t: in_segment;\n\t\t\t\t\t\t\t\t\t\tlet nextSegmentToPushInParentStack = in_context.getLastSegment();\n\t\t\t\t\t\t\t\t\t\t// Note: we don't quote the path string here, since the paths\n\t\t\t\t\t\t\t\t\t\t// in a ChangeSet are already quoted, if necessary\n\t\t\t\t\t\t\t\t\t\tin_context._lastSegmentString =\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"map\" ||\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"array\" ||\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"set\"\n\t\t\t\t\t\t\t\t\t\t\t\t? `[${escapedSegment}]`\n\t\t\t\t\t\t\t\t\t\t\t\t: pathSeparator + escapedSegment;\n\t\t\t\t\t\t\t\t\t\tin_context._fullPath = currentPath + in_context.getLastSegmentString();\n\n\t\t\t\t\t\t\t\t\t\t// Store the typeid and nested ChangeSet\n\t\t\t\t\t\t\t\t\t\tin_context._typeid = in_nestedTypeid;\n\t\t\t\t\t\t\t\t\t\tin_context._nestedChangeSet = in_subChangeSet;\n\t\t\t\t\t\t\t\t\t\tin_context._propertyContainerType = in_parentPropertyType;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayOperationIndex = in_arrayOperationIndex;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayLocalIndex = in_arrayLocalIndex;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayOperationOffset = in_arrayOperationOffset;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayIteratorOffset = in_arrayIteratorOffset;\n\t\t\t\t\t\t\t\t\t\tif (in_arrayIteratorOffset !== undefined && isNumber(in_segment)) {\n\t\t\t\t\t\t\t\t\t\t\tif (in_context._operationType === \"remove\") {\n\t\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t\t\t\t\t\t\t\t(in_context.getLastSegment() as number) +\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_arrayIteratorOffset -\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_arrayLocalIndex;\n\t\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_segment + in_arrayIteratorOffset - in_arrayLocalIndex\n\t\t\t\t\t\t\t\t\t\t\t\t}]`;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t\t\t\t\t\t\t\t(in_context.getLastSegment() as number) + in_arrayIteratorOffset;\n\t\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_segment + in_arrayIteratorOffset\n\t\t\t\t\t\t\t\t\t\t\t\t}]`;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath =\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentPostPath + in_context._lastSegmentString;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Continue traversal\n\t\t\t\t\t\t\t\t\t\tin_context._stackDepth++;\n\t\t\t\t\t\t\t\t\t\tin_context._typeStack.push(in_context.getTypeid());\n\t\t\t\t\t\t\t\t\t\tin_context._parentStack.push(nextSegmentToPushInParentStack);\n\t\t\t\t\t\t\t\t\t\tin_context._containerStack.push(in_context._propertyContainerType);\n\t\t\t\t\t\t\t\t\t\tin_context._userStack.push({});\n\t\t\t\t\t\t\t\t\t\t_traverseChangeSetRecursivelyAsync(\n\t\t\t\t\t\t\t\t\t\t\tin_preCallback,\n\t\t\t\t\t\t\t\t\t\t\tin_postCallback,\n\t\t\t\t\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t\t\t\t\tn2,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t\t\t\tn2(ex);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (n2) {\n\t\t\t\t\t\t\t\t\tin_context._stackDepth--;\n\t\t\t\t\t\t\t\t\tin_context._typeStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._parentStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._containerStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._userStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._userData = currentUserData;\n\t\t\t\t\t\t\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\t\t\t\t\t\t\t\t\tn2();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\tin_callback(err);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t};\n\n\t\t\t\t\tseries(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tfunction (n3) {\n\t\t\t\t\t\t\t\t// If this property is a collection, we set the correct type, otherwise we assume it is a NodeProperty\n\t\t\t\t\t\t\t\tconst propertyContainerType =\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"map\" ||\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"set\" ||\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"array\"\n\t\t\t\t\t\t\t\t\t\t? splitTypeId.context\n\t\t\t\t\t\t\t\t\t\t: \"NodeProperty\";\n\n\t\t\t\t\t\t\t\tlet oldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\tif (splitTypeId.context === \"array\") {\n\t\t\t\t\t\t\t\t\t// Use the ArrayChangeSetIterator to process the changes in the ChangeSet in the correct order\n\t\t\t\t\t\t\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeSet);\n\t\t\t\t\t\t\t\t\tlet insertCounter = 0;\n\t\t\t\t\t\t\t\t\tlet removeCounter = 0;\n\t\t\t\t\t\t\t\t\tlet modifyCounter = 0;\n\n\t\t\t\t\t\t\t\t\twhilst(\n\t\t\t\t\t\t\t\t\t\tfunction (callback) {\n\t\t\t\t\t\t\t\t\t\t\treturn callback(null, !arrayIterator.atEnd());\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\tlet operation;\n\t\t\t\t\t\t\t\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\teachOfSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1] as any,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (item: any, i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = item.typeid;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For removals, we don't have a typeid and we use the ChangeSet\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the removal operation as nested\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ChangeSet -- TODO: doing this is maybe not really nice here\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"modify\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1].length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = operation[1][i].typeid;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1][i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodifyCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodifyCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Error(MSG.UNKNOWN_OPERATOR + arrayIterator.opDescription.type),\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\tn3(err);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Process insertion of dynamic property, maps and sets\n\t\t\t\t\t\t\t\t\tseries(\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.remove) {\n\t\t\t\t\t\t\t\t\t\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet paths = nestedChangeSet.remove;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (Array.isArray(paths)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For removals in irreversible CSs, we don't have a typeid and we use the ChangeSet of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// removal operation as nested ChangeSet\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for removals in reversible changesets we have an object containing the types\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.remove);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths = Object.keys(nestedChangeSet.remove[typeid]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.insert) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Once we have reached an insert operation all subsequent operations are inserts\n\t\t\t\t\t\t\t\t\t\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Maps and NodeProperties group the insertions by type\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.insert);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet.insert[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.insert[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.modify) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Maps and NodeProperties group modifications by type\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.modify);\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet.modify[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.modify[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Process nested properties\n\t\t\t\t\t\t\t\t\t\t\t\tif (splitTypeId.context === \"single\") {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isReservedKeyword(typeid)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\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\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (in_postCallback) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_postCallback(postOrderContext, n4);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tn3,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tnext,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t],\n\t\t\tfunction (err) {\n\t\t\t\tif (err === \"break\") {\n\t\t\t\t\tin_levelCallback();\n\t\t\t\t} else {\n\t\t\t\t\tin_levelCallback(err);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Copies a change set into an object that is meant to be a placeholder for the next\n\t * property in the tree.\n\t * @param in_objectToPopulate - Object to copy the change set into\n\t * @param in_context - change set traversal context\n\t * @param in_changeSet - Original change set to copy\n\t * @param in_isLeaf - Flag indicating that the entire sub tree should be copied over.\n\t * @returns ChangeSet that will be populated by the next iteration.\n\t * @throws if the container type is array, set or unknown (should never happen)\n\t */\n\tconst _filterChangeSetBySegment = function (\n\t\tin_objectToPopulate: any,\n\t\tin_context: TraversalContext,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_isLeaf: boolean = false,\n\t): any {\n\t\tconst nestedChangeSet = {};\n\t\tif (\n\t\t\tin_context.getPropertyContainerType() === \"NodeProperty\" ||\n\t\t\tin_context.getPropertyContainerType() === \"map\" ||\n\t\t\tin_context.getPropertyContainerType() === \"set\"\n\t\t) {\n\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\tif (Array.isArray(in_context.getNestedChangeSet())) {\n\t\t\t\t\tin_objectToPopulate.remove = in_objectToPopulate.remove || [];\n\t\t\t\t\tin_objectToPopulate.remove.push(in_context.getLastSegment());\n\t\t\t\t} else {\n\t\t\t\t\t// We are in a reversible changeset case\n\t\t\t\t\tin_objectToPopulate.remove = in_objectToPopulate.remove || {};\n\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()] =\n\t\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()] || {};\n\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()][in_context.getLastSegment()] =\n\t\t\t\t\t\tcloneDeep(in_context.getNestedChangeSet());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tin_objectToPopulate[in_context.getOperationType()] =\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()] || {};\n\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()] =\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()] || {};\n\n\t\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid()) || in_isLeaf) {\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()][\n\t\t\t\t\t\tin_context.getLastSegment()\n\t\t\t\t\t] = cloneDeep(in_context.getNestedChangeSet());\n\t\t\t\t} else {\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()][\n\t\t\t\t\t\tin_context.getLastSegment()\n\t\t\t\t\t] = nestedChangeSet;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (in_context.getPropertyContainerType() === \"template\") {\n\t\t\tin_objectToPopulate[in_context.getTypeid()] =\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()] || {};\n\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid()) || in_isLeaf) {\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()][in_context.getLastSegment()] = cloneDeep(\n\t\t\t\t\tin_context.getNestedChangeSet(),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()][in_context.getLastSegment()] =\n\t\t\t\t\tnestedChangeSet;\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (in_context.getPropertyContainerType()) {\n\t\t\t\tcase \"array\":\n\t\t\t\t\tthrow new Error(MSG.FILTER_PATH_WITHIN_ARRAY);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Encountered an unknown parent container type ${in_context.getPropertyContainerType()}`,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn nestedChangeSet;\n\t};\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes the callback for each visited property.\n\t *\n\t * @param in_preCallback - The (pre-order) callback function that is invoked for each property\n\t * @param in_postCallback - The (post-order) callback function that is invoked for each property\n\t * @param in_context - The traversal context for the currently processed property\n\t */\n\tconst _traverseChangeSetRecursively = function (\n\t\tin_preCallback: (context: TraversalContext) => any | undefined,\n\t\tin_postCallback: (context: TraversalContext) => any | undefined,\n\t\tin_context: TraversalContext,\n\t) {\n\t\tconst pathSeparator = in_context.getFullPath() !== \"\" ? PROPERTY_PATH_DELIMITER : \"\";\n\t\tconst currentPath = in_context.getFullPath();\n\t\tconst currentPostPath = in_context.getFullPostPath();\n\t\tconst nestedChangeSet = in_context.getNestedChangeSet();\n\n\t\t// Call the callback function for this ChangeSet\n\t\tin_context._traversalStopped = false;\n\t\tconst splitTypeId =\n\t\t\tin_context.getTypeid() !== undefined\n\t\t\t\t? TypeIdHelper.extractContext(in_context.getTypeid())\n\t\t\t\t: undefined;\n\t\tin_context._splitTypeId = splitTypeId;\n\n\t\t// TODO: this duplicates the context object putting stress on the GC.\n\t\tlet postOrderContext;\n\t\tif (in_preCallback !== undefined) {\n\t\t\tin_preCallback(in_context);\n\t\t}\n\t\tif (in_postCallback !== undefined) {\n\t\t\tpostOrderContext = in_context.clone();\n\t\t}\n\t\tconst currentUserData = in_context.getUserData();\n\n\t\tif (\n\t\t\t!in_context.isTraversing() ||\n\t\t\tin_context._operationType === \"remove\" ||\n\t\t\tTypeIdHelper.isPrimitiveType(in_context._splitTypeId.typeid) ||\n\t\t\tin_context.getSplitTypeID().isEnum\n\t\t) {\n\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\tin_postCallback(postOrderContext);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst currentTypeIdContext = in_context._splitTypeId.context;\n\n\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\n\t\t// Process an individual change recursively, by preparing the traversal context and invoking\n\t\t// _traverseChangeSetRecursively\n\t\tconst processChange = function (\n\t\t\tin_segment: string | number,\n\t\t\tin_subChangeSet: SerializedChangeSet,\n\t\t\tin_nestedTypeid: string,\n\t\t\tin_escape: boolean,\n\t\t\tin_parentPropertyType: PropertyContainerType,\n\t\t\tin_arrayOperationIndex?: number,\n\t\t\tin_arrayLocalIndex?: number,\n\t\t\tin_arrayOperationOffset?: number,\n\t\t\tin_arrayIteratorOffset?: number,\n\t\t) {\n\t\t\t// Update the path\n\t\t\tin_context._lastSegment = in_segment;\n\t\t\tconst escapedSegment =\n\t\t\t\tin_escape && isString(in_segment)\n\t\t\t\t\t? PathHelper.quotePathSegmentIfNeeded(in_segment)\n\t\t\t\t\t: in_segment;\n\t\t\tlet nextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t// Note: we don't quote the path string here, since the paths in a ChangeSet are already quoted, if necessary\n\t\t\tin_context._lastSegmentString =\n\t\t\t\tcurrentTypeIdContext === \"map\" ||\n\t\t\t\tcurrentTypeIdContext === \"array\" ||\n\t\t\t\tcurrentTypeIdContext === \"set\"\n\t\t\t\t\t? `[${escapedSegment}]`\n\t\t\t\t\t: pathSeparator + escapedSegment;\n\t\t\tin_context._fullPath = currentPath + in_context._lastSegmentString;\n\n\t\t\t// Store the typeid and nested ChangeSet\n\t\t\tin_context._typeid = in_nestedTypeid;\n\t\t\tin_context._nestedChangeSet = in_subChangeSet;\n\t\t\tin_context._propertyContainerType = in_parentPropertyType;\n\t\t\tin_context._arrayOperationIndex = in_arrayOperationIndex;\n\t\t\tin_context._arrayLocalIndex = in_arrayLocalIndex;\n\t\t\tin_context._arrayOperationOffset = in_arrayOperationOffset;\n\t\t\tin_context._arrayIteratorOffset = in_arrayIteratorOffset;\n\t\t\tif (in_arrayIteratorOffset !== undefined) {\n\t\t\t\tif (in_context._operationType === \"remove\") {\n\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t(in_context._lastSegment as number) + in_arrayIteratorOffset - in_arrayLocalIndex;\n\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t(in_segment as number) + in_arrayIteratorOffset - in_arrayLocalIndex\n\t\t\t\t\t}]`;\n\t\t\t\t} else {\n\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t(in_context._lastSegment as number) + in_arrayIteratorOffset;\n\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t(in_segment as number) + in_arrayIteratorOffset\n\t\t\t\t\t}]`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t\tin_context._fullPostPath = currentPostPath + in_context._lastSegmentString;\n\t\t\t}\n\n\t\t\t// Continue traversal\n\t\t\tin_context._stackDepth++;\n\t\t\tin_context._typeStack.push(in_context.getTypeid());\n\t\t\tin_context._parentStack.push(nextSegmentToPushInParentStack);\n\t\t\tin_context._containerStack.push(in_context._propertyContainerType);\n\t\t\tin_context._userStack.push({});\n\t\t\t_traverseChangeSetRecursively(in_preCallback, in_postCallback, in_context);\n\t\t\tin_context._stackDepth--;\n\t\t\tin_context._typeStack.pop();\n\t\t\tin_context._parentStack.pop();\n\t\t\tin_context._containerStack.pop();\n\t\t\tin_context._userStack.pop();\n\n\t\t\tin_context._userData = currentUserData;\n\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\t\t};\n\n\t\t// If this property is a collection, we set the correct type, otherwise we assume it is a NodeProperty\n\t\tconst propertyContainerType =\n\t\t\tsplitTypeId.context === \"map\" ||\n\t\t\tsplitTypeId.context === \"set\" ||\n\t\t\tsplitTypeId.context === \"array\"\n\t\t\t\t? splitTypeId.context\n\t\t\t\t: \"NodeProperty\";\n\n\t\tlet oldOperationType = in_context._operationType;\n\t\tlet paths: string[];\n\t\tlet typeids: string[];\n\t\tlet typeid: string;\n\t\tlet i: number;\n\t\tlet j: number;\n\t\tif (splitTypeId.context === \"array\") {\n\t\t\t// Use the ArrayChangeSetIterator to process the changes in the ChangeSet in the correct order\n\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeSet);\n\t\t\tlet insertCounter = 0;\n\t\t\tlet removeCounter = 0;\n\t\t\tlet modifyCounter = 0;\n\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\tfor (i = 0; i < arrayIterator.opDescription.operation[1].length; ++i) {\n\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\ttypeid = (arrayIterator.opDescription.operation[1][i] as any).typeid;\n\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1][i],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tinsertCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t// WARNING: 'operation[1]' is 'string | number | genericArray'. The cast to 'number'\n\t\t\t\t\t\t// preserves the JavaScript coercion behavior, which was permitted prior to TS5.\n\t\t\t\t\t\tfor (i = 0; i < (arrayIterator.opDescription.operation[1] as number); ++i) {\n\t\t\t\t\t\t\t// For removals, we don't have a typeid and we use the ChangeSet of the removal operation as nested\n\t\t\t\t\t\t\t// ChangeSet -- TODO: doing this is maybe not really nice here\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tremoveCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremoveCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\tin_context._operationType = \"modify\";\n\t\t\t\t\t\tfor (i = 0; i < arrayIterator.opDescription.operation[1].length; ++i) {\n\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\ttypeid = (arrayIterator.opDescription.operation[1][i] as any).typeid;\n\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1][i],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tmodifyCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmodifyCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(MSG.UNKNOWN_OPERATOR + arrayIterator.opDescription.type);\n\t\t\t\t}\n\t\t\t\tarrayIterator.next();\n\t\t\t}\n\t\t\tin_context._operationType = oldOperationType;\n\t\t} else {\n\t\t\t// Bug fix: if we insert & remove/modify the same key in the same ChangeSet,\n\t\t\t// we need to process remove first, followed by insert & modify\n\t\t\tif (nestedChangeSet.remove) {\n\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\tpaths = nestedChangeSet.remove;\n\t\t\t\tif (Array.isArray(paths)) {\n\t\t\t\t\tfor (i = 0; i < paths.length; i++) {\n\t\t\t\t\t\t// For removals in irreversible CSs, we don't have a typeid and we use the ChangeSet of the\n\t\t\t\t\t\t// removal operation as nested ChangeSet\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[i],\n\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// for removals in reversible changesets we have an object containing the types\n\t\t\t\t\ttypeids = Object.keys(nestedChangeSet.remove);\n\t\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\t\tpaths = Object.keys(nestedChangeSet.remove[typeid]);\n\t\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\tnestedChangeSet.remove[typeid][paths[j]],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t}\n\n\t\t\t// Process insertion of dynamic property, maps and sets\n\t\t\tif (nestedChangeSet.insert) {\n\t\t\t\t// Once we have reached an insert operation all subsequent operations are inserts\n\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t// Maps and NodeProperties group the insertions by type\n\t\t\t\ttypeids = Object.keys(nestedChangeSet.insert);\n\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet.insert[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet.insert[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t}\n\n\t\t\tif (nestedChangeSet.modify) {\n\t\t\t\t// Maps and NodeProperties group modifications by type\n\t\t\t\ttypeids = Object.keys(nestedChangeSet.modify);\n\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet.modify[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet.modify[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Process nested properties\n\t\tif (splitTypeId.context === \"single\") {\n\t\t\ttypeids = Object.keys(nestedChangeSet);\n\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\ttypeid = typeids[i];\n\t\t\t\tif (!isReservedKeyword(typeid)) {\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\"template\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (in_postCallback) {\n\t\t\tin_postCallback(postOrderContext);\n\t\t}\n\t};\n\n\tinterface TraversalContextParams {\n\t\tfullPostPath?: string;\n\t\tfullPath?: string;\n\t\tpropertyContainerType?: PropertyContainerType;\n\t\toperationType?: OperationType;\n\t}\n\n\t/**\n\t * Provides traversal information when parsing ChangeSets via the traverseChangeSetRecursively function.\n\t * @internal\n\t */\n\texport class TraversalContext {\n\t\tpublic _fullPath: string;\n\t\tpublic _lastSegment: string | number;\n\t\tpublic _lastSegmentString: string;\n\t\tpublic _typeid: string | undefined;\n\t\tpublic _splitTypeId: any;\n\t\tpublic _userData: any;\n\t\tpublic _traversalStopped: boolean;\n\t\tpublic _nestedChangeSet: SerializedChangeSet;\n\t\tpublic _parentNestedChangeSet: SerializedChangeSet;\n\t\tpublic _propertyContainerType: PropertyContainerType;\n\t\tpublic _arrayLocalIndex: number | undefined;\n\t\tpublic _arrayOperationIndex: number | undefined;\n\t\tpublic _arrayOperationOffset: number | undefined;\n\t\tpublic _arrayIteratorOffset: number | undefined;\n\t\tpublic _fullPostPath: string;\n\t\tpublic _stackDepth: number;\n\t\tpublic _typeStack: string[];\n\t\tpublic _parentStack: (string | number)[];\n\t\tpublic _containerStack: string[];\n\t\tpublic _userStack: any[];\n\t\tpublic _operationType: OperationType;\n\t\tconstructor(params: TraversalContextParams = {}) {\n\t\t\tthis._fullPath = params.fullPath || \"\";\n\t\t\tthis._lastSegment = \"\";\n\t\t\tthis._lastSegmentString = \"\";\n\t\t\tthis._typeid = undefined;\n\t\t\tthis._splitTypeId = undefined;\n\t\t\tthis._userData = undefined;\n\t\t\tthis._traversalStopped = false;\n\t\t\tthis._nestedChangeSet = undefined;\n\t\t\tthis._parentNestedChangeSet = undefined;\n\t\t\tthis._propertyContainerType = params.propertyContainerType || \"root\";\n\t\t\tthis._arrayLocalIndex = undefined;\n\t\t\tthis._arrayOperationIndex = undefined;\n\t\t\tthis._arrayOperationOffset = undefined;\n\t\t\tthis._arrayIteratorOffset = undefined;\n\t\t\tthis._fullPostPath = params.fullPostPath || \"\";\n\t\t\tthis._stackDepth = 0;\n\t\t\tthis._typeStack = [];\n\t\t\tthis._parentStack = [];\n\t\t\tthis._containerStack = [];\n\t\t\tthis._userStack = [];\n\n\t\t\t// By default, operations are modify operations\n\t\t\tthis._operationType = params.operationType || \"modify\";\n\t\t}\n\t\t/**\n\t\t * @returns Whether it's traversing or not\n\t\t */\n\t\tisTraversing(): boolean {\n\t\t\treturn !this._traversalStopped;\n\t\t}\n\n\t\t/**\n\t\t * Stop the traversal for all nodes below the currently processed one\n\t\t */\n\t\tstopTraversal() {\n\t\t\tthis._traversalStopped = true;\n\t\t}\n\n\t\t/**\n\t\t * Start the traversal for all nodes below the currently processed one\n\t\t */\n\t\tstartTraversal() {\n\t\t\tthis._traversalStopped = false;\n\t\t}\n\n\t\t/**\n\t\t * Returns the operation type\n\t\t * @returns one of 'insert', 'modify' or 'remove'\n\t\t */\n\t\tgetOperationType(): OperationType {\n\t\t\treturn this._operationType;\n\t\t}\n\n\t\t/**\n\t\t * Returns the full path to the currently visited ChangeSet\n\t\t * (from the root of the ChangeSet)\n\t\t * @returns The full path\n\t\t */\n\t\tgetFullPath(): string {\n\t\t\treturn this._fullPath;\n\t\t}\n\n\t\t/**\n\t\t * Returns the last segment of the path, either a string with the key or a number with the position in the array.\n\t\t * If the path is part of a templated property with nested properties, this string can contain multiple path\n\t\t * segments, separated by dots. The segment is returned here in the form it appears in the changeSet. For a\n\t\t * templated property, it is an escaped (if necessary) path with dots. For a map/NodeProperty,\n\t\t * it is an unescaped path segment.\n\t\t *\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetLastSegment(): string | number {\n\t\t\treturn this._lastSegment;\n\t\t}\n\n\t\t/**\n\t\t * Returns the last segment of the path escaped to be compatible for use in a path.\n\t\t *\n\t\t * This returns the same segment as getLastSegment, but always performs escaping in such a way that this segment can\n\t\t * be used in a path\n\t\t *\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetLastSegmentEscaped(): string | number {\n\t\t\tif (\n\t\t\t\tthis._propertyContainerType === \"NodeProperty\" ||\n\t\t\t\tthis._propertyContainerType === \"map\" ||\n\t\t\t\tthis._propertyContainerType === \"set\" ||\n\t\t\t\tthis._propertyContainerType === \"root\"\n\t\t\t) {\n\t\t\t\treturn PathHelper.quotePathSegmentIfNeeded(this._lastSegment as string);\n\t\t\t}\n\t\t\treturn this._lastSegment;\n\t\t}\n\n\t\t/**\n\t\t * Returns true if the passed context is an empty object\n\t\t * @private\n\t\t * @param in_context - change set traversal context\n\t\t * @returns Wether the object is empty\n\t\t */\n\t\t_isEmptyObject(in_context: TraversalContext) {\n\t\t\treturn Object(in_context._nestedChangeSet) && isEmpty(in_context._nestedChangeSet);\n\t\t}\n\n\t\t/**\n\t\t * Returns true if we're at the tip of a path\n\t\t * @returns Wether the context is at a leaf\n\t\t */\n\t\t//\n\t\t// @ts-ignore currently it's not needed\n\t\tprivate isLeafNode(): boolean {\n\t\t\treturn (\n\t\t\t\tTypeIdHelper.isPrimitiveType(this._typeid) ||\n\t\t\t\tthis._isEmptyObject(this) ||\n\t\t\t\tthis.getOperationType() === \"remove\"\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Returns the index of the last segment, either a string with the key or a number with the position in the array\n\t\t * @private\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetPostLastSegment(): number | string {\n\t\t\tif (\n\t\t\t\tthis._propertyContainerType === \"array\" &&\n\t\t\t\tisNumber(this._lastSegment) &&\n\t\t\t\tthis._arrayIteratorOffset !== undefined\n\t\t\t) {\n\t\t\t\treturn this._operationType === \"remove\"\n\t\t\t\t\t? this._lastSegment + this._arrayIteratorOffset - this._arrayLocalIndex\n\t\t\t\t\t: this._lastSegment + this._arrayIteratorOffset;\n\t\t\t} else {\n\t\t\t\treturn this._lastSegment;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the typeid of the currently visited Property\n\t\t * @returns typeid or undefined, if the current operation type is 'remove'\n\t\t */\n\t\tgetTypeid(): string | undefined {\n\t\t\treturn this._typeid;\n\t\t}\n\n\t\t/**\n\t\t * The ChangeSet that should be applied to the currently visited node.\n\t\t *\n\t\t * If this is a remove operation, it is the whole ChangeSet of the removal operation\n\t\t * @returns The ChangeSet\n\t\t */\n\t\tgetNestedChangeSet(): SerializedChangeSet {\n\t\t\treturn this._nestedChangeSet;\n\t\t}\n\n\t\t/**\n\t\t * Replace the current nested ChangeSet by another one\n\t\t *\n\t\t * @param in_newNestedChangeset - The new content\n\t\t */\n\t\treplaceNestedChangeSet(in_newNestedChangeset: SerializedChangeSet) {\n\t\t\tlet parent = this.getParentNestedChangeSet();\n\t\t\tif (this.getPropertyContainerType() === \"template\") {\n\t\t\t\tparent = parent[this.getTypeid()!];\n\t\t\t\tif (parent) {\n\t\t\t\t\tparent[this.getLastSegment()] = in_newNestedChangeset;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`TEMPORARY - INTERNAL: Was expected to replace a nested ChangeSet\n under \"${this.getLastSegment()}\" by \"${JSON.stringify(in_newNestedChangeset)}\",\n but could not find \"${this.getTypeid()}\" in \"${JSON.stringify(\n\t\t\t\t\t\t\t\t\t\tthis.getParentNestedChangeSet(),\n\t\t\t\t\t\t\t\t\t)}\"`);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tthis.getPropertyContainerType() === \"NodeProperty\" ||\n\t\t\t\tthis.getPropertyContainerType() === \"map\"\n\t\t\t) {\n\t\t\t\tparent[this.getOperationType()][this.getTypeid()!][this.getLastSegment()] =\n\t\t\t\t\tin_newNestedChangeset;\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"replaceNestedChangeSet: not implemented. type: \",\n\t\t\t\t\tthis.getPropertyContainerType(),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get the ChangeSet of the parent that contains the currently visited node.\n\t\t *\n\t\t * @returns The parent ChangeSet\n\t\t */\n\t\tgetParentNestedChangeSet(): SerializedChangeSet {\n\t\t\treturn this._parentNestedChangeSet;\n\t\t}\n\n\t\t/**\n\t\t * Returns the split Typeid as returned by TypeIdHelper.TypeIdHelper.extractContext\n\t\t * @returns The split typeid\n\t\t */\n\t\tgetSplitTypeID(): ExtractedContext {\n\t\t\treturn this._splitTypeId;\n\t\t}\n\n\t\t/**\n\t\t * Sets the split typeid.\n\t\t */\n\t\tsetSplitTypeID(splitTypeid: ExtractedContext) {\n\t\t\tthis._splitTypeId = splitTypeid;\n\t\t}\n\n\t\t/**\n\t\t * Sets user data, which will be passed to the recursive calls within this scope\n\t\t *\n\t\t * @param in_userData - The user data\n\t\t */\n\t\tsetUserData(in_userData: any) {\n\t\t\tthis._userData = in_userData;\n\t\t}\n\n\t\t/**\n\t\t * Returns the user data set by the calling function\n\t\t *\n\t\t * @returns The user data\n\t\t */\n\t\tgetUserData(): any {\n\t\t\treturn this._userData;\n\t\t}\n\n\t\t/**\n\t\t * Clones the current Traversal Object\n\t\t * @returns The cloned object\n\t\t */\n\t\tclone(): TraversalContext {\n\t\t\tconst result = new TraversalContext();\n\t\t\tresult._fullPath = this._fullPath;\n\t\t\tresult._lastSegment = this._lastSegment;\n\t\t\tresult._lastSegmentString = this._lastSegmentString;\n\t\t\tresult._typeid = this._typeid;\n\t\t\tresult._splitTypeId = this._splitTypeId; // it's OK that it's not a deep copy as it's not modified partially\n\t\t\tresult._userData = this._userData;\n\t\t\tresult._traversalStopped = this._traversalStopped;\n\t\t\tresult._nestedChangeSet = this._nestedChangeSet;\n\t\t\tresult._parentNestedChangeSet = this._parentNestedChangeSet;\n\t\t\tresult._propertyContainerType = this._propertyContainerType;\n\t\t\tresult._arrayLocalIndex = this._arrayLocalIndex;\n\t\t\tresult._arrayOperationIndex = this._arrayOperationIndex;\n\t\t\tresult._arrayOperationOffset = this._arrayOperationOffset;\n\t\t\tresult._arrayIteratorOffset = this._arrayIteratorOffset;\n\t\t\tresult._fullPostPath = this._fullPostPath;\n\t\t\tresult._operationType = this._operationType;\n\t\t\tresult._stackDepth = this._stackDepth;\n\t\t\tresult._typeStack = this._typeStack.slice();\n\t\t\tresult._parentStack = this._parentStack.slice();\n\t\t\tresult._containerStack = this._containerStack.slice();\n\t\t\tresult._userStack = this._userStack.slice();\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Returns the type of the property this property is contained within.\n\t\t * It can be one of ['NodeProperty', 'map', 'array', 'set', 'template', 'root']\n\t\t *\n\t\t * @returns The type of the property container\n\t\t */\n\t\tgetPropertyContainerType(): PropertyContainerType {\n\t\t\treturn this._propertyContainerType;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the index of this operations\n\t\t *\n\t\t * @returns The index\n\t\t */\n\t\tgetArrayOperationIndex(): number | undefined {\n\t\t\treturn this._arrayOperationIndex;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the offset of this operations\n\t\t *\n\t\t * @returns The index\n\t\t */\n\t\tgetArrayOperationOffset(): number | undefined {\n\t\t\treturn this._arrayOperationOffset;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the local index of this entry within the array of entries\n\t\t * of the currently processed operation\n\t\t *\n\t\t * @returns {Number} The index\n\t\t * @private\n\t\t */\n\t\tgetArrayLocalIndex() {\n\t\t\treturn this._arrayLocalIndex;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the offset of this operation as defined by the internal\n\t\t * ArrayIteratorOffset of the currently processed operation\n\t\t * @returns The offset\n\t\t */\n\t\tgetArrayIteratorOffset(): number | undefined {\n\t\t\treturn this._arrayIteratorOffset;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the valid path post this operation. For example if the original\n\t\t * path is foo.bar[0] and we insert one element at position 0, then the valid post path will be foo.bar[1].\n\t\t * In the case of array remove operations, the path returned by this function is only valid during the traversal\n\t\t * itself, since the elements get deleted. Array entries are deleted element by element.\n\t\t * @returns The path\n\t\t */\n\t\tgetFullPostPath(): string {\n\t\t\treturn this._fullPostPath;\n\t\t}\n\n\t\t/**\n\t\t * Returns the depth level of the current traversal state\n\t\t * @returns The Depth\n\t\t */\n\t\tgetStackDepth(): number {\n\t\t\treturn this._stackDepth;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all types traversed to this node\n\t\t * @returns The types traversed\n\t\t */\n\t\tgetTypeStack(): string[] {\n\t\t\treturn this._typeStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all property names traversed to this node\n\t\t * @returns The names traversed\n\t\t */\n\t\tgetParentStack(): (string | number)[] {\n\t\t\treturn this._parentStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all container types traversed to this node\n\t\t * @returns The container types traversed\n\t\t */\n\t\tgetContainerStack(): string[] {\n\t\t\treturn this._containerStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all validation checks traversed to this node\n\t\t * @returns The validation checks traversed\n\t\t */\n\t\tgetUserStack(): string[] {\n\t\t\treturn this._userStack;\n\t\t}\n\n\t\t/**\n\t\t * @returns Last segment string.\n\t\t */\n\t\tgetLastSegmentString(): string {\n\t\t\treturn this._lastSegmentString;\n\t\t}\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes either a pre- or a post-order callback for each visited property.\n\t *\n\t * At least one of the pre- or post-order callbacks must be specified. Both may be specified as well.\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @internal\n\t */\n\texport function traverseChangeSetRecursively(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_params?: TraversalOptions,\n\t) {\n\t\tConsoleUtils.assert(\n\t\t\tin_params.preCallback || in_params.postCallback,\n\t\t\tMSG.MISSING_PRE_POST_CALLBACK,\n\t\t);\n\t\t// Initialize the traversal context\n\t\tconst context = new Utils.TraversalContext();\n\t\tif (in_changeSet.typeid) {\n\t\t\tcontext._typeid = in_changeSet.typeid;\n\t\t} else {\n\t\t\t// if we're given an extra rootTypeId, use that\n\t\t\tcontext._typeid = in_params.rootTypeid ? in_params.rootTypeid : \"NodeProperty\";\n\t\t}\n\t\tcontext._nestedChangeSet = in_changeSet;\n\t\tcontext._parentNestedChangeSet = in_changeSet;\n\t\tcontext._splitTypeId = TypeIdHelper.extractContext(context._typeid);\n\t\tcontext._userData = in_params.userData;\n\n\t\tif (in_params.rootOperation) {\n\t\t\tcontext._operationType = in_params.rootOperation;\n\t\t}\n\n\t\t// Start the traversal\n\t\t_traverseChangeSetRecursively(in_params.preCallback, in_params.postCallback, context);\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes either a pre- or a post-order callback for each visited property.\n\t *\n\t * At least one of the pre- or post-order callbacks must be specified. Both may be specified as well.\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_finalizer - A callback when traversal is completed\n\t * @internal\n\t */\n\texport function traverseChangeSetRecursivelyAsync(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_params?: TraversalOptions,\n\t\tin_finalizer?: (any) => any,\n\t) {\n\t\tConsoleUtils.assert(\n\t\t\tin_params.preCallback || in_params.postCallback,\n\t\t\tMSG.MISSING_PRE_POST_CALLBACK,\n\t\t);\n\t\t// Initialize the traversal context\n\t\tconst context = new Utils.TraversalContext();\n\t\tif (in_changeSet.typeid) {\n\t\t\tcontext._typeid = in_changeSet.typeid;\n\t\t} else {\n\t\t\t// if we're given an extra rootTypeId, use that\n\t\t\tcontext._typeid = in_params.rootTypeid ? in_params.rootTypeid : \"NodeProperty\";\n\t\t}\n\t\tcontext._nestedChangeSet = in_changeSet;\n\t\tcontext._parentNestedChangeSet = in_changeSet;\n\t\tcontext._splitTypeId = TypeIdHelper.extractContext(context._typeid);\n\t\tcontext._userData = in_params.userData;\n\n\t\tif (in_params.rootOperation) {\n\t\t\tcontext._operationType = in_params.rootOperation;\n\t\t}\n\n\t\t// Start the traversal\n\t\t_traverseChangeSetRecursivelyAsync(\n\t\t\tin_params.preCallback,\n\t\t\tin_params.postCallback,\n\t\t\tcontext,\n\t\t\tin_finalizer,\n\t\t);\n\t}\n\n\t/**\n\t * Extracts all typeIds from the given ChangeSet\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t *\n\t * @returns All typeids that appear in the ChangeSet\n\t * @internal\n\t */\n\texport function extractTypeids(in_changeSet: SerializedChangeSet): string[] {\n\t\tconst result = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tif (\n\t\t\t\t\tin_context.getOperationType() === \"insert\" ||\n\t\t\t\t\tin_context.getOperationType() === \"modify\"\n\t\t\t\t) {\n\t\t\t\t\tin_context.getUserData()[in_context.getTypeid()] = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\t\treturn Object.keys(result);\n\t}\n\n\t/**\n\t * Enumerates all template from a given ChangeSet\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_callback - A callback that is used to emit every template\n\t * @param in_finalizer - A callback that is called when enumeration is completed\n\t *\n\t * @returns All templates that appear in the ChangeSet.\n\t * The returned object has members key (string), corresponding to the type and value with the definition (object)\n\t * @internal\n\t */\n\texport function enumerateSchemas(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_callback: (arg0: { key: string; value: any }, arg1: ErrorCallback<Error>) => void,\n\t\tin_finalizer: ErrorCallback<Error>,\n\t): string[] {\n\t\tconst result = [];\n\n\t\tif (in_changeSet.insertTemplates) {\n\t\t\tconst keys = Object.keys(in_changeSet.insertTemplates);\n\t\t\teachSeries(\n\t\t\t\tkeys,\n\t\t\t\tfunction (k, next) {\n\t\t\t\t\tin_callback(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: k,\n\t\t\t\t\t\t\tvalue: in_changeSet.insertTemplates[k],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnext,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tin_finalizer,\n\t\t\t);\n\t\t} else {\n\t\t\tin_finalizer();\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Removes all typeids from a ChangeSet\n\t * This is a private functions, it is only exported for the tests.\n\t *\n\t * @param io_changeSet - The ChangeSet to process\n\t * @internal\n\t */\n\texport function _stripTypeids(io_changeSet: SerializedChangeSet) {\n\t\tconst result = {};\n\t\tUtils.traverseChangeSetRecursively(io_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\t// We do nothing for the root\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst userData = in_context.getUserData();\n\n\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\tif (!userData[in_context.getOperationType()]) {\n\t\t\t\t\t\tuserData[in_context.getOperationType()] = cloneDeep(\n\t\t\t\t\t\t\tin_context.getNestedChangeSet(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst operationScope =\n\t\t\t\t\tin_context.getPropertyContainerType() !== \"template\"\n\t\t\t\t\t\t? (userData[in_context.getOperationType()] =\n\t\t\t\t\t\t\t\tuserData[in_context.getOperationType()] ||\n\t\t\t\t\t\t\t\t(in_context.getPropertyContainerType() === \"array\" ? [] : {}))\n\t\t\t\t\t\t: userData;\n\n\t\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid())) {\n\t\t\t\t\t// This is a primitive type, we store it under its name in the result\n\t\t\t\t\toperationScope[in_context.getLastSegment()] = in_context.getNestedChangeSet();\n\t\t\t\t} else {\n\t\t\t\t\tconst nestedUserData = {};\n\t\t\t\t\tif (in_context.getPropertyContainerType() === \"array\") {\n\t\t\t\t\t\tif (!operationScope[in_context.getArrayOperationIndex()]) {\n\t\t\t\t\t\t\toperationScope[in_context.getArrayOperationIndex()] = [\n\t\t\t\t\t\t\t\tin_context.getArrayOperationOffset(),\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst arrayOperation = operationScope[in_context.getArrayOperationIndex()];\n\n\t\t\t\t\t\tarrayOperation[1][in_context.getArrayLocalIndex()] = nestedUserData;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is a collection, we have to continue recursively\n\t\t\t\t\t\toperationScope[in_context.getLastSegment()] = nestedUserData;\n\t\t\t\t\t}\n\n\t\t\t\t\tin_context.setUserData(nestedUserData);\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\n\t\t// Remove all existing keys from the ChangeSet\n\t\tObject.keys(io_changeSet).forEach(function (key) {\n\t\t\tdelete io_changeSet[key];\n\t\t});\n\n\t\t// Assign from the result user data\n\t\textend(io_changeSet, result);\n\t}\n\n\t/**\n\t * Searches through a ChangeSet and returns all Changes to a properties with a given typeid\n\t *\n\t * @param in_typeid - The typeid of the property to look for\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_excludeTypeids - Exclude all typeids from the returned ChangeSet\n\t * @returns Returns the applied operations to entries of the given typeid. The returned maps for insert and modify map paths to ChangeSets\n\t * @internal\n\t */\n\texport function getChangesByType(\n\t\tin_typeid: string,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_excludeTypeids: boolean,\n\t): { insert?: object; modify?: object } {\n\t\tconst result: SerializedChangeSet = {};\n\n\t\t// We search for the typeid by traversing the whole ChangeSet recursively\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\t// If we found and instance of the requested typeid, we store it under its path\n\t\t\t\tif (in_context.getTypeid() === in_typeid) {\n\t\t\t\t\tconst userData = in_context.getUserData();\n\t\t\t\t\tuserData[in_context.getOperationType()] =\n\t\t\t\t\t\tuserData[in_context.getOperationType()] || {};\n\t\t\t\t\tuserData[in_context.getOperationType()][in_context.getFullPath()] =\n\t\t\t\t\t\tin_context.getNestedChangeSet();\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\n\t\t// Exclude typeids if requested by the caller\n\t\tif (in_excludeTypeids) {\n\t\t\tconst insertKeys = Object.keys(result.insert);\n\t\t\tfor (let i = 0; i < insertKeys.length; i++) {\n\t\t\t\tresult.insert[insertKeys[i]] = cloneDeep(result.insert[insertKeys[i]]);\n\t\t\t\tUtils._stripTypeids(result.insert[insertKeys[i]]);\n\t\t\t}\n\n\t\t\tconst modifyKeys = Object.keys(result.modify);\n\t\t\tfor (let i = 0; i < modifyKeys.length; i++) {\n\t\t\t\tresult.modify[modifyKeys[i]] = cloneDeep(result.modify[modifyKeys[i]]);\n\t\t\t\tUtils._stripTypeids(result.modify[modifyKeys[i]]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Filter the serialized ChangeSet returning a subset of serialized ChangeSet which has been performed\n\t * on the given path. Returns an empty serialized ChangeSet if the path has not been affected.\n\t *\n\t * @param in_path - The path to process\n\t * @param in_root - The root node to which the ChangeSet has been applied\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_excludetypeids - Exclude all typeids from the returned ChangeSet\n\t * @throws if path is invalid.\n\t * @returns The changes that are applied to the given path.\n\t *\n\t * ```\n\t * <pre>\n\t * {insert: Object|undefined, modify: Object|undefined, remove: boolean|undefined}\n\t * </pre>\n\t * ```\n\t * @internal\n\t */\n\texport function getChangesByPath(\n\t\tin_path: string,\n\t\tin_root,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_excludetypeids: boolean,\n\t): object {\n\t\t// if we're asked for the root, just return the root (in a modify)\n\t\tif (in_path === \"\") {\n\t\t\treturn { modify: in_changeSet };\n\t\t}\n\n\t\t// tokenize the path we are searching for\n\t\tconst pathSegments = PathHelper.tokenizePathString(in_path);\n\n\t\t// Recursively traverse the ChangeSet and search for the path\n\t\tconst result: SerializedChangeSet = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\t// We ignore the root\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst userData = in_context.getUserData();\n\n\t\t\t\tconst currentSegment = pathSegments[userData.currentLevel];\n\t\t\t\tconst changesetSegment = in_context.getLastSegmentEscaped().toString();\n\t\t\t\tlet level = userData.currentLevel;\n\n\t\t\t\t// We have to handle the case that a path contains nested properties. In that case we concatenate the\n\t\t\t\t// properties in the path, as long as they are a prefix of the segment we are currently looking at\n\t\t\t\tlet mergedSegment = PathHelper.quotePathSegmentIfNeeded(currentSegment);\n\t\t\t\twhile (\n\t\t\t\t\tchangesetSegment.length > mergedSegment.length &&\n\t\t\t\t\tchangesetSegment.substr(0, mergedSegment.length) === mergedSegment &&\n\t\t\t\t\tlevel < pathSegments.length - 1\n\t\t\t\t) {\n\t\t\t\t\tlevel++;\n\t\t\t\t\tmergedSegment =\n\t\t\t\t\t\tmergedSegment +\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER +\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(pathSegments[level]);\n\t\t\t\t}\n\n\t\t\t\t// Have we found the right entry in the ChangeSet?\n\t\t\t\t// TODO: This could be done more efficiently\n\t\t\t\tif (changesetSegment === mergedSegment) {\n\t\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\t\t// If this is a removal operation, we mark the path as removed, even if we haven't reached the end of the\n\t\t\t\t\t\t// path\n\t\t\t\t\t\tresult.removed = true;\n\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Did we find the last segment in the path?\n\t\t\t\t\t\tif (level === pathSegments.length - 1) {\n\t\t\t\t\t\t\t// In that case, we return the result\n\t\t\t\t\t\t\tresult[in_context.getOperationType()] = {};\n\n\t\t\t\t\t\t\tlet currentChangeSet = in_context.getNestedChangeSet();\n\t\t\t\t\t\t\tif (in_excludetypeids) {\n\t\t\t\t\t\t\t\tcurrentChangeSet = cloneDeep(currentChangeSet);\n\t\t\t\t\t\t\t\tUtils._stripTypeids(currentChangeSet);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult[in_context.getOperationType()][in_context.getFullPath()] =\n\t\t\t\t\t\t\t\tcurrentChangeSet;\n\t\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Otherwise, we continue recursively with the next level\n\t\t\t\t\t\t\tin_context.setUserData({ currentLevel: level + 1 });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop the traversal, if this is the wrong segment\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: { currentLevel: 0 },\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Invoke a callback for all nested ChangeSets that correspond to a set of user supplied tokenized paths.\n\t *\n\t * @param in_paths - A map or object which contains the tokenized paths as nested elements.\n\t * Common path segment are thus shared.\n\t *\n\t * NOTE: It is recommended to use Map as it provides better performance.\n\t * For example, for these three paths:\n\t *\n\t * - 'entry1'\n\t *\n\t * - 'nested.entry2'\n\t *\n\t * - 'nested.entry3'\n\t *\n\t * Using a map for paths would look like this:\n\t *\n\t * ```typescript\n\t * new Map([\n\t * ['entry', new Map()],\n\t * ['nested', new Map([\n\t * ['entry2', new Map()],\n\t * ['entry3', new Map()]\n\t * ])]\n\t * ])\n\t * ```\n\t *\n\t * While using objects for paths would look like this:\n\t *\n\t * ```typescript\n\t * {\n\t * entry: {},\n\t * nested: {\n\t * entry2: {}\n\t * entry3: {}\n\t * }\n\t * }\n\t * ```\n\t *\n\t * The element under the path, will be provided to the callback. If you have to pass additional data\n\t * to the callback, you can add private data by prefixing it with __ and setting\n\t * in_options.escapeLeadingDoubleUnderscore to true.\n\t * In case you do that, bear in mind that paths that refer to changeSet properties that have at least\n\t * two underscores as prefix in its id, should contain an extra underscore character as prefix:\n\t *\n\t * ```\n\t * | Path in changeSet | Path in paths |\n\t * | path0 | path0 | (unescaped)\n\t * | _path1 | _path1 | (unescaoed)\n\t * | __path2 | ___path2 | (escaped with one extra leading underscore)\n\t * | ___path3 | ____path3 | (also escaped, the same applies to N underscores where N >= 2)\n\t * ```\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_callback - The function to invoke at the registered paths (it is called both for the interior and the\n\t * leaf nodes). The callback will be called for each node with the following parameters:\n\t *\n\t * - `context`: The current TraversalContext as returned by Utils.traverseChangeSetRecursively.\n\t * Can be used for querying the current Property type, operation, etc.\n\t *\n\t * - `currentSubPaths`: A subset of the tokenized paths passed in as input to this function that still need to be\n\t * processed from the current node\n\t *\n\t * - `currentTokenizedPath`: The tokenized path leading to the current node\n\t *\n\t * - `contractedPathSegment`: True if the current node is inside a contracted path segment (e.g.\n\t * currentTokenizedPath is ['foo'], coming from the changeset segment 'foo.bar'), false otherwise. If true, the\n\t * typeid from the context parameter may not be valid at the current node. Callbacks may ignore this if they are\n\t * not concerned with the type.\n\t *\n\t * @param in_options.rootOperation - The operation that has been applied to the root of the ChangeSet\n\t * (either 'insert' or 'modify')\n\t * @param in_options.rootTypeid - The full type of the root Property of the ChangeSet\n\t * @param in_options.escapeLeadingDoubleUnderscore - If this is set to true, keys which start with '__' will be\n\t * escaped (by adding an additional '_') before the lookup into the paths map. This frees the keyspace with\n\t * duplicated underscores for the use by the calling application.\n\t * @internal\n\t */\n\texport function getChangesToTokenizedPaths(\n\t\tin_paths: Map<string, Map<string, any>> | { [key: string]: any },\n\t\tin_changeSet: any,\n\t\tin_callback: {\n\t\t\t(\n\t\t\t\tcontext: TraversalContext,\n\t\t\t\tnestedObj: any,\n\t\t\t\ttokenizedPath: string[],\n\t\t\t\tcontractedPathSegment: boolean,\n\t\t\t): void;\n\t\t\t(arg0: TraversalContext, arg1: any, arg2: any[], arg3: boolean): void;\n\t\t},\n\t\tin_options: {\n\t\t\tescapeLeadingDoubleUnderscore?: boolean;\n\t\t\trootOperation?: OperationType;\n\t\t\trootTypeid?: string;\n\t\t} = { escapeLeadingDoubleUnderscore: false, rootOperation: \"modify\" },\n\t) {\n\t\tconst currentTokenizedPath = [];\n\n\t\tlet paths;\n\t\tlet legacyPaths;\n\n\t\tconst _isUserData = (k) => {\n\t\t\t// We only support storing user data \"as is\" if the in_options.escapeLeadingUnderscore is enabled.\n\t\t\t// We assume user data is anything that begins with exactly two underscores.\n\t\t\t// If the third character is also an underscore it is either an escaped changeSet segment or something that the\n\t\t\t// calling application escaped so we don't consider this user data.\n\t\t\t// Note that if the calling application sets the in_options.escapeLeadingDoubleUnderscore option, it is responsible\n\t\t\t// for escaping input path segments that begin with a double underscore,\n\t\t\t// otherwise such segments will be considered as user data!\n\t\t\treturn (\n\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\tk &&\n\t\t\t\tk.length > 2 &&\n\t\t\t\tk[0] === \"_\" &&\n\t\t\t\tk[1] === \"_\" &&\n\t\t\t\tk[2] !== \"_\"\n\t\t\t);\n\t\t};\n\n\t\tlet _convertLevelToMap = function (obj) {\n\t\t\tconst thisLevel = new Map();\n\t\t\tObject.entries(obj).forEach(([k, v]) => {\n\t\t\t\tif (_isUserData(k)) {\n\t\t\t\t\t// We do not want to convert user provided data into maps so we store this subtree as is\n\t\t\t\t\tthisLevel.set(k, v);\n\t\t\t\t} else {\n\t\t\t\t\tthisLevel.set(k, _convertLevelToMap(v));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn thisLevel;\n\t\t};\n\n\t\tlet _convertMapToLevel = function (map) {\n\t\t\tconst thisLevel = {};\n\t\t\tfor (const [k, v] of map) {\n\t\t\t\tif (_isUserData(k)) {\n\t\t\t\t\tthisLevel[k] = v;\n\t\t\t\t} else {\n\t\t\t\t\tthisLevel[k] = v instanceof Map ? _convertMapToLevel(v) : v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn thisLevel;\n\t\t};\n\n\t\tconst _toCallbackParam = (pathLevels) => {\n\t\t\treturn legacyPaths\n\t\t\t\t? // If a user provided objects as paths, they would expect objects in their callbacks as well.\n\t\t\t\t\t// So, we transform the parameter to an object, which is not very performant but is backwards compatible.\n\t\t\t\t\t_convertMapToLevel(pathLevels)\n\t\t\t\t: pathLevels;\n\t\t};\n\n\t\tif (!(in_paths instanceof Map)) {\n\t\t\tlegacyPaths = true;\n\t\t\tpaths = _convertLevelToMap(in_paths);\n\t\t} else {\n\t\t\tlegacyPaths = false;\n\t\t\tpaths = in_paths;\n\t\t}\n\n\t\t// Recursively traverse the ChangeSet and search for the path\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tconst userData = in_context.getUserData();\n\t\t\t\tconst currentSubPaths = userData.currentSubPaths;\n\n\t\t\t\t// We ignore the root\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\tin_callback(\n\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t_toCallbackParam(currentSubPaths),\n\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet changesetSegment = in_context.getLastSegmentEscaped().toString();\n\t\t\t\tlet numberOfSegments = 1;\n\t\t\t\tlet nestedSubPath;\n\t\t\t\tif (\n\t\t\t\t\tchangesetSegment.indexOf(\".\") !== -1 ||\n\t\t\t\t\t(changesetSegment.length > 0 && changesetSegment.startsWith('\"'))\n\t\t\t\t) {\n\t\t\t\t\tnestedSubPath = currentSubPaths;\n\t\t\t\t\tconst tokenized = PathHelper.tokenizePathString(changesetSegment);\n\t\t\t\t\tnumberOfSegments = tokenized.length;\n\t\t\t\t\tfor (let i = 0; i < tokenized.length; i++) {\n\t\t\t\t\t\tlet segment = tokenized[i];\n\t\t\t\t\t\tcurrentTokenizedPath.push(segment);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\t\t\t\tsegment.startsWith(\"_\") &&\n\t\t\t\t\t\t\tsegment[1] === \"_\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tsegment = `_${segment}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnestedSubPath = nestedSubPath.get(segment);\n\t\t\t\t\t\tif (nestedSubPath === undefined) {\n\t\t\t\t\t\t\tnumberOfSegments = i + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i !== tokenized.length - 1) {\n\t\t\t\t\t\t\t// Bug fix: signal the callback that we're inside a contracted path segment\n\t\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcurrentTokenizedPath.push(changesetSegment);\n\t\t\t\t\tif (\n\t\t\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\t\t\tchangesetSegment.startsWith(\"_\") &&\n\t\t\t\t\t\tchangesetSegment[1] === \"_\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tchangesetSegment = `_${changesetSegment}`;\n\t\t\t\t\t}\n\t\t\t\t\tnestedSubPath = currentSubPaths.get(changesetSegment);\n\t\t\t\t}\n\n\t\t\t\t// Have we found the right entry in the ChangeSet?\n\t\t\t\t// TODO: This could be done more efficiently\n\t\t\t\tif (nestedSubPath) {\n\t\t\t\t\t// Otherwise, we continue recursively with the next level\n\t\t\t\t\tin_context.setUserData({ currentSubPaths: nestedSubPath, numberOfSegments });\n\t\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\t\t// If this is a removal operation, we mark the path as removed, even if we haven't reached the end of the\n\t\t\t\t\t\t// path\n\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop the traversal, if this is the wrong segment\n\t\t\t\t\tin_context.setUserData({ currentSubPaths: undefined, numberOfSegments });\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tpostCallback(in_context) {\n\t\t\t\tfor (let i = 0; i < in_context.getUserData().numberOfSegments; i++) {\n\t\t\t\t\tcurrentTokenizedPath.pop();\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: {\n\t\t\t\tcurrentSubPaths: paths,\n\t\t\t\tnumberOfSegments: 0,\n\t\t\t},\n\t\t\trootOperation: in_options.rootOperation,\n\t\t\trootTypeid: in_options.rootTypeid,\n\t\t});\n\t}\n\n\ttype PathsType = string[] | PathTree;\n\n\t/**\n\t * Filter change sets by paths.\n\t * Given a change set, this function will filter it based on a series of paths.\n\t * The final ChangeSet will only include the paths in question starting from the root of\n\t * the ChangeSet.\n\t *\n\t * @example\n\t *\n\t * Given the following change set:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello',\n\t * 'string2': 'world\n\t * }\n\t * }\n\t * ```\n\t *\n\t * And the path `['string1']`, the resulting ChangeSet will be:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello'\n\t * }\n\t * }\n\t * ```\n\t *\n\t * NOTE: Paths that traverse through sets and arrays are not supported.\n\t *\n\t * @param in_changeSet - The changeset to parse.\n\t * @param in_paths - List of paths to filter by. This can either be passed\n\t * as a flat array of paths or as a Map with the tokenized, tree structured paths, see the\n\t * documentation of getChangesToTokenizedPaths for an example.\n\t * Note: duplicate paths will be ignored including ones that encompasse other paths.\n\t *\n\t * @throws If a path given resolves into an array or set.\n\t * @returns The filtered ChangeSet\n\t * @internal\n\t */\n\texport function getFilteredChangeSetByPaths(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_paths: PathsType,\n\t): SerializedChangeSet {\n\t\tlet pathsToObj;\n\n\t\tif (Array.isArray(in_paths)) {\n\t\t\tpathsToObj = Utils.convertPathArrayToTree(in_paths);\n\t\t} else if (in_paths instanceof Map) {\n\t\t\tpathsToObj = in_paths;\n\t\t} else {\n\t\t\tthrow new TypeError(\"in_paths must be a list of paths or a map of the tokenized paths\");\n\t\t}\n\n\t\tconst rootChangeSet = {};\n\n\t\tconst pathToChangeSet = {};\n\n\t\tconst toPurge: SerializedChangeSet = {};\n\n\t\tconst redundantPaths = new Map();\n\t\tUtils.getChangesToTokenizedPaths(\n\t\t\tpathsToObj,\n\t\t\tin_changeSet,\n\t\t\tfunction (\n\t\t\t\tcontext: TraversalContext,\n\t\t\t\tnestedObj: { size: number },\n\t\t\t\ttokenizedPath: string[],\n\t\t\t\tcontractedPathSegment: any,\n\t\t\t) {\n\t\t\t\tif (context.getFullPath() === \"\") {\n\t\t\t\t\t// skip the root\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst parentNestedChangeSet = context.getParentNestedChangeSet();\n\t\t\t\tlet changeSetToPopulate;\n\n\t\t\t\tlet pathHasBeenFound = false;\n\t\t\t\tlet fullPath;\n\t\t\t\tif (tokenizedPath.length === 1) {\n\t\t\t\t\t// first depth\n\t\t\t\t\tchangeSetToPopulate = rootChangeSet;\n\t\t\t\t\tfullPath = PathHelper.quotePathSegmentIfNeeded(tokenizedPath[0]);\n\t\t\t\t\tconst pathEntry = pathsToObj.get(tokenizedPath[0]);\n\t\t\t\t\tif (pathEntry) {\n\t\t\t\t\t\tpathHasBeenFound = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet parentPath = \"\";\n\t\t\t\t\tfullPath = \"\";\n\t\t\t\t\tlet currentEntryInPathsToObj = pathsToObj;\n\n\t\t\t\t\tconst pathsToDelete = [];\n\t\t\t\t\ttokenizedPath.forEach((segment, index) => {\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tparentPath += PathHelper.quotePathSegmentIfNeeded(segment);\n\t\t\t\t\t\t\tchangeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;\n\t\t\t\t\t\t} else if (index < tokenizedPath.length - 1) {\n\t\t\t\t\t\t\tparentPath +=\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"set\" &&\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"map\"\n\t\t\t\t\t\t\t\t\t? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`\n\t\t\t\t\t\t\t\t\t: `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;\n\t\t\t\t\t\t\tchangeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparentPath +=\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"set\" &&\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"map\"\n\t\t\t\t\t\t\t\t\t? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`\n\t\t\t\t\t\t\t\t\t: `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;\n\t\t\t\t\t\t\tfullPath = parentPath;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpathsToDelete.push(parentPath);\n\n\t\t\t\t\t\tif (currentEntryInPathsToObj) {\n\t\t\t\t\t\t\tcurrentEntryInPathsToObj = currentEntryInPathsToObj.get(segment);\n\n\t\t\t\t\t\t\tif (currentEntryInPathsToObj) {\n\t\t\t\t\t\t\t\tif (currentEntryInPathsToObj.size === 0) {\n\t\t\t\t\t\t\t\t\t// Handle the case where we do not want to remove paths that should be included\n\t\t\t\t\t\t\t\t\t// when filtering by a parent path. The case in particular that is of interest are\n\t\t\t\t\t\t\t\t\t// paths that are folded into a single path for custom templates I.e.\n\t\t\t\t\t\t\t\t\t// E.g.\n\t\t\t\t\t\t\t\t\t// Given the following nested change set\n\t\t\t\t\t\t\t\t\t// {String: {'a.b.c.d.f' : '...'}}\n\t\t\t\t\t\t\t\t\t// we want to include it as part of the result when filtering by 'a.b.c'\n\t\t\t\t\t\t\t\t\tdelete toPurge[context.getFullPath()];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// We matched a path from the list of paths the user has passed in_context\n\t\t\t\t\t\t\t\t// In that case, we can remove all prefix paths from the list of redundant paths,\n\t\t\t\t\t\t\t\t// since we now know for sure, that they are needed in the final changeset\n\t\t\t\t\t\t\t\tpathHasBeenFound = true;\n\t\t\t\t\t\t\t\tfor (let i = 0; i < pathsToDelete.length; i++) {\n\t\t\t\t\t\t\t\t\tredundantPaths.delete(pathsToDelete[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (fullPath !== context.getFullPath() && pathToChangeSet[context.getFullPath()]) {\n\t\t\t\t\t\t// Here we are in the case where we have a changeset that\n\t\t\t\t\t\t// contains a property with path a.b.c.d as the key.\n\t\t\t\t\t\t// In that case, getChangesToTokenizedPaths will be called\n\t\t\t\t\t\t// at each level but will be ignored on every path leading up\n\t\t\t\t\t\t// to the leaf node\n\t\t\t\t\t\t// i.e. for a path \"a.b.c.d\", \"a\" \"b\" and \"c\" will be ignored.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!pathHasBeenFound) {\n\t\t\t\t\tredundantPaths.set(fullPath, {\n\t\t\t\t\t\tchangeSetToPopulate,\n\t\t\t\t\t\toperation: context.getOperationType(),\n\t\t\t\t\t\ttypeid: context.getTypeid(),\n\t\t\t\t\t\tlastSegment: context.getLastSegment(),\n\t\t\t\t\t\tcontainerType: context.getPropertyContainerType(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Here we override the fullPath to be the full path of the context\n\t\t\t\t// For anything that is not a set or a map. This is due to the fact that\n\t\t\t\t// on the next iteration of the child of a set, we lose the context of\n\t\t\t\t// property container which means that our fullPath will actually contain\n\t\t\t\t// dots for sets. This is OK because we build the fullpath ourselves in such a\n\t\t\t\t// case and it will be consistent with the way we search for a valid changeSetToPopulate\n\t\t\t\tif (\n\t\t\t\t\tcontext.getPropertyContainerType() !== \"set\" &&\n\t\t\t\t\tcontext.getPropertyContainerType() !== \"map\"\n\t\t\t\t) {\n\t\t\t\t\tfullPath = context.getFullPath();\n\t\t\t\t}\n\n\t\t\t\t// keep a reference to the underlying change set of the current path.\n\t\t\t\t// This will speed up the process to know which object representing\n\t\t\t\t// the nested change set needs to be populated on the subsequent iterations\n\t\t\t\tpathToChangeSet[fullPath] = _filterChangeSetBySegment(\n\t\t\t\t\tchangeSetToPopulate,\n\t\t\t\t\tcontext,\n\t\t\t\t\tparentNestedChangeSet,\n\t\t\t\t\tnestedObj.size === 0,\n\t\t\t\t);\n\n\t\t\t\t// Since some hierarchies are folded into a single path, there is a case where\n\t\t\t\t// we end up with entries in the change set that we did not want. For instance,\n\t\t\t\t// if the change set contains two sibling paths \"a.b.c\" and \"a.b.d\", getChangesToTokenizedPaths\n\t\t\t\t// will invoke the callback for both paths at each level and we'll end up including both\n\t\t\t\t// paths in the filtered change set even if we didn't ask for both.\n\t\t\t\t// In that case, we keep track of change sets that we will later purge if we did not ask for them.\n\t\t\t\t//\n\t\t\t\t// NOTE: A common pitfal is to check against the presence of a \"dot\" in the segment to detect such a case\n\t\t\t\t// we instead check against the tokenized paths.\n\t\t\t\t// Otherwise, the function will behave incorrectly if a segment contains a dot\n\t\t\t\t// i.e.\n\t\t\t\tconst lastSegment = context.getLastSegmentEscaped() as string;\n\t\t\t\tif (\n\t\t\t\t\tcontractedPathSegment &&\n\t\t\t\t\t(lastSegment.indexOf(\".\") !== -1 ||\n\t\t\t\t\t\t(lastSegment.length > 0 && lastSegment.startsWith('\"'))) &&\n\t\t\t\t\tPathHelper.tokenizePathString(lastSegment).length > 1\n\t\t\t\t) {\n\t\t\t\t\ttoPurge[context.getFullPath()] = {\n\t\t\t\t\t\tchangeSet: changeSetToPopulate,\n\t\t\t\t\t\ttypeid: context.getTypeid(),\n\t\t\t\t\t\tpathToPurge: lastSegment,\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tdelete toPurge[context.getFullPath()];\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\t// Delete entries from the change set that we do not want.\n\t\t// We can enter this case when dealing with folded paths.\n\t\teach(toPurge, function (item, fullPath) {\n\t\t\tdelete item.changeSet[item.typeid][item.pathToPurge];\n\t\t\tif (isEmpty(item.changeSet[item.typeid])) {\n\t\t\t\tdelete item.changeSet[item.typeid];\n\t\t\t}\n\t\t});\n\n\t\t// Remove paths from the changeset that have been inserted during the traversal, but later\n\t\t// did not match any of the passed paths.\n\t\tfor (const key of redundantPaths.keys()) {\n\t\t\tconst removalInformation = redundantPaths.get(key);\n\t\t\tconst CS = removalInformation.changeSetToPopulate;\n\t\t\tif (removalInformation.containerType !== \"template\") {\n\t\t\t\tconst operation = removalInformation.operation;\n\t\t\t\tif (operation === \"remove\") {\n\t\t\t\t\t// Removes will recursively continue and don't need to be filtered\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tconst operationCS = CS[operation];\n\t\t\t\t\tlet typeidCS = CS[operation][removalInformation.typeid];\n\t\t\t\t\tdelete typeidCS[removalInformation.lastSegment];\n\t\t\t\t\tif (isEmpty(typeidCS)) {\n\t\t\t\t\t\tdelete operationCS[removalInformation.typeid];\n\t\t\t\t\t}\n\t\t\t\t\tif (isEmpty(CS[operation])) {\n\t\t\t\t\t\tdelete CS[operation];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet typeidCS = CS[removalInformation.typeid];\n\t\t\t\tdelete typeidCS[removalInformation.lastSegment];\n\t\t\t\tif (isEmpty(typeidCS)) {\n\t\t\t\t\tdelete CS[removalInformation.typeid];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rootChangeSet;\n\t}\n\n\t/**\n\t * Converts an array of paths to the tree structured representation that is needed\n\t * as input for the function getChangesToTokenizedPaths.\n\t *\n\t * @param in_paths - An array with paths\n\t * @returns {Map} A tree structured representation of the tokenized paths that can be\n\t * passed to getChangesToTokenizedPaths and getFilteredChangeSetByPaths.\n\t * @internal\n\t */\n\texport function convertPathArrayToTree(in_paths: string[]): PathTree {\n\t\tin_paths = Array.isArray(in_paths) ? in_paths : [in_paths];\n\t\tconst pathsToProcess = new Set(in_paths);\n\n\t\t// create an array of arrays splitting by .\n\t\tconst tokenizedPaths = in_paths.map((path) => PathHelper.tokenizePathString(path));\n\n\t\t// Create a tree representation of the paths that are passed as an input so that\n\t\t// we can leverage getChangesToTokenizedPaths and only be notified on paths\n\t\t// that we care about.\n\t\tconst pathsToObj = tokenizedPaths.reduce(function (memo, tokenizedPath) {\n\t\t\tlet obj = memo;\n\t\t\tlet path = \"\";\n\t\t\tlet segment;\n\n\t\t\tfor (let index = 0; index < tokenizedPath.length; index++) {\n\t\t\t\tsegment = tokenizedPath[index];\n\n\t\t\t\tif (index === 0) {\n\t\t\t\t\tpath = PathHelper.quotePathSegmentIfNeeded(segment);\n\t\t\t\t} else {\n\t\t\t\t\tpath += `.${PathHelper.quotePathSegmentIfNeeded(segment)}`;\n\t\t\t\t}\n\n\t\t\t\tif (pathsToProcess.has(path) && index < tokenizedPath.length - 1) {\n\t\t\t\t\treturn memo;\n\t\t\t\t}\n\n\t\t\t\tif (!obj.has(segment)) {\n\t\t\t\t\tobj.set(segment, new Map());\n\t\t\t\t}\n\n\t\t\t\tobj = obj.get(segment);\n\t\t\t}\n\n\t\t\treturn memo;\n\t\t}, new Map());\n\n\t\treturn pathsToObj;\n\t}\n\n\t/**\n\t * Exclude path from change set.\n\t * Given a change set, this function will filter it based on a series of paths.\n\t * The final ChangeSet will exclude the paths in question starting from the root of\n\t * the ChangeSet.\n\t *\n\t * @example\n\t *\n\t * Given the following change set:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello',\n\t * 'string2': 'world\n\t * }\n\t * }\n\t * ```\n\t *\n\t * And the path `['string1']`, the resulting ChangeSet will be:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string2': 'world'\n\t * }\n\t * }\n\t * ```\n\t *\n\t * NOTE: Paths that traverse through sets and arrays are not supported.\n\t *\n\t * @param in_changeSet - The changeset to parse\n\t * @param in_paths - List of paths to exclude. Note: duplicate paths will be ignored\n\t * including ones that encompasse other paths\n\t * @throws if a path given resolves into an array or set\n\t * @returns Filtered ChangeSet\n\t * @internal\n\t */\n\texport function excludePathsFromChangeSet(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_paths: string[],\n\t): SerializedChangeSet {\n\t\tif (!in_changeSet || !in_paths || isEmpty(in_paths)) {\n\t\t\treturn in_changeSet;\n\t\t}\n\n\t\tin_paths = Array.isArray(in_paths) ? in_paths : [in_paths];\n\t\t// create an array of arrays splitting by .\n\t\tconst tokenizedPaths = in_paths.map((path) => PathHelper.tokenizePathString(path));\n\n\t\tconst rootChangeSet = cloneDeep(in_changeSet);\n\n\t\tUtils.traverseChangeSetRecursively(rootChangeSet, {\n\t\t\tpreCallback: (in_context) => {\n\t\t\t\tconst shouldExclude = find(tokenizedPaths, (val) => {\n\t\t\t\t\treturn isEqual(val, in_context.getParentStack());\n\t\t\t\t});\n\t\t\t\tif (shouldExclude) {\n\t\t\t\t\tconst operationType = in_context.getOperationType();\n\t\t\t\t\tconst typeId = in_context.getTypeid();\n\t\t\t\t\tconst lastSegment = in_context.getLastSegment();\n\t\t\t\t\tdelete in_context.getParentNestedChangeSet()[operationType][typeId][lastSegment];\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\treturn rootChangeSet;\n\t}\n\n\t/**\n\t * Extract all paths from the ChangeSet in a flattened list and include the operations and typeid information.\n\t * @remarks NOTE: The paths returned also include the parent. i.e. the path 'nodeProp.subproperty' will result in:\n\t * ```json\n\t * {\n\t * nodeProp: {\n\t * operation: 'modify',\n\t * typeid: { typeid: 'NodeProperty', context: 'single', isEnum: false }\n\t * },\n\t * nodeProp.subProperty: {\n\t * operation: 'insert',\n\t * typeid: { typeid: 'Float32', context: 'single', isEnum: false }\n\t * }\n\t * }\n\t * ```\n\t *\n\t * @param in_changeSet - The changeset to extract paths from\n\t * @param in_options - Set of options\n\t * @param in_options.includeOperation - Flag to include the operation\n\t * @param in_options.includeTypeidInfo - Flag to include the typeid info\n\t * @returns Flat list of paths\n\t * @internal\n\t */\n\texport function extractPathsFromChangeSet(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_options?: { includeOperation?: boolean; includeTypeidInfo?: boolean },\n\t): { [key: string]: { operation: string; typeInfo: string } } {\n\t\tconst paths = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(context) {\n\t\t\t\tconst fullPath = context.getFullPath();\n\t\t\t\tpaths[fullPath] = paths[fullPath] || {};\n\t\t\t\tif (in_options.includeOperation) {\n\t\t\t\t\tpaths[fullPath].operation = context.getOperationType();\n\t\t\t\t}\n\n\t\t\t\tif (in_options.includeTypeidInfo) {\n\t\t\t\t\tpaths[fullPath].typeidInfo = context.getSplitTypeID();\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\treturn paths;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,aAAa;AACb,yEAA8E;AAC9E,iCAA6F;AAC7F,uEAA4C;AAC5C,6DAAkC;AAClC,iEAAsC;AACtC,6DAAkC;AAClC,mEAAwC;AACxC,mEAAwC;AACxC,qEAA0C;AAC1C,qEAA0C;AAG1C,gGAA0F;AAC1F,gFAAuF;AACvF,+DAA2E;AAC3E,iEAA2D;AAC3D,mDAAuD;AAEvD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAInD;;;;;GAKG;AACH,2DAA2D;AAC3D,IAAiB,KAAK,CA82ErB;AA92ED,WAAiB,KAAK;IAuCrB;;;;;;;OAOG;IACH,SAAS,kCAAkC,CAC1C,cAGQ,EACR,eAGQ,EACR,UAA4B,EAC5B,gBAAsC;QAEtC,IAAI,aAAa,CAAC;QAClB,IAAI,WAAW,CAAC;QAChB,IAAI,eAAe,CAAC;QACpB,IAAI,eAA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AAM,CAAC,CAAC,WAAW,CAAC,CAAC;oBACjF,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC;gBACrC,CAAC;YACF,CAAC;SACD,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACtB,CAAC;IA9Be,+BAAyB,4BA8BxC,CAAA;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,SAAgB,yBAAyB,CACxC,YAAiC,EACjC,UAAwE;QAExE,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,CAAC,4BAA4B,CAAC,YAAY,EAAE;YAChD,WAAW,CAAC,OAAO;gBAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBACvC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACxC,IAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;oBACjC,KAAK,CAAC,QAAQ,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;gBACxD,CAAC;gBAED,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC;oBAClC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;gBACvD,CAAC;YACF,CAAC;SACD,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;IApBe,+BAAyB,4BAoBxC,CAAA;AACF,CAAC,EA92EgB,KAAK,qBAAL,KAAK,QA82ErB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// @ts-ignore\nimport { constants, ConsoleUtils } from \"@fluid-experimental/property-common\";\nimport { ErrorCallback, eachOfSeries, eachSeries, series, timesSeries, whilst } from \"async\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport each from \"lodash/each.js\";\nimport extend from \"lodash/extend.js\";\nimport find from \"lodash/find.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isNumber from \"lodash/isNumber.js\";\nimport isString from \"lodash/isString.js\";\n\nimport { SerializedChangeSet } from \"./changeset.js\";\nimport { ArrayChangeSetIterator } from \"./changeset_operations/arrayChangesetIterator.js\";\nimport { ArrayIteratorOperationTypes } from \"./changeset_operations/operationTypes.js\";\nimport { ExtractedContext, TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { isReservedKeyword } from \"./isReservedKeyword.js\";\nimport { PathHelper, PathTree } from \"./pathHelper.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\ntype NextFn = (err?: Error | null | undefined | string, result?: unknown) => void;\n\n/**\n * Utils\n * @alias property-changeset.Utils\n * @class\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Utils {\n\t/**\n\t * @internal\n\t */\n\texport type OperationType = \"modify\" | \"insert\" | \"remove\";\n\t/**\n\t * @internal\n\t */\n\texport type PropertyContainerType =\n\t\t| \"array\"\n\t\t| \"map\"\n\t\t| \"set\"\n\t\t| \"root\"\n\t\t| \"NodeProperty\"\n\t\t| \"template\";\n\n\tinterface TraversalOptions {\n\t\t/**\n\t\t * The(pre-order) callback function that is invoked for each property\n\t\t */\n\t\tpreCallback?: (context: TraversalContext) => any;\n\t\t/**\n\t\t * The (post-order) callback function that is invoked for each property\n\t\t */\n\t\tpostCallback?: (context: TraversalContext) => any;\n\t\t/**\n\t\t * An optional object that is passed to all invocations of the callback via the\n\t\t */\n\t\tuserData?: { [key: string]: any };\n\t\t/**\n\t\t * The operation that has been applied to the root of the ChangeSet (either 'insert' or 'modify')\n\t\t */\n\t\trootOperation?: OperationType;\n\t\t/**\n\t\t * The full typeid for the Property at the root of the ChangeSet\n\t\t */\n\t\trootTypeid?: string;\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes the callback for each visited property.\n\t *\n\t * @param in_preCallback - The (pre-order) callback function that is invoked for each property\n\t * @param in_postCallback - The (post-order) callback function that is invoked for each property\n\t * @param in_context - The traversal context for the currently processed property\n\t * @param in_levelCallback - A callback for when a node is reached\n\t */\n\tfunction _traverseChangeSetRecursivelyAsync(\n\t\tin_preCallback: (\n\t\t\tcontext: TraversalContext,\n\t\t\tnext: (err?: Error | null | undefined | string, result?: unknown) => void,\n\t\t) => any,\n\t\tin_postCallback: (\n\t\t\tcontext: TraversalContext,\n\t\t\tnext: (err?: Error | null | undefined | string, result?: unknown) => void,\n\t\t) => any,\n\t\tin_context: TraversalContext,\n\t\tin_levelCallback: (param?: any) => any,\n\t) {\n\t\tlet pathSeparator;\n\t\tlet currentPath;\n\t\tlet currentPostPath;\n\t\tlet nestedChangeSet;\n\t\tlet postOrderContext;\n\n\t\t// Call the callback function for this ChangeSet\n\t\tin_context._traversalStopped = false;\n\t\tconst typeid = in_context.getTypeid();\n\t\tlet splitTypeId = typeid !== undefined ? TypeIdHelper.extractContext(typeid) : undefined;\n\t\tin_context.setSplitTypeID(splitTypeId!);\n\n\t\tlet currentUserData;\n\n\t\tseries(\n\t\t\t[\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tif (in_preCallback !== undefined) {\n\t\t\t\t\t\tin_preCallback(in_context, next);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext();\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tpathSeparator = in_context.getFullPath() !== \"\" ? PROPERTY_PATH_DELIMITER : \"\";\n\t\t\t\t\tcurrentPath = in_context.getFullPath();\n\t\t\t\t\tcurrentPostPath = in_context.getFullPostPath();\n\t\t\t\t\tnestedChangeSet = in_context.getNestedChangeSet();\n\n\t\t\t\t\tconst _typeid = in_context.getTypeid();\n\t\t\t\t\t// Call the callback function for this ChangeSet\n\t\t\t\t\tin_context._traversalStopped = false;\n\t\t\t\t\tsplitTypeId =\n\t\t\t\t\t\t_typeid !== undefined ? TypeIdHelper.extractContext(_typeid) : undefined;\n\t\t\t\t\tin_context.setSplitTypeID(splitTypeId!);\n\n\t\t\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\t\t\t// TODO: this duplicates the context object putting stress on the GC.\n\t\t\t\t\t\tpostOrderContext = in_context.clone();\n\t\t\t\t\t}\n\t\t\t\t\tcurrentUserData = in_context.getUserData();\n\t\t\t\t\tif (\n\t\t\t\t\t\t!in_context.isTraversing() ||\n\t\t\t\t\t\tin_context.getOperationType() === \"remove\" ||\n\t\t\t\t\t\tTypeIdHelper.isPrimitiveType(in_context.getSplitTypeID().typeid) ||\n\t\t\t\t\t\tin_context.getSplitTypeID().isEnum\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\t\t\t\tin_postCallback(postOrderContext, function () {\n\t\t\t\t\t\t\t\tnext(\"break\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnext(\"break\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext();\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tfunction (next: NextFn) {\n\t\t\t\t\tconst currentTypeIdContext = in_context._splitTypeId.context;\n\n\t\t\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\n\t\t\t\t\t// Process an individual change recursively, by preparing the traversal context and invoking\n\t\t\t\t\t// _traverseChangeSetRecursively\n\t\t\t\t\tconst processChange = function (\n\t\t\t\t\t\tin_segment: string | number,\n\t\t\t\t\t\tin_subChangeSet: SerializedChangeSet,\n\t\t\t\t\t\tin_nestedTypeid: string,\n\t\t\t\t\t\tin_escape: boolean,\n\t\t\t\t\t\tin_parentPropertyType: PropertyContainerType,\n\t\t\t\t\t\tin_arrayOperationIndex: number,\n\t\t\t\t\t\tin_arrayLocalIndex: number,\n\t\t\t\t\t\tin_arrayOperationOffset: number,\n\t\t\t\t\t\tin_arrayIteratorOffset: number,\n\t\t\t\t\t\tin_callback: (param: any) => any,\n\t\t\t\t\t) {\n\t\t\t\t\t\tseries(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tfunction (n2) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t// Update the path\n\t\t\t\t\t\t\t\t\t\tin_context._lastSegment = in_segment;\n\t\t\t\t\t\t\t\t\t\tconst escapedSegment =\n\t\t\t\t\t\t\t\t\t\t\tin_escape && isString(in_segment)\n\t\t\t\t\t\t\t\t\t\t\t\t? PathHelper.quotePathSegmentIfNeeded(in_segment)\n\t\t\t\t\t\t\t\t\t\t\t\t: in_segment;\n\t\t\t\t\t\t\t\t\t\tlet nextSegmentToPushInParentStack = in_context.getLastSegment();\n\t\t\t\t\t\t\t\t\t\t// Note: we don't quote the path string here, since the paths\n\t\t\t\t\t\t\t\t\t\t// in a ChangeSet are already quoted, if necessary\n\t\t\t\t\t\t\t\t\t\tin_context._lastSegmentString =\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"map\" ||\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"array\" ||\n\t\t\t\t\t\t\t\t\t\t\tcurrentTypeIdContext === \"set\"\n\t\t\t\t\t\t\t\t\t\t\t\t? `[${escapedSegment}]`\n\t\t\t\t\t\t\t\t\t\t\t\t: pathSeparator + escapedSegment;\n\t\t\t\t\t\t\t\t\t\tin_context._fullPath = currentPath + in_context.getLastSegmentString();\n\n\t\t\t\t\t\t\t\t\t\t// Store the typeid and nested ChangeSet\n\t\t\t\t\t\t\t\t\t\tin_context._typeid = in_nestedTypeid;\n\t\t\t\t\t\t\t\t\t\tin_context._nestedChangeSet = in_subChangeSet;\n\t\t\t\t\t\t\t\t\t\tin_context._propertyContainerType = in_parentPropertyType;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayOperationIndex = in_arrayOperationIndex;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayLocalIndex = in_arrayLocalIndex;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayOperationOffset = in_arrayOperationOffset;\n\t\t\t\t\t\t\t\t\t\tin_context._arrayIteratorOffset = in_arrayIteratorOffset;\n\t\t\t\t\t\t\t\t\t\tif (in_arrayIteratorOffset !== undefined && isNumber(in_segment)) {\n\t\t\t\t\t\t\t\t\t\t\tif (in_context._operationType === \"remove\") {\n\t\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t\t\t\t\t\t\t\t(in_context.getLastSegment() as number) +\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_arrayIteratorOffset -\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_arrayLocalIndex;\n\t\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_segment + in_arrayIteratorOffset - in_arrayLocalIndex\n\t\t\t\t\t\t\t\t\t\t\t\t}]`;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t\t\t\t\t\t\t\t(in_context.getLastSegment() as number) + in_arrayIteratorOffset;\n\t\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_segment + in_arrayIteratorOffset\n\t\t\t\t\t\t\t\t\t\t\t\t}]`;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t\t\t\t\t\t\t\t\tin_context._fullPostPath =\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentPostPath + in_context._lastSegmentString;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Continue traversal\n\t\t\t\t\t\t\t\t\t\tin_context._stackDepth++;\n\t\t\t\t\t\t\t\t\t\tin_context._typeStack.push(in_context.getTypeid());\n\t\t\t\t\t\t\t\t\t\tin_context._parentStack.push(nextSegmentToPushInParentStack);\n\t\t\t\t\t\t\t\t\t\tin_context._containerStack.push(in_context._propertyContainerType);\n\t\t\t\t\t\t\t\t\t\tin_context._userStack.push({});\n\t\t\t\t\t\t\t\t\t\t_traverseChangeSetRecursivelyAsync(\n\t\t\t\t\t\t\t\t\t\t\tin_preCallback,\n\t\t\t\t\t\t\t\t\t\t\tin_postCallback,\n\t\t\t\t\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t\t\t\t\tn2,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t\t\t\tn2(ex);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (n2) {\n\t\t\t\t\t\t\t\t\tin_context._stackDepth--;\n\t\t\t\t\t\t\t\t\tin_context._typeStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._parentStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._containerStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._userStack.pop();\n\t\t\t\t\t\t\t\t\tin_context._userData = currentUserData;\n\t\t\t\t\t\t\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\t\t\t\t\t\t\t\t\tn2();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\tin_callback(err);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t};\n\n\t\t\t\t\tseries(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tfunction (n3) {\n\t\t\t\t\t\t\t\t// If this property is a collection, we set the correct type, otherwise we assume it is a NodeProperty\n\t\t\t\t\t\t\t\tconst propertyContainerType =\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"map\" ||\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"set\" ||\n\t\t\t\t\t\t\t\t\tsplitTypeId.context === \"array\"\n\t\t\t\t\t\t\t\t\t\t? splitTypeId.context\n\t\t\t\t\t\t\t\t\t\t: \"NodeProperty\";\n\n\t\t\t\t\t\t\t\tlet oldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\tif (splitTypeId.context === \"array\") {\n\t\t\t\t\t\t\t\t\t// Use the ArrayChangeSetIterator to process the changes in the ChangeSet in the correct order\n\t\t\t\t\t\t\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeSet);\n\t\t\t\t\t\t\t\t\tlet insertCounter = 0;\n\t\t\t\t\t\t\t\t\tlet removeCounter = 0;\n\t\t\t\t\t\t\t\t\tlet modifyCounter = 0;\n\n\t\t\t\t\t\t\t\t\twhilst(\n\t\t\t\t\t\t\t\t\t\tfunction (callback) {\n\t\t\t\t\t\t\t\t\t\t\treturn callback(null, !arrayIterator.atEnd());\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\tlet operation;\n\t\t\t\t\t\t\t\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\teachOfSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1] as any,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (item: any, i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = item.typeid;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For removals, we don't have a typeid and we use the ChangeSet\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the removal operation as nested\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ChangeSet -- TODO: doing this is maybe not really nice here\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\t\t\t\t\t\t\t\toperation = arrayIterator.opDescription.operation;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"modify\";\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1].length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i: number, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = operation[1][i].typeid;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0] + i,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[1][i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodifyCounter,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperation[0],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodifyCounter++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t\t\tarrayIterator.next();\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew Error(MSG.UNKNOWN_OPERATOR + arrayIterator.opDescription.type),\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\tn3(err);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Process insertion of dynamic property, maps and sets\n\t\t\t\t\t\t\t\t\tseries(\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.remove) {\n\t\t\t\t\t\t\t\t\t\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet paths = nestedChangeSet.remove;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (Array.isArray(paths)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For removals in irreversible CSs, we don't have a typeid and we use the ChangeSet of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// removal operation as nested ChangeSet\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for removals in reversible changesets we have an object containing the types\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.remove);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths = Object.keys(nestedChangeSet.remove[typeid]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.remove[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.insert) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Once we have reached an insert operation all subsequent operations are inserts\n\t\t\t\t\t\t\t\t\t\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Maps and NodeProperties group the insertions by type\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.insert);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet.insert[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.insert[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (nestedChangeSet.modify) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Maps and NodeProperties group modifications by type\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet.modify);\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet.modify[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet.modify[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Process nested properties\n\t\t\t\t\t\t\t\t\t\t\t\tif (splitTypeId.context === \"single\") {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeids = Object.keys(nestedChangeSet);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeids.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (i, n5) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst typeid = typeids[i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isReservedKeyword(typeid)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst paths = Object.keys(nestedChangeSet[typeid]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimesSeries(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths.length,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (j, n6) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnestedChangeSet[typeid][paths[j]],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"template\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tn5();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tn4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\tfunction (n4) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (in_postCallback) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tin_postCallback(postOrderContext, n4);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tn4();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tn3,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tnext,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t],\n\t\t\tfunction (err) {\n\t\t\t\tif (err === \"break\") {\n\t\t\t\t\tin_levelCallback();\n\t\t\t\t} else {\n\t\t\t\t\tin_levelCallback(err);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Copies a change set into an object that is meant to be a placeholder for the next\n\t * property in the tree.\n\t * @param in_objectToPopulate - Object to copy the change set into\n\t * @param in_context - change set traversal context\n\t * @param in_changeSet - Original change set to copy\n\t * @param in_isLeaf - Flag indicating that the entire sub tree should be copied over.\n\t * @returns ChangeSet that will be populated by the next iteration.\n\t * @throws if the container type is array, set or unknown (should never happen)\n\t */\n\tconst _filterChangeSetBySegment = function (\n\t\tin_objectToPopulate: any,\n\t\tin_context: TraversalContext,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_isLeaf: boolean = false,\n\t): any {\n\t\tconst nestedChangeSet = {};\n\t\tif (\n\t\t\tin_context.getPropertyContainerType() === \"NodeProperty\" ||\n\t\t\tin_context.getPropertyContainerType() === \"map\" ||\n\t\t\tin_context.getPropertyContainerType() === \"set\"\n\t\t) {\n\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\tif (Array.isArray(in_context.getNestedChangeSet())) {\n\t\t\t\t\tin_objectToPopulate.remove = in_objectToPopulate.remove || [];\n\t\t\t\t\tin_objectToPopulate.remove.push(in_context.getLastSegment());\n\t\t\t\t} else {\n\t\t\t\t\t// We are in a reversible changeset case\n\t\t\t\t\tin_objectToPopulate.remove = in_objectToPopulate.remove || {};\n\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()] =\n\t\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()] || {};\n\t\t\t\t\tin_objectToPopulate.remove[in_context.getTypeid()][in_context.getLastSegment()] =\n\t\t\t\t\t\tcloneDeep(in_context.getNestedChangeSet());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tin_objectToPopulate[in_context.getOperationType()] =\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()] || {};\n\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()] =\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()] || {};\n\n\t\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid()) || in_isLeaf) {\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()][\n\t\t\t\t\t\tin_context.getLastSegment()\n\t\t\t\t\t] = cloneDeep(in_context.getNestedChangeSet());\n\t\t\t\t} else {\n\t\t\t\t\tin_objectToPopulate[in_context.getOperationType()][in_context.getTypeid()][\n\t\t\t\t\t\tin_context.getLastSegment()\n\t\t\t\t\t] = nestedChangeSet;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (in_context.getPropertyContainerType() === \"template\") {\n\t\t\tin_objectToPopulate[in_context.getTypeid()] =\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()] || {};\n\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid()) || in_isLeaf) {\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()][in_context.getLastSegment()] = cloneDeep(\n\t\t\t\t\tin_context.getNestedChangeSet(),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tin_objectToPopulate[in_context.getTypeid()][in_context.getLastSegment()] =\n\t\t\t\t\tnestedChangeSet;\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (in_context.getPropertyContainerType()) {\n\t\t\t\tcase \"array\":\n\t\t\t\t\tthrow new Error(MSG.FILTER_PATH_WITHIN_ARRAY);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Encountered an unknown parent container type ${in_context.getPropertyContainerType()}`,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn nestedChangeSet;\n\t};\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes the callback for each visited property.\n\t *\n\t * @param in_preCallback - The (pre-order) callback function that is invoked for each property\n\t * @param in_postCallback - The (post-order) callback function that is invoked for each property\n\t * @param in_context - The traversal context for the currently processed property\n\t */\n\tconst _traverseChangeSetRecursively = function (\n\t\tin_preCallback: (context: TraversalContext) => any | undefined,\n\t\tin_postCallback: (context: TraversalContext) => any | undefined,\n\t\tin_context: TraversalContext,\n\t) {\n\t\tconst pathSeparator = in_context.getFullPath() !== \"\" ? PROPERTY_PATH_DELIMITER : \"\";\n\t\tconst currentPath = in_context.getFullPath();\n\t\tconst currentPostPath = in_context.getFullPostPath();\n\t\tconst nestedChangeSet = in_context.getNestedChangeSet();\n\n\t\t// Call the callback function for this ChangeSet\n\t\tin_context._traversalStopped = false;\n\t\tconst splitTypeId =\n\t\t\tin_context.getTypeid() !== undefined\n\t\t\t\t? TypeIdHelper.extractContext(in_context.getTypeid())\n\t\t\t\t: undefined;\n\t\tin_context._splitTypeId = splitTypeId;\n\n\t\t// TODO: this duplicates the context object putting stress on the GC.\n\t\tlet postOrderContext;\n\t\tif (in_preCallback !== undefined) {\n\t\t\tin_preCallback(in_context);\n\t\t}\n\t\tif (in_postCallback !== undefined) {\n\t\t\tpostOrderContext = in_context.clone();\n\t\t}\n\t\tconst currentUserData = in_context.getUserData();\n\n\t\tif (\n\t\t\t!in_context.isTraversing() ||\n\t\t\tin_context._operationType === \"remove\" ||\n\t\t\tTypeIdHelper.isPrimitiveType(in_context._splitTypeId.typeid) ||\n\t\t\tin_context.getSplitTypeID().isEnum\n\t\t) {\n\t\t\tif (in_postCallback !== undefined) {\n\t\t\t\tin_postCallback(postOrderContext);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst currentTypeIdContext = in_context._splitTypeId.context;\n\n\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\n\t\t// Process an individual change recursively, by preparing the traversal context and invoking\n\t\t// _traverseChangeSetRecursively\n\t\tconst processChange = function (\n\t\t\tin_segment: string | number,\n\t\t\tin_subChangeSet: SerializedChangeSet,\n\t\t\tin_nestedTypeid: string,\n\t\t\tin_escape: boolean,\n\t\t\tin_parentPropertyType: PropertyContainerType,\n\t\t\tin_arrayOperationIndex?: number,\n\t\t\tin_arrayLocalIndex?: number,\n\t\t\tin_arrayOperationOffset?: number,\n\t\t\tin_arrayIteratorOffset?: number,\n\t\t) {\n\t\t\t// Update the path\n\t\t\tin_context._lastSegment = in_segment;\n\t\t\tconst escapedSegment =\n\t\t\t\tin_escape && isString(in_segment)\n\t\t\t\t\t? PathHelper.quotePathSegmentIfNeeded(in_segment)\n\t\t\t\t\t: in_segment;\n\t\t\tlet nextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t// Note: we don't quote the path string here, since the paths in a ChangeSet are already quoted, if necessary\n\t\t\tin_context._lastSegmentString =\n\t\t\t\tcurrentTypeIdContext === \"map\" ||\n\t\t\t\tcurrentTypeIdContext === \"array\" ||\n\t\t\t\tcurrentTypeIdContext === \"set\"\n\t\t\t\t\t? `[${escapedSegment}]`\n\t\t\t\t\t: pathSeparator + escapedSegment;\n\t\t\tin_context._fullPath = currentPath + in_context._lastSegmentString;\n\n\t\t\t// Store the typeid and nested ChangeSet\n\t\t\tin_context._typeid = in_nestedTypeid;\n\t\t\tin_context._nestedChangeSet = in_subChangeSet;\n\t\t\tin_context._propertyContainerType = in_parentPropertyType;\n\t\t\tin_context._arrayOperationIndex = in_arrayOperationIndex;\n\t\t\tin_context._arrayLocalIndex = in_arrayLocalIndex;\n\t\t\tin_context._arrayOperationOffset = in_arrayOperationOffset;\n\t\t\tin_context._arrayIteratorOffset = in_arrayIteratorOffset;\n\t\t\tif (in_arrayIteratorOffset !== undefined) {\n\t\t\t\tif (in_context._operationType === \"remove\") {\n\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t(in_context._lastSegment as number) + in_arrayIteratorOffset - in_arrayLocalIndex;\n\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t(in_segment as number) + in_arrayIteratorOffset - in_arrayLocalIndex\n\t\t\t\t\t}]`;\n\t\t\t\t} else {\n\t\t\t\t\tnextSegmentToPushInParentStack =\n\t\t\t\t\t\t(in_context._lastSegment as number) + in_arrayIteratorOffset;\n\t\t\t\t\tin_context._fullPostPath = `${currentPostPath}[${\n\t\t\t\t\t\t(in_segment as number) + in_arrayIteratorOffset\n\t\t\t\t\t}]`;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnextSegmentToPushInParentStack = in_context._lastSegment;\n\t\t\t\tin_context._fullPostPath = currentPostPath + in_context._lastSegmentString;\n\t\t\t}\n\n\t\t\t// Continue traversal\n\t\t\tin_context._stackDepth++;\n\t\t\tin_context._typeStack.push(in_context.getTypeid());\n\t\t\tin_context._parentStack.push(nextSegmentToPushInParentStack);\n\t\t\tin_context._containerStack.push(in_context._propertyContainerType);\n\t\t\tin_context._userStack.push({});\n\t\t\t_traverseChangeSetRecursively(in_preCallback, in_postCallback, in_context);\n\t\t\tin_context._stackDepth--;\n\t\t\tin_context._typeStack.pop();\n\t\t\tin_context._parentStack.pop();\n\t\t\tin_context._containerStack.pop();\n\t\t\tin_context._userStack.pop();\n\n\t\t\tin_context._userData = currentUserData;\n\t\t\tin_context._parentNestedChangeSet = nestedChangeSet;\n\t\t};\n\n\t\t// If this property is a collection, we set the correct type, otherwise we assume it is a NodeProperty\n\t\tconst propertyContainerType =\n\t\t\tsplitTypeId.context === \"map\" ||\n\t\t\tsplitTypeId.context === \"set\" ||\n\t\t\tsplitTypeId.context === \"array\"\n\t\t\t\t? splitTypeId.context\n\t\t\t\t: \"NodeProperty\";\n\n\t\tlet oldOperationType = in_context._operationType;\n\t\tlet paths: string[];\n\t\tlet typeids: string[];\n\t\tlet typeid: string;\n\t\tlet i: number;\n\t\tlet j: number;\n\t\tif (splitTypeId.context === \"array\") {\n\t\t\t// Use the ArrayChangeSetIterator to process the changes in the ChangeSet in the correct order\n\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeSet);\n\t\t\tlet insertCounter = 0;\n\t\t\tlet removeCounter = 0;\n\t\t\tlet modifyCounter = 0;\n\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t\t\tfor (i = 0; i < arrayIterator.opDescription.operation[1].length; ++i) {\n\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\ttypeid = (arrayIterator.opDescription.operation[1][i] as any).typeid;\n\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1][i],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tinsertCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\t\t\t// WARNING: 'operation[1]' is 'string | number | genericArray'. The cast to 'number'\n\t\t\t\t\t\t// preserves the JavaScript coercion behavior, which was permitted prior to TS5.\n\t\t\t\t\t\tfor (i = 0; i < (arrayIterator.opDescription.operation[1] as number); ++i) {\n\t\t\t\t\t\t\t// For removals, we don't have a typeid and we use the ChangeSet of the removal operation as nested\n\t\t\t\t\t\t\t// ChangeSet -- TODO: doing this is maybe not really nice here\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tremoveCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremoveCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\tin_context._operationType = \"modify\";\n\t\t\t\t\t\tfor (i = 0; i < arrayIterator.opDescription.operation[1].length; ++i) {\n\t\t\t\t\t\t\t// The typeid is stored inline for arrays\n\t\t\t\t\t\t\ttypeid = (arrayIterator.opDescription.operation[1][i] as any).typeid;\n\t\t\t\t\t\t\tConsoleUtils.assert(typeid, MSG.NON_PRIMITIVE_ARRAY_NO_TYPEID);\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + i,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1][i],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t\tmodifyCounter,\n\t\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0],\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmodifyCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(MSG.UNKNOWN_OPERATOR + arrayIterator.opDescription.type);\n\t\t\t\t}\n\t\t\t\tarrayIterator.next();\n\t\t\t}\n\t\t\tin_context._operationType = oldOperationType;\n\t\t} else {\n\t\t\t// Bug fix: if we insert & remove/modify the same key in the same ChangeSet,\n\t\t\t// we need to process remove first, followed by insert & modify\n\t\t\tif (nestedChangeSet.remove) {\n\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\tin_context._operationType = \"remove\";\n\t\t\t\tpaths = nestedChangeSet.remove;\n\t\t\t\tif (Array.isArray(paths)) {\n\t\t\t\t\tfor (i = 0; i < paths.length; i++) {\n\t\t\t\t\t\t// For removals in irreversible CSs, we don't have a typeid and we use the ChangeSet of the\n\t\t\t\t\t\t// removal operation as nested ChangeSet\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[i],\n\t\t\t\t\t\t\tnestedChangeSet.remove,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// for removals in reversible changesets we have an object containing the types\n\t\t\t\t\ttypeids = Object.keys(nestedChangeSet.remove);\n\t\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\t\tpaths = Object.keys(nestedChangeSet.remove[typeid]);\n\t\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\t\tnestedChangeSet.remove[typeid][paths[j]],\n\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t}\n\n\t\t\t// Process insertion of dynamic property, maps and sets\n\t\t\tif (nestedChangeSet.insert) {\n\t\t\t\t// Once we have reached an insert operation all subsequent operations are inserts\n\t\t\t\toldOperationType = in_context._operationType;\n\t\t\t\tin_context._operationType = \"insert\";\n\t\t\t\t// Maps and NodeProperties group the insertions by type\n\t\t\t\ttypeids = Object.keys(nestedChangeSet.insert);\n\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet.insert[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet.insert[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tin_context._operationType = oldOperationType;\n\t\t\t}\n\n\t\t\tif (nestedChangeSet.modify) {\n\t\t\t\t// Maps and NodeProperties group modifications by type\n\t\t\t\ttypeids = Object.keys(nestedChangeSet.modify);\n\t\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\t\ttypeid = typeids[i];\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet.modify[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet.modify[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tpropertyContainerType,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Process nested properties\n\t\tif (splitTypeId.context === \"single\") {\n\t\t\ttypeids = Object.keys(nestedChangeSet);\n\t\t\tfor (i = 0; i < typeids.length; i++) {\n\t\t\t\ttypeid = typeids[i];\n\t\t\t\tif (!isReservedKeyword(typeid)) {\n\t\t\t\t\tpaths = Object.keys(nestedChangeSet[typeid]);\n\t\t\t\t\tfor (j = 0; j < paths.length; j++) {\n\t\t\t\t\t\tprocessChange(\n\t\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\t\tnestedChangeSet[typeid][paths[j]],\n\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\"template\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (in_postCallback) {\n\t\t\tin_postCallback(postOrderContext);\n\t\t}\n\t};\n\n\tinterface TraversalContextParams {\n\t\tfullPostPath?: string;\n\t\tfullPath?: string;\n\t\tpropertyContainerType?: PropertyContainerType;\n\t\toperationType?: OperationType;\n\t}\n\n\t/**\n\t * Provides traversal information when parsing ChangeSets via the traverseChangeSetRecursively function.\n\t * @internal\n\t */\n\texport class TraversalContext {\n\t\tpublic _fullPath: string;\n\t\tpublic _lastSegment: string | number;\n\t\tpublic _lastSegmentString: string;\n\t\tpublic _typeid: string | undefined;\n\t\tpublic _splitTypeId: any;\n\t\tpublic _userData: any;\n\t\tpublic _traversalStopped: boolean;\n\t\tpublic _nestedChangeSet: SerializedChangeSet;\n\t\tpublic _parentNestedChangeSet: SerializedChangeSet;\n\t\tpublic _propertyContainerType: PropertyContainerType;\n\t\tpublic _arrayLocalIndex: number | undefined;\n\t\tpublic _arrayOperationIndex: number | undefined;\n\t\tpublic _arrayOperationOffset: number | undefined;\n\t\tpublic _arrayIteratorOffset: number | undefined;\n\t\tpublic _fullPostPath: string;\n\t\tpublic _stackDepth: number;\n\t\tpublic _typeStack: string[];\n\t\tpublic _parentStack: (string | number)[];\n\t\tpublic _containerStack: string[];\n\t\tpublic _userStack: any[];\n\t\tpublic _operationType: OperationType;\n\t\tconstructor(params: TraversalContextParams = {}) {\n\t\t\tthis._fullPath = params.fullPath || \"\";\n\t\t\tthis._lastSegment = \"\";\n\t\t\tthis._lastSegmentString = \"\";\n\t\t\tthis._typeid = undefined;\n\t\t\tthis._splitTypeId = undefined;\n\t\t\tthis._userData = undefined;\n\t\t\tthis._traversalStopped = false;\n\t\t\tthis._nestedChangeSet = undefined;\n\t\t\tthis._parentNestedChangeSet = undefined;\n\t\t\tthis._propertyContainerType = params.propertyContainerType || \"root\";\n\t\t\tthis._arrayLocalIndex = undefined;\n\t\t\tthis._arrayOperationIndex = undefined;\n\t\t\tthis._arrayOperationOffset = undefined;\n\t\t\tthis._arrayIteratorOffset = undefined;\n\t\t\tthis._fullPostPath = params.fullPostPath || \"\";\n\t\t\tthis._stackDepth = 0;\n\t\t\tthis._typeStack = [];\n\t\t\tthis._parentStack = [];\n\t\t\tthis._containerStack = [];\n\t\t\tthis._userStack = [];\n\n\t\t\t// By default, operations are modify operations\n\t\t\tthis._operationType = params.operationType || \"modify\";\n\t\t}\n\t\t/**\n\t\t * @returns Whether it's traversing or not\n\t\t */\n\t\tisTraversing(): boolean {\n\t\t\treturn !this._traversalStopped;\n\t\t}\n\n\t\t/**\n\t\t * Stop the traversal for all nodes below the currently processed one\n\t\t */\n\t\tstopTraversal() {\n\t\t\tthis._traversalStopped = true;\n\t\t}\n\n\t\t/**\n\t\t * Start the traversal for all nodes below the currently processed one\n\t\t */\n\t\tstartTraversal() {\n\t\t\tthis._traversalStopped = false;\n\t\t}\n\n\t\t/**\n\t\t * Returns the operation type\n\t\t * @returns one of 'insert', 'modify' or 'remove'\n\t\t */\n\t\tgetOperationType(): OperationType {\n\t\t\treturn this._operationType;\n\t\t}\n\n\t\t/**\n\t\t * Returns the full path to the currently visited ChangeSet\n\t\t * (from the root of the ChangeSet)\n\t\t * @returns The full path\n\t\t */\n\t\tgetFullPath(): string {\n\t\t\treturn this._fullPath;\n\t\t}\n\n\t\t/**\n\t\t * Returns the last segment of the path, either a string with the key or a number with the position in the array.\n\t\t * If the path is part of a templated property with nested properties, this string can contain multiple path\n\t\t * segments, separated by dots. The segment is returned here in the form it appears in the changeSet. For a\n\t\t * templated property, it is an escaped (if necessary) path with dots. For a map/NodeProperty,\n\t\t * it is an unescaped path segment.\n\t\t *\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetLastSegment(): string | number {\n\t\t\treturn this._lastSegment;\n\t\t}\n\n\t\t/**\n\t\t * Returns the last segment of the path escaped to be compatible for use in a path.\n\t\t *\n\t\t * This returns the same segment as getLastSegment, but always performs escaping in such a way that this segment can\n\t\t * be used in a path\n\t\t *\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetLastSegmentEscaped(): string | number {\n\t\t\tif (\n\t\t\t\tthis._propertyContainerType === \"NodeProperty\" ||\n\t\t\t\tthis._propertyContainerType === \"map\" ||\n\t\t\t\tthis._propertyContainerType === \"set\" ||\n\t\t\t\tthis._propertyContainerType === \"root\"\n\t\t\t) {\n\t\t\t\treturn PathHelper.quotePathSegmentIfNeeded(this._lastSegment as string);\n\t\t\t}\n\t\t\treturn this._lastSegment;\n\t\t}\n\n\t\t/**\n\t\t * Returns true if the passed context is an empty object\n\t\t * @private\n\t\t * @param in_context - change set traversal context\n\t\t * @returns Wether the object is empty\n\t\t */\n\t\t_isEmptyObject(in_context: TraversalContext) {\n\t\t\treturn Object(in_context._nestedChangeSet) && isEmpty(in_context._nestedChangeSet);\n\t\t}\n\n\t\t/**\n\t\t * Returns true if we're at the tip of a path\n\t\t * @returns Wether the context is at a leaf\n\t\t */\n\t\t//\n\t\t// @ts-ignore currently it's not needed\n\t\tprivate isLeafNode(): boolean {\n\t\t\treturn (\n\t\t\t\tTypeIdHelper.isPrimitiveType(this._typeid) ||\n\t\t\t\tthis._isEmptyObject(this) ||\n\t\t\t\tthis.getOperationType() === \"remove\"\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Returns the index of the last segment, either a string with the key or a number with the position in the array\n\t\t * @private\n\t\t * @returns The last segment index\n\t\t */\n\t\tgetPostLastSegment(): number | string {\n\t\t\tif (\n\t\t\t\tthis._propertyContainerType === \"array\" &&\n\t\t\t\tisNumber(this._lastSegment) &&\n\t\t\t\tthis._arrayIteratorOffset !== undefined\n\t\t\t) {\n\t\t\t\treturn this._operationType === \"remove\"\n\t\t\t\t\t? this._lastSegment + this._arrayIteratorOffset - this._arrayLocalIndex\n\t\t\t\t\t: this._lastSegment + this._arrayIteratorOffset;\n\t\t\t} else {\n\t\t\t\treturn this._lastSegment;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the typeid of the currently visited Property\n\t\t * @returns typeid or undefined, if the current operation type is 'remove'\n\t\t */\n\t\tgetTypeid(): string | undefined {\n\t\t\treturn this._typeid;\n\t\t}\n\n\t\t/**\n\t\t * The ChangeSet that should be applied to the currently visited node.\n\t\t *\n\t\t * If this is a remove operation, it is the whole ChangeSet of the removal operation\n\t\t * @returns The ChangeSet\n\t\t */\n\t\tgetNestedChangeSet(): SerializedChangeSet {\n\t\t\treturn this._nestedChangeSet;\n\t\t}\n\n\t\t/**\n\t\t * Replace the current nested ChangeSet by another one\n\t\t *\n\t\t * @param in_newNestedChangeset - The new content\n\t\t */\n\t\treplaceNestedChangeSet(in_newNestedChangeset: SerializedChangeSet) {\n\t\t\tlet parent = this.getParentNestedChangeSet();\n\t\t\tif (this.getPropertyContainerType() === \"template\") {\n\t\t\t\tparent = parent[this.getTypeid()!];\n\t\t\t\tif (parent) {\n\t\t\t\t\tparent[this.getLastSegment()] = in_newNestedChangeset;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`TEMPORARY - INTERNAL: Was expected to replace a nested ChangeSet\n under \"${this.getLastSegment()}\" by \"${JSON.stringify(in_newNestedChangeset)}\",\n but could not find \"${this.getTypeid()}\" in \"${JSON.stringify(\n\t\t\t\t\t\t\t\t\t\tthis.getParentNestedChangeSet(),\n\t\t\t\t\t\t\t\t\t)}\"`);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tthis.getPropertyContainerType() === \"NodeProperty\" ||\n\t\t\t\tthis.getPropertyContainerType() === \"map\"\n\t\t\t) {\n\t\t\t\tparent[this.getOperationType()][this.getTypeid()!][this.getLastSegment()] =\n\t\t\t\t\tin_newNestedChangeset;\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"replaceNestedChangeSet: not implemented. type: \",\n\t\t\t\t\tthis.getPropertyContainerType(),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Get the ChangeSet of the parent that contains the currently visited node.\n\t\t *\n\t\t * @returns The parent ChangeSet\n\t\t */\n\t\tgetParentNestedChangeSet(): SerializedChangeSet {\n\t\t\treturn this._parentNestedChangeSet;\n\t\t}\n\n\t\t/**\n\t\t * Returns the split Typeid as returned by TypeIdHelper.TypeIdHelper.extractContext\n\t\t * @returns The split typeid\n\t\t */\n\t\tgetSplitTypeID(): ExtractedContext {\n\t\t\treturn this._splitTypeId;\n\t\t}\n\n\t\t/**\n\t\t * Sets the split typeid.\n\t\t */\n\t\tsetSplitTypeID(splitTypeid: ExtractedContext) {\n\t\t\tthis._splitTypeId = splitTypeid;\n\t\t}\n\n\t\t/**\n\t\t * Sets user data, which will be passed to the recursive calls within this scope\n\t\t *\n\t\t * @param in_userData - The user data\n\t\t */\n\t\tsetUserData(in_userData: any) {\n\t\t\tthis._userData = in_userData;\n\t\t}\n\n\t\t/**\n\t\t * Returns the user data set by the calling function\n\t\t *\n\t\t * @returns The user data\n\t\t */\n\t\tgetUserData(): any {\n\t\t\treturn this._userData;\n\t\t}\n\n\t\t/**\n\t\t * Clones the current Traversal Object\n\t\t * @returns The cloned object\n\t\t */\n\t\tclone(): TraversalContext {\n\t\t\tconst result = new TraversalContext();\n\t\t\tresult._fullPath = this._fullPath;\n\t\t\tresult._lastSegment = this._lastSegment;\n\t\t\tresult._lastSegmentString = this._lastSegmentString;\n\t\t\tresult._typeid = this._typeid;\n\t\t\tresult._splitTypeId = this._splitTypeId; // it's OK that it's not a deep copy as it's not modified partially\n\t\t\tresult._userData = this._userData;\n\t\t\tresult._traversalStopped = this._traversalStopped;\n\t\t\tresult._nestedChangeSet = this._nestedChangeSet;\n\t\t\tresult._parentNestedChangeSet = this._parentNestedChangeSet;\n\t\t\tresult._propertyContainerType = this._propertyContainerType;\n\t\t\tresult._arrayLocalIndex = this._arrayLocalIndex;\n\t\t\tresult._arrayOperationIndex = this._arrayOperationIndex;\n\t\t\tresult._arrayOperationOffset = this._arrayOperationOffset;\n\t\t\tresult._arrayIteratorOffset = this._arrayIteratorOffset;\n\t\t\tresult._fullPostPath = this._fullPostPath;\n\t\t\tresult._operationType = this._operationType;\n\t\t\tresult._stackDepth = this._stackDepth;\n\t\t\tresult._typeStack = this._typeStack.slice();\n\t\t\tresult._parentStack = this._parentStack.slice();\n\t\t\tresult._containerStack = this._containerStack.slice();\n\t\t\tresult._userStack = this._userStack.slice();\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Returns the type of the property this property is contained within.\n\t\t * It can be one of ['NodeProperty', 'map', 'array', 'set', 'template', 'root']\n\t\t *\n\t\t * @returns The type of the property container\n\t\t */\n\t\tgetPropertyContainerType(): PropertyContainerType {\n\t\t\treturn this._propertyContainerType;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the index of this operations\n\t\t *\n\t\t * @returns The index\n\t\t */\n\t\tgetArrayOperationIndex(): number | undefined {\n\t\t\treturn this._arrayOperationIndex;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the offset of this operations\n\t\t *\n\t\t * @returns The index\n\t\t */\n\t\tgetArrayOperationOffset(): number | undefined {\n\t\t\treturn this._arrayOperationOffset;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the local index of this entry within the array of entries\n\t\t * of the currently processed operation\n\t\t *\n\t\t * @returns {Number} The index\n\t\t * @private\n\t\t */\n\t\tgetArrayLocalIndex() {\n\t\t\treturn this._arrayLocalIndex;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the offset of this operation as defined by the internal\n\t\t * ArrayIteratorOffset of the currently processed operation\n\t\t * @returns The offset\n\t\t */\n\t\tgetArrayIteratorOffset(): number | undefined {\n\t\t\treturn this._arrayIteratorOffset;\n\t\t}\n\n\t\t/**\n\t\t * If this is an array operation, it returns the valid path post this operation. For example if the original\n\t\t * path is foo.bar[0] and we insert one element at position 0, then the valid post path will be foo.bar[1].\n\t\t * In the case of array remove operations, the path returned by this function is only valid during the traversal\n\t\t * itself, since the elements get deleted. Array entries are deleted element by element.\n\t\t * @returns The path\n\t\t */\n\t\tgetFullPostPath(): string {\n\t\t\treturn this._fullPostPath;\n\t\t}\n\n\t\t/**\n\t\t * Returns the depth level of the current traversal state\n\t\t * @returns The Depth\n\t\t */\n\t\tgetStackDepth(): number {\n\t\t\treturn this._stackDepth;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all types traversed to this node\n\t\t * @returns The types traversed\n\t\t */\n\t\tgetTypeStack(): string[] {\n\t\t\treturn this._typeStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all property names traversed to this node\n\t\t * @returns The names traversed\n\t\t */\n\t\tgetParentStack(): (string | number)[] {\n\t\t\treturn this._parentStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all container types traversed to this node\n\t\t * @returns The container types traversed\n\t\t */\n\t\tgetContainerStack(): string[] {\n\t\t\treturn this._containerStack;\n\t\t}\n\n\t\t/**\n\t\t * Returns stack of all validation checks traversed to this node\n\t\t * @returns The validation checks traversed\n\t\t */\n\t\tgetUserStack(): string[] {\n\t\t\treturn this._userStack;\n\t\t}\n\n\t\t/**\n\t\t * @returns Last segment string.\n\t\t */\n\t\tgetLastSegmentString(): string {\n\t\t\treturn this._lastSegmentString;\n\t\t}\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes either a pre- or a post-order callback for each visited property.\n\t *\n\t * At least one of the pre- or post-order callbacks must be specified. Both may be specified as well.\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @internal\n\t */\n\texport function traverseChangeSetRecursively(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_params?: TraversalOptions,\n\t) {\n\t\tConsoleUtils.assert(\n\t\t\tin_params.preCallback || in_params.postCallback,\n\t\t\tMSG.MISSING_PRE_POST_CALLBACK,\n\t\t);\n\t\t// Initialize the traversal context\n\t\tconst context = new Utils.TraversalContext();\n\t\tif (in_changeSet.typeid) {\n\t\t\tcontext._typeid = in_changeSet.typeid;\n\t\t} else {\n\t\t\t// if we're given an extra rootTypeId, use that\n\t\t\tcontext._typeid = in_params.rootTypeid ? in_params.rootTypeid : \"NodeProperty\";\n\t\t}\n\t\tcontext._nestedChangeSet = in_changeSet;\n\t\tcontext._parentNestedChangeSet = in_changeSet;\n\t\tcontext._splitTypeId = TypeIdHelper.extractContext(context._typeid);\n\t\tcontext._userData = in_params.userData;\n\n\t\tif (in_params.rootOperation) {\n\t\t\tcontext._operationType = in_params.rootOperation;\n\t\t}\n\n\t\t// Start the traversal\n\t\t_traverseChangeSetRecursively(in_params.preCallback, in_params.postCallback, context);\n\t}\n\n\t/**\n\t * Traverses a ChangeSet recursively and invokes either a pre- or a post-order callback for each visited property.\n\t *\n\t * At least one of the pre- or post-order callbacks must be specified. Both may be specified as well.\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_finalizer - A callback when traversal is completed\n\t * @internal\n\t */\n\texport function traverseChangeSetRecursivelyAsync(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_params?: TraversalOptions,\n\t\tin_finalizer?: (any) => any,\n\t) {\n\t\tConsoleUtils.assert(\n\t\t\tin_params.preCallback || in_params.postCallback,\n\t\t\tMSG.MISSING_PRE_POST_CALLBACK,\n\t\t);\n\t\t// Initialize the traversal context\n\t\tconst context = new Utils.TraversalContext();\n\t\tif (in_changeSet.typeid) {\n\t\t\tcontext._typeid = in_changeSet.typeid;\n\t\t} else {\n\t\t\t// if we're given an extra rootTypeId, use that\n\t\t\tcontext._typeid = in_params.rootTypeid ? in_params.rootTypeid : \"NodeProperty\";\n\t\t}\n\t\tcontext._nestedChangeSet = in_changeSet;\n\t\tcontext._parentNestedChangeSet = in_changeSet;\n\t\tcontext._splitTypeId = TypeIdHelper.extractContext(context._typeid);\n\t\tcontext._userData = in_params.userData;\n\n\t\tif (in_params.rootOperation) {\n\t\t\tcontext._operationType = in_params.rootOperation;\n\t\t}\n\n\t\t// Start the traversal\n\t\t_traverseChangeSetRecursivelyAsync(\n\t\t\tin_params.preCallback,\n\t\t\tin_params.postCallback,\n\t\t\tcontext,\n\t\t\tin_finalizer,\n\t\t);\n\t}\n\n\t/**\n\t * Extracts all typeIds from the given ChangeSet\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t *\n\t * @returns All typeids that appear in the ChangeSet\n\t * @internal\n\t */\n\texport function extractTypeids(in_changeSet: SerializedChangeSet): string[] {\n\t\tconst result = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tif (\n\t\t\t\t\tin_context.getOperationType() === \"insert\" ||\n\t\t\t\t\tin_context.getOperationType() === \"modify\"\n\t\t\t\t) {\n\t\t\t\t\tin_context.getUserData()[in_context.getTypeid()] = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\t\treturn Object.keys(result);\n\t}\n\n\t/**\n\t * Enumerates all template from a given ChangeSet\n\t *\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_callback - A callback that is used to emit every template\n\t * @param in_finalizer - A callback that is called when enumeration is completed\n\t *\n\t * @returns All templates that appear in the ChangeSet.\n\t * The returned object has members key (string), corresponding to the type and value with the definition (object)\n\t * @internal\n\t */\n\texport function enumerateSchemas(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_callback: (arg0: { key: string; value: any }, arg1: ErrorCallback<Error>) => void,\n\t\tin_finalizer: ErrorCallback<Error>,\n\t): string[] {\n\t\tconst result = [];\n\n\t\tif (in_changeSet.insertTemplates) {\n\t\t\tconst keys = Object.keys(in_changeSet.insertTemplates);\n\t\t\teachSeries(\n\t\t\t\tkeys,\n\t\t\t\tfunction (k, next) {\n\t\t\t\t\tin_callback(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: k,\n\t\t\t\t\t\t\tvalue: in_changeSet.insertTemplates[k],\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnext,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tin_finalizer,\n\t\t\t);\n\t\t} else {\n\t\t\tin_finalizer();\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Removes all typeids from a ChangeSet\n\t * This is a private functions, it is only exported for the tests.\n\t *\n\t * @param io_changeSet - The ChangeSet to process\n\t * @internal\n\t */\n\texport function _stripTypeids(io_changeSet: SerializedChangeSet) {\n\t\tconst result = {};\n\t\tUtils.traverseChangeSetRecursively(io_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\t// We do nothing for the root\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst userData = in_context.getUserData();\n\n\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\tif (!userData[in_context.getOperationType()]) {\n\t\t\t\t\t\tuserData[in_context.getOperationType()] = cloneDeep(\n\t\t\t\t\t\t\tin_context.getNestedChangeSet(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst operationScope =\n\t\t\t\t\tin_context.getPropertyContainerType() !== \"template\"\n\t\t\t\t\t\t? (userData[in_context.getOperationType()] =\n\t\t\t\t\t\t\t\tuserData[in_context.getOperationType()] ||\n\t\t\t\t\t\t\t\t(in_context.getPropertyContainerType() === \"array\" ? [] : {}))\n\t\t\t\t\t\t: userData;\n\n\t\t\t\tif (TypeIdHelper.isPrimitiveType(in_context.getTypeid())) {\n\t\t\t\t\t// This is a primitive type, we store it under its name in the result\n\t\t\t\t\toperationScope[in_context.getLastSegment()] = in_context.getNestedChangeSet();\n\t\t\t\t} else {\n\t\t\t\t\tconst nestedUserData = {};\n\t\t\t\t\tif (in_context.getPropertyContainerType() === \"array\") {\n\t\t\t\t\t\tif (!operationScope[in_context.getArrayOperationIndex()]) {\n\t\t\t\t\t\t\toperationScope[in_context.getArrayOperationIndex()] = [\n\t\t\t\t\t\t\t\tin_context.getArrayOperationOffset(),\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst arrayOperation = operationScope[in_context.getArrayOperationIndex()];\n\n\t\t\t\t\t\tarrayOperation[1][in_context.getArrayLocalIndex()] = nestedUserData;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is a collection, we have to continue recursively\n\t\t\t\t\t\toperationScope[in_context.getLastSegment()] = nestedUserData;\n\t\t\t\t\t}\n\n\t\t\t\t\tin_context.setUserData(nestedUserData);\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\n\t\t// Remove all existing keys from the ChangeSet\n\t\tObject.keys(io_changeSet).forEach(function (key) {\n\t\t\tdelete io_changeSet[key];\n\t\t});\n\n\t\t// Assign from the result user data\n\t\textend(io_changeSet, result);\n\t}\n\n\t/**\n\t * Searches through a ChangeSet and returns all Changes to a properties with a given typeid\n\t *\n\t * @param in_typeid - The typeid of the property to look for\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_excludeTypeids - Exclude all typeids from the returned ChangeSet\n\t * @returns Returns the applied operations to entries of the given typeid. The returned maps for insert and modify map paths to ChangeSets\n\t * @internal\n\t */\n\texport function getChangesByType(\n\t\tin_typeid: string,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_excludeTypeids: boolean,\n\t): { insert?: object; modify?: object } {\n\t\tconst result: SerializedChangeSet = {};\n\n\t\t// We search for the typeid by traversing the whole ChangeSet recursively\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\t// If we found and instance of the requested typeid, we store it under its path\n\t\t\t\tif (in_context.getTypeid() === in_typeid) {\n\t\t\t\t\tconst userData = in_context.getUserData();\n\t\t\t\t\tuserData[in_context.getOperationType()] =\n\t\t\t\t\t\tuserData[in_context.getOperationType()] || {};\n\t\t\t\t\tuserData[in_context.getOperationType()][in_context.getFullPath()] =\n\t\t\t\t\t\tin_context.getNestedChangeSet();\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: result,\n\t\t});\n\n\t\t// Exclude typeids if requested by the caller\n\t\tif (in_excludeTypeids) {\n\t\t\tconst insertKeys = Object.keys(result.insert);\n\t\t\tfor (let i = 0; i < insertKeys.length; i++) {\n\t\t\t\tresult.insert[insertKeys[i]] = cloneDeep(result.insert[insertKeys[i]]);\n\t\t\t\tUtils._stripTypeids(result.insert[insertKeys[i]]);\n\t\t\t}\n\n\t\t\tconst modifyKeys = Object.keys(result.modify);\n\t\t\tfor (let i = 0; i < modifyKeys.length; i++) {\n\t\t\t\tresult.modify[modifyKeys[i]] = cloneDeep(result.modify[modifyKeys[i]]);\n\t\t\t\tUtils._stripTypeids(result.modify[modifyKeys[i]]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Filter the serialized ChangeSet returning a subset of serialized ChangeSet which has been performed\n\t * on the given path. Returns an empty serialized ChangeSet if the path has not been affected.\n\t *\n\t * @param in_path - The path to process\n\t * @param in_root - The root node to which the ChangeSet has been applied\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_excludetypeids - Exclude all typeids from the returned ChangeSet\n\t * @throws if path is invalid.\n\t * @returns The changes that are applied to the given path.\n\t *\n\t * ```\n\t * <pre>\n\t * {insert: Object|undefined, modify: Object|undefined, remove: boolean|undefined}\n\t * </pre>\n\t * ```\n\t * @internal\n\t */\n\texport function getChangesByPath(\n\t\tin_path: string,\n\t\tin_root,\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_excludetypeids: boolean,\n\t): object {\n\t\t// if we're asked for the root, just return the root (in a modify)\n\t\tif (in_path === \"\") {\n\t\t\treturn { modify: in_changeSet };\n\t\t}\n\n\t\t// tokenize the path we are searching for\n\t\tconst pathSegments = PathHelper.tokenizePathString(in_path);\n\n\t\t// Recursively traverse the ChangeSet and search for the path\n\t\tconst result: SerializedChangeSet = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\t// We ignore the root\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst userData = in_context.getUserData();\n\n\t\t\t\tconst currentSegment = pathSegments[userData.currentLevel];\n\t\t\t\tconst changesetSegment = in_context.getLastSegmentEscaped().toString();\n\t\t\t\tlet level = userData.currentLevel;\n\n\t\t\t\t// We have to handle the case that a path contains nested properties. In that case we concatenate the\n\t\t\t\t// properties in the path, as long as they are a prefix of the segment we are currently looking at\n\t\t\t\tlet mergedSegment = PathHelper.quotePathSegmentIfNeeded(currentSegment);\n\t\t\t\twhile (\n\t\t\t\t\tchangesetSegment.length > mergedSegment.length &&\n\t\t\t\t\tchangesetSegment.substr(0, mergedSegment.length) === mergedSegment &&\n\t\t\t\t\tlevel < pathSegments.length - 1\n\t\t\t\t) {\n\t\t\t\t\tlevel++;\n\t\t\t\t\tmergedSegment =\n\t\t\t\t\t\tmergedSegment +\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER +\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(pathSegments[level]);\n\t\t\t\t}\n\n\t\t\t\t// Have we found the right entry in the ChangeSet?\n\t\t\t\t// TODO: This could be done more efficiently\n\t\t\t\tif (changesetSegment === mergedSegment) {\n\t\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\t\t// If this is a removal operation, we mark the path as removed, even if we haven't reached the end of the\n\t\t\t\t\t\t// path\n\t\t\t\t\t\tresult.removed = true;\n\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Did we find the last segment in the path?\n\t\t\t\t\t\tif (level === pathSegments.length - 1) {\n\t\t\t\t\t\t\t// In that case, we return the result\n\t\t\t\t\t\t\tresult[in_context.getOperationType()] = {};\n\n\t\t\t\t\t\t\tlet currentChangeSet = in_context.getNestedChangeSet();\n\t\t\t\t\t\t\tif (in_excludetypeids) {\n\t\t\t\t\t\t\t\tcurrentChangeSet = cloneDeep(currentChangeSet);\n\t\t\t\t\t\t\t\tUtils._stripTypeids(currentChangeSet);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult[in_context.getOperationType()][in_context.getFullPath()] =\n\t\t\t\t\t\t\t\tcurrentChangeSet;\n\t\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Otherwise, we continue recursively with the next level\n\t\t\t\t\t\t\tin_context.setUserData({ currentLevel: level + 1 });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop the traversal, if this is the wrong segment\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: { currentLevel: 0 },\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Invoke a callback for all nested ChangeSets that correspond to a set of user supplied tokenized paths.\n\t *\n\t * @param in_paths - A map or object which contains the tokenized paths as nested elements.\n\t * Common path segment are thus shared.\n\t *\n\t * NOTE: It is recommended to use Map as it provides better performance.\n\t * For example, for these three paths:\n\t *\n\t * - 'entry1'\n\t *\n\t * - 'nested.entry2'\n\t *\n\t * - 'nested.entry3'\n\t *\n\t * Using a map for paths would look like this:\n\t *\n\t * ```typescript\n\t * new Map([\n\t * ['entry', new Map()],\n\t * ['nested', new Map([\n\t * ['entry2', new Map()],\n\t * ['entry3', new Map()]\n\t * ])]\n\t * ])\n\t * ```\n\t *\n\t * While using objects for paths would look like this:\n\t *\n\t * ```typescript\n\t * {\n\t * entry: {},\n\t * nested: {\n\t * entry2: {}\n\t * entry3: {}\n\t * }\n\t * }\n\t * ```\n\t *\n\t * The element under the path, will be provided to the callback. If you have to pass additional data\n\t * to the callback, you can add private data by prefixing it with __ and setting\n\t * in_options.escapeLeadingDoubleUnderscore to true.\n\t * In case you do that, bear in mind that paths that refer to changeSet properties that have at least\n\t * two underscores as prefix in its id, should contain an extra underscore character as prefix:\n\t *\n\t * ```\n\t * | Path in changeSet | Path in paths |\n\t * | path0 | path0 | (unescaped)\n\t * | _path1 | _path1 | (unescaoed)\n\t * | __path2 | ___path2 | (escaped with one extra leading underscore)\n\t * | ___path3 | ____path3 | (also escaped, the same applies to N underscores where N >= 2)\n\t * ```\n\t * @param in_changeSet - The ChangeSet to process\n\t * @param in_callback - The function to invoke at the registered paths (it is called both for the interior and the\n\t * leaf nodes). The callback will be called for each node with the following parameters:\n\t *\n\t * - `context`: The current TraversalContext as returned by Utils.traverseChangeSetRecursively.\n\t * Can be used for querying the current Property type, operation, etc.\n\t *\n\t * - `currentSubPaths`: A subset of the tokenized paths passed in as input to this function that still need to be\n\t * processed from the current node\n\t *\n\t * - `currentTokenizedPath`: The tokenized path leading to the current node\n\t *\n\t * - `contractedPathSegment`: True if the current node is inside a contracted path segment (e.g.\n\t * currentTokenizedPath is ['foo'], coming from the changeset segment 'foo.bar'), false otherwise. If true, the\n\t * typeid from the context parameter may not be valid at the current node. Callbacks may ignore this if they are\n\t * not concerned with the type.\n\t *\n\t * @param in_options.rootOperation - The operation that has been applied to the root of the ChangeSet\n\t * (either 'insert' or 'modify')\n\t * @param in_options.rootTypeid - The full type of the root Property of the ChangeSet\n\t * @param in_options.escapeLeadingDoubleUnderscore - If this is set to true, keys which start with '__' will be\n\t * escaped (by adding an additional '_') before the lookup into the paths map. This frees the keyspace with\n\t * duplicated underscores for the use by the calling application.\n\t * @internal\n\t */\n\texport function getChangesToTokenizedPaths(\n\t\tin_paths: Map<string, Map<string, any>> | { [key: string]: any },\n\t\tin_changeSet: any,\n\t\tin_callback: {\n\t\t\t(\n\t\t\t\tcontext: TraversalContext,\n\t\t\t\tnestedObj: any,\n\t\t\t\ttokenizedPath: string[],\n\t\t\t\tcontractedPathSegment: boolean,\n\t\t\t): void;\n\t\t\t(arg0: TraversalContext, arg1: any, arg2: any[], arg3: boolean): void;\n\t\t},\n\t\tin_options: {\n\t\t\tescapeLeadingDoubleUnderscore?: boolean;\n\t\t\trootOperation?: OperationType;\n\t\t\trootTypeid?: string;\n\t\t} = { escapeLeadingDoubleUnderscore: false, rootOperation: \"modify\" },\n\t) {\n\t\tconst currentTokenizedPath = [];\n\n\t\tlet paths;\n\t\tlet legacyPaths;\n\n\t\tconst _isUserData = (k) => {\n\t\t\t// We only support storing user data \"as is\" if the in_options.escapeLeadingUnderscore is enabled.\n\t\t\t// We assume user data is anything that begins with exactly two underscores.\n\t\t\t// If the third character is also an underscore it is either an escaped changeSet segment or something that the\n\t\t\t// calling application escaped so we don't consider this user data.\n\t\t\t// Note that if the calling application sets the in_options.escapeLeadingDoubleUnderscore option, it is responsible\n\t\t\t// for escaping input path segments that begin with a double underscore,\n\t\t\t// otherwise such segments will be considered as user data!\n\t\t\treturn (\n\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\tk &&\n\t\t\t\tk.length > 2 &&\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with\n\t\t\t\tk[0] === \"_\" &&\n\t\t\t\tk[1] === \"_\" &&\n\t\t\t\tk[2] !== \"_\"\n\t\t\t);\n\t\t};\n\n\t\tlet _convertLevelToMap = function (obj) {\n\t\t\tconst thisLevel = new Map();\n\t\t\tObject.entries(obj).forEach(([k, v]) => {\n\t\t\t\tif (_isUserData(k)) {\n\t\t\t\t\t// We do not want to convert user provided data into maps so we store this subtree as is\n\t\t\t\t\tthisLevel.set(k, v);\n\t\t\t\t} else {\n\t\t\t\t\tthisLevel.set(k, _convertLevelToMap(v));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn thisLevel;\n\t\t};\n\n\t\tlet _convertMapToLevel = function (map) {\n\t\t\tconst thisLevel = {};\n\t\t\tfor (const [k, v] of map) {\n\t\t\t\tif (_isUserData(k)) {\n\t\t\t\t\tthisLevel[k] = v;\n\t\t\t\t} else {\n\t\t\t\t\tthisLevel[k] = v instanceof Map ? _convertMapToLevel(v) : v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn thisLevel;\n\t\t};\n\n\t\tconst _toCallbackParam = (pathLevels) => {\n\t\t\treturn legacyPaths\n\t\t\t\t? // If a user provided objects as paths, they would expect objects in their callbacks as well.\n\t\t\t\t\t// So, we transform the parameter to an object, which is not very performant but is backwards compatible.\n\t\t\t\t\t_convertMapToLevel(pathLevels)\n\t\t\t\t: pathLevels;\n\t\t};\n\n\t\tif (!(in_paths instanceof Map)) {\n\t\t\tlegacyPaths = true;\n\t\t\tpaths = _convertLevelToMap(in_paths);\n\t\t} else {\n\t\t\tlegacyPaths = false;\n\t\t\tpaths = in_paths;\n\t\t}\n\n\t\t// Recursively traverse the ChangeSet and search for the path\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(in_context) {\n\t\t\t\tconst userData = in_context.getUserData();\n\t\t\t\tconst currentSubPaths = userData.currentSubPaths;\n\n\t\t\t\t// We ignore the root\n\t\t\t\tif (in_context.getFullPath() === \"\") {\n\t\t\t\t\tin_callback(\n\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t_toCallbackParam(currentSubPaths),\n\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet changesetSegment = in_context.getLastSegmentEscaped().toString();\n\t\t\t\tlet numberOfSegments = 1;\n\t\t\t\tlet nestedSubPath;\n\t\t\t\tif (\n\t\t\t\t\tchangesetSegment.indexOf(\".\") !== -1 ||\n\t\t\t\t\t(changesetSegment.length > 0 && changesetSegment.startsWith('\"'))\n\t\t\t\t) {\n\t\t\t\t\tnestedSubPath = currentSubPaths;\n\t\t\t\t\tconst tokenized = PathHelper.tokenizePathString(changesetSegment);\n\t\t\t\t\tnumberOfSegments = tokenized.length;\n\t\t\t\t\tfor (let i = 0; i < tokenized.length; i++) {\n\t\t\t\t\t\tlet segment = tokenized[i];\n\t\t\t\t\t\tcurrentTokenizedPath.push(segment);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\t\t\t\tsegment.startsWith(\"_\") &&\n\t\t\t\t\t\t\tsegment[1] === \"_\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tsegment = `_${segment}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnestedSubPath = nestedSubPath.get(segment);\n\t\t\t\t\t\tif (nestedSubPath === undefined) {\n\t\t\t\t\t\t\tnumberOfSegments = i + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i !== tokenized.length - 1) {\n\t\t\t\t\t\t\t// Bug fix: signal the callback that we're inside a contracted path segment\n\t\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcurrentTokenizedPath.push(changesetSegment);\n\t\t\t\t\tif (\n\t\t\t\t\t\tin_options.escapeLeadingDoubleUnderscore &&\n\t\t\t\t\t\tchangesetSegment.startsWith(\"_\") &&\n\t\t\t\t\t\tchangesetSegment[1] === \"_\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tchangesetSegment = `_${changesetSegment}`;\n\t\t\t\t\t}\n\t\t\t\t\tnestedSubPath = currentSubPaths.get(changesetSegment);\n\t\t\t\t}\n\n\t\t\t\t// Have we found the right entry in the ChangeSet?\n\t\t\t\t// TODO: This could be done more efficiently\n\t\t\t\tif (nestedSubPath) {\n\t\t\t\t\t// Otherwise, we continue recursively with the next level\n\t\t\t\t\tin_context.setUserData({ currentSubPaths: nestedSubPath, numberOfSegments });\n\t\t\t\t\tif (in_context.getOperationType() === \"remove\") {\n\t\t\t\t\t\t// If this is a removal operation, we mark the path as removed, even if we haven't reached the end of the\n\t\t\t\t\t\t// path\n\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tin_callback(\n\t\t\t\t\t\t\tin_context,\n\t\t\t\t\t\t\t_toCallbackParam(nestedSubPath),\n\t\t\t\t\t\t\tcurrentTokenizedPath,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop the traversal, if this is the wrong segment\n\t\t\t\t\tin_context.setUserData({ currentSubPaths: undefined, numberOfSegments });\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t\tpostCallback(in_context) {\n\t\t\t\tfor (let i = 0; i < in_context.getUserData().numberOfSegments; i++) {\n\t\t\t\t\tcurrentTokenizedPath.pop();\n\t\t\t\t}\n\t\t\t},\n\t\t\tuserData: {\n\t\t\t\tcurrentSubPaths: paths,\n\t\t\t\tnumberOfSegments: 0,\n\t\t\t},\n\t\t\trootOperation: in_options.rootOperation,\n\t\t\trootTypeid: in_options.rootTypeid,\n\t\t});\n\t}\n\n\ttype PathsType = string[] | PathTree;\n\n\t/**\n\t * Filter change sets by paths.\n\t * Given a change set, this function will filter it based on a series of paths.\n\t * The final ChangeSet will only include the paths in question starting from the root of\n\t * the ChangeSet.\n\t *\n\t * @example\n\t *\n\t * Given the following change set:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello',\n\t * 'string2': 'world\n\t * }\n\t * }\n\t * ```\n\t *\n\t * And the path `['string1']`, the resulting ChangeSet will be:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello'\n\t * }\n\t * }\n\t * ```\n\t *\n\t * NOTE: Paths that traverse through sets and arrays are not supported.\n\t *\n\t * @param in_changeSet - The changeset to parse.\n\t * @param in_paths - List of paths to filter by. This can either be passed\n\t * as a flat array of paths or as a Map with the tokenized, tree structured paths, see the\n\t * documentation of getChangesToTokenizedPaths for an example.\n\t * Note: duplicate paths will be ignored including ones that encompasse other paths.\n\t *\n\t * @throws If a path given resolves into an array or set.\n\t * @returns The filtered ChangeSet\n\t * @internal\n\t */\n\texport function getFilteredChangeSetByPaths(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_paths: PathsType,\n\t): SerializedChangeSet {\n\t\tlet pathsToObj;\n\n\t\tif (Array.isArray(in_paths)) {\n\t\t\tpathsToObj = Utils.convertPathArrayToTree(in_paths);\n\t\t} else if (in_paths instanceof Map) {\n\t\t\tpathsToObj = in_paths;\n\t\t} else {\n\t\t\tthrow new TypeError(\"in_paths must be a list of paths or a map of the tokenized paths\");\n\t\t}\n\n\t\tconst rootChangeSet = {};\n\n\t\tconst pathToChangeSet = {};\n\n\t\tconst toPurge: SerializedChangeSet = {};\n\n\t\tconst redundantPaths = new Map();\n\t\tUtils.getChangesToTokenizedPaths(\n\t\t\tpathsToObj,\n\t\t\tin_changeSet,\n\t\t\tfunction (\n\t\t\t\tcontext: TraversalContext,\n\t\t\t\tnestedObj: { size: number },\n\t\t\t\ttokenizedPath: string[],\n\t\t\t\tcontractedPathSegment: any,\n\t\t\t) {\n\t\t\t\tif (context.getFullPath() === \"\") {\n\t\t\t\t\t// skip the root\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst parentNestedChangeSet = context.getParentNestedChangeSet();\n\t\t\t\tlet changeSetToPopulate;\n\n\t\t\t\tlet pathHasBeenFound = false;\n\t\t\t\tlet fullPath;\n\t\t\t\tif (tokenizedPath.length === 1) {\n\t\t\t\t\t// first depth\n\t\t\t\t\tchangeSetToPopulate = rootChangeSet;\n\t\t\t\t\tfullPath = PathHelper.quotePathSegmentIfNeeded(tokenizedPath[0]);\n\t\t\t\t\tconst pathEntry = pathsToObj.get(tokenizedPath[0]);\n\t\t\t\t\tif (pathEntry) {\n\t\t\t\t\t\tpathHasBeenFound = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet parentPath = \"\";\n\t\t\t\t\tfullPath = \"\";\n\t\t\t\t\tlet currentEntryInPathsToObj = pathsToObj;\n\n\t\t\t\t\tconst pathsToDelete = [];\n\t\t\t\t\ttokenizedPath.forEach((segment, index) => {\n\t\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\t\tparentPath += PathHelper.quotePathSegmentIfNeeded(segment);\n\t\t\t\t\t\t\tchangeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;\n\t\t\t\t\t\t} else if (index < tokenizedPath.length - 1) {\n\t\t\t\t\t\t\tparentPath +=\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"set\" &&\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"map\"\n\t\t\t\t\t\t\t\t\t? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`\n\t\t\t\t\t\t\t\t\t: `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;\n\t\t\t\t\t\t\tchangeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparentPath +=\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"set\" &&\n\t\t\t\t\t\t\t\tcontext.getContainerStack()[index] !== \"map\"\n\t\t\t\t\t\t\t\t\t? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`\n\t\t\t\t\t\t\t\t\t: `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;\n\t\t\t\t\t\t\tfullPath = parentPath;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpathsToDelete.push(parentPath);\n\n\t\t\t\t\t\tif (currentEntryInPathsToObj) {\n\t\t\t\t\t\t\tcurrentEntryInPathsToObj = currentEntryInPathsToObj.get(segment);\n\n\t\t\t\t\t\t\tif (currentEntryInPathsToObj) {\n\t\t\t\t\t\t\t\tif (currentEntryInPathsToObj.size === 0) {\n\t\t\t\t\t\t\t\t\t// Handle the case where we do not want to remove paths that should be included\n\t\t\t\t\t\t\t\t\t// when filtering by a parent path. The case in particular that is of interest are\n\t\t\t\t\t\t\t\t\t// paths that are folded into a single path for custom templates I.e.\n\t\t\t\t\t\t\t\t\t// E.g.\n\t\t\t\t\t\t\t\t\t// Given the following nested change set\n\t\t\t\t\t\t\t\t\t// {String: {'a.b.c.d.f' : '...'}}\n\t\t\t\t\t\t\t\t\t// we want to include it as part of the result when filtering by 'a.b.c'\n\t\t\t\t\t\t\t\t\tdelete toPurge[context.getFullPath()];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// We matched a path from the list of paths the user has passed in_context\n\t\t\t\t\t\t\t\t// In that case, we can remove all prefix paths from the list of redundant paths,\n\t\t\t\t\t\t\t\t// since we now know for sure, that they are needed in the final changeset\n\t\t\t\t\t\t\t\tpathHasBeenFound = true;\n\t\t\t\t\t\t\t\tfor (let i = 0; i < pathsToDelete.length; i++) {\n\t\t\t\t\t\t\t\t\tredundantPaths.delete(pathsToDelete[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (fullPath !== context.getFullPath() && pathToChangeSet[context.getFullPath()]) {\n\t\t\t\t\t\t// Here we are in the case where we have a changeset that\n\t\t\t\t\t\t// contains a property with path a.b.c.d as the key.\n\t\t\t\t\t\t// In that case, getChangesToTokenizedPaths will be called\n\t\t\t\t\t\t// at each level but will be ignored on every path leading up\n\t\t\t\t\t\t// to the leaf node\n\t\t\t\t\t\t// i.e. for a path \"a.b.c.d\", \"a\" \"b\" and \"c\" will be ignored.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!pathHasBeenFound) {\n\t\t\t\t\tredundantPaths.set(fullPath, {\n\t\t\t\t\t\tchangeSetToPopulate,\n\t\t\t\t\t\toperation: context.getOperationType(),\n\t\t\t\t\t\ttypeid: context.getTypeid(),\n\t\t\t\t\t\tlastSegment: context.getLastSegment(),\n\t\t\t\t\t\tcontainerType: context.getPropertyContainerType(),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Here we override the fullPath to be the full path of the context\n\t\t\t\t// For anything that is not a set or a map. This is due to the fact that\n\t\t\t\t// on the next iteration of the child of a set, we lose the context of\n\t\t\t\t// property container which means that our fullPath will actually contain\n\t\t\t\t// dots for sets. This is OK because we build the fullpath ourselves in such a\n\t\t\t\t// case and it will be consistent with the way we search for a valid changeSetToPopulate\n\t\t\t\tif (\n\t\t\t\t\tcontext.getPropertyContainerType() !== \"set\" &&\n\t\t\t\t\tcontext.getPropertyContainerType() !== \"map\"\n\t\t\t\t) {\n\t\t\t\t\tfullPath = context.getFullPath();\n\t\t\t\t}\n\n\t\t\t\t// keep a reference to the underlying change set of the current path.\n\t\t\t\t// This will speed up the process to know which object representing\n\t\t\t\t// the nested change set needs to be populated on the subsequent iterations\n\t\t\t\tpathToChangeSet[fullPath] = _filterChangeSetBySegment(\n\t\t\t\t\tchangeSetToPopulate,\n\t\t\t\t\tcontext,\n\t\t\t\t\tparentNestedChangeSet,\n\t\t\t\t\tnestedObj.size === 0,\n\t\t\t\t);\n\n\t\t\t\t// Since some hierarchies are folded into a single path, there is a case where\n\t\t\t\t// we end up with entries in the change set that we did not want. For instance,\n\t\t\t\t// if the change set contains two sibling paths \"a.b.c\" and \"a.b.d\", getChangesToTokenizedPaths\n\t\t\t\t// will invoke the callback for both paths at each level and we'll end up including both\n\t\t\t\t// paths in the filtered change set even if we didn't ask for both.\n\t\t\t\t// In that case, we keep track of change sets that we will later purge if we did not ask for them.\n\t\t\t\t//\n\t\t\t\t// NOTE: A common pitfal is to check against the presence of a \"dot\" in the segment to detect such a case\n\t\t\t\t// we instead check against the tokenized paths.\n\t\t\t\t// Otherwise, the function will behave incorrectly if a segment contains a dot\n\t\t\t\t// i.e.\n\t\t\t\tconst lastSegment = context.getLastSegmentEscaped() as string;\n\t\t\t\tif (\n\t\t\t\t\tcontractedPathSegment &&\n\t\t\t\t\t(lastSegment.indexOf(\".\") !== -1 ||\n\t\t\t\t\t\t(lastSegment.length > 0 && lastSegment.startsWith('\"'))) &&\n\t\t\t\t\tPathHelper.tokenizePathString(lastSegment).length > 1\n\t\t\t\t) {\n\t\t\t\t\ttoPurge[context.getFullPath()] = {\n\t\t\t\t\t\tchangeSet: changeSetToPopulate,\n\t\t\t\t\t\ttypeid: context.getTypeid(),\n\t\t\t\t\t\tpathToPurge: lastSegment,\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tdelete toPurge[context.getFullPath()];\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\t// Delete entries from the change set that we do not want.\n\t\t// We can enter this case when dealing with folded paths.\n\t\teach(toPurge, function (item, fullPath) {\n\t\t\tdelete item.changeSet[item.typeid][item.pathToPurge];\n\t\t\tif (isEmpty(item.changeSet[item.typeid])) {\n\t\t\t\tdelete item.changeSet[item.typeid];\n\t\t\t}\n\t\t});\n\n\t\t// Remove paths from the changeset that have been inserted during the traversal, but later\n\t\t// did not match any of the passed paths.\n\t\tfor (const key of redundantPaths.keys()) {\n\t\t\tconst removalInformation = redundantPaths.get(key);\n\t\t\tconst CS = removalInformation.changeSetToPopulate;\n\t\t\tif (removalInformation.containerType !== \"template\") {\n\t\t\t\tconst operation = removalInformation.operation;\n\t\t\t\tif (operation === \"remove\") {\n\t\t\t\t\t// Removes will recursively continue and don't need to be filtered\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tconst operationCS = CS[operation];\n\t\t\t\t\tlet typeidCS = CS[operation][removalInformation.typeid];\n\t\t\t\t\tdelete typeidCS[removalInformation.lastSegment];\n\t\t\t\t\tif (isEmpty(typeidCS)) {\n\t\t\t\t\t\tdelete operationCS[removalInformation.typeid];\n\t\t\t\t\t}\n\t\t\t\t\tif (isEmpty(CS[operation])) {\n\t\t\t\t\t\tdelete CS[operation];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet typeidCS = CS[removalInformation.typeid];\n\t\t\t\tdelete typeidCS[removalInformation.lastSegment];\n\t\t\t\tif (isEmpty(typeidCS)) {\n\t\t\t\t\tdelete CS[removalInformation.typeid];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rootChangeSet;\n\t}\n\n\t/**\n\t * Converts an array of paths to the tree structured representation that is needed\n\t * as input for the function getChangesToTokenizedPaths.\n\t *\n\t * @param in_paths - An array with paths\n\t * @returns {Map} A tree structured representation of the tokenized paths that can be\n\t * passed to getChangesToTokenizedPaths and getFilteredChangeSetByPaths.\n\t * @internal\n\t */\n\texport function convertPathArrayToTree(in_paths: string[]): PathTree {\n\t\tin_paths = Array.isArray(in_paths) ? in_paths : [in_paths];\n\t\tconst pathsToProcess = new Set(in_paths);\n\n\t\t// create an array of arrays splitting by .\n\t\tconst tokenizedPaths = in_paths.map((path) => PathHelper.tokenizePathString(path));\n\n\t\t// Create a tree representation of the paths that are passed as an input so that\n\t\t// we can leverage getChangesToTokenizedPaths and only be notified on paths\n\t\t// that we care about.\n\t\tconst pathsToObj = tokenizedPaths.reduce(function (memo, tokenizedPath) {\n\t\t\tlet obj = memo;\n\t\t\tlet path = \"\";\n\t\t\tlet segment;\n\n\t\t\tfor (let index = 0; index < tokenizedPath.length; index++) {\n\t\t\t\tsegment = tokenizedPath[index];\n\n\t\t\t\tif (index === 0) {\n\t\t\t\t\tpath = PathHelper.quotePathSegmentIfNeeded(segment);\n\t\t\t\t} else {\n\t\t\t\t\tpath += `.${PathHelper.quotePathSegmentIfNeeded(segment)}`;\n\t\t\t\t}\n\n\t\t\t\tif (pathsToProcess.has(path) && index < tokenizedPath.length - 1) {\n\t\t\t\t\treturn memo;\n\t\t\t\t}\n\n\t\t\t\tif (!obj.has(segment)) {\n\t\t\t\t\tobj.set(segment, new Map());\n\t\t\t\t}\n\n\t\t\t\tobj = obj.get(segment);\n\t\t\t}\n\n\t\t\treturn memo;\n\t\t}, new Map());\n\n\t\treturn pathsToObj;\n\t}\n\n\t/**\n\t * Exclude path from change set.\n\t * Given a change set, this function will filter it based on a series of paths.\n\t * The final ChangeSet will exclude the paths in question starting from the root of\n\t * the ChangeSet.\n\t *\n\t * @example\n\t *\n\t * Given the following change set:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string1': 'hello',\n\t * 'string2': 'world\n\t * }\n\t * }\n\t * ```\n\t *\n\t * And the path `['string1']`, the resulting ChangeSet will be:\n\t *\n\t * ```json\n\t * 'insert': {\n\t * 'String': {\n\t * 'string2': 'world'\n\t * }\n\t * }\n\t * ```\n\t *\n\t * NOTE: Paths that traverse through sets and arrays are not supported.\n\t *\n\t * @param in_changeSet - The changeset to parse\n\t * @param in_paths - List of paths to exclude. Note: duplicate paths will be ignored\n\t * including ones that encompasse other paths\n\t * @throws if a path given resolves into an array or set\n\t * @returns Filtered ChangeSet\n\t * @internal\n\t */\n\texport function excludePathsFromChangeSet(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_paths: string[],\n\t): SerializedChangeSet {\n\t\tif (!in_changeSet || !in_paths || isEmpty(in_paths)) {\n\t\t\treturn in_changeSet;\n\t\t}\n\n\t\tin_paths = Array.isArray(in_paths) ? in_paths : [in_paths];\n\t\t// create an array of arrays splitting by .\n\t\tconst tokenizedPaths = in_paths.map((path) => PathHelper.tokenizePathString(path));\n\n\t\tconst rootChangeSet = cloneDeep(in_changeSet);\n\n\t\tUtils.traverseChangeSetRecursively(rootChangeSet, {\n\t\t\tpreCallback: (in_context) => {\n\t\t\t\tconst shouldExclude = find(tokenizedPaths, (val) => {\n\t\t\t\t\treturn isEqual(val, in_context.getParentStack());\n\t\t\t\t});\n\t\t\t\tif (shouldExclude) {\n\t\t\t\t\tconst operationType = in_context.getOperationType();\n\t\t\t\t\tconst typeId = in_context.getTypeid();\n\t\t\t\t\tconst lastSegment = in_context.getLastSegment();\n\t\t\t\t\tdelete in_context.getParentNestedChangeSet()[operationType][typeId][lastSegment];\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\treturn rootChangeSet;\n\t}\n\n\t/**\n\t * Extract all paths from the ChangeSet in a flattened list and include the operations and typeid information.\n\t * @remarks NOTE: The paths returned also include the parent. i.e. the path 'nodeProp.subproperty' will result in:\n\t * ```json\n\t * {\n\t * nodeProp: {\n\t * operation: 'modify',\n\t * typeid: { typeid: 'NodeProperty', context: 'single', isEnum: false }\n\t * },\n\t * nodeProp.subProperty: {\n\t * operation: 'insert',\n\t * typeid: { typeid: 'Float32', context: 'single', isEnum: false }\n\t * }\n\t * }\n\t * ```\n\t *\n\t * @param in_changeSet - The changeset to extract paths from\n\t * @param in_options - Set of options\n\t * @param in_options.includeOperation - Flag to include the operation\n\t * @param in_options.includeTypeidInfo - Flag to include the typeid info\n\t * @returns Flat list of paths\n\t * @internal\n\t */\n\texport function extractPathsFromChangeSet(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tin_options?: { includeOperation?: boolean; includeTypeidInfo?: boolean },\n\t): { [key: string]: { operation: string; typeInfo: string } } {\n\t\tconst paths = {};\n\t\tUtils.traverseChangeSetRecursively(in_changeSet, {\n\t\t\tpreCallback(context) {\n\t\t\t\tconst fullPath = context.getFullPath();\n\t\t\t\tpaths[fullPath] = paths[fullPath] || {};\n\t\t\t\tif (in_options.includeOperation) {\n\t\t\t\t\tpaths[fullPath].operation = context.getOperationType();\n\t\t\t\t}\n\n\t\t\t\tif (in_options.includeTypeidInfo) {\n\t\t\t\t\tpaths[fullPath].typeidInfo = context.getSplitTypeID();\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\treturn paths;\n\t}\n}\n"]}
|