@fluid-experimental/property-changeset 2.0.2 → 2.1.0-276326
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/changeset.js +11 -11
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.js +7 -7
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.js +4 -4
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/rebase.js +6 -6
- package/dist/rebase.js.map +1 -1
- package/dist/templateValidator.js +2 -2
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/array.spec.js +15 -15
- package/dist/test/array.spec.js.map +1 -1
- package/dist/test/reversibleCs.spec.js +6 -3
- package/dist/test/reversibleCs.spec.js.map +1 -1
- package/dist/test/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils.js +9 -9
- package/dist/utils.js.map +1 -1
- package/lib/changeset.js +1 -1
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.js +1 -1
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.js +1 -1
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/rebase.js +1 -1
- package/lib/rebase.js.map +1 -1
- package/lib/templateValidator.js +1 -1
- package/lib/templateValidator.js.map +1 -1
- package/lib/test/array.spec.js +1 -1
- package/lib/test/array.spec.js.map +1 -1
- package/lib/test/reversibleCs.spec.js +1 -1
- package/lib/test/reversibleCs.spec.js.map +1 -1
- package/lib/test/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +3 -4
package/dist/changeset.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.ChangeSet = void 0;
|
|
|
12
12
|
* @fileoverview Serialized representation of the changes in a repository
|
|
13
13
|
*/
|
|
14
14
|
const property_common_1 = require("@fluid-experimental/property-common");
|
|
15
|
-
const
|
|
15
|
+
const cloneDeep_js_1 = __importDefault(require("lodash/cloneDeep.js"));
|
|
16
16
|
const each_js_1 = __importDefault(require("lodash/each.js"));
|
|
17
17
|
const extend_js_1 = __importDefault(require("lodash/extend.js"));
|
|
18
18
|
const isEmpty_js_1 = __importDefault(require("lodash/isEmpty.js"));
|
|
@@ -52,7 +52,7 @@ class ChangeSet {
|
|
|
52
52
|
this._changes = JSON.parse(in_changes);
|
|
53
53
|
}
|
|
54
54
|
else if (in_changes instanceof ChangeSet) {
|
|
55
|
-
this._changes = (0,
|
|
55
|
+
this._changes = (0, cloneDeep_js_1.default)(in_changes._changes);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
// Serialized Changeset
|
|
@@ -99,7 +99,7 @@ class ChangeSet {
|
|
|
99
99
|
* @returns The cloned ChangeSet
|
|
100
100
|
*/
|
|
101
101
|
clone() {
|
|
102
|
-
return new ChangeSet((0,
|
|
102
|
+
return new ChangeSet((0, cloneDeep_js_1.default)(this._changes));
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Updates this ChangeSet. The result will be the concatenation of the two ChangeSets. First the changes in this
|
|
@@ -302,7 +302,7 @@ class ChangeSet {
|
|
|
302
302
|
}
|
|
303
303
|
else {
|
|
304
304
|
// If the key doesn't exist, yet, we can just copy it
|
|
305
|
-
in_baseChanges[in_changedKey] = (0,
|
|
305
|
+
in_baseChanges[in_changedKey] = (0, cloneDeep_js_1.default)(in_appliedPropertyChanges[in_changedKey]);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
@@ -445,7 +445,7 @@ class ChangeSet {
|
|
|
445
445
|
changeSet[typeid] = changeSet[typeid] || {};
|
|
446
446
|
// Store the change. Note: We make a deep copy here, as this is a reference into our
|
|
447
447
|
// own internal ChangeSet and we want to be sure, nobody changes our internal data-structures
|
|
448
|
-
changeSet[typeid][paths[j]] = (0,
|
|
448
|
+
changeSet[typeid][paths[j]] = (0, cloneDeep_js_1.default)(in_ownPropertyChangeSet[typeid][paths[j]]);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
// Remove the typeid, when it no longer contains any keys
|
|
@@ -622,7 +622,7 @@ class ChangeSet {
|
|
|
622
622
|
let entryOffset = entry[0];
|
|
623
623
|
let oldEntries = [];
|
|
624
624
|
for (let j = 0; j < entry[1].length; j++) {
|
|
625
|
-
oldEntries.push((0,
|
|
625
|
+
oldEntries.push((0, cloneDeep_js_1.default)(oldValue[entryOffset + j]));
|
|
626
626
|
}
|
|
627
627
|
entry[2] = oldEntries;
|
|
628
628
|
}
|
|
@@ -638,7 +638,7 @@ class ChangeSet {
|
|
|
638
638
|
removeRangeLength = entry[1].length;
|
|
639
639
|
}
|
|
640
640
|
for (let j = 0; j < removeRangeLength; j++) {
|
|
641
|
-
oldEntries.push((0,
|
|
641
|
+
oldEntries.push((0, cloneDeep_js_1.default)(oldValue[entryOffset + j]));
|
|
642
642
|
}
|
|
643
643
|
entry[1] = oldEntries;
|
|
644
644
|
}
|
|
@@ -670,7 +670,7 @@ class ChangeSet {
|
|
|
670
670
|
}
|
|
671
671
|
nestedChangeset.modify[modifiedKeys[i]] = {
|
|
672
672
|
value: entry,
|
|
673
|
-
oldValue: (0,
|
|
673
|
+
oldValue: (0, cloneDeep_js_1.default)(oldValue[modifiedKeys[i]]),
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
676
|
}
|
|
@@ -681,7 +681,7 @@ class ChangeSet {
|
|
|
681
681
|
removedKeys = Object.keys(removedKeys);
|
|
682
682
|
}
|
|
683
683
|
for (let i = 0; i < removedKeys.length; i++) {
|
|
684
|
-
newRemove[removedKeys[i]] = (0,
|
|
684
|
+
newRemove[removedKeys[i]] = (0, cloneDeep_js_1.default)(oldValue[removedKeys[i]]);
|
|
685
685
|
}
|
|
686
686
|
nestedChangeset.remove = newRemove;
|
|
687
687
|
}
|
|
@@ -705,7 +705,7 @@ class ChangeSet {
|
|
|
705
705
|
if (!newRemove[oldTypeKeys[k]]) {
|
|
706
706
|
newRemove[oldTypeKeys[k]] = {};
|
|
707
707
|
}
|
|
708
|
-
newRemove[oldTypeKeys[k]][removedKeys[i]] = (0,
|
|
708
|
+
newRemove[oldTypeKeys[k]][removedKeys[i]] = (0, cloneDeep_js_1.default)(entry);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
}
|
|
@@ -1023,7 +1023,7 @@ class ChangeSet {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
if (oldInsert) {
|
|
1025
1025
|
if (replacedInsert) {
|
|
1026
|
-
nestedChangeset.remove = (0,
|
|
1026
|
+
nestedChangeset.remove = (0, cloneDeep_js_1.default)(oldInsert);
|
|
1027
1027
|
}
|
|
1028
1028
|
else {
|
|
1029
1029
|
nestedChangeset.remove = oldInsert;
|
package/dist/changeset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeset.js","sourceRoot":"","sources":["../src/changeset.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,yEAAyF;AACzF,yDAAsD;AACtD,6DAAkC;AAClC,iEAAsC;AACtC,mEAAwC;AACxC,qEAA0C;AAC1C,qEAA0C;AAE1C,aAAa;AAEb,8DAA0E;AAC1E,gGAA0F;AAC1F,gGAAgF;AAChF,2EAA2E;AAC3E,sFAAkG;AAClG,oFAA8E;AAC9E,gFAAuF;AACvF,+DAAyD;AACzD,iEAA2D;AAC3D,iEAA2D;AAC3D,yCAAmC;AAEnC,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAEnD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,8BAAY,CAAC;AAqCzD;;;;;GAKG;AACH,MAAa,SAAS;IAerB;;;OAGG;IACH,YAAY,UAA0B;QACrC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACrD,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,CAAC;aAAM,IAAI,IAAA,qBAAQ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K,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/E,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAChC,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC9B,CAAC;aAAM,CAAC;YACP,gBAAK,CAAC,4BAA4B,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACjD,WAAW,EAAE,IAAI,CAAC,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC;aAClE,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;;AA9uCF,8BA+uCC;AA9uCO,sBAAY,GAAG,wCAAY,CAAC;AAC5B,0BAAgB,GAAG,sCAAgB,CAAC;AACpC,2BAAiB,GAAG,wCAAiB,CAAC;AA8uC9C,SAAS,CAAC,SAAS,CAAC,iCAAiC;IACpD,kCAAuB,CAAC,iCAAiC,CAAC;AAC3D,SAAS,CAAC,SAAS,CAAC,gCAAgC;IACnD,kCAAuB,CAAC,gCAAgC,CAAC;AAC1D,SAAS,CAAC,SAAS,CAAC,yBAAyB;IAC5C,kCAAuB,CAAC,yBAAyB,CAAC;AAEnD,2EAA2E;AAC3E,SAAS,CAAC,SAAS,CAAC,6CAA6C;IAChE,0DAAmC,CAAC,6CAA6C,CAAC;AACnF,SAAS,CAAC,SAAS,CAAC,gCAAgC;IACnD,0DAAmC,CAAC,gCAAgC,CAAC;AACtE,SAAS,CAAC,SAAS,CAAC,4CAA4C;IAC/D,0DAAmC,CAAC,4CAA4C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Serialized representation of the changes in a repository\n */\n\nimport { constants, ConsoleUtils, joinPaths } from \"@fluid-experimental/property-common\";\nimport { copy as cloneDeep } from \"fastest-json-copy\";\nimport each from \"lodash/each.js\";\nimport extend from \"lodash/extend.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isObject from \"lodash/isObject.js\";\nimport isString from \"lodash/isString.js\";\n\n// @ts-ignore\n\nimport { ChangeSetArrayFunctions } from \"./changeset_operations/array.js\";\nimport { ArrayChangeSetIterator } from \"./changeset_operations/arrayChangesetIterator.js\";\nimport { ConflictType } from \"./changeset_operations/changesetConflictTypes.js\";\n// Add the indexed collection functions into the prototype of the ChangeSet\nimport { ChangeSetIndexedCollectionFunctions } from \"./changeset_operations/indexedCollection.js\";\nimport { isEmptyChangeSet } from \"./changeset_operations/isEmptyChangeset.js\";\nimport { ArrayIteratorOperationTypes } from \"./changeset_operations/operationTypes.js\";\nimport { TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { isReservedKeyword } from \"./isReservedKeyword.js\";\nimport { TemplateValidator } from \"./templateValidator.js\";\nimport { Utils } from \"./utils.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nconst { extractContext, isPrimitiveType } = TypeIdHelper;\n\nexport interface ApplyChangeSetOptions {\n\t/**\n\t * Additional meta information which help later to obtain more compact changeset during the apply operation.\n\t */\n\tapplyAfterMetaInformation?: Map<any, any>;\n\n\t/**\n\t * Throw error for template definition mismatches.\n\t */\n\tthrowOnTemplateMismatch?: boolean;\n}\n\nexport interface RebaseChangeSetOptions extends ApplyChangeSetOptions {\n\trebaseMetaInformation?: object;\n}\n\n/**\n * The plain serialization data structure used to encode a ChangeSet.\n * @internal\n */\nexport type SerializedChangeSet = any; // @TODO Maybe we should add full type for the ChangeSet\nexport type ChangeSetType = any;\nexport interface ConflictInfo {\n\t/**\n\t * Path to the position where the conflict occurred. If the conflicting change is of type\n\t * MISMATCH_TEMPLATES then the path will be undefined.\n\t */\n\tpath?: string | undefined;\n\t/**\n\t * Type of the conflict\n\t */\n\ttype: ConflictType;\n\tconflictingChange?: SerializedChangeSet;\n}\n\n/**\n * The ChangeSet represents an operation to be done (or that was done) on the data. It encapsulate one or\n * many addition/insertion and deletion of properties. The ChangeSetObject also provides functionality\n * to merge and swap change sets.\n * @internal\n */\nexport class ChangeSet {\n\tstatic ConflictType = ConflictType;\n\tstatic isEmptyChangeSet = isEmptyChangeSet;\n\tstatic isReservedKeyword = isReservedKeyword;\n\n\tpublic declare _cleanIndexedCollectionChangeSet: typeof ChangeSetIndexedCollectionFunctions._cleanIndexedCollectionChangeSet;\n\tpublic declare _performApplyAfterOnPropertyArray: typeof ChangeSetArrayFunctions._performApplyAfterOnPropertyArray;\n\tpublic declare _rebaseArrayChangeSetForProperty: typeof ChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;\n\tpublic declare _rebaseChangeSetForString: typeof ChangeSetArrayFunctions._rebaseChangeSetForString;\n\tpublic declare _performApplyAfterOnPropertyIndexedCollection: typeof ChangeSetIndexedCollectionFunctions._performApplyAfterOnPropertyIndexedCollection;\n\tpublic declare _rebaseIndexedCollectionChangeSetForProperty: typeof ChangeSetIndexedCollectionFunctions._rebaseIndexedCollectionChangeSetForProperty;\n\n\t_changes: SerializedChangeSet;\n\t_isNormalized: boolean;\n\n\t/**\n\t * @param [in_changes] - The serialized changes to store in this change set if a string is supplied,\n\t * we assume it to be a serialized JSON representation of the change set. If none is supplied, an empty changeset will be created.\n\t */\n\tconstructor(in_changes?: ChangeSetType) {\n\t\tif (in_changes === undefined || in_changes === null) {\n\t\t\tthis._changes = {};\n\t\t} else if (isString(in_changes)) {\n\t\t\t// Stringified Serialized JSON\n\t\t\tthis._changes = JSON.parse(in_changes);\n\t\t} else if (in_changes instanceof ChangeSet) {\n\t\t\tthis._changes = cloneDeep(in_changes._changes);\n\t\t} else {\n\t\t\t// Serialized Changeset\n\t\t\tthis._changes = in_changes;\n\t\t}\n\n\t\tthis._isNormalized = false;\n\t}\n\n\t/**\n\t * Creates a string representation of the change set\n\t * @returns JSON encoding of the changes in this change set\n\t */\n\ttoString(): string {\n\t\treturn JSON.stringify(this._changes);\n\t}\n\n\t/**\n\t * Returns the serialized changes.\n\t *\n\t * @returns The serialized changeset\n\t */\n\tgetSerializedChangeSet(): SerializedChangeSet {\n\t\treturn this._changes;\n\t}\n\n\t/**\n\t * Indicates whether this is a normalized ChangeSet. If this is set to true, squashes will not remove empty entries\n\t * from the ChangeSet.\n\t *\n\t * @param in_isNormalized - is this a normalized ChangeSet?\n\t */\n\tsetIsNormalized(in_isNormalized: boolean) {\n\t\tthis._isNormalized = in_isNormalized;\n\t}\n\n\t/**\n\t * Indicates whether this is a normalized ChangeSet. If this is set to true, squashes will not remove empty entries\n\t * from the ChangeSet.\n\t *\n\t * @returns Is this a normalized ChangeSet?\n\t */\n\tgetIsNormalized(): boolean {\n\t\treturn this._isNormalized;\n\t}\n\n\t/**\n\t * Clones the ChangeSet\n\t *\n\t * @returns The cloned ChangeSet\n\t */\n\tclone(): ChangeSet {\n\t\treturn new ChangeSet(cloneDeep(this._changes));\n\t}\n\n\t/**\n\t * Updates this ChangeSet. The result will be the concatenation of the two ChangeSets. First the changes in this\n\t * ChangeSet are executed, then the changes in the supplied in_changeSet are applied. The result will be\n\t * stored in this ChangeSet. This function assumes that the second ChangeSet is relative to the state after\n\t * application of the first ChangeSet.\n\t *\n\t * @param in_changeSet - The changeset to apply\n\t * @param in_options - Optional additional parameters\n\t */\n\tapplyChangeSet(in_changeSet: SerializedChangeSet, in_options?: ApplyChangeSetOptions) {\n\t\tlet changes = in_changeSet;\n\t\tif (in_changeSet instanceof ChangeSet) {\n\t\t\tchanges = in_changeSet.getSerializedChangeSet();\n\t\t}\n\n\t\tif (!isObject(this._changes) || Array.isArray(this._changes)) {\n\t\t\tconst oldValue =\n\t\t\t\tisObject(changes) && (changes as SerializedChangeSet).value !== undefined\n\t\t\t\t\t? (changes as SerializedChangeSet).value\n\t\t\t\t\t: changes;\n\t\t\tthis._changes = Array.isArray(oldValue) ? oldValue.slice() : oldValue;\n\t\t} else {\n\t\t\tthis._performApplyAfterOnProperty(\n\t\t\t\tthis._changes,\n\t\t\t\tchanges,\n\t\t\t\t!this._isNormalized,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Applies a changeset to a given property (recursively). The ChangeSet is assumed to be relative to the same\n\t * property root and it will be applied behind the base ChangeSet (assuming that the changes are relative to the\n\t * state after the base ChangeSet has been applied. It will change the base ChangeSet).\n\t *\n\t * @param io_basePropertyChanges - The ChangeSet describing the initial state.\n\t * @param in_appliedPropertyChanges - The ChangeSet to apply to this state.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param in_options - Optional additional parameters.\n\t */\n\tprivate _performApplyAfterOnProperty(\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_removeEmpty: boolean,\n\t\tin_options?: ApplyChangeSetOptions,\n\t) {\n\t\t// Apply dynamic property operations\n\t\tif (\n\t\t\tin_appliedPropertyChanges.insert ||\n\t\t\tin_appliedPropertyChanges.modify ||\n\t\t\tin_appliedPropertyChanges.remove\n\t\t) {\n\t\t\tthis._performApplyAfterOnPropertyIndexedCollection(\n\t\t\t\tio_basePropertyChanges,\n\t\t\t\tin_appliedPropertyChanges,\n\t\t\t\t\"NodeProperty\",\n\t\t\t\tin_options,\n\t\t\t); // TODO: recursively propagate the typeid?\n\t\t}\n\n\t\tif (!isEmpty(in_appliedPropertyChanges.insertTemplates)) {\n\t\t\tio_basePropertyChanges.insertTemplates = io_basePropertyChanges.insertTemplates || {};\n\t\t\textend(\n\t\t\t\tio_basePropertyChanges.insertTemplates,\n\t\t\t\tin_appliedPropertyChanges.insertTemplates,\n\t\t\t);\n\t\t}\n\n\t\t// Apply ChangeSet to the properties\n\t\tconst modifiedTypeids = Object.keys(in_appliedPropertyChanges);\n\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\tconst typeid = modifiedTypeids[i];\n\t\t\t// The reserved keywords have already been handled above\n\t\t\tif (ChangeSet.isReservedKeyword(typeid)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tio_basePropertyChanges[typeid] = io_basePropertyChanges[typeid] || {};\n\t\t\tconst baseChanges = io_basePropertyChanges[typeid];\n\t\t\tconst changedKeys = Object.keys(in_appliedPropertyChanges[typeid]);\n\t\t\tfor (let j = 0; j < changedKeys.length; j++) {\n\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\tchangedKeys[j],\n\t\t\t\t\tbaseChanges,\n\t\t\t\t\tin_appliedPropertyChanges[typeid],\n\t\t\t\t\ttypeid,\n\t\t\t\t\tin_removeEmpty,\n\t\t\t\t\tin_options,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Remove the type when it no longer contains any changed keys\n\t\t\tif (in_removeEmpty && isEmpty(io_basePropertyChanges[typeid])) {\n\t\t\t\tdelete io_basePropertyChanges[typeid];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper function used to apply a new value to a given ChangeSet.\n\t * It is used to handle setting a primitive value, which might either be represented\n\t * via a literal or an object with a member value.\n\t * applies in_appliedValue to the io_baseChanges at the given in_baseKey\n\t * @param io_baseChanges - base changes (modified)\n\t * @param in_baseKey - key\n\t * @param in_appliedValue - applied changes to be applied\n\t */\n\tprivate _applyValue(\n\t\tio_baseChanges: SerializedChangeSet,\n\t\tin_baseKey: string,\n\t\tin_appliedValue: SerializedChangeSet,\n\t) {\n\t\tconst newValue =\n\t\t\tin_appliedValue && in_appliedValue.hasOwnProperty(\"value\")\n\t\t\t\t? in_appliedValue.value\n\t\t\t\t: in_appliedValue;\n\t\tif (io_baseChanges[in_baseKey] && io_baseChanges[in_baseKey].hasOwnProperty(\"value\")) {\n\t\t\tio_baseChanges[in_baseKey].value = newValue;\n\t\t} else {\n\t\t\tio_baseChanges[in_baseKey] =\n\t\t\t\tio_baseChanges[in_baseKey] === undefined &&\n\t\t\t\tin_appliedValue &&\n\t\t\t\tin_appliedValue.hasOwnProperty(\"oldValue\")\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\toldValue: in_appliedValue.oldValue,\n\t\t\t\t\t\t}\n\t\t\t\t\t: newValue;\n\t\t}\n\t}\n\n\t/**\n\t * Decides based on the given Typeid which applyAfter operation to perform.\n\t * Note: This function is not directly called on the ChangeSet but on the object containing it together with a key\n\t * since it needs to be able to overwrite this entry\n\t *\n\t * @param in_changedKey - The key of the entry in the object.\n\t * @param in_baseChanges - The object containing the state before the applyAfter.\n\t * @param in_appliedPropertyChanges - The object containing the ChangeSet with the modification.\n\t * @param in_typeid - The typeid of the property to modify.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param in_options - Optional additional parameters.\n\t */\n\tpublic performApplyAfterOnPropertyWithTypeid(\n\t\tin_changedKey: string,\n\t\tin_baseChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: { [x: string]: any },\n\t\tin_typeid: string,\n\t\tin_removeEmpty: boolean,\n\t\tin_options?: ApplyChangeSetOptions,\n\t) {\n\t\tconst splitTypeid = extractContext(in_typeid);\n\n\t\tif (splitTypeid.context === \"set\" || splitTypeid.context === \"map\") {\n\t\t\tin_baseChanges[in_changedKey] = in_baseChanges[in_changedKey] || {};\n\t\t\tthis._performApplyAfterOnPropertyIndexedCollection(\n\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\tin_options,\n\t\t\t);\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(in_baseChanges[in_changedKey])) {\n\t\t\t\tdelete in_baseChanges[in_changedKey];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"array\" || splitTypeid.typeid === \"String\") {\n\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\tin_baseChanges[in_changedKey] !== undefined ? in_baseChanges[in_changedKey] : {};\n\t\t\tlet baseIsSetChange = false;\n\t\t\tlet oldValue;\n\t\t\tif (\n\t\t\t\tsplitTypeid.typeid === \"String\" &&\n\t\t\t\t(isString(in_baseChanges[in_changedKey]) ||\n\t\t\t\t\t(in_baseChanges[in_changedKey] &&\n\t\t\t\t\t\tin_baseChanges[in_changedKey].hasOwnProperty(\"value\")))\n\t\t\t) {\n\t\t\t\toldValue = in_baseChanges[in_changedKey].oldValue;\n\t\t\t\t// we need to convert the format to allow the application of the changes\n\t\t\t\t// since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\tin_baseChanges[in_changedKey] &&\n\t\t\t\t\tin_baseChanges[in_changedKey].hasOwnProperty(\"value\")\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tinsert: [[0, in_baseChanges[in_changedKey].value]],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tinsert: [[0, in_baseChanges[in_changedKey]]],\n\t\t\t\t\t\t\t};\n\t\t\t\tbaseIsSetChange = true;\n\t\t\t}\n\t\t\tlet appliedChanges = in_appliedPropertyChanges[in_changedKey];\n\t\t\tif (isObject(appliedChanges) && appliedChanges.hasOwnProperty(\"value\")) {\n\t\t\t\tappliedChanges = (appliedChanges as SerializedChangeSet).value;\n\t\t\t}\n\n\t\t\tif (splitTypeid.typeid === \"String\" && isString(appliedChanges)) {\n\t\t\t\t// we've got a 'set' command and just overwrite the changes\n\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\tbaseIsSetChange && oldValue !== undefined\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalue: appliedChanges,\n\t\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: appliedChanges;\n\t\t\t} else {\n\t\t\t\t// we have incremental changes (or a standard array)\n\t\t\t\tthis._performApplyAfterOnPropertyArray(\n\t\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\tsplitTypeid.typeid,\n\t\t\t\t\tin_options,\n\t\t\t\t);\n\t\t\t\tif (baseIsSetChange) {\n\t\t\t\t\t// we have to convert back to a string, if it had been converted before\n\t\t\t\t\tlet newValue;\n\t\t\t\t\tnewValue = isEmpty(in_baseChanges[in_changedKey])\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: in_baseChanges[in_changedKey].insert[0][1];\n\t\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\t\toldValue !== undefined\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: newValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && ChangeSet.isEmptyChangeSet(in_baseChanges[in_changedKey])) {\n\t\t\t\tdelete in_baseChanges[in_changedKey];\n\t\t\t}\n\t\t} else if (splitTypeid.isEnum) {\n\t\t\t// Enum types can simply be overwritten\n\t\t\tthis._applyValue(\n\t\t\t\tin_baseChanges,\n\t\t\t\tin_changedKey,\n\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t);\n\t\t} else if (splitTypeid.context === \"single\") {\n\t\t\tif (isPrimitiveType(splitTypeid.typeid)) {\n\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\tif (splitTypeid.typeid === \"Int64\" || splitTypeid.typeid === \"Uint64\") {\n\t\t\t\t\tlet appliedVal = in_appliedPropertyChanges[in_changedKey];\n\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyValue(in_baseChanges, in_changedKey, appliedVal.slice());\n\t\t\t\t} else {\n\t\t\t\t\tthis._applyValue(\n\t\t\t\t\t\tin_baseChanges,\n\t\t\t\t\t\tin_changedKey,\n\t\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (in_baseChanges[in_changedKey]) {\n\t\t\t\t\t// Otherwise we have to continue the merging recursively\n\t\t\t\t\tthis._performApplyAfterOnProperty(\n\t\t\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// If the key doesn't exist, yet, we can just copy it\n\t\t\t\t\tin_baseChanges[in_changedKey] = cloneDeep(in_appliedPropertyChanges[in_changedKey]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(MSG.UNKNOWN_CONTEXT + splitTypeid.context);\n\t\t}\n\t}\n\n\t/**\n\t * Rebases a given ChangeSet behind the current ChangeSet.\n\t *\n\t * This function takes a ChangeSet which is assumed to be relative to the same base state as the ChangeSet stored in\n\t * this class and transforms it in such a way that it can be applied after this ChangeSet. The function will modify\n\t * the supplied ChangeSet\n\t *\n\t * @param io_changeSet - The ChangeSet that is rebased behind the state obtained by application of this ChangeSet.\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t * @param in_options - Optional additional parameters.\n\t * @returns The rebased ChangeSet (the same object as io_changeSet, it will be\n\t * modified in place).\n\t */\n\tpublic _rebaseChangeSet(\n\t\tio_changeSet: SerializedChangeSet,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options?: RebaseChangeSetOptions,\n\t): SerializedChangeSet {\n\t\t// We actually only pass this request to the recursive internal function\n\t\treturn this._rebaseChangeSetForProperty(\n\t\t\tthis._changes,\n\t\t\tio_changeSet,\n\t\t\t\"\",\n\t\t\tout_conflicts,\n\t\t\tin_options,\n\t\t);\n\t}\n\n\t/**\n\t * Internal helper function that performs a rebase on a single property\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for the property stored in this class\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the property to be rebased\n\t * @param in_basePath - Base path to get to the property processed by this function\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n\t * @param in_options - Optional additional parameters\n\t * @returns The rebased ChangeSet for this property\n\t */\n\tprivate _rebaseChangeSetForProperty(\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t): SerializedChangeSet {\n\t\t// Process the children in this ChangeSet\n\t\tif (\n\t\t\t(in_ownPropertyChangeSet.insert ||\n\t\t\t\tin_ownPropertyChangeSet.modify ||\n\t\t\t\tin_ownPropertyChangeSet.remove) &&\n\t\t\t(io_rebasePropertyChangeSet.insert ||\n\t\t\t\tio_rebasePropertyChangeSet.modify ||\n\t\t\t\tio_rebasePropertyChangeSet.remove)\n\t\t) {\n\t\t\tthis._rebaseIndexedCollectionChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet,\n\t\t\t\tio_rebasePropertyChangeSet,\n\t\t\t\tin_basePath,\n\t\t\t\t\"NodeProperty\", // TODO: recursively propagate the typeid?\n\t\t\t\tfalse, // don't use square brackets (use dots instead)\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t}\n\t\tif (!isEmpty(io_rebasePropertyChangeSet.insertTemplates)) {\n\t\t\tconst typeids = Object.keys(io_rebasePropertyChangeSet.insertTemplates);\n\n\t\t\tconst templateMismatchChangeSet = { insertTemplates: {} };\n\n\t\t\tconst templateMismatchConflict = {\n\t\t\t\ttype: ChangeSet.ConflictType.MISMATCH_TEMPLATES,\n\t\t\t\tconflictingChange: templateMismatchChangeSet,\n\t\t\t};\n\n\t\t\teach(typeids, function (typeid) {\n\t\t\t\tconst template = io_rebasePropertyChangeSet.insertTemplates[typeid];\n\t\t\t\tif (\n\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates &&\n\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[typeid]\n\t\t\t\t) {\n\t\t\t\t\tconst isEqual = TemplateValidator.Utils.psetDeepEquals(\n\t\t\t\t\t\ttemplate,\n\t\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[template.typeid],\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!isEqual) {\n\t\t\t\t\t\tif (in_options && in_options.throwOnTemplateMismatch) {\n\t\t\t\t\t\t\tthrow new Error(MSG.TEMPLATE_MISMATCH + typeid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttemplateMismatchChangeSet.insertTemplates[typeid] =\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[template.typeid];\n\t\t\t\t\t\t// TODO: Remove this warning message once we offer a conflict resolution API\n\t\t\t\t\t\tconsole.warn(MSG.TEMPLATE_MISMATCH + typeid);\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete io_rebasePropertyChangeSet.insertTemplates[typeid];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Remove insertTemplates key if it is empty\n\t\t\tif (isEmpty(io_rebasePropertyChangeSet.insertTemplates)) {\n\t\t\t\tdelete io_rebasePropertyChangeSet.insertTemplates;\n\t\t\t}\n\n\t\t\tif (!isEmpty(templateMismatchConflict.conflictingChange.insertTemplates)) {\n\t\t\t\tout_conflicts.push(templateMismatchConflict);\n\t\t\t}\n\t\t}\n\n\t\t// Check for collisions in the property assignments\n\t\tconst changedTypeids = Object.keys(in_ownPropertyChangeSet);\n\n\t\t// We currently do not yet have any\n\t\tconst changeSet = {};\n\t\tfor (let i = 0; i < changedTypeids.length; i++) {\n\t\t\tconst typeid = changedTypeids[i];\n\t\t\tconst paths = Object.keys(in_ownPropertyChangeSet[typeid]);\n\n\t\t\t// Update the oldValue of primitive property of a changeset\n\t\t\t// for simple changeset with 'modify', property type, name, value\n\t\t\t// find the oldValue of the property and update it\n\t\t\tif (typeid === \"modify\" && \"modify\" in io_rebasePropertyChangeSet) {\n\t\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\t\tconst tempTypeid = paths[i];\n\t\t\t\t\tif (isPrimitiveType(tempTypeid) && tempTypeid in io_rebasePropertyChangeSet.modify) {\n\t\t\t\t\t\tconst tempPaths = Object.keys(in_ownPropertyChangeSet.modify[tempTypeid]);\n\t\t\t\t\t\tfor (let z = 0; z < tempPaths.length; z++) {\n\t\t\t\t\t\t\tif (tempPaths[z] in io_rebasePropertyChangeSet.modify[tempTypeid]) {\n\t\t\t\t\t\t\t\tlet rebasedPropContent =\n\t\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[tempTypeid][tempPaths[z]];\n\t\t\t\t\t\t\t\tif (isObject(rebasedPropContent) && \"oldValue\" in rebasedPropContent) {\n\t\t\t\t\t\t\t\t\t(rebasedPropContent as SerializedChangeSet).oldValue =\n\t\t\t\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[tempTypeid][tempPaths[z]].value;\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\t\t\t\t}\n\t\t\t} else if (isPrimitiveType(typeid)) {\n\t\t\t\t// for complex changeset, the function will be called recursively, when the function is at the level where\n\t\t\t\t// io_rebasePropertyChangeSet && in_ownPropertyChangeSet contain only property type, name and value, we update\n\t\t\t\t// oldValue of io_rebasePropertyChangeSet.\n\t\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeid in io_rebasePropertyChangeSet &&\n\t\t\t\t\t\tpaths[j] in io_rebasePropertyChangeSet[typeid]\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet rebasedPropContent = io_rebasePropertyChangeSet[typeid][paths[j]];\n\t\t\t\t\t\tif (isObject(rebasedPropContent) && \"oldValue\" in rebasedPropContent) {\n\t\t\t\t\t\t\t// if oldValue already be update above, we don't need to update\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid][paths[j]].oldValue !==\n\t\t\t\t\t\t\t\tin_ownPropertyChangeSet[typeid][paths[j]].value\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid][paths[j]].oldValue =\n\t\t\t\t\t\t\t\t\tin_ownPropertyChangeSet[typeid][paths[j]].value;\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}\n\n\t\t\t// The reserved keywords have already been handled above and changes which are not present in\n\t\t\t// the other ChangeSet can be ignored\n\t\t\tif (ChangeSet.isReservedKeyword(typeid) || !io_rebasePropertyChangeSet[typeid]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check, whether we have a collision in a path update\n\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\tif (io_rebasePropertyChangeSet[typeid][paths[j]] !== undefined) {\n\t\t\t\t\tin_ownPropertyChangeSet[typeid] = in_ownPropertyChangeSet[typeid] || {};\n\n\t\t\t\t\tconst newPath = joinPaths(in_basePath, paths[j], PROPERTY_PATH_DELIMITER);\n\t\t\t\t\t// Perform the rebase operation on the ChangeSet for this entry\n\t\t\t\t\tconst setConflict = this.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\tin_ownPropertyChangeSet[typeid],\n\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid],\n\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\n\t\t\t\t\t// If there has been a non-recursive set collision we handle it here separately\n\t\t\t\t\tif (setConflict) {\n\t\t\t\t\t\t// If we have two writes to primitive types, this is a conflict\n\t\t\t\t\t\tchangeSet[typeid] = changeSet[typeid] || {};\n\n\t\t\t\t\t\t// Store the change. Note: We make a deep copy here, as this is a reference into our\n\t\t\t\t\t\t// own internal ChangeSet and we want to be sure, nobody changes our internal data-structures\n\t\t\t\t\t\tchangeSet[typeid][paths[j]] = cloneDeep(in_ownPropertyChangeSet[typeid][paths[j]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove the typeid, when it no longer contains any keys\n\t\t\t\tif (isEmpty(io_rebasePropertyChangeSet[typeid][paths[j]])) {\n\t\t\t\t\tdelete io_rebasePropertyChangeSet[typeid][paths[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove the typeid, when it no longer contains any keys\n\t\t\tif (isEmpty(io_rebasePropertyChangeSet[typeid])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[typeid];\n\t\t\t}\n\t\t}\n\n\t\t// If there were conflicts in the set operations, report them\n\t\tif (!isEmpty(changeSet)) {\n\t\t\tconst conflict = {\n\t\t\t\tpath: in_basePath,\n\t\t\t\ttype: ChangeSet.ConflictType.COLLIDING_SET,\n\t\t\t\tconflictingChange: changeSet,\n\t\t\t};\n\t\t\tout_conflicts.push(conflict);\n\t\t}\n\n\t\treturn io_rebasePropertyChangeSet;\n\t}\n\n\t/**\n\t * Decides based on the given Typeid which rebase operation to perform.\n\t *\n\t * @remarks Note: This function is not directly called on the ChangeSet but on the object containing it together\n\t * with a key since it needs to be able to overwrite this entry\n\t *\n\t * @param in_key - The key of the entry in the object\n\t * @param in_ownPropertyChangeSet - The object containing the ChangeSet for the property stored in this class.\n\t * @param io_rebasePropertyChangeSet - The object containing the ChangeSet for the property to be rebased.\n\t * @param in_typeid - The typeid of the property to rebase.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t *\n\t * @returns Has there been a simple set collision? Those have to be handled separately\n\t *\n\t * @privateRemarks TODO: We should unify the handling of set collisions\n\t * @private\n\t */\n\tprivate rebaseChangeSetForPropertyEntryWithTypeid(\n\t\tin_key: string,\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_basePath: string,\n\t\tin_removeEmpty: boolean,\n\t\tout_conflicts: any,\n\t\tin_options: ApplyChangeSetOptions,\n\t): boolean {\n\t\tconst splitTypeid = extractContext(in_typeid);\n\n\t\tif (splitTypeid.context === \"set\" || splitTypeid.context === \"map\") {\n\t\t\tthis._rebaseIndexedCollectionChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\tin_basePath,\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\ttrue, // use square brackets\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"array\") {\n\t\t\tthis._rebaseArrayChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\tin_basePath,\n\t\t\t\tout_conflicts,\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.typeid === \"String\") {\n\t\t\tthis._rebaseChangeSetForString(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet,\n\t\t\t\tin_key,\n\t\t\t\tin_basePath,\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"single\") {\n\t\t\t// We only can have a conflict when the path exists in both ChangeSets\n\t\t\tif (in_ownPropertyChangeSet[in_key] !== undefined) {\n\t\t\t\tif (isPrimitiveType(splitTypeid.typeid) || splitTypeid.isEnum) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, we have to continue recursively\n\n\t\t\t\t\t// Make sure the paths exist\n\t\t\t\t\tin_ownPropertyChangeSet[in_key] = in_ownPropertyChangeSet[in_key] || {};\n\n\t\t\t\t\t// And then perform the recursive rebase\n\t\t\t\t\tthis._rebaseChangeSetForProperty(\n\t\t\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(MSG.UNKNOWN_CONTEXT + splitTypeid.context);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Recursive helper function for ChangeSet.prototype._toReversibleChangeSet\n\t * which converts a irreversible changeset to a reversible changeset\n\t * or updates the former state of a reversible changeset\n\t * @param in_context - The traversal context.\n\t */\n\tprivate _recursivelyBuildReversibleChangeSet(in_context: Utils.TraversalContext) {\n\t\tconst opType = in_context.getOperationType();\n\t\tif (opType === \"modify\") {\n\t\t\tconst type = in_context.getTypeid();\n\t\t\tconst splitType = in_context.getSplitTypeID();\n\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\n\t\t\tlet current = in_context.getUserData().parallelState;\n\t\t\tif (in_context.getPropertyContainerType() === \"root\") {\n\t\t\t\tcurrent = in_context.getUserData().oldState;\n\t\t\t} else if (current) {\n\t\t\t\tif (in_context.getPropertyContainerType() !== \"template\") {\n\t\t\t\t\tcurrent = current.insert;\n\t\t\t\t}\n\n\t\t\t\tif (in_context.getPropertyContainerType() !== \"array\") {\n\t\t\t\t\tcurrent = current && current[in_context.getTypeid()];\n\t\t\t\t\tcurrent = current && current[in_context.getLastSegment()];\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = current && current[0][1][in_context.getLastSegment()];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tin_context.setUserData({\n\t\t\t\tparallelState: current,\n\t\t\t\toldState: in_context.getUserData().oldState,\n\t\t\t});\n\n\t\t\tif (isPrimitiveType(type)) {\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tMSG.INVALID_PATH + in_context.getFullPath()\n\t\t\t\t\t\t}. Making primitive value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current;\n\n\t\t\t\t// store it in reversibleChangeSet\n\t\t\t\tif (type === \"String\" && !isString(nestedChangeset)) {\n\t\t\t\t\t// String is a special case\n\t\t\t\t\tlet oldString;\n\t\t\t\t\tif (isString(oldValue)) {\n\t\t\t\t\t\toldString = oldValue;\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\t\tconst entryLength = entry[1].length;\n\t\t\t\t\t\t\tentry[2] = oldString.slice(entryOffset, entryOffset + entryLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\n\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\tif (isString(removeRangeLength)) {\n\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[1] = oldString.slice(entryOffset, entryOffset + removeRangeLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tnestedChangeset.oldValue = oldValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst newChangeSet = {\n\t\t\t\t\t\t\tvalue: nestedChangeset,\n\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tin_context.replaceNestedChangeSet(newChangeSet);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (splitType.context === \"array\") {\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${MSG.INVALID_PATH + in_context.getFullPath()}. Making array value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current.insert ? current.insert[0][1] : [];\n\n\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\t\tlet oldEntries = [];\n\t\t\t\t\t\t\tfor (let j = 0; j < entry[1].length; j++) {\n\t\t\t\t\t\t\t\toldEntries.push(cloneDeep(oldValue[entryOffset + j]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[2] = oldEntries;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\tlet oldEntries = [];\n\n\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\tif (Array.isArray(removeRangeLength)) {\n\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let j = 0; j < removeRangeLength; j++) {\n\t\t\t\t\t\t\toldEntries.push(cloneDeep(oldValue[entryOffset + j]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tentry[1] = oldEntries;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tsplitType.context === \"map\" ||\n\t\t\t\t// node property test: (we have to do the test this way, because of inheritance)\n\t\t\t\tnestedChangeset.insert ||\n\t\t\t\tnestedChangeset.modify ||\n\t\t\t\tnestedChangeset.remove\n\t\t\t) {\n\t\t\t\t// This prevents an error, if the changeset only contains an insert operation. In that case\n\t\t\t\t// we don't actually need the corresponding old state and thus do not need to throw an error\n\t\t\t\t// This type of situation can occur in the materialized history, if an insert happens right at a chunk boundary.\n\t\t\t\tif (Object.keys(nestedChangeset).length === 1 && nestedChangeset.insert) {\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${MSG.INVALID_PATH + in_context.getFullPath()}. Making map value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current.insert;\n\n\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\tif (typeof entry === \"object\" && entry.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tentry = entry.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnestedChangeset.modify[modifiedKeys[i]] = {\n\t\t\t\t\t\t\t\tvalue: entry,\n\t\t\t\t\t\t\t\toldValue: cloneDeep(oldValue[modifiedKeys[i]]),\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\tlet newRemove = {};\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\tif (!Array.isArray(removedKeys)) {\n\t\t\t\t\t\t\tremovedKeys = Object.keys(removedKeys);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tnewRemove[removedKeys[i]] = cloneDeep(oldValue[removedKeys[i]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnestedChangeset.remove = newRemove;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t// this case is handeled recursively\n\t\t\t\t\t}\n\t\t\t\t\tlet newRemove = {};\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tif (Array.isArray(nestedChangeset.remove)) {\n\t\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\tlet searchedKey = removedKeys[i];\n\t\t\t\t\t\t\t\t// search for this key in the old keys:\n\t\t\t\t\t\t\t\tconst oldTypeKeys = Object.keys(oldValue);\n\t\t\t\t\t\t\t\tfor (let k = 0; k < oldTypeKeys.length; k++) {\n\t\t\t\t\t\t\t\t\tif (oldValue[oldTypeKeys[k]].hasOwnProperty(searchedKey)) {\n\t\t\t\t\t\t\t\t\t\tlet entry = oldValue[oldTypeKeys[k]][searchedKey];\n\t\t\t\t\t\t\t\t\t\tif (!newRemove[oldTypeKeys[k]]) {\n\t\t\t\t\t\t\t\t\t\t\tnewRemove[oldTypeKeys[k]] = {};\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tnewRemove[oldTypeKeys[k]][removedKeys[i]] = cloneDeep(entry);\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\tnestedChangeset.remove = newRemove;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we already have a reversibleChangeSet and need to update the oldValues\n\t\t\t\t\t\t\tconst removedTypes = Object.keys(nestedChangeset.remove);\n\t\t\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\t\t\tlet removedKeys = Object.keys(nestedChangeset.remove[removedTypes[t]]);\n\t\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\t\tlet searchedKey = removedKeys[i];\n\t\t\t\t\t\t\t\t\tlet entry = oldValue[removedTypes[t]][searchedKey];\n\t\t\t\t\t\t\t\t\tnestedChangeset.remove[removedTypes[t]][removedKeys[i]] = entry;\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\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Converts an irreversible changeset to a reversible changeset\n\t * or updates the former state of a reversible changeset\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release.\n\t * @param in_oldSerializedState - The old state.\n\t */\n\tpublic _toReversibleChangeSet(in_oldSerializedState: SerializedChangeSet) {\n\t\tConsoleUtils.assert(\n\t\t\tin_oldSerializedState !== undefined,\n\t\t\t`${MSG.ASSERTION_FAILED}Missing function parameter \"in_oldSerializedState\" of \"_toReversibleChangeSet\".`,\n\t\t);\n\n\t\tif (!isObject(in_oldSerializedState) || Array.isArray(in_oldSerializedState)) {\n\t\t\tif (!isObject(this._changes) || Array.isArray(this._changes)) {\n\t\t\t\tthis._changes = {\n\t\t\t\t\toldValue: Array.isArray(in_oldSerializedState)\n\t\t\t\t\t\t? in_oldSerializedState.slice()\n\t\t\t\t\t\t: in_oldSerializedState,\n\t\t\t\t\tvalue: this._changes,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t(this._changes as SerializedChangeSet).oldValue = Array.isArray(in_oldSerializedState)\n\t\t\t\t\t? in_oldSerializedState.slice()\n\t\t\t\t\t: in_oldSerializedState;\n\t\t\t}\n\t\t} else {\n\t\t\tconst workspace = { oldState: in_oldSerializedState };\n\t\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\t\tpreCallback: this._recursivelyBuildReversibleChangeSet,\n\t\t\t\tuserData: workspace,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Converts a reversible changeset to an irreversible changeset\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release.\n\t * @param in_withoutRoot - Bypass a fix where the root of a changeset is cleaned\n\t */\n\tpublic _stripReversibleChangeSet(in_withoutRoot: boolean) {\n\t\tconst callback = function (in_context) {\n\t\t\tconst opType = in_context.getOperationType();\n\t\t\tif (opType === \"remove\" || opType === \"modify\") {\n\t\t\t\tconst type = in_context.getTypeid();\n\t\t\t\tif (!type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst splitType = in_context.getSplitTypeID();\n\n\t\t\t\tif (isPrimitiveType(type)) {\n\t\t\t\t\t// remove old state\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (type === \"String\" && !isString(nestedChangeset)) {\n\t\t\t\t\t\t// String is a special case\n\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\t\tentry.splice(2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\n\t\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\t\tif (isString(removeRangeLength)) {\n\t\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tentry[1] = removeRangeLength;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tin_context.replaceNestedChangeSet(nestedChangeset.value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tin_context.replaceNestedChangeSet(nestedChangeset.value);\n\t\t\t\t\t}\n\t\t\t\t} else if (splitType.context === \"array\") {\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tentry.splice(2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\tif (Array.isArray(removeRangeLength)) {\n\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[1] = removeRangeLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// TODO: Remove in_withoutRoot when it will not be used anymore\n\t\t\t\t} else if (\n\t\t\t\t\tsplitType.context === \"map\" ||\n\t\t\t\t\t(!in_withoutRoot && splitType.context === \"single\")\n\t\t\t\t) {\n\t\t\t\t\t// For NodeProperty / inserts at the root\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\t\tif (typeof entry === \"object\" && entry.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tentry = entry.value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnestedChangeset.modify[modifiedKeys[i]] = entry;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\t\tif (!Array.isArray(removedKeys)) {\n\t\t\t\t\t\t\t\tremovedKeys = Object.keys(removedKeys);\n\t\t\t\t\t\t\t\tnestedChangeset.remove = removedKeys;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\t// this case is handeled recursively\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tif (!Array.isArray(nestedChangeset.remove)) {\n\t\t\t\t\t\t\t\t// we have a reversibleChangeSet and need to convert\n\t\t\t\t\t\t\t\tlet newRemove = [];\n\t\t\t\t\t\t\t\tconst removedTypes = Object.keys(nestedChangeset.remove);\n\t\t\t\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\t\t\t\tlet removedKeys = Object.keys(nestedChangeset.remove[removedTypes[t]]);\n\t\t\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\t\t\tnewRemove.push(removedKeys[i]);\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\tnestedChangeset.remove = newRemove;\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}\n\t\t};\n\n\t\tif (\n\t\t\tisObject(this._changes) &&\n\t\t\t(this._changes as SerializedChangeSet).oldValue !== undefined &&\n\t\t\t(this._changes as SerializedChangeSet).value !== undefined\n\t\t) {\n\t\t\tthis._changes = (this._changes as SerializedChangeSet).value;\n\t\t\treturn;\n\t\t}\n\n\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\tpreCallback: callback,\n\t\t});\n\t}\n\n\t/**\n\t * Helper function to extract the first level paths from a given change set\n\t * @param in_changeSet - The ChangeSet to extract paths from.\n\t * @param isPrimitiveCollection - Is this a primitive type collection?\n\t *\n\t * @returns List of paths found at the first level of the change set\n\t */\n\tprivate _extractFirstLevelPaths(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tisPrimitiveCollection: boolean,\n\t): string[] {\n\t\tlet paths;\n\t\tif (isPrimitiveCollection) {\n\t\t\tpaths = Object.keys(in_changeSet);\n\t\t} else {\n\t\t\tpaths = [];\n\t\t\teach(in_changeSet, function (nestedChangeSet) {\n\t\t\t\teach(nestedChangeSet, function (nestedChangeSet2, path) {\n\t\t\t\t\tpaths.push(path);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn paths;\n\t}\n\n\t/**\n\t * recursive helper function for ChangeSet.prototype._toInverseChangeSet\n\t * @param in_context - The traversal context.\n\t */\n\tprivate _recursivelyInvertReversibleChangeset(in_context: Utils.TraversalContext) {\n\t\tin_context.setUserData(in_context.getUserData() || {});\n\n\t\t// Figure out if we have already visited this path by verifying that the full path\n\t\t// is contained within the list of processed deleted or inserted paths\n\t\tconst isWithinInsertOrDelete = in_context.getUserData()[in_context.getFullPath()];\n\n\t\tif (isWithinInsertOrDelete && in_context.getOperationType() !== \"modify\") {\n\t\t\t// We are within an insert or remove sub tree. Skip this iteration.\n\t\t\tin_context._traversalStopped = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tin_context.getOperationType() === \"remove\" ||\n\t\t\tin_context.getOperationType() === \"modify\"\n\t\t) {\n\t\t\tconst type = in_context.getTypeid();\n\t\t\tconst splitType = in_context.getSplitTypeID();\n\n\t\t\tif (!splitType) {\n\t\t\t\tConsoleUtils.assert(\n\t\t\t\t\tfalse,\n\t\t\t\t\t`${MSG.ASSERTION_FAILED}Missing \"splitType\" in \"in_context\":${JSON.stringify(\n\t\t\t\t\t\tin_context,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst nestedChangeset = in_context.getNestedChangeSet();\n\n\t\t\tif (\n\t\t\t\t(isPrimitiveType(type) && type !== \"String\") ||\n\t\t\t\t(type === \"String\" && isString(nestedChangeset.oldValue))\n\t\t\t) {\n\t\t\t\t// check if we were called with an irreversible changeset\n\t\t\t\tif (\n\t\t\t\t\tin_context.getOperationType() === \"modify\" &&\n\t\t\t\t\t(!isObject(nestedChangeset) ||\n\t\t\t\t\t\ttypeof (nestedChangeset as SerializedChangeSet).oldValue === \"undefined\")\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(MSG.OLD_VALUE_NOT_FOUND);\n\t\t\t\t}\n\n\t\t\t\t// switch oldValue and value\n\t\t\t\tlet tmp = nestedChangeset.oldValue;\n\t\t\t\tnestedChangeset.oldValue = nestedChangeset.value;\n\t\t\t\tnestedChangeset.value = tmp;\n\t\t\t} else if (\n\t\t\t\t(type === \"String\" && !isString(nestedChangeset.oldValue)) ||\n\t\t\t\tsplitType.context === \"array\"\n\t\t\t) {\n\t\t\t\t// String and Arrays need special treatment:\n\t\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeset);\n\t\t\t\tconst resultChangeset: SerializedChangeSet = {};\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tresultChangeset.modify = [];\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.insert) {\n\t\t\t\t\tresultChangeset.remove = [];\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tresultChangeset.insert = [];\n\t\t\t\t}\n\t\t\t\t// Successively invert the changes from the changeSet\n\t\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\t\t// Handle inserts\n\t\t\t\t\t\t\tresultChangeset.remove.push([\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\t\t// Handle removes\n\t\t\t\t\t\t\tresultChangeset.insert.push([\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\t\t// Handle modifies\n\t\t\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\t\t\tresultChangeset.modify.push([\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[2],\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresultChangeset.modify.push([\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`applyChangeset: ${MSG.UNKNOWN_OPERATION}${arrayIterator.opDescription.type}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tarrayIterator.next();\n\t\t\t\t}\n\t\t\t\tin_context.replaceNestedChangeSet(resultChangeset);\n\t\t\t} else {\n\t\t\t\t// Covers NodeProperty, Map and Set\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid) && splitType.context === \"map\") {\n\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\tconst entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\tlet tmp = entry.value;\n\t\t\t\t\t\t\tentry.value = entry.oldValue;\n\t\t\t\t\t\t\tentry.oldValue = tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst oldInsert = nestedChangeset.insert;\n\t\t\t\tlet replacedInsert = false;\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tnestedChangeset.insert = nestedChangeset.remove;\n\t\t\t\t\treplacedInsert = true;\n\t\t\t\t\tnestedChangeset.remove = undefined;\n\t\t\t\t\tdelete nestedChangeset.remove;\n\t\t\t\t\tconst isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);\n\t\t\t\t\teach(\n\t\t\t\t\t\tthis._extractFirstLevelPaths(nestedChangeset.insert, isPrimitiveTypeid),\n\t\t\t\t\t\tfunction (path) {\n\t\t\t\t\t\t\tconst fullPath = joinPaths(\n\t\t\t\t\t\t\t\tin_context.getFullPath(),\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tin_context.getUserData()[fullPath] = true;\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (oldInsert) {\n\t\t\t\t\tif (replacedInsert) {\n\t\t\t\t\t\tnestedChangeset.remove = cloneDeep(oldInsert);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnestedChangeset.remove = oldInsert;\n\t\t\t\t\t\tnestedChangeset.insert = undefined;\n\t\t\t\t\t\tdelete nestedChangeset.insert;\n\t\t\t\t\t}\n\t\t\t\t\tconst isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);\n\t\t\t\t\teach(\n\t\t\t\t\t\tthis._extractFirstLevelPaths(nestedChangeset.remove, isPrimitiveTypeid),\n\t\t\t\t\t\tfunction (path) {\n\t\t\t\t\t\t\tconst fullPath = joinPaths(\n\t\t\t\t\t\t\t\tin_context.getFullPath(),\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tin_context.getUserData()[fullPath] = true;\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}\n\n\t/**\n\t * Inverts a reversible ChangeSets\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release\n\t */\n\tpublic toInverseChangeSet() {\n\t\tif (this._changes.value !== undefined && this._changes.oldValue !== undefined) {\n\t\t\tconst tmp = this._changes.value;\n\t\t\tthis._changes.value = this._changes.oldValue;\n\t\t\tthis._changes.oldValue = tmp;\n\t\t} else {\n\t\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\t\tpreCallback: this._recursivelyInvertReversibleChangeset.bind(this),\n\t\t\t});\n\t\t}\n\t}\n}\n\nChangeSet.prototype._performApplyAfterOnPropertyArray =\n\tChangeSetArrayFunctions._performApplyAfterOnPropertyArray;\nChangeSet.prototype._rebaseArrayChangeSetForProperty =\n\tChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;\nChangeSet.prototype._rebaseChangeSetForString =\n\tChangeSetArrayFunctions._rebaseChangeSetForString;\n\n// Add the indexed collection functions into the prototype of the ChangeSet\nChangeSet.prototype._performApplyAfterOnPropertyIndexedCollection =\n\tChangeSetIndexedCollectionFunctions._performApplyAfterOnPropertyIndexedCollection;\nChangeSet.prototype._cleanIndexedCollectionChangeSet =\n\tChangeSetIndexedCollectionFunctions._cleanIndexedCollectionChangeSet;\nChangeSet.prototype._rebaseIndexedCollectionChangeSetForProperty =\n\tChangeSetIndexedCollectionFunctions._rebaseIndexedCollectionChangeSetForProperty;\n"]}
|
|
1
|
+
{"version":3,"file":"changeset.js","sourceRoot":"","sources":["../src/changeset.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,yEAAyF;AACzF,uEAA4C;AAC5C,6DAAkC;AAClC,iEAAsC;AACtC,mEAAwC;AACxC,qEA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AC,SAAS,CAAC,gCAAgC;IACnD,kCAAuB,CAAC,gCAAgC,CAAC;AAC1D,SAAS,CAAC,SAAS,CAAC,yBAAyB;IAC5C,kCAAuB,CAAC,yBAAyB,CAAC;AAEnD,2EAA2E;AAC3E,SAAS,CAAC,SAAS,CAAC,6CAA6C;IAChE,0DAAmC,CAAC,6CAA6C,CAAC;AACnF,SAAS,CAAC,SAAS,CAAC,gCAAgC;IACnD,0DAAmC,CAAC,gCAAgC,CAAC;AACtE,SAAS,CAAC,SAAS,CAAC,4CAA4C;IAC/D,0DAAmC,CAAC,4CAA4C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Serialized representation of the changes in a repository\n */\n\nimport { constants, ConsoleUtils, joinPaths } from \"@fluid-experimental/property-common\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport each from \"lodash/each.js\";\nimport extend from \"lodash/extend.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isObject from \"lodash/isObject.js\";\nimport isString from \"lodash/isString.js\";\n\n// @ts-ignore\n\nimport { ChangeSetArrayFunctions } from \"./changeset_operations/array.js\";\nimport { ArrayChangeSetIterator } from \"./changeset_operations/arrayChangesetIterator.js\";\nimport { ConflictType } from \"./changeset_operations/changesetConflictTypes.js\";\n// Add the indexed collection functions into the prototype of the ChangeSet\nimport { ChangeSetIndexedCollectionFunctions } from \"./changeset_operations/indexedCollection.js\";\nimport { isEmptyChangeSet } from \"./changeset_operations/isEmptyChangeset.js\";\nimport { ArrayIteratorOperationTypes } from \"./changeset_operations/operationTypes.js\";\nimport { TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { isReservedKeyword } from \"./isReservedKeyword.js\";\nimport { TemplateValidator } from \"./templateValidator.js\";\nimport { Utils } from \"./utils.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nconst { extractContext, isPrimitiveType } = TypeIdHelper;\n\nexport interface ApplyChangeSetOptions {\n\t/**\n\t * Additional meta information which help later to obtain more compact changeset during the apply operation.\n\t */\n\tapplyAfterMetaInformation?: Map<any, any>;\n\n\t/**\n\t * Throw error for template definition mismatches.\n\t */\n\tthrowOnTemplateMismatch?: boolean;\n}\n\nexport interface RebaseChangeSetOptions extends ApplyChangeSetOptions {\n\trebaseMetaInformation?: object;\n}\n\n/**\n * The plain serialization data structure used to encode a ChangeSet.\n * @internal\n */\nexport type SerializedChangeSet = any; // @TODO Maybe we should add full type for the ChangeSet\nexport type ChangeSetType = any;\nexport interface ConflictInfo {\n\t/**\n\t * Path to the position where the conflict occurred. If the conflicting change is of type\n\t * MISMATCH_TEMPLATES then the path will be undefined.\n\t */\n\tpath?: string | undefined;\n\t/**\n\t * Type of the conflict\n\t */\n\ttype: ConflictType;\n\tconflictingChange?: SerializedChangeSet;\n}\n\n/**\n * The ChangeSet represents an operation to be done (or that was done) on the data. It encapsulate one or\n * many addition/insertion and deletion of properties. The ChangeSetObject also provides functionality\n * to merge and swap change sets.\n * @internal\n */\nexport class ChangeSet {\n\tstatic ConflictType = ConflictType;\n\tstatic isEmptyChangeSet = isEmptyChangeSet;\n\tstatic isReservedKeyword = isReservedKeyword;\n\n\tpublic declare _cleanIndexedCollectionChangeSet: typeof ChangeSetIndexedCollectionFunctions._cleanIndexedCollectionChangeSet;\n\tpublic declare _performApplyAfterOnPropertyArray: typeof ChangeSetArrayFunctions._performApplyAfterOnPropertyArray;\n\tpublic declare _rebaseArrayChangeSetForProperty: typeof ChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;\n\tpublic declare _rebaseChangeSetForString: typeof ChangeSetArrayFunctions._rebaseChangeSetForString;\n\tpublic declare _performApplyAfterOnPropertyIndexedCollection: typeof ChangeSetIndexedCollectionFunctions._performApplyAfterOnPropertyIndexedCollection;\n\tpublic declare _rebaseIndexedCollectionChangeSetForProperty: typeof ChangeSetIndexedCollectionFunctions._rebaseIndexedCollectionChangeSetForProperty;\n\n\t_changes: SerializedChangeSet;\n\t_isNormalized: boolean;\n\n\t/**\n\t * @param [in_changes] - The serialized changes to store in this change set if a string is supplied,\n\t * we assume it to be a serialized JSON representation of the change set. If none is supplied, an empty changeset will be created.\n\t */\n\tconstructor(in_changes?: ChangeSetType) {\n\t\tif (in_changes === undefined || in_changes === null) {\n\t\t\tthis._changes = {};\n\t\t} else if (isString(in_changes)) {\n\t\t\t// Stringified Serialized JSON\n\t\t\tthis._changes = JSON.parse(in_changes);\n\t\t} else if (in_changes instanceof ChangeSet) {\n\t\t\tthis._changes = cloneDeep(in_changes._changes);\n\t\t} else {\n\t\t\t// Serialized Changeset\n\t\t\tthis._changes = in_changes;\n\t\t}\n\n\t\tthis._isNormalized = false;\n\t}\n\n\t/**\n\t * Creates a string representation of the change set\n\t * @returns JSON encoding of the changes in this change set\n\t */\n\ttoString(): string {\n\t\treturn JSON.stringify(this._changes);\n\t}\n\n\t/**\n\t * Returns the serialized changes.\n\t *\n\t * @returns The serialized changeset\n\t */\n\tgetSerializedChangeSet(): SerializedChangeSet {\n\t\treturn this._changes;\n\t}\n\n\t/**\n\t * Indicates whether this is a normalized ChangeSet. If this is set to true, squashes will not remove empty entries\n\t * from the ChangeSet.\n\t *\n\t * @param in_isNormalized - is this a normalized ChangeSet?\n\t */\n\tsetIsNormalized(in_isNormalized: boolean) {\n\t\tthis._isNormalized = in_isNormalized;\n\t}\n\n\t/**\n\t * Indicates whether this is a normalized ChangeSet. If this is set to true, squashes will not remove empty entries\n\t * from the ChangeSet.\n\t *\n\t * @returns Is this a normalized ChangeSet?\n\t */\n\tgetIsNormalized(): boolean {\n\t\treturn this._isNormalized;\n\t}\n\n\t/**\n\t * Clones the ChangeSet\n\t *\n\t * @returns The cloned ChangeSet\n\t */\n\tclone(): ChangeSet {\n\t\treturn new ChangeSet(cloneDeep(this._changes));\n\t}\n\n\t/**\n\t * Updates this ChangeSet. The result will be the concatenation of the two ChangeSets. First the changes in this\n\t * ChangeSet are executed, then the changes in the supplied in_changeSet are applied. The result will be\n\t * stored in this ChangeSet. This function assumes that the second ChangeSet is relative to the state after\n\t * application of the first ChangeSet.\n\t *\n\t * @param in_changeSet - The changeset to apply\n\t * @param in_options - Optional additional parameters\n\t */\n\tapplyChangeSet(in_changeSet: SerializedChangeSet, in_options?: ApplyChangeSetOptions) {\n\t\tlet changes = in_changeSet;\n\t\tif (in_changeSet instanceof ChangeSet) {\n\t\t\tchanges = in_changeSet.getSerializedChangeSet();\n\t\t}\n\n\t\tif (!isObject(this._changes) || Array.isArray(this._changes)) {\n\t\t\tconst oldValue =\n\t\t\t\tisObject(changes) && (changes as SerializedChangeSet).value !== undefined\n\t\t\t\t\t? (changes as SerializedChangeSet).value\n\t\t\t\t\t: changes;\n\t\t\tthis._changes = Array.isArray(oldValue) ? oldValue.slice() : oldValue;\n\t\t} else {\n\t\t\tthis._performApplyAfterOnProperty(\n\t\t\t\tthis._changes,\n\t\t\t\tchanges,\n\t\t\t\t!this._isNormalized,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Applies a changeset to a given property (recursively). The ChangeSet is assumed to be relative to the same\n\t * property root and it will be applied behind the base ChangeSet (assuming that the changes are relative to the\n\t * state after the base ChangeSet has been applied. It will change the base ChangeSet).\n\t *\n\t * @param io_basePropertyChanges - The ChangeSet describing the initial state.\n\t * @param in_appliedPropertyChanges - The ChangeSet to apply to this state.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param in_options - Optional additional parameters.\n\t */\n\tprivate _performApplyAfterOnProperty(\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_removeEmpty: boolean,\n\t\tin_options?: ApplyChangeSetOptions,\n\t) {\n\t\t// Apply dynamic property operations\n\t\tif (\n\t\t\tin_appliedPropertyChanges.insert ||\n\t\t\tin_appliedPropertyChanges.modify ||\n\t\t\tin_appliedPropertyChanges.remove\n\t\t) {\n\t\t\tthis._performApplyAfterOnPropertyIndexedCollection(\n\t\t\t\tio_basePropertyChanges,\n\t\t\t\tin_appliedPropertyChanges,\n\t\t\t\t\"NodeProperty\",\n\t\t\t\tin_options,\n\t\t\t); // TODO: recursively propagate the typeid?\n\t\t}\n\n\t\tif (!isEmpty(in_appliedPropertyChanges.insertTemplates)) {\n\t\t\tio_basePropertyChanges.insertTemplates = io_basePropertyChanges.insertTemplates || {};\n\t\t\textend(\n\t\t\t\tio_basePropertyChanges.insertTemplates,\n\t\t\t\tin_appliedPropertyChanges.insertTemplates,\n\t\t\t);\n\t\t}\n\n\t\t// Apply ChangeSet to the properties\n\t\tconst modifiedTypeids = Object.keys(in_appliedPropertyChanges);\n\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\tconst typeid = modifiedTypeids[i];\n\t\t\t// The reserved keywords have already been handled above\n\t\t\tif (ChangeSet.isReservedKeyword(typeid)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tio_basePropertyChanges[typeid] = io_basePropertyChanges[typeid] || {};\n\t\t\tconst baseChanges = io_basePropertyChanges[typeid];\n\t\t\tconst changedKeys = Object.keys(in_appliedPropertyChanges[typeid]);\n\t\t\tfor (let j = 0; j < changedKeys.length; j++) {\n\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\tchangedKeys[j],\n\t\t\t\t\tbaseChanges,\n\t\t\t\t\tin_appliedPropertyChanges[typeid],\n\t\t\t\t\ttypeid,\n\t\t\t\t\tin_removeEmpty,\n\t\t\t\t\tin_options,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Remove the type when it no longer contains any changed keys\n\t\t\tif (in_removeEmpty && isEmpty(io_basePropertyChanges[typeid])) {\n\t\t\t\tdelete io_basePropertyChanges[typeid];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper function used to apply a new value to a given ChangeSet.\n\t * It is used to handle setting a primitive value, which might either be represented\n\t * via a literal or an object with a member value.\n\t * applies in_appliedValue to the io_baseChanges at the given in_baseKey\n\t * @param io_baseChanges - base changes (modified)\n\t * @param in_baseKey - key\n\t * @param in_appliedValue - applied changes to be applied\n\t */\n\tprivate _applyValue(\n\t\tio_baseChanges: SerializedChangeSet,\n\t\tin_baseKey: string,\n\t\tin_appliedValue: SerializedChangeSet,\n\t) {\n\t\tconst newValue =\n\t\t\tin_appliedValue && in_appliedValue.hasOwnProperty(\"value\")\n\t\t\t\t? in_appliedValue.value\n\t\t\t\t: in_appliedValue;\n\t\tif (io_baseChanges[in_baseKey] && io_baseChanges[in_baseKey].hasOwnProperty(\"value\")) {\n\t\t\tio_baseChanges[in_baseKey].value = newValue;\n\t\t} else {\n\t\t\tio_baseChanges[in_baseKey] =\n\t\t\t\tio_baseChanges[in_baseKey] === undefined &&\n\t\t\t\tin_appliedValue &&\n\t\t\t\tin_appliedValue.hasOwnProperty(\"oldValue\")\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\toldValue: in_appliedValue.oldValue,\n\t\t\t\t\t\t}\n\t\t\t\t\t: newValue;\n\t\t}\n\t}\n\n\t/**\n\t * Decides based on the given Typeid which applyAfter operation to perform.\n\t * Note: This function is not directly called on the ChangeSet but on the object containing it together with a key\n\t * since it needs to be able to overwrite this entry\n\t *\n\t * @param in_changedKey - The key of the entry in the object.\n\t * @param in_baseChanges - The object containing the state before the applyAfter.\n\t * @param in_appliedPropertyChanges - The object containing the ChangeSet with the modification.\n\t * @param in_typeid - The typeid of the property to modify.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param in_options - Optional additional parameters.\n\t */\n\tpublic performApplyAfterOnPropertyWithTypeid(\n\t\tin_changedKey: string,\n\t\tin_baseChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: { [x: string]: any },\n\t\tin_typeid: string,\n\t\tin_removeEmpty: boolean,\n\t\tin_options?: ApplyChangeSetOptions,\n\t) {\n\t\tconst splitTypeid = extractContext(in_typeid);\n\n\t\tif (splitTypeid.context === \"set\" || splitTypeid.context === \"map\") {\n\t\t\tin_baseChanges[in_changedKey] = in_baseChanges[in_changedKey] || {};\n\t\t\tthis._performApplyAfterOnPropertyIndexedCollection(\n\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\tin_options,\n\t\t\t);\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(in_baseChanges[in_changedKey])) {\n\t\t\t\tdelete in_baseChanges[in_changedKey];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"array\" || splitTypeid.typeid === \"String\") {\n\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\tin_baseChanges[in_changedKey] !== undefined ? in_baseChanges[in_changedKey] : {};\n\t\t\tlet baseIsSetChange = false;\n\t\t\tlet oldValue;\n\t\t\tif (\n\t\t\t\tsplitTypeid.typeid === \"String\" &&\n\t\t\t\t(isString(in_baseChanges[in_changedKey]) ||\n\t\t\t\t\t(in_baseChanges[in_changedKey] &&\n\t\t\t\t\t\tin_baseChanges[in_changedKey].hasOwnProperty(\"value\")))\n\t\t\t) {\n\t\t\t\toldValue = in_baseChanges[in_changedKey].oldValue;\n\t\t\t\t// we need to convert the format to allow the application of the changes\n\t\t\t\t// since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands\n\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\tin_baseChanges[in_changedKey] &&\n\t\t\t\t\tin_baseChanges[in_changedKey].hasOwnProperty(\"value\")\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tinsert: [[0, in_baseChanges[in_changedKey].value]],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tinsert: [[0, in_baseChanges[in_changedKey]]],\n\t\t\t\t\t\t\t};\n\t\t\t\tbaseIsSetChange = true;\n\t\t\t}\n\t\t\tlet appliedChanges = in_appliedPropertyChanges[in_changedKey];\n\t\t\tif (isObject(appliedChanges) && appliedChanges.hasOwnProperty(\"value\")) {\n\t\t\t\tappliedChanges = (appliedChanges as SerializedChangeSet).value;\n\t\t\t}\n\n\t\t\tif (splitTypeid.typeid === \"String\" && isString(appliedChanges)) {\n\t\t\t\t// we've got a 'set' command and just overwrite the changes\n\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\tbaseIsSetChange && oldValue !== undefined\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tvalue: appliedChanges,\n\t\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: appliedChanges;\n\t\t\t} else {\n\t\t\t\t// we have incremental changes (or a standard array)\n\t\t\t\tthis._performApplyAfterOnPropertyArray(\n\t\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\tsplitTypeid.typeid,\n\t\t\t\t\tin_options,\n\t\t\t\t);\n\t\t\t\tif (baseIsSetChange) {\n\t\t\t\t\t// we have to convert back to a string, if it had been converted before\n\t\t\t\t\tlet newValue;\n\t\t\t\t\tnewValue = isEmpty(in_baseChanges[in_changedKey])\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: in_baseChanges[in_changedKey].insert[0][1];\n\t\t\t\t\tin_baseChanges[in_changedKey] =\n\t\t\t\t\t\toldValue !== undefined\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: newValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && ChangeSet.isEmptyChangeSet(in_baseChanges[in_changedKey])) {\n\t\t\t\tdelete in_baseChanges[in_changedKey];\n\t\t\t}\n\t\t} else if (splitTypeid.isEnum) {\n\t\t\t// Enum types can simply be overwritten\n\t\t\tthis._applyValue(\n\t\t\t\tin_baseChanges,\n\t\t\t\tin_changedKey,\n\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t);\n\t\t} else if (splitTypeid.context === \"single\") {\n\t\t\tif (isPrimitiveType(splitTypeid.typeid)) {\n\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\tif (splitTypeid.typeid === \"Int64\" || splitTypeid.typeid === \"Uint64\") {\n\t\t\t\t\tlet appliedVal = in_appliedPropertyChanges[in_changedKey];\n\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyValue(in_baseChanges, in_changedKey, appliedVal.slice());\n\t\t\t\t} else {\n\t\t\t\t\tthis._applyValue(\n\t\t\t\t\t\tin_baseChanges,\n\t\t\t\t\t\tin_changedKey,\n\t\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (in_baseChanges[in_changedKey]) {\n\t\t\t\t\t// Otherwise we have to continue the merging recursively\n\t\t\t\t\tthis._performApplyAfterOnProperty(\n\t\t\t\t\t\tin_baseChanges[in_changedKey],\n\t\t\t\t\t\tin_appliedPropertyChanges[in_changedKey],\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// If the key doesn't exist, yet, we can just copy it\n\t\t\t\t\tin_baseChanges[in_changedKey] = cloneDeep(in_appliedPropertyChanges[in_changedKey]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(MSG.UNKNOWN_CONTEXT + splitTypeid.context);\n\t\t}\n\t}\n\n\t/**\n\t * Rebases a given ChangeSet behind the current ChangeSet.\n\t *\n\t * This function takes a ChangeSet which is assumed to be relative to the same base state as the ChangeSet stored in\n\t * this class and transforms it in such a way that it can be applied after this ChangeSet. The function will modify\n\t * the supplied ChangeSet\n\t *\n\t * @param io_changeSet - The ChangeSet that is rebased behind the state obtained by application of this ChangeSet.\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t * @param in_options - Optional additional parameters.\n\t * @returns The rebased ChangeSet (the same object as io_changeSet, it will be\n\t * modified in place).\n\t */\n\tpublic _rebaseChangeSet(\n\t\tio_changeSet: SerializedChangeSet,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options?: RebaseChangeSetOptions,\n\t): SerializedChangeSet {\n\t\t// We actually only pass this request to the recursive internal function\n\t\treturn this._rebaseChangeSetForProperty(\n\t\t\tthis._changes,\n\t\t\tio_changeSet,\n\t\t\t\"\",\n\t\t\tout_conflicts,\n\t\t\tin_options,\n\t\t);\n\t}\n\n\t/**\n\t * Internal helper function that performs a rebase on a single property\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for the property stored in this class\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the property to be rebased\n\t * @param in_basePath - Base path to get to the property processed by this function\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n\t * @param in_options - Optional additional parameters\n\t * @returns The rebased ChangeSet for this property\n\t */\n\tprivate _rebaseChangeSetForProperty(\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t): SerializedChangeSet {\n\t\t// Process the children in this ChangeSet\n\t\tif (\n\t\t\t(in_ownPropertyChangeSet.insert ||\n\t\t\t\tin_ownPropertyChangeSet.modify ||\n\t\t\t\tin_ownPropertyChangeSet.remove) &&\n\t\t\t(io_rebasePropertyChangeSet.insert ||\n\t\t\t\tio_rebasePropertyChangeSet.modify ||\n\t\t\t\tio_rebasePropertyChangeSet.remove)\n\t\t) {\n\t\t\tthis._rebaseIndexedCollectionChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet,\n\t\t\t\tio_rebasePropertyChangeSet,\n\t\t\t\tin_basePath,\n\t\t\t\t\"NodeProperty\", // TODO: recursively propagate the typeid?\n\t\t\t\tfalse, // don't use square brackets (use dots instead)\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t}\n\t\tif (!isEmpty(io_rebasePropertyChangeSet.insertTemplates)) {\n\t\t\tconst typeids = Object.keys(io_rebasePropertyChangeSet.insertTemplates);\n\n\t\t\tconst templateMismatchChangeSet = { insertTemplates: {} };\n\n\t\t\tconst templateMismatchConflict = {\n\t\t\t\ttype: ChangeSet.ConflictType.MISMATCH_TEMPLATES,\n\t\t\t\tconflictingChange: templateMismatchChangeSet,\n\t\t\t};\n\n\t\t\teach(typeids, function (typeid) {\n\t\t\t\tconst template = io_rebasePropertyChangeSet.insertTemplates[typeid];\n\t\t\t\tif (\n\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates &&\n\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[typeid]\n\t\t\t\t) {\n\t\t\t\t\tconst isEqual = TemplateValidator.Utils.psetDeepEquals(\n\t\t\t\t\t\ttemplate,\n\t\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[template.typeid],\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!isEqual) {\n\t\t\t\t\t\tif (in_options && in_options.throwOnTemplateMismatch) {\n\t\t\t\t\t\t\tthrow new Error(MSG.TEMPLATE_MISMATCH + typeid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttemplateMismatchChangeSet.insertTemplates[typeid] =\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.insertTemplates[template.typeid];\n\t\t\t\t\t\t// TODO: Remove this warning message once we offer a conflict resolution API\n\t\t\t\t\t\tconsole.warn(MSG.TEMPLATE_MISMATCH + typeid);\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete io_rebasePropertyChangeSet.insertTemplates[typeid];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Remove insertTemplates key if it is empty\n\t\t\tif (isEmpty(io_rebasePropertyChangeSet.insertTemplates)) {\n\t\t\t\tdelete io_rebasePropertyChangeSet.insertTemplates;\n\t\t\t}\n\n\t\t\tif (!isEmpty(templateMismatchConflict.conflictingChange.insertTemplates)) {\n\t\t\t\tout_conflicts.push(templateMismatchConflict);\n\t\t\t}\n\t\t}\n\n\t\t// Check for collisions in the property assignments\n\t\tconst changedTypeids = Object.keys(in_ownPropertyChangeSet);\n\n\t\t// We currently do not yet have any\n\t\tconst changeSet = {};\n\t\tfor (let i = 0; i < changedTypeids.length; i++) {\n\t\t\tconst typeid = changedTypeids[i];\n\t\t\tconst paths = Object.keys(in_ownPropertyChangeSet[typeid]);\n\n\t\t\t// Update the oldValue of primitive property of a changeset\n\t\t\t// for simple changeset with 'modify', property type, name, value\n\t\t\t// find the oldValue of the property and update it\n\t\t\tif (typeid === \"modify\" && \"modify\" in io_rebasePropertyChangeSet) {\n\t\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\t\tconst tempTypeid = paths[i];\n\t\t\t\t\tif (isPrimitiveType(tempTypeid) && tempTypeid in io_rebasePropertyChangeSet.modify) {\n\t\t\t\t\t\tconst tempPaths = Object.keys(in_ownPropertyChangeSet.modify[tempTypeid]);\n\t\t\t\t\t\tfor (let z = 0; z < tempPaths.length; z++) {\n\t\t\t\t\t\t\tif (tempPaths[z] in io_rebasePropertyChangeSet.modify[tempTypeid]) {\n\t\t\t\t\t\t\t\tlet rebasedPropContent =\n\t\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[tempTypeid][tempPaths[z]];\n\t\t\t\t\t\t\t\tif (isObject(rebasedPropContent) && \"oldValue\" in rebasedPropContent) {\n\t\t\t\t\t\t\t\t\t(rebasedPropContent as SerializedChangeSet).oldValue =\n\t\t\t\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[tempTypeid][tempPaths[z]].value;\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\t\t\t\t}\n\t\t\t} else if (isPrimitiveType(typeid)) {\n\t\t\t\t// for complex changeset, the function will be called recursively, when the function is at the level where\n\t\t\t\t// io_rebasePropertyChangeSet && in_ownPropertyChangeSet contain only property type, name and value, we update\n\t\t\t\t// oldValue of io_rebasePropertyChangeSet.\n\t\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeid in io_rebasePropertyChangeSet &&\n\t\t\t\t\t\tpaths[j] in io_rebasePropertyChangeSet[typeid]\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet rebasedPropContent = io_rebasePropertyChangeSet[typeid][paths[j]];\n\t\t\t\t\t\tif (isObject(rebasedPropContent) && \"oldValue\" in rebasedPropContent) {\n\t\t\t\t\t\t\t// if oldValue already be update above, we don't need to update\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid][paths[j]].oldValue !==\n\t\t\t\t\t\t\t\tin_ownPropertyChangeSet[typeid][paths[j]].value\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid][paths[j]].oldValue =\n\t\t\t\t\t\t\t\t\tin_ownPropertyChangeSet[typeid][paths[j]].value;\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}\n\n\t\t\t// The reserved keywords have already been handled above and changes which are not present in\n\t\t\t// the other ChangeSet can be ignored\n\t\t\tif (ChangeSet.isReservedKeyword(typeid) || !io_rebasePropertyChangeSet[typeid]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check, whether we have a collision in a path update\n\t\t\tfor (let j = 0; j < paths.length; j++) {\n\t\t\t\tif (io_rebasePropertyChangeSet[typeid][paths[j]] !== undefined) {\n\t\t\t\t\tin_ownPropertyChangeSet[typeid] = in_ownPropertyChangeSet[typeid] || {};\n\n\t\t\t\t\tconst newPath = joinPaths(in_basePath, paths[j], PROPERTY_PATH_DELIMITER);\n\t\t\t\t\t// Perform the rebase operation on the ChangeSet for this entry\n\t\t\t\t\tconst setConflict = this.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\tpaths[j],\n\t\t\t\t\t\tin_ownPropertyChangeSet[typeid],\n\t\t\t\t\t\tio_rebasePropertyChangeSet[typeid],\n\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\n\t\t\t\t\t// If there has been a non-recursive set collision we handle it here separately\n\t\t\t\t\tif (setConflict) {\n\t\t\t\t\t\t// If we have two writes to primitive types, this is a conflict\n\t\t\t\t\t\tchangeSet[typeid] = changeSet[typeid] || {};\n\n\t\t\t\t\t\t// Store the change. Note: We make a deep copy here, as this is a reference into our\n\t\t\t\t\t\t// own internal ChangeSet and we want to be sure, nobody changes our internal data-structures\n\t\t\t\t\t\tchangeSet[typeid][paths[j]] = cloneDeep(in_ownPropertyChangeSet[typeid][paths[j]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Remove the typeid, when it no longer contains any keys\n\t\t\t\tif (isEmpty(io_rebasePropertyChangeSet[typeid][paths[j]])) {\n\t\t\t\t\tdelete io_rebasePropertyChangeSet[typeid][paths[j]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove the typeid, when it no longer contains any keys\n\t\t\tif (isEmpty(io_rebasePropertyChangeSet[typeid])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[typeid];\n\t\t\t}\n\t\t}\n\n\t\t// If there were conflicts in the set operations, report them\n\t\tif (!isEmpty(changeSet)) {\n\t\t\tconst conflict = {\n\t\t\t\tpath: in_basePath,\n\t\t\t\ttype: ChangeSet.ConflictType.COLLIDING_SET,\n\t\t\t\tconflictingChange: changeSet,\n\t\t\t};\n\t\t\tout_conflicts.push(conflict);\n\t\t}\n\n\t\treturn io_rebasePropertyChangeSet;\n\t}\n\n\t/**\n\t * Decides based on the given Typeid which rebase operation to perform.\n\t *\n\t * @remarks Note: This function is not directly called on the ChangeSet but on the object containing it together\n\t * with a key since it needs to be able to overwrite this entry\n\t *\n\t * @param in_key - The key of the entry in the object\n\t * @param in_ownPropertyChangeSet - The object containing the ChangeSet for the property stored in this class.\n\t * @param io_rebasePropertyChangeSet - The object containing the ChangeSet for the property to be rebased.\n\t * @param in_typeid - The typeid of the property to rebase.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_removeEmpty - Should empty ChangeSets be removed?\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t *\n\t * @returns Has there been a simple set collision? Those have to be handled separately\n\t *\n\t * @privateRemarks TODO: We should unify the handling of set collisions\n\t * @private\n\t */\n\tprivate rebaseChangeSetForPropertyEntryWithTypeid(\n\t\tin_key: string,\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_basePath: string,\n\t\tin_removeEmpty: boolean,\n\t\tout_conflicts: any,\n\t\tin_options: ApplyChangeSetOptions,\n\t): boolean {\n\t\tconst splitTypeid = extractContext(in_typeid);\n\n\t\tif (splitTypeid.context === \"set\" || splitTypeid.context === \"map\") {\n\t\t\tthis._rebaseIndexedCollectionChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\tin_basePath,\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\ttrue, // use square brackets\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"array\") {\n\t\t\tthis._rebaseArrayChangeSetForProperty(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\tin_basePath,\n\t\t\t\tout_conflicts,\n\t\t\t\tsplitTypeid.typeid,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.typeid === \"String\") {\n\t\t\tthis._rebaseChangeSetForString(\n\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\tio_rebasePropertyChangeSet,\n\t\t\t\tin_key,\n\t\t\t\tin_basePath,\n\t\t\t\tout_conflicts,\n\t\t\t\tin_options,\n\t\t\t);\n\t\t\t// Remove the key, when it no longer contains a changeset\n\t\t\tif (in_removeEmpty && isEmpty(io_rebasePropertyChangeSet[in_key])) {\n\t\t\t\tdelete io_rebasePropertyChangeSet[in_key];\n\t\t\t}\n\t\t} else if (splitTypeid.context === \"single\") {\n\t\t\t// We only can have a conflict when the path exists in both ChangeSets\n\t\t\tif (in_ownPropertyChangeSet[in_key] !== undefined) {\n\t\t\t\tif (isPrimitiveType(splitTypeid.typeid) || splitTypeid.isEnum) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, we have to continue recursively\n\n\t\t\t\t\t// Make sure the paths exist\n\t\t\t\t\tin_ownPropertyChangeSet[in_key] = in_ownPropertyChangeSet[in_key] || {};\n\n\t\t\t\t\t// And then perform the recursive rebase\n\t\t\t\t\tthis._rebaseChangeSetForProperty(\n\t\t\t\t\t\tin_ownPropertyChangeSet[in_key],\n\t\t\t\t\t\tio_rebasePropertyChangeSet[in_key],\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\tin_options,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(MSG.UNKNOWN_CONTEXT + splitTypeid.context);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Recursive helper function for ChangeSet.prototype._toReversibleChangeSet\n\t * which converts a irreversible changeset to a reversible changeset\n\t * or updates the former state of a reversible changeset\n\t * @param in_context - The traversal context.\n\t */\n\tprivate _recursivelyBuildReversibleChangeSet(in_context: Utils.TraversalContext) {\n\t\tconst opType = in_context.getOperationType();\n\t\tif (opType === \"modify\") {\n\t\t\tconst type = in_context.getTypeid();\n\t\t\tconst splitType = in_context.getSplitTypeID();\n\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\n\t\t\tlet current = in_context.getUserData().parallelState;\n\t\t\tif (in_context.getPropertyContainerType() === \"root\") {\n\t\t\t\tcurrent = in_context.getUserData().oldState;\n\t\t\t} else if (current) {\n\t\t\t\tif (in_context.getPropertyContainerType() !== \"template\") {\n\t\t\t\t\tcurrent = current.insert;\n\t\t\t\t}\n\n\t\t\t\tif (in_context.getPropertyContainerType() !== \"array\") {\n\t\t\t\t\tcurrent = current && current[in_context.getTypeid()];\n\t\t\t\t\tcurrent = current && current[in_context.getLastSegment()];\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = current && current[0][1][in_context.getLastSegment()];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tin_context.setUserData({\n\t\t\t\tparallelState: current,\n\t\t\t\toldState: in_context.getUserData().oldState,\n\t\t\t});\n\n\t\t\tif (isPrimitiveType(type)) {\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${\n\t\t\t\t\t\t\tMSG.INVALID_PATH + in_context.getFullPath()\n\t\t\t\t\t\t}. Making primitive value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current;\n\n\t\t\t\t// store it in reversibleChangeSet\n\t\t\t\tif (type === \"String\" && !isString(nestedChangeset)) {\n\t\t\t\t\t// String is a special case\n\t\t\t\t\tlet oldString;\n\t\t\t\t\tif (isString(oldValue)) {\n\t\t\t\t\t\toldString = oldValue;\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\t\tconst entryLength = entry[1].length;\n\t\t\t\t\t\t\tentry[2] = oldString.slice(entryOffset, entryOffset + entryLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\n\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\tif (isString(removeRangeLength)) {\n\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[1] = oldString.slice(entryOffset, entryOffset + removeRangeLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tnestedChangeset.oldValue = oldValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst newChangeSet = {\n\t\t\t\t\t\t\tvalue: nestedChangeset,\n\t\t\t\t\t\t\toldValue,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tin_context.replaceNestedChangeSet(newChangeSet);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (splitType.context === \"array\") {\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${MSG.INVALID_PATH + in_context.getFullPath()}. Making array value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current.insert ? current.insert[0][1] : [];\n\n\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\t\tlet oldEntries = [];\n\t\t\t\t\t\t\tfor (let j = 0; j < entry[1].length; j++) {\n\t\t\t\t\t\t\t\toldEntries.push(cloneDeep(oldValue[entryOffset + j]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[2] = oldEntries;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\tlet entryOffset = entry[0];\n\t\t\t\t\t\tlet oldEntries = [];\n\n\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\tif (Array.isArray(removeRangeLength)) {\n\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let j = 0; j < removeRangeLength; j++) {\n\t\t\t\t\t\t\toldEntries.push(cloneDeep(oldValue[entryOffset + j]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tentry[1] = oldEntries;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tsplitType.context === \"map\" ||\n\t\t\t\t// node property test: (we have to do the test this way, because of inheritance)\n\t\t\t\tnestedChangeset.insert ||\n\t\t\t\tnestedChangeset.modify ||\n\t\t\t\tnestedChangeset.remove\n\t\t\t) {\n\t\t\t\t// This prevents an error, if the changeset only contains an insert operation. In that case\n\t\t\t\t// we don't actually need the corresponding old state and thus do not need to throw an error\n\t\t\t\t// This type of situation can occur in the materialized history, if an insert happens right at a chunk boundary.\n\t\t\t\tif (Object.keys(nestedChangeset).length === 1 && nestedChangeset.insert) {\n\t\t\t\t\tin_context._traversalStopped = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (current === undefined) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`${MSG.INVALID_PATH + in_context.getFullPath()}. Making map value reversible.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tlet oldValue = current.insert;\n\n\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\tif (typeof entry === \"object\" && entry.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tentry = entry.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnestedChangeset.modify[modifiedKeys[i]] = {\n\t\t\t\t\t\t\t\tvalue: entry,\n\t\t\t\t\t\t\t\toldValue: cloneDeep(oldValue[modifiedKeys[i]]),\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\tlet newRemove = {};\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\tif (!Array.isArray(removedKeys)) {\n\t\t\t\t\t\t\tremovedKeys = Object.keys(removedKeys);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tnewRemove[removedKeys[i]] = cloneDeep(oldValue[removedKeys[i]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnestedChangeset.remove = newRemove;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t// this case is handeled recursively\n\t\t\t\t\t}\n\t\t\t\t\tlet newRemove = {};\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tif (Array.isArray(nestedChangeset.remove)) {\n\t\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\tlet searchedKey = removedKeys[i];\n\t\t\t\t\t\t\t\t// search for this key in the old keys:\n\t\t\t\t\t\t\t\tconst oldTypeKeys = Object.keys(oldValue);\n\t\t\t\t\t\t\t\tfor (let k = 0; k < oldTypeKeys.length; k++) {\n\t\t\t\t\t\t\t\t\tif (oldValue[oldTypeKeys[k]].hasOwnProperty(searchedKey)) {\n\t\t\t\t\t\t\t\t\t\tlet entry = oldValue[oldTypeKeys[k]][searchedKey];\n\t\t\t\t\t\t\t\t\t\tif (!newRemove[oldTypeKeys[k]]) {\n\t\t\t\t\t\t\t\t\t\t\tnewRemove[oldTypeKeys[k]] = {};\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tnewRemove[oldTypeKeys[k]][removedKeys[i]] = cloneDeep(entry);\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\tnestedChangeset.remove = newRemove;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// we already have a reversibleChangeSet and need to update the oldValues\n\t\t\t\t\t\t\tconst removedTypes = Object.keys(nestedChangeset.remove);\n\t\t\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\t\t\tlet removedKeys = Object.keys(nestedChangeset.remove[removedTypes[t]]);\n\t\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\t\tlet searchedKey = removedKeys[i];\n\t\t\t\t\t\t\t\t\tlet entry = oldValue[removedTypes[t]][searchedKey];\n\t\t\t\t\t\t\t\t\tnestedChangeset.remove[removedTypes[t]][removedKeys[i]] = entry;\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\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Converts an irreversible changeset to a reversible changeset\n\t * or updates the former state of a reversible changeset\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release.\n\t * @param in_oldSerializedState - The old state.\n\t */\n\tpublic _toReversibleChangeSet(in_oldSerializedState: SerializedChangeSet) {\n\t\tConsoleUtils.assert(\n\t\t\tin_oldSerializedState !== undefined,\n\t\t\t`${MSG.ASSERTION_FAILED}Missing function parameter \"in_oldSerializedState\" of \"_toReversibleChangeSet\".`,\n\t\t);\n\n\t\tif (!isObject(in_oldSerializedState) || Array.isArray(in_oldSerializedState)) {\n\t\t\tif (!isObject(this._changes) || Array.isArray(this._changes)) {\n\t\t\t\tthis._changes = {\n\t\t\t\t\toldValue: Array.isArray(in_oldSerializedState)\n\t\t\t\t\t\t? in_oldSerializedState.slice()\n\t\t\t\t\t\t: in_oldSerializedState,\n\t\t\t\t\tvalue: this._changes,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t(this._changes as SerializedChangeSet).oldValue = Array.isArray(in_oldSerializedState)\n\t\t\t\t\t? in_oldSerializedState.slice()\n\t\t\t\t\t: in_oldSerializedState;\n\t\t\t}\n\t\t} else {\n\t\t\tconst workspace = { oldState: in_oldSerializedState };\n\t\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\t\tpreCallback: this._recursivelyBuildReversibleChangeSet,\n\t\t\t\tuserData: workspace,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Converts a reversible changeset to an irreversible changeset\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release.\n\t * @param in_withoutRoot - Bypass a fix where the root of a changeset is cleaned\n\t */\n\tpublic _stripReversibleChangeSet(in_withoutRoot: boolean) {\n\t\tconst callback = function (in_context) {\n\t\t\tconst opType = in_context.getOperationType();\n\t\t\tif (opType === \"remove\" || opType === \"modify\") {\n\t\t\t\tconst type = in_context.getTypeid();\n\t\t\t\tif (!type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst splitType = in_context.getSplitTypeID();\n\n\t\t\t\tif (isPrimitiveType(type)) {\n\t\t\t\t\t// remove old state\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (type === \"String\" && !isString(nestedChangeset)) {\n\t\t\t\t\t\t// String is a special case\n\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\t\tentry.splice(2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\n\t\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\t\tif (isString(removeRangeLength)) {\n\t\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tentry[1] = removeRangeLength;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tin_context.replaceNestedChangeSet(nestedChangeset.value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (nestedChangeset && nestedChangeset.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\tin_context.replaceNestedChangeSet(nestedChangeset.value);\n\t\t\t\t\t}\n\t\t\t\t} else if (splitType.context === \"array\") {\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.modify.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[i];\n\t\t\t\t\t\t\tentry.splice(2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\tfor (let i = 0; i < nestedChangeset.remove.length; i++) {\n\t\t\t\t\t\t\tlet entry = nestedChangeset.remove[i];\n\t\t\t\t\t\t\tlet removeRangeLength = entry[1];\n\t\t\t\t\t\t\tif (Array.isArray(removeRangeLength)) {\n\t\t\t\t\t\t\t\tremoveRangeLength = entry[1].length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tentry[1] = removeRangeLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// TODO: Remove in_withoutRoot when it will not be used anymore\n\t\t\t\t} else if (\n\t\t\t\t\tsplitType.context === \"map\" ||\n\t\t\t\t\t(!in_withoutRoot && splitType.context === \"single\")\n\t\t\t\t) {\n\t\t\t\t\t// For NodeProperty / inserts at the root\n\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\t\tlet entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\t\tif (typeof entry === \"object\" && entry.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tentry = entry.value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnestedChangeset.modify[modifiedKeys[i]] = entry;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tlet removedKeys = nestedChangeset.remove;\n\t\t\t\t\t\t\tif (!Array.isArray(removedKeys)) {\n\t\t\t\t\t\t\t\tremovedKeys = Object.keys(removedKeys);\n\t\t\t\t\t\t\t\tnestedChangeset.remove = removedKeys;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet nestedChangeset = in_context.getNestedChangeSet();\n\t\t\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\t\t\t// this case is handeled recursively\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\t\t\tif (!Array.isArray(nestedChangeset.remove)) {\n\t\t\t\t\t\t\t\t// we have a reversibleChangeSet and need to convert\n\t\t\t\t\t\t\t\tlet newRemove = [];\n\t\t\t\t\t\t\t\tconst removedTypes = Object.keys(nestedChangeset.remove);\n\t\t\t\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\t\t\t\tlet removedKeys = Object.keys(nestedChangeset.remove[removedTypes[t]]);\n\t\t\t\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\t\t\t\tnewRemove.push(removedKeys[i]);\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\tnestedChangeset.remove = newRemove;\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}\n\t\t};\n\n\t\tif (\n\t\t\tisObject(this._changes) &&\n\t\t\t(this._changes as SerializedChangeSet).oldValue !== undefined &&\n\t\t\t(this._changes as SerializedChangeSet).value !== undefined\n\t\t) {\n\t\t\tthis._changes = (this._changes as SerializedChangeSet).value;\n\t\t\treturn;\n\t\t}\n\n\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\tpreCallback: callback,\n\t\t});\n\t}\n\n\t/**\n\t * Helper function to extract the first level paths from a given change set\n\t * @param in_changeSet - The ChangeSet to extract paths from.\n\t * @param isPrimitiveCollection - Is this a primitive type collection?\n\t *\n\t * @returns List of paths found at the first level of the change set\n\t */\n\tprivate _extractFirstLevelPaths(\n\t\tin_changeSet: SerializedChangeSet,\n\t\tisPrimitiveCollection: boolean,\n\t): string[] {\n\t\tlet paths;\n\t\tif (isPrimitiveCollection) {\n\t\t\tpaths = Object.keys(in_changeSet);\n\t\t} else {\n\t\t\tpaths = [];\n\t\t\teach(in_changeSet, function (nestedChangeSet) {\n\t\t\t\teach(nestedChangeSet, function (nestedChangeSet2, path) {\n\t\t\t\t\tpaths.push(path);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn paths;\n\t}\n\n\t/**\n\t * recursive helper function for ChangeSet.prototype._toInverseChangeSet\n\t * @param in_context - The traversal context.\n\t */\n\tprivate _recursivelyInvertReversibleChangeset(in_context: Utils.TraversalContext) {\n\t\tin_context.setUserData(in_context.getUserData() || {});\n\n\t\t// Figure out if we have already visited this path by verifying that the full path\n\t\t// is contained within the list of processed deleted or inserted paths\n\t\tconst isWithinInsertOrDelete = in_context.getUserData()[in_context.getFullPath()];\n\n\t\tif (isWithinInsertOrDelete && in_context.getOperationType() !== \"modify\") {\n\t\t\t// We are within an insert or remove sub tree. Skip this iteration.\n\t\t\tin_context._traversalStopped = true;\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tin_context.getOperationType() === \"remove\" ||\n\t\t\tin_context.getOperationType() === \"modify\"\n\t\t) {\n\t\t\tconst type = in_context.getTypeid();\n\t\t\tconst splitType = in_context.getSplitTypeID();\n\n\t\t\tif (!splitType) {\n\t\t\t\tConsoleUtils.assert(\n\t\t\t\t\tfalse,\n\t\t\t\t\t`${MSG.ASSERTION_FAILED}Missing \"splitType\" in \"in_context\":${JSON.stringify(\n\t\t\t\t\t\tin_context,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst nestedChangeset = in_context.getNestedChangeSet();\n\n\t\t\tif (\n\t\t\t\t(isPrimitiveType(type) && type !== \"String\") ||\n\t\t\t\t(type === \"String\" && isString(nestedChangeset.oldValue))\n\t\t\t) {\n\t\t\t\t// check if we were called with an irreversible changeset\n\t\t\t\tif (\n\t\t\t\t\tin_context.getOperationType() === \"modify\" &&\n\t\t\t\t\t(!isObject(nestedChangeset) ||\n\t\t\t\t\t\ttypeof (nestedChangeset as SerializedChangeSet).oldValue === \"undefined\")\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(MSG.OLD_VALUE_NOT_FOUND);\n\t\t\t\t}\n\n\t\t\t\t// switch oldValue and value\n\t\t\t\tlet tmp = nestedChangeset.oldValue;\n\t\t\t\tnestedChangeset.oldValue = nestedChangeset.value;\n\t\t\t\tnestedChangeset.value = tmp;\n\t\t\t} else if (\n\t\t\t\t(type === \"String\" && !isString(nestedChangeset.oldValue)) ||\n\t\t\t\tsplitType.context === \"array\"\n\t\t\t) {\n\t\t\t\t// String and Arrays need special treatment:\n\t\t\t\tconst arrayIterator = new ArrayChangeSetIterator(nestedChangeset);\n\t\t\t\tconst resultChangeset: SerializedChangeSet = {};\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tresultChangeset.modify = [];\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.insert) {\n\t\t\t\t\tresultChangeset.remove = [];\n\t\t\t\t}\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tresultChangeset.insert = [];\n\t\t\t\t}\n\t\t\t\t// Successively invert the changes from the changeSet\n\t\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.INSERT:\n\t\t\t\t\t\t\t// Handle inserts\n\t\t\t\t\t\t\tresultChangeset.remove.push([\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.REMOVE:\n\t\t\t\t\t\t\t// Handle removes\n\t\t\t\t\t\t\tresultChangeset.insert.push([\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ArrayIteratorOperationTypes.MODIFY:\n\t\t\t\t\t\t\t// Handle modifies\n\t\t\t\t\t\t\tif (isPrimitiveType(splitType.typeid)) {\n\t\t\t\t\t\t\t\tresultChangeset.modify.push([\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[2],\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresultChangeset.modify.push([\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\t\t\tarrayIterator.opDescription.operation[1],\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t`applyChangeset: ${MSG.UNKNOWN_OPERATION}${arrayIterator.opDescription.type}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tarrayIterator.next();\n\t\t\t\t}\n\t\t\t\tin_context.replaceNestedChangeSet(resultChangeset);\n\t\t\t} else {\n\t\t\t\t// Covers NodeProperty, Map and Set\n\t\t\t\tif (nestedChangeset.modify) {\n\t\t\t\t\tif (isPrimitiveType(splitType.typeid) && splitType.context === \"map\") {\n\t\t\t\t\t\tconst modifiedKeys = Object.keys(nestedChangeset.modify);\n\t\t\t\t\t\tfor (let i = 0; i < modifiedKeys.length; i++) {\n\t\t\t\t\t\t\tconst entry = nestedChangeset.modify[modifiedKeys[i]];\n\t\t\t\t\t\t\tlet tmp = entry.value;\n\t\t\t\t\t\t\tentry.value = entry.oldValue;\n\t\t\t\t\t\t\tentry.oldValue = tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst oldInsert = nestedChangeset.insert;\n\t\t\t\tlet replacedInsert = false;\n\t\t\t\tif (nestedChangeset.remove) {\n\t\t\t\t\tnestedChangeset.insert = nestedChangeset.remove;\n\t\t\t\t\treplacedInsert = true;\n\t\t\t\t\tnestedChangeset.remove = undefined;\n\t\t\t\t\tdelete nestedChangeset.remove;\n\t\t\t\t\tconst isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);\n\t\t\t\t\teach(\n\t\t\t\t\t\tthis._extractFirstLevelPaths(nestedChangeset.insert, isPrimitiveTypeid),\n\t\t\t\t\t\tfunction (path) {\n\t\t\t\t\t\t\tconst fullPath = joinPaths(\n\t\t\t\t\t\t\t\tin_context.getFullPath(),\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tin_context.getUserData()[fullPath] = true;\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (oldInsert) {\n\t\t\t\t\tif (replacedInsert) {\n\t\t\t\t\t\tnestedChangeset.remove = cloneDeep(oldInsert);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnestedChangeset.remove = oldInsert;\n\t\t\t\t\t\tnestedChangeset.insert = undefined;\n\t\t\t\t\t\tdelete nestedChangeset.insert;\n\t\t\t\t\t}\n\t\t\t\t\tconst isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);\n\t\t\t\t\teach(\n\t\t\t\t\t\tthis._extractFirstLevelPaths(nestedChangeset.remove, isPrimitiveTypeid),\n\t\t\t\t\t\tfunction (path) {\n\t\t\t\t\t\t\tconst fullPath = joinPaths(\n\t\t\t\t\t\t\t\tin_context.getFullPath(),\n\t\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tin_context.getUserData()[fullPath] = true;\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}\n\n\t/**\n\t * Inverts a reversible ChangeSets\n\t * WARNING: This function is still experimental and needs more testing\n\t * and it's set to private for now. It will be converted to a public API function\n\t * in a later release\n\t */\n\tpublic toInverseChangeSet() {\n\t\tif (this._changes.value !== undefined && this._changes.oldValue !== undefined) {\n\t\t\tconst tmp = this._changes.value;\n\t\t\tthis._changes.value = this._changes.oldValue;\n\t\t\tthis._changes.oldValue = tmp;\n\t\t} else {\n\t\t\tUtils.traverseChangeSetRecursively(this._changes, {\n\t\t\t\tpreCallback: this._recursivelyInvertReversibleChangeset.bind(this),\n\t\t\t});\n\t\t}\n\t}\n}\n\nChangeSet.prototype._performApplyAfterOnPropertyArray =\n\tChangeSetArrayFunctions._performApplyAfterOnPropertyArray;\nChangeSet.prototype._rebaseArrayChangeSetForProperty =\n\tChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;\nChangeSet.prototype._rebaseChangeSetForString =\n\tChangeSetArrayFunctions._rebaseChangeSetForString;\n\n// Add the indexed collection functions into the prototype of the ChangeSet\nChangeSet.prototype._performApplyAfterOnPropertyIndexedCollection =\n\tChangeSetIndexedCollectionFunctions._performApplyAfterOnPropertyIndexedCollection;\nChangeSet.prototype._cleanIndexedCollectionChangeSet =\n\tChangeSetIndexedCollectionFunctions._cleanIndexedCollectionChangeSet;\nChangeSet.prototype._rebaseIndexedCollectionChangeSetForProperty =\n\tChangeSetIndexedCollectionFunctions._rebaseIndexedCollectionChangeSetForProperty;\n"]}
|
|
@@ -12,7 +12,7 @@ exports.ChangeSetArrayFunctions = void 0;
|
|
|
12
12
|
* @fileoverview Helper functions and classes to work with array ChangeSets
|
|
13
13
|
*/
|
|
14
14
|
const property_common_1 = require("@fluid-experimental/property-common");
|
|
15
|
-
const
|
|
15
|
+
const cloneDeep_js_1 = __importDefault(require("lodash/cloneDeep.js"));
|
|
16
16
|
const isEqual_js_1 = __importDefault(require("lodash/isEqual.js"));
|
|
17
17
|
const isNumber_js_1 = __importDefault(require("lodash/isNumber.js"));
|
|
18
18
|
const isString_js_1 = __importDefault(require("lodash/isString.js"));
|
|
@@ -950,7 +950,7 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
950
950
|
const conflict = {
|
|
951
951
|
path: in_basePath, // TODO: We have to report the range or per element
|
|
952
952
|
type: changesetConflictTypes_js_1.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY, // todo
|
|
953
|
-
conflictingChange: (0,
|
|
953
|
+
conflictingChange: (0, cloneDeep_js_1.default)(baseOp),
|
|
954
954
|
};
|
|
955
955
|
out_conflicts.push(conflict);
|
|
956
956
|
// move to the right side of the insert
|
|
@@ -1020,7 +1020,7 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
1020
1020
|
let conflict = {
|
|
1021
1021
|
path: in_basePath, // TODO: We have to report the range or per element
|
|
1022
1022
|
type: changesetConflictTypes_js_1.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,
|
|
1023
|
-
conflictingChange: (0,
|
|
1023
|
+
conflictingChange: (0, cloneDeep_js_1.default)(opB),
|
|
1024
1024
|
};
|
|
1025
1025
|
out_conflicts.push(conflict);
|
|
1026
1026
|
}
|
|
@@ -1042,7 +1042,7 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
1042
1042
|
let conflict = {
|
|
1043
1043
|
path: in_basePath, // TODO: We have to report the range or per element
|
|
1044
1044
|
type: changesetConflictTypes_js_1.ConflictType.COLLIDING_SET,
|
|
1045
|
-
conflictingChange: (0,
|
|
1045
|
+
conflictingChange: (0, cloneDeep_js_1.default)(opB),
|
|
1046
1046
|
};
|
|
1047
1047
|
out_conflicts.push(conflict);
|
|
1048
1048
|
// If opB new value is same as opA new value, replace the modify with a NOP
|
|
@@ -1069,7 +1069,7 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
1069
1069
|
let conflict = {
|
|
1070
1070
|
path: in_basePath, // TODO: We have to report the range or per element
|
|
1071
1071
|
type: changesetConflictTypes_js_1.ConflictType.REMOVE_AFTER_MODIFY,
|
|
1072
|
-
conflictingChange: (0,
|
|
1072
|
+
conflictingChange: (0, cloneDeep_js_1.default)(opB),
|
|
1073
1073
|
};
|
|
1074
1074
|
out_conflicts.push(conflict);
|
|
1075
1075
|
}
|
|
@@ -1470,7 +1470,7 @@ var ChangeSetArrayFunctions;
|
|
|
1470
1470
|
let conflict = {
|
|
1471
1471
|
path: in_basePath,
|
|
1472
1472
|
type: changesetConflictTypes_js_1.ConflictType.COLLIDING_SET,
|
|
1473
|
-
conflictingChange: (0,
|
|
1473
|
+
conflictingChange: (0, cloneDeep_js_1.default)(in_ownPropertyChangeSet),
|
|
1474
1474
|
};
|
|
1475
1475
|
out_conflicts.push(conflict);
|
|
1476
1476
|
// If value is the same, delete the entry
|
|
@@ -1493,7 +1493,7 @@ var ChangeSetArrayFunctions;
|
|
|
1493
1493
|
let conflict = {
|
|
1494
1494
|
path: in_basePath,
|
|
1495
1495
|
type: changesetConflictTypes_js_1.ConflictType.COLLIDING_SET,
|
|
1496
|
-
conflictingChange: (0,
|
|
1496
|
+
conflictingChange: (0, cloneDeep_js_1.default)(io_rebasePropertyChangeSetParent[in_key]),
|
|
1497
1497
|
};
|
|
1498
1498
|
out_conflicts.push(conflict);
|
|
1499
1499
|
io_rebasePropertyChangeSetParent[in_key] = in_ownPropertyChangeSet;
|