@fluid-experimental/property-changeset 2.74.0 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/lib/changeset.d.ts.map +1 -1
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.d.ts.map +1 -1
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.d.ts.map +1 -1
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/templateValidator.d.ts.map +1 -1
- package/lib/templateValidator.js.map +1 -1
- package/lib/test/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -0
- package/lib/utils.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,Q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AC;YAC7C,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;;AA3NM,4BAAK,GAAG,2BAA2B,CAAC,CAAC,uEAAuE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Iterator to iterate over array ChangeSets\n */\n\nimport { constants } from \"@fluid-experimental/property-common\";\n\nimport isNumber from \"lodash/isNumber.js\";\nimport isString from \"lodash/isString.js\";\n\n// @ts-ignore\n\nimport { SerializedChangeSet } from \"../changeset.js\";\n\nimport { ArrayIteratorOperationTypes } from \"./operationTypes.js\";\n\nconst { MSG } = constants;\n\ntype genericArray = (number | string | (SerializedChangeSet & { typeid: string }))[];\nexport type arrayInsertList = [number, string | genericArray];\nexport type arrayModifyList =\n\t| [number, string | genericArray]\n\t| [number, string, string]\n\t| [number, genericArray, genericArray];\nexport type arrayRemoveList = [number, number | string | genericArray];\n\n/**\n * Description of an array operation\n */\nexport interface OperationDescription {\n\t_absoluteBegin?: number;\n\ttype?: ArrayIteratorOperationTypes;\n\toffset?: number;\n}\n\n/**\n * Description of an insert array operation\n */\nexport interface InsertOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.INSERT;\n\tremoveInsertOperation?: arrayInsertList;\n\toperation?: arrayInsertList;\n}\n\n/**\n * Description of a remove array operation\n */\nexport interface RemoveOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.REMOVE;\n\tremoveInsertOperation?: arrayRemoveList;\n\toperation?: arrayRemoveList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface ModifyOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.MODIFY;\n\tremoveInsertOperation?: arrayModifyList;\n\toperation: arrayModifyList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface NOPOperation\n\textends Omit<OperationDescription, \"removeInsertOperation\" | \"operation\"> {\n\ttype: ArrayIteratorOperationTypes.NOP;\n\toperation?: [];\n}\n\nexport type NoneNOPOperation = RemoveOperation | InsertOperation | ModifyOperation;\nexport type GenericOperation = NoneNOPOperation | NOPOperation;\n\n/**\n * Iterator class which iterates over an array ChangeSet. It will successively return the operations ordered by their\n * position within the array. Additionally, it will keep track of the modifications to the array indices caused\n * by the previous operations.\n * @internal\n */\nexport class ArrayChangeSetIterator {\n\tstatic types = ArrayIteratorOperationTypes; // @TODO Not sure if this is still required if we export it separately.\n\n\tprivate readonly _changeSet: SerializedChangeSet;\n\tprivate _copiedModifies: string | any[];\n\tprivate readonly _currentIndices: { insert: number; remove: number; modify: number };\n\tprivate _currentOffset: number;\n\tprivate _lastOperationIndex: number;\n\tprivate _lastOperationOffset: number;\n\n\tprivate _atEnd: boolean;\n\tprivate _op: GenericOperation;\n\n\tpublic get opDescription(): GenericOperation {\n\t\treturn this._op;\n\t}\n\n\tpublic get currentOffset(): number {\n\t\treturn this._currentOffset;\n\t}\n\n\tpublic get lastOperationIndex(): number {\n\t\treturn this._lastOperationIndex;\n\t}\n\n\tpublic get lastOperationOffset(): number {\n\t\treturn this._lastOperationOffset;\n\t}\n\n\t/**\n\t * @param in_changeSet - The ChangeSet to iterate over (this has to be an array ChangeSet\n\t */\n\tconstructor(in_changeSet: SerializedChangeSet) {\n\t\tthis._changeSet = in_changeSet;\n\t\t// if we need to chop overlapping modifies internally, so we have to copy them\n\t\t// we do this lazy and only if really needed\n\t\tthis._copiedModifies = in_changeSet.modify;\n\t\tthis._currentIndices = {\n\t\t\tinsert: 0,\n\t\t\tremove: 0,\n\t\t\tmodify: 0,\n\t\t};\n\n\t\tthis._currentOffset = 0;\n\t\tthis._lastOperationIndex = -1;\n\t\tthis._lastOperationOffset = 0;\n\t\tthis._atEnd = false;\n\n\t\tthis._op = {\n\t\t\ttype: ArrayIteratorOperationTypes.NOP,\n\t\t\toffset: 0,\n\t\t\toperation: undefined,\n\t\t};\n\n\t\t// go to the first element\n\t\tthis.next();\n\t}\n\n\t/**\n\t * Returns the next operation in the ChangeSet\n\t * @returns true, if there are operations left\n\t */\n\tnext(): boolean {\n\t\t// Find the smallest index in the operations lists\n\t\tlet currentIndex = Infinity;\n\t\tlet type: ArrayIteratorOperationTypes;\n\t\t(this._op as any).removeInsertOperation = undefined;\n\t\t// Process the current remove entry\n\t\tif (\n\t\t\tthis._changeSet.remove &&\n\t\t\tthis._currentIndices.remove < this._changeSet.remove.length\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.REMOVE;\n\t\t\tcurrentIndex = this._changeSet.remove[this._currentIndices.remove][0];\n\t\t\tlet currentLength = this._changeSet.remove[this._currentIndices.remove][1];\n\t\t\tif (!isNumber(currentLength)) {\n\t\t\t\tcurrentLength = currentLength.length;\n\t\t\t}\n\n\t\t\t// Check, whether this is a removeInsertOperation\n\t\t\tif (\n\t\t\t\tthis._changeSet.insert &&\n\t\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] <= currentIndex + currentLength\n\t\t\t) {\n\t\t\t\t(this._op as InsertOperation).removeInsertOperation =\n\t\t\t\t\tthis._changeSet.insert[this._currentIndices.insert];\n\t\t\t}\n\t\t}\n\n\t\t// Process the current insert entry (we prefer remove over insert, since this prevents the array from growing more\n\t\t// than necessary)\n\t\tif (\n\t\t\tthis._changeSet.insert &&\n\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] < currentIndex\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.INSERT;\n\t\t\tcurrentIndex = this._changeSet.insert[this._currentIndices.insert][0];\n\t\t}\n\n\t\t// Process the current modify entry\n\t\tif (\n\t\t\tthis._copiedModifies &&\n\t\t\tthis._currentIndices.modify < this._copiedModifies.length &&\n\t\t\tthis._copiedModifies[this._currentIndices.modify][0] < currentIndex\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.MODIFY;\n\t\t}\n\n\t\tif (this._lastOperationIndex !== currentIndex) {\n\t\t\tthis._currentOffset += this._lastOperationOffset;\n\t\t\tthis._lastOperationIndex = currentIndex;\n\t\t\tthis._lastOperationOffset = 0;\n\t\t}\n\n\t\t// We have found nothing, so we are at the end of the ChangeSet\n\t\tif (type === undefined) {\n\t\t\tthis._op.type = ArrayChangeSetIterator.types.NOP;\n\t\t\tthis._op.offset = this._currentOffset;\n\t\t\tthis._op.operation = undefined;\n\t\t\tthis._atEnd = true;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Determine the return value and update the internal indices and offsets depending on the next operation\n\t\tswitch (type) {\n\t\t\tcase ArrayChangeSetIterator.types.INSERT:\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.INSERT;\n\t\t\t\t// Define the return value\n\t\t\t\tthis._op.operation = this._changeSet.insert[this._currentIndices.insert];\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// Update the current offset. For an insert we have to increase it by the number of the inserted elements\n\t\t\t\tthis._lastOperationOffset += (this._op.operation[1] as any).length;\n\n\t\t\t\t// Shift the internal index\n\t\t\t\tthis._currentIndices.insert++;\n\t\t\t\tbreak;\n\t\t\tcase ArrayChangeSetIterator.types.REMOVE:\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.REMOVE;\n\t\t\t\t// Define the return value\n\t\t\t\tthis._op.operation = this._changeSet.remove[this._currentIndices.remove];\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// Update the current offset. For a remove we have to decrement it by the number of the removed elements\n\t\t\t\tvar removedElements = isNumber(this._op.operation[1])\n\t\t\t\t\t? this._op.operation[1]\n\t\t\t\t\t: this._op.operation[1].length;\n\t\t\t\tthis._lastOperationOffset -= removedElements;\n\n\t\t\t\t// Shift the internal index\n\t\t\t\tthis._currentIndices.remove++;\n\t\t\t\tbreak;\n\t\t\tcase ArrayChangeSetIterator.types.MODIFY: {\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.MODIFY;\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// check, if the modify's range overlaps with coming insert changes:\n\t\t\t\tlet nextModify = this._copiedModifies[this._currentIndices.modify];\n\t\t\t\tconst modifyEnd = nextModify[0] + nextModify[1].length;\n\t\t\t\tif (\n\t\t\t\t\tthis._changeSet.insert &&\n\t\t\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] < modifyEnd\n\t\t\t\t) {\n\t\t\t\t\t// we have an overlap and need to cut the modify\n\t\t\t\t\tconst insertPosition = this._changeSet.insert[this._currentIndices.insert][0];\n\n\t\t\t\t\t// if we haven't copied the change set's modifies yet, we need to do that now\n\t\t\t\t\tif (this._copiedModifies === this._changeSet.modify) {\n\t\t\t\t\t\tthis._copiedModifies = this._copyModifies(this._changeSet.modify);\n\t\t\t\t\t\t// now we need to update nextModify!\n\t\t\t\t\t\tnextModify = this._copiedModifies[this._currentIndices.modify];\n\t\t\t\t\t}\n\n\t\t\t\t\t// use modify only up to insert's position\n\n\t\t\t\t\t// build a partial modify and cut the remaining one:\n\t\t\t\t\tconst partialModify: arrayModifyList = [nextModify[0], undefined];\n\t\t\t\t\tif (isString(nextModify[1])) {\n\t\t\t\t\t\tpartialModify[1] = nextModify[1].substr(0, insertPosition - nextModify[0]);\n\t\t\t\t\t\tnextModify[1] = nextModify[1].substr(insertPosition - nextModify[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpartialModify[1] = nextModify[1].splice(0, insertPosition - nextModify[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tnextModify[0] = insertPosition;\n\n\t\t\t\t\t// use the whole modify\n\t\t\t\t\tthis._op.operation = partialModify;\n\t\t\t\t} else {\n\t\t\t\t\t// use the whole modify\n\t\t\t\t\tthis._op.operation = nextModify;\n\n\t\t\t\t\t// Shift the internal index\n\t\t\t\t\tthis._currentIndices.modify++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`ArrayChangeSetIterator: ${MSG.UNKNOWN_OPERATION}`);\n\t\t}\n\t\tthis._atEnd = false;\n\t\treturn true;\n\t}\n\n\t/**\n\t * @returns true, if there are no more operations left\n\t */\n\tatEnd(): boolean {\n\t\treturn this._atEnd;\n\t}\n\n\tprivate _copyModifies(in_modifies: string[]) {\n\t\tif (!in_modifies || in_modifies.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst result = [];\n\t\tfor (let i = 0; i < in_modifies.length; i++) {\n\t\t\tresult.push([in_modifies[i][0], in_modifies[i][1].slice()]);\n\t\t}\n\t\treturn result;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAM1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA0D1B;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IAalC,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;IAED,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,YA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BACvB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,aAAa,CAAC;gBACpC,CAAC;qBAAM,CAAC;oBACP,uBAAuB;oBACvB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,UAAU,CAAC;oBAEhC,2BAA2B;oBAC3B,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;gBAC/B,CAAC;gBACD,MAAM;YACP,CAAC;YACD;gBACC,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAEO,aAAa,CAAC,WAAqB;QAC1C,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;;AA3NM,4BAAK,GAAG,2BAA2B,CAAC,CAAC,uEAAuE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Iterator to iterate over array ChangeSets\n */\n\nimport { constants } from \"@fluid-experimental/property-common\";\nimport isNumber from \"lodash/isNumber.js\";\nimport isString from \"lodash/isString.js\";\n\n// @ts-ignore\n\nimport { SerializedChangeSet } from \"../changeset.js\";\n\nimport { ArrayIteratorOperationTypes } from \"./operationTypes.js\";\n\nconst { MSG } = constants;\n\ntype genericArray = (number | string | (SerializedChangeSet & { typeid: string }))[];\nexport type arrayInsertList = [number, string | genericArray];\nexport type arrayModifyList =\n\t| [number, string | genericArray]\n\t| [number, string, string]\n\t| [number, genericArray, genericArray];\nexport type arrayRemoveList = [number, number | string | genericArray];\n\n/**\n * Description of an array operation\n */\nexport interface OperationDescription {\n\t_absoluteBegin?: number;\n\ttype?: ArrayIteratorOperationTypes;\n\toffset?: number;\n}\n\n/**\n * Description of an insert array operation\n */\nexport interface InsertOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.INSERT;\n\tremoveInsertOperation?: arrayInsertList;\n\toperation?: arrayInsertList;\n}\n\n/**\n * Description of a remove array operation\n */\nexport interface RemoveOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.REMOVE;\n\tremoveInsertOperation?: arrayRemoveList;\n\toperation?: arrayRemoveList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface ModifyOperation extends OperationDescription {\n\ttype: ArrayIteratorOperationTypes.MODIFY;\n\tremoveInsertOperation?: arrayModifyList;\n\toperation: arrayModifyList;\n}\n\n/**\n * Description of a modify array operation\n */\nexport interface NOPOperation\n\textends Omit<OperationDescription, \"removeInsertOperation\" | \"operation\"> {\n\ttype: ArrayIteratorOperationTypes.NOP;\n\toperation?: [];\n}\n\nexport type NoneNOPOperation = RemoveOperation | InsertOperation | ModifyOperation;\nexport type GenericOperation = NoneNOPOperation | NOPOperation;\n\n/**\n * Iterator class which iterates over an array ChangeSet. It will successively return the operations ordered by their\n * position within the array. Additionally, it will keep track of the modifications to the array indices caused\n * by the previous operations.\n * @internal\n */\nexport class ArrayChangeSetIterator {\n\tstatic types = ArrayIteratorOperationTypes; // @TODO Not sure if this is still required if we export it separately.\n\n\tprivate readonly _changeSet: SerializedChangeSet;\n\tprivate _copiedModifies: string | any[];\n\tprivate readonly _currentIndices: { insert: number; remove: number; modify: number };\n\tprivate _currentOffset: number;\n\tprivate _lastOperationIndex: number;\n\tprivate _lastOperationOffset: number;\n\n\tprivate _atEnd: boolean;\n\tprivate _op: GenericOperation;\n\n\tpublic get opDescription(): GenericOperation {\n\t\treturn this._op;\n\t}\n\n\tpublic get currentOffset(): number {\n\t\treturn this._currentOffset;\n\t}\n\n\tpublic get lastOperationIndex(): number {\n\t\treturn this._lastOperationIndex;\n\t}\n\n\tpublic get lastOperationOffset(): number {\n\t\treturn this._lastOperationOffset;\n\t}\n\n\t/**\n\t * @param in_changeSet - The ChangeSet to iterate over (this has to be an array ChangeSet\n\t */\n\tconstructor(in_changeSet: SerializedChangeSet) {\n\t\tthis._changeSet = in_changeSet;\n\t\t// if we need to chop overlapping modifies internally, so we have to copy them\n\t\t// we do this lazy and only if really needed\n\t\tthis._copiedModifies = in_changeSet.modify;\n\t\tthis._currentIndices = {\n\t\t\tinsert: 0,\n\t\t\tremove: 0,\n\t\t\tmodify: 0,\n\t\t};\n\n\t\tthis._currentOffset = 0;\n\t\tthis._lastOperationIndex = -1;\n\t\tthis._lastOperationOffset = 0;\n\t\tthis._atEnd = false;\n\n\t\tthis._op = {\n\t\t\ttype: ArrayIteratorOperationTypes.NOP,\n\t\t\toffset: 0,\n\t\t\toperation: undefined,\n\t\t};\n\n\t\t// go to the first element\n\t\tthis.next();\n\t}\n\n\t/**\n\t * Returns the next operation in the ChangeSet\n\t * @returns true, if there are operations left\n\t */\n\tnext(): boolean {\n\t\t// Find the smallest index in the operations lists\n\t\tlet currentIndex = Infinity;\n\t\tlet type: ArrayIteratorOperationTypes;\n\t\t(this._op as any).removeInsertOperation = undefined;\n\t\t// Process the current remove entry\n\t\tif (\n\t\t\tthis._changeSet.remove &&\n\t\t\tthis._currentIndices.remove < this._changeSet.remove.length\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.REMOVE;\n\t\t\tcurrentIndex = this._changeSet.remove[this._currentIndices.remove][0];\n\t\t\tlet currentLength = this._changeSet.remove[this._currentIndices.remove][1];\n\t\t\tif (!isNumber(currentLength)) {\n\t\t\t\tcurrentLength = currentLength.length;\n\t\t\t}\n\n\t\t\t// Check, whether this is a removeInsertOperation\n\t\t\tif (\n\t\t\t\tthis._changeSet.insert &&\n\t\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] <= currentIndex + currentLength\n\t\t\t) {\n\t\t\t\t(this._op as InsertOperation).removeInsertOperation =\n\t\t\t\t\tthis._changeSet.insert[this._currentIndices.insert];\n\t\t\t}\n\t\t}\n\n\t\t// Process the current insert entry (we prefer remove over insert, since this prevents the array from growing more\n\t\t// than necessary)\n\t\tif (\n\t\t\tthis._changeSet.insert &&\n\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] < currentIndex\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.INSERT;\n\t\t\tcurrentIndex = this._changeSet.insert[this._currentIndices.insert][0];\n\t\t}\n\n\t\t// Process the current modify entry\n\t\tif (\n\t\t\tthis._copiedModifies &&\n\t\t\tthis._currentIndices.modify < this._copiedModifies.length &&\n\t\t\tthis._copiedModifies[this._currentIndices.modify][0] < currentIndex\n\t\t) {\n\t\t\ttype = ArrayChangeSetIterator.types.MODIFY;\n\t\t}\n\n\t\tif (this._lastOperationIndex !== currentIndex) {\n\t\t\tthis._currentOffset += this._lastOperationOffset;\n\t\t\tthis._lastOperationIndex = currentIndex;\n\t\t\tthis._lastOperationOffset = 0;\n\t\t}\n\n\t\t// We have found nothing, so we are at the end of the ChangeSet\n\t\tif (type === undefined) {\n\t\t\tthis._op.type = ArrayChangeSetIterator.types.NOP;\n\t\t\tthis._op.offset = this._currentOffset;\n\t\t\tthis._op.operation = undefined;\n\t\t\tthis._atEnd = true;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Determine the return value and update the internal indices and offsets depending on the next operation\n\t\tswitch (type) {\n\t\t\tcase ArrayChangeSetIterator.types.INSERT:\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.INSERT;\n\t\t\t\t// Define the return value\n\t\t\t\tthis._op.operation = this._changeSet.insert[this._currentIndices.insert];\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// Update the current offset. For an insert we have to increase it by the number of the inserted elements\n\t\t\t\tthis._lastOperationOffset += (this._op.operation[1] as any).length;\n\n\t\t\t\t// Shift the internal index\n\t\t\t\tthis._currentIndices.insert++;\n\t\t\t\tbreak;\n\t\t\tcase ArrayChangeSetIterator.types.REMOVE:\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.REMOVE;\n\t\t\t\t// Define the return value\n\t\t\t\tthis._op.operation = this._changeSet.remove[this._currentIndices.remove];\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// Update the current offset. For a remove we have to decrement it by the number of the removed elements\n\t\t\t\tvar removedElements = isNumber(this._op.operation[1])\n\t\t\t\t\t? this._op.operation[1]\n\t\t\t\t\t: this._op.operation[1].length;\n\t\t\t\tthis._lastOperationOffset -= removedElements;\n\n\t\t\t\t// Shift the internal index\n\t\t\t\tthis._currentIndices.remove++;\n\t\t\t\tbreak;\n\t\t\tcase ArrayChangeSetIterator.types.MODIFY: {\n\t\t\t\tthis._op.type = ArrayChangeSetIterator.types.MODIFY;\n\t\t\t\tthis._op.offset = this._currentOffset;\n\t\t\t\t// check, if the modify's range overlaps with coming insert changes:\n\t\t\t\tlet nextModify = this._copiedModifies[this._currentIndices.modify];\n\t\t\t\tconst modifyEnd = nextModify[0] + nextModify[1].length;\n\t\t\t\tif (\n\t\t\t\t\tthis._changeSet.insert &&\n\t\t\t\t\tthis._currentIndices.insert < this._changeSet.insert.length &&\n\t\t\t\t\tthis._changeSet.insert[this._currentIndices.insert][0] < modifyEnd\n\t\t\t\t) {\n\t\t\t\t\t// we have an overlap and need to cut the modify\n\t\t\t\t\tconst insertPosition = this._changeSet.insert[this._currentIndices.insert][0];\n\n\t\t\t\t\t// if we haven't copied the change set's modifies yet, we need to do that now\n\t\t\t\t\tif (this._copiedModifies === this._changeSet.modify) {\n\t\t\t\t\t\tthis._copiedModifies = this._copyModifies(this._changeSet.modify);\n\t\t\t\t\t\t// now we need to update nextModify!\n\t\t\t\t\t\tnextModify = this._copiedModifies[this._currentIndices.modify];\n\t\t\t\t\t}\n\n\t\t\t\t\t// use modify only up to insert's position\n\n\t\t\t\t\t// build a partial modify and cut the remaining one:\n\t\t\t\t\tconst partialModify: arrayModifyList = [nextModify[0], undefined];\n\t\t\t\t\tif (isString(nextModify[1])) {\n\t\t\t\t\t\tpartialModify[1] = nextModify[1].substr(0, insertPosition - nextModify[0]);\n\t\t\t\t\t\tnextModify[1] = nextModify[1].substr(insertPosition - nextModify[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpartialModify[1] = nextModify[1].splice(0, insertPosition - nextModify[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tnextModify[0] = insertPosition;\n\n\t\t\t\t\t// use the whole modify\n\t\t\t\t\tthis._op.operation = partialModify;\n\t\t\t\t} else {\n\t\t\t\t\t// use the whole modify\n\t\t\t\t\tthis._op.operation = nextModify;\n\n\t\t\t\t\t// Shift the internal index\n\t\t\t\t\tthis._currentIndices.modify++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`ArrayChangeSetIterator: ${MSG.UNKNOWN_OPERATION}`);\n\t\t}\n\t\tthis._atEnd = false;\n\t\treturn true;\n\t}\n\n\t/**\n\t * @returns true, if there are no more operations left\n\t */\n\tatEnd(): boolean {\n\t\treturn this._atEnd;\n\t}\n\n\tprivate _copyModifies(in_modifies: string[]) {\n\t\tif (!in_modifies || in_modifies.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst result = [];\n\t\tfor (let i = 0; i < in_modifies.length; i++) {\n\t\t\tresult.push([in_modifies[i][0], in_modifies[i][1].slice()]);\n\t\t}\n\t\treturn result;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedCollection.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"indexedCollection.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAuC3F,yBAAiB,mCAAmC,CAAC;IACpD;;;;;;;;;;;;;OAaG;IACI,MAAM,6CAA6C,2BACjC,mBAAmB,6BAChB,mBAAmB,aACnC,MAAM,cACL,qBAAqB,SAsWjC,CAAC;IAEF;;;;;;;;;;;;;;;OAeG;IACI,MAAM,4CAA4C,4BAC/B,mBAAmB,8BAChB,mBAAmB,eAClC,MAAM,aACR,MAAM,8BACW,OAAO,iBACpB,YAAY,EAAE,cACjB,qBAAqB,SAuXjC,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,gCAAgC,uBACxB,mBAAmB,sBACnB,OAAO,SAyD3B,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OA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IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC5C,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC/C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;oBAChC,CAAC;gBACF,CAAC;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtC,CAAC;YACF,CAAC;QACF,CAAC;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;AACH,CAAC,EA90BgB,mCAAmC,KAAnC,mCAAmC,QA80BnD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\n\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport includes from \"lodash/includes.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isObject from \"lodash/isObject.js\";\nimport omit from \"lodash/omit.js\";\nimport without from \"lodash/without.js\";\n\n// @ts-ignore\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset.js\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper.js\";\nimport { PathHelper } from \"../pathHelper.js\";\n\nimport { ConflictType } from \"./changesetConflictTypes.js\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function (in_object: any): boolean {\n\tif (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n\t\treturn isEmpty(in_object);\n\t}\n\n\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\tfor (const _entry in in_object) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ChangeSetIndexedCollectionFunctions {\n\t/**\n\t * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n\t * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n\t * relative to the 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_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_options - Optional additional parameters\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _performApplyAfterOnPropertyIndexedCollection = function (\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\t// Handle remove entry operations\n\t\tif (in_appliedPropertyChanges.remove) {\n\t\t\t// Get and initialize the corresponding entries in the existing collection\n\t\t\tlet removedEntries = in_appliedPropertyChanges.remove;\n\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.remove =\n\t\t\t\tio_basePropertyChanges.remove ||\n\t\t\t\t(Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet done = false;\n\n\t\t\tif (!Array.isArray(removedEntries)) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tremovedEntries = Object.keys(removedEntries);\n\t\t\t\t} else {\n\t\t\t\t\t// this is a reversible change set of templated types\n\t\t\t\t\tconst removedTypes = Object.keys(removedEntries);\n\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\tconst removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]] &&\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]];\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\tif (\n\t\t\t\t\t\t\t\t\tbaseModified &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]] &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]];\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\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\t\tbaseRemoved.push(removedKeys[i]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!baseRemoved[removedTypes[t]]) {\n\t\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]] = {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]][removedKeys[i]] =\n\t\t\t\t\t\t\t\t\t\tremovedEntries[removedTypes[t]][removedKeys[i]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!done) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\n\t\t\t\t\t\t// If there is an insert for this key, we just remove it\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\tdelete baseInserted[key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tif (baseModified && baseModified[key] !== undefined) {\n\t\t\t\t\t\t\t\tdelete baseModified[key];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseRemoved[key] = in_appliedPropertyChanges.remove[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst baseInsertedTypeids = Object.keys(baseInserted);\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\t\t\t\t\t\tlet foundInTypeid;\n\n\t\t\t\t\t\t// Since we only have a flat remove list (without typeid) in the changeset, we have\n\t\t\t\t\t\t// to check all inserts\n\t\t\t\t\t\tfor (let j = 0; j < baseInsertedTypeids.length; j++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]] &&\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]][key] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfoundInTypeid = baseInsertedTypeids[j];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (foundInTypeid) {\n\t\t\t\t\t\t\t// If this key was inserted by this ChangeSet, we just remove it from the inserted list\n\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid][key];\n\n\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t// the whole typeid from the inserted or modified section\n\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tconst baseModifiedTypeids = Object.keys(baseModified || {});\n\t\t\t\t\t\t\tfor (let j = 0; j < baseModifiedTypeids.length; j++) {\n\t\t\t\t\t\t\t\tif (baseModified[baseModifiedTypeids[j]][key]) {\n\t\t\t\t\t\t\t\t\tfoundInTypeid = baseModifiedTypeids[j];\n\t\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid][key];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Apply insert operations\n\t\tif (in_appliedPropertyChanges.insert) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n\t\t\tlet baseInserted = io_basePropertyChanges.insert;\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\n\t\t\t// Insert the inserted entries\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst insertedTypeids = isPrimitiveTypeid\n\t\t\t\t? [undefined]\n\t\t\t\t: Object.keys(in_appliedPropertyChanges.insert);\n\t\t\tfor (let i = 0; i < insertedTypeids.length; i++) {\n\t\t\t\tlet typeid = insertedTypeids[i];\n\t\t\t\tconst insertedEntries = isPrimitiveTypeid\n\t\t\t\t\t? in_appliedPropertyChanges.insert\n\t\t\t\t\t: in_appliedPropertyChanges.insert[typeid];\n\t\t\t\tconst insertedKeys = Object.keys(insertedEntries);\n\t\t\t\tlet removalCS;\n\t\t\t\tif (baseRemoved) {\n\t\t\t\t\tremovalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n\t\t\t\t}\n\t\t\t\tfor (let j = 0; j < insertedKeys.length; j++) {\n\t\t\t\t\tlet key = insertedKeys[j];\n\t\t\t\t\tlet deeplyEqualCS = false;\n\n\t\t\t\t\t// If we have a complex type in the collection, we need to do a deep comparison of the two\n\t\t\t\t\t// ChangeSets to determine, whether they are equal\n\t\t\t\t\t// TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n\t\t\t\t\t// Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n\t\t\t\t\t// the insert is reinserting exactly what was removed.\n\t\t\t\t\tif (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\tisObject(removalCS) &&\n\t\t\t\t\t\tremovalCS[key] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Split out the two parts: all the keys other than remove/insert should match exactly.\n\t\t\t\t\t\t// The contents 'remove' and 'insert', if they exist, should also match.\n\t\t\t\t\t\tdeeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n\t\t\t\t\t\t// If there are 'insert' and 'remove', see if the removed data matches the inserted data\n\t\t\t\t\t\tif (deeplyEqualCS && insertedEntries[key].insert) {\n\t\t\t\t\t\t\tdeeplyEqualCS = isEqual(insertedEntries[key].insert, removalCS[key].remove);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Finally, check if the data being inserted matches the data that was removed\n\t\t\t\t\t\tconst insertedEntry = isObject(insertedEntries[key])\n\t\t\t\t\t\t\t? omit(insertedEntries[key], \"insert\")\n\t\t\t\t\t\t\t: insertedEntries[key];\n\t\t\t\t\t\tconst removedEntry = isObject(removalCS[key])\n\t\t\t\t\t\t\t? omit(removalCS[key], \"remove\")\n\t\t\t\t\t\t\t: removalCS[key];\n\t\t\t\t\t\tdeeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\t((Array.isArray(removalCS) && includes(baseRemoved, key)) ||\n\t\t\t\t\t\t\tremovalCS[key] !== undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// A remove and insert are combined into a modify for primitive types\n\n\t\t\t\t\t\t// Remove the old remove command\n\t\t\t\t\t\tlet oldValueMatches = false;\n\t\t\t\t\t\tif (Array.isArray(removalCS)) {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid] = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid],\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toldValueMatches = deeplyEqualCS || removalCS[key] === insertedEntries[key];\n\t\t\t\t\t\t\tdelete removalCS[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert a modify command instead\n\t\t\t\t\t\tif (!oldValueMatches) {\n\t\t\t\t\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[key] = insertedEntries[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] =\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] || {};\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n\t\t\t\t\t\tbaseInserted[key] = insertedEntries[key];\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\t(!baseInserted[typeid] || baseInserted[typeid][key] === undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tbaseInserted[typeid] = baseInserted[typeid] || {};\n\t\t\t\t\t\tbaseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle modification operations\n\t\tif (in_appliedPropertyChanges.modify) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tconst modifiedEntries = in_appliedPropertyChanges.modify;\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\n\t\t\t// Process the modifications\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n\t\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\t\tlet typeid = modifiedTypeids[i];\n\n\t\t\t\tconst modifyKeys = Object.keys(\n\t\t\t\t\tisPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid],\n\t\t\t\t);\n\t\t\t\tfor (let j = 0; j < modifyKeys.length; j++) {\n\t\t\t\t\tlet key = modifyKeys[j];\n\n\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\tlet newValue = modifiedEntries[key];\n\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tnewValue = newValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tbaseInserted[key] = newValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tbaseModified[key].value = newValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseModified[key] = newValue;\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\t// If this is a polymorphic collection, we can still have individual entries with\n\t\t\t\t\t\t// primitive types\n\t\t\t\t\t\tconst isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n\t\t\t\t\t\tif (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\tlet newValue = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tnewValue = modifiedEntries[typeid][key].value;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// In the case of Int64 or Uint64 we copy the array so that\n\t\t\t\t\t\t\t\t// both ChangeSets don't point to the same instance\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tnewValue = newValue.slice();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] &&\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].hasOwnProperty(\"value\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].value = newValue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] = newValue;\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\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If there was a previous modification operation, we have to merge the two\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tlet appliedVal = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = appliedVal.slice();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = modifiedEntries[typeid][key];\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\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseModified[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbaseModified[typeid] = baseModified[typeid] || {};\n\t\t\t\t\t\t\tbaseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Performs the rebase operation for set and map collections.\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for this collection.\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_useSquareBracketsInPath - If set to true, paths will be created using the angular brackets syntax (for\n\t * arrays), otherwise dots will be used (for NodeProperties).\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 * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _rebaseIndexedCollectionChangeSetForProperty = function (\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tin_typeid: string,\n\t\tin_useSquareBracketsInPath: boolean,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\tconst changesByKeys = {};\n\t\tlet modifyMap = {};\n\t\t// Helper function which stores the changes indexed by key in the changesByKeys array to\n\t\t// make it easier to compare the related changes in the two ChangeSets\n\t\tconst addChanges = function (\n\t\t\tin_collection: Record<string, any>,\n\t\t\tin_changeIdentifier: string,\n\t\t\tin_changePrefix: string,\n\t\t\tin_typeidChange?: string,\n\t\t) {\n\t\t\t// Collection didn't exist in this ChangeSet\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n\t\t\t// distinguish the two cases here\n\t\t\tconst keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n\t\t\t// Add all entries indexed with the key\n\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\tconst key = keys[j];\n\n\t\t\t\t// Store the type of the change\n\t\t\t\tchangesByKeys[key] = changesByKeys[key] || {};\n\t\t\t\tchangesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix]\n\t\t\t\t\t? `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}`\n\t\t\t\t\t: in_changeIdentifier;\n\n\t\t\t\t// If applicable store the typeid of the change\n\t\t\t\tif (in_typeidChange) {\n\t\t\t\t\tchangesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n\t\t\t\t}\n\n\t\t\t\t// Store the ChangeSet\n\t\t\t\tif (in_changePrefix === \"other\") {\n\t\t\t\t\tchangesByKeys[key].change = Array.isArray(in_collection) ? key : in_collection[key];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n\t\tconst addChangesWithTypeids = function (\n\t\t\tin_collection,\n\t\t\tin_changeIdentifier,\n\t\t\tin_changePrefix,\n\t\t) {\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Iterate over the typeids (or use dummy entry for the iteration\n\t\t\tconst addedKeyTypeids = Object.keys(in_collection);\n\t\t\tfor (let i = 0; i < addedKeyTypeids.length; i++) {\n\t\t\t\tconst Typeid = addedKeyTypeids[i];\n\t\t\t\taddChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n\t\t\t}\n\t\t};\n\n\t\t// Insert all changes from the ChangeSet into the lookup map\n\t\tif (Array.isArray(in_ownPropertyChangeSet.remove)) {\n\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t}\n\t\t}\n\n\t\tif (isPrimitiveTypeid) {\n\t\t\taddChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t} else {\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t}\n\n\t\t// Check for modifications that affect the same object\n\t\tconst changedKeys = Object.keys(changesByKeys);\n\t\tfor (let i = 0; i < changedKeys.length; i++) {\n\t\t\tconst key = changedKeys[i];\n\t\t\tconst newPath = in_useSquareBracketsInPath\n\t\t\t\t? `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]`\n\t\t\t\t: joinPaths(\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(key),\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t);\n\n\t\t\tconst modification = changesByKeys[key];\n\t\t\tif (modification.own && modification.other) {\n\t\t\t\t/*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n\t\t\t\t// A key was modified after it had been removed\n\t\t\t\tif (modification.own === \"modify\" && modification.other === \"modify\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisPrimitiveTypeid ||\n\t\t\t\t\t\t(TypeIdHelper.isPrimitiveType(modification.ownTypeid) &&\n\t\t\t\t\t\t\tmodification.ownTypeid !== \"String\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We have two modification operations that affect the same entry for a base type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflict\n\t\t\t\t\t\tlet ownModify = in_ownPropertyChangeSet.modify;\n\t\t\t\t\t\tlet rebasedModify = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\townModify = ownModify[modification.otherTypeid];\n\t\t\t\t\t\t\trebasedModify = rebasedModify[modification.otherTypeid];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: ownModify[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t\t// If value is the same, delete the entry\n\t\t\t\t\t\tlet ownValue = ownModify[key];\n\t\t\t\t\t\tif (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\townValue = ownValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet rebaseValue = rebasedModify[key];\n\t\t\t\t\t\tif (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\trebaseValue = rebaseValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Int64\" ||\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Uint64\" ||\n\t\t\t\t\t\t\townValue.length === 2\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// For (u)int64, values are arrays of 2 elements\n\t\t\t\t\t\t\tif (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (ownValue === rebaseValue) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\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\tthis.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[modification.ownTypeid],\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid],\n\t\t\t\t\t\t\tmodification.ownTypeid,\n\t\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"remove\" && modification.other === \"modify\") {\n\t\t\t\t\tmodifyMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.modify[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.modify;\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\tdelete modifyMap[key];\n\t\t\t\t} else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n\t\t\t\t\tif (!isPrimitiveTypeid) {\n\t\t\t\t\t\t// We have a conflicting change. A node was removed and inserted (replaced) in the original\n\t\t\t\t\t\t// ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n\t\t\t\t\t\t// can have been changed significantly by this operation, we don't know whether we can\n\t\t\t\t\t\t// apply the modification\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n\t\t\t\t\t\t\tconflictingChange:\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t(modification.own === \"modify\" || modification.own === \"remove\") &&\n\t\t\t\t\t(modification.other === \"remove\" || modification.other === \"remove_insert\")\n\t\t\t\t) {\n\t\t\t\t\tif (modification.own === \"modify\") {\n\t\t\t\t\t\tmodifyMap = modification.ownTypeid\n\t\t\t\t\t\t\t? in_ownPropertyChangeSet.modify[modification.ownTypeid]\n\t\t\t\t\t\t\t: in_ownPropertyChangeSet.modify;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.REMOVE_AFTER_MODIFY,\n\t\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have a duplicated delete, we remove it from the new ChangeSet\n\t\t\t\t\tif (modification.own === \"remove\") {\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"insert\" && modification.other === \"insert\") {\n\t\t\t\t\tif (isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(modification.ownTypeid)) {\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// We have two insert operations that affect the same key for a primitive type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflicting set\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Convert to modify\n\t\t\t\t\t\tlet oldValue;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodifyMap[key] = { value: insertMap[key], oldValue };\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n\t\t\t\t\t\t// just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"remove_insert\"\n\t\t\t\t) {\n\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t// Raise the duplicate inserts as a conflict\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t} else {\n\t\t\t\t\t// All other operations are conflicting changes, which only occur for ChangeSets that are relative\n\t\t\t\t\t// to different bases\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.INVALID_CHANGESET_BASE,\n\t\t\t\t\t\tconflictingChange: modification.change,\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Remove the change from the ChangeSet\n\t\t\t\t\tif (modification.other !== \"remove\") {\n\t\t\t\t\t\tif (modification.otherTypeid !== undefined) {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][\n\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove remove operations from the ChangeSet\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other] = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other],\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Removes empty entries from the .children collection of the ChangeSet\n\t *\n\t * @param in_propertyChanges - The ChangeSet to clean up\n\t * @param in_containsTypeids - Does this ChangeSet contain typeids\n\t * @private\n\t */\n\texport const _cleanIndexedCollectionChangeSet = function (\n\t\tin_propertyChanges: SerializedChangeSet,\n\t\tin_containsTypeids: boolean,\n\t) {\n\t\tconst changes = in_propertyChanges;\n\t\t// Clean inserts\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.insert || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n\t\t\t\t\tdelete changes.insert[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove add group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.insert)) {\n\t\t\tdelete changes.insert;\n\t\t}\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.remove || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n\t\t\t\t\tdelete changes.remove[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Remove remove group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.remove)) {\n\t\t\tdelete changes.remove;\n\t\t}\n\n\t\t// Clean modifies\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.modify || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tconst modifies = changes.modify[typeidList[j]];\n\t\t\t\tconst modifyKeys = Object.keys(modifies);\n\t\t\t\tfor (let k = 0; k < modifyKeys.length; k++) {\n\t\t\t\t\tif (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n\t\t\t\t\t\tdelete modifies[modifyKeys[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n\t\t\t\t\tdelete changes.modify[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove modify group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.modify)) {\n\t\t\tdelete changes.modify;\n\t\t}\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAU,SAAc;IAClD,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACpE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,8DAA8D;IAC9D,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,KAAW,mCAAmC,CA80BnD;AA90BD,WAAiB,mCAAmC;IACn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C,OAAO,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC;QAED,iBAAiB;QAEjB,sCAAsC;QACtC,IAAI,kBAAkB,EAAE,CAAC;YACxB,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC5C,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC/C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;oBAChC,CAAC;gBACF,CAAC;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtC,CAAC;YACF,CAAC;QACF,CAAC;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;AACH,CAAC,EA90BgB,mCAAmC,KAAnC,mCAAmC,QA80BnD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport includes from \"lodash/includes.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isObject from \"lodash/isObject.js\";\nimport omit from \"lodash/omit.js\";\nimport without from \"lodash/without.js\";\n\n// @ts-ignore\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset.js\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper.js\";\nimport { PathHelper } from \"../pathHelper.js\";\n\nimport { ConflictType } from \"./changesetConflictTypes.js\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function (in_object: any): boolean {\n\tif (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n\t\treturn isEmpty(in_object);\n\t}\n\n\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\tfor (const _entry in in_object) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ChangeSetIndexedCollectionFunctions {\n\t/**\n\t * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n\t * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n\t * relative to the 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_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_options - Optional additional parameters\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _performApplyAfterOnPropertyIndexedCollection = function (\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\t// Handle remove entry operations\n\t\tif (in_appliedPropertyChanges.remove) {\n\t\t\t// Get and initialize the corresponding entries in the existing collection\n\t\t\tlet removedEntries = in_appliedPropertyChanges.remove;\n\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.remove =\n\t\t\t\tio_basePropertyChanges.remove ||\n\t\t\t\t(Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet done = false;\n\n\t\t\tif (!Array.isArray(removedEntries)) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tremovedEntries = Object.keys(removedEntries);\n\t\t\t\t} else {\n\t\t\t\t\t// this is a reversible change set of templated types\n\t\t\t\t\tconst removedTypes = Object.keys(removedEntries);\n\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\tconst removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]] &&\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]];\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\tif (\n\t\t\t\t\t\t\t\t\tbaseModified &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]] &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]];\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\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\t\tbaseRemoved.push(removedKeys[i]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!baseRemoved[removedTypes[t]]) {\n\t\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]] = {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]][removedKeys[i]] =\n\t\t\t\t\t\t\t\t\t\tremovedEntries[removedTypes[t]][removedKeys[i]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!done) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\n\t\t\t\t\t\t// If there is an insert for this key, we just remove it\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\tdelete baseInserted[key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tif (baseModified && baseModified[key] !== undefined) {\n\t\t\t\t\t\t\t\tdelete baseModified[key];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseRemoved[key] = in_appliedPropertyChanges.remove[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst baseInsertedTypeids = Object.keys(baseInserted);\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\t\t\t\t\t\tlet foundInTypeid;\n\n\t\t\t\t\t\t// Since we only have a flat remove list (without typeid) in the changeset, we have\n\t\t\t\t\t\t// to check all inserts\n\t\t\t\t\t\tfor (let j = 0; j < baseInsertedTypeids.length; j++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]] &&\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]][key] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfoundInTypeid = baseInsertedTypeids[j];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (foundInTypeid) {\n\t\t\t\t\t\t\t// If this key was inserted by this ChangeSet, we just remove it from the inserted list\n\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid][key];\n\n\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t// the whole typeid from the inserted or modified section\n\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tconst baseModifiedTypeids = Object.keys(baseModified || {});\n\t\t\t\t\t\t\tfor (let j = 0; j < baseModifiedTypeids.length; j++) {\n\t\t\t\t\t\t\t\tif (baseModified[baseModifiedTypeids[j]][key]) {\n\t\t\t\t\t\t\t\t\tfoundInTypeid = baseModifiedTypeids[j];\n\t\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid][key];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Apply insert operations\n\t\tif (in_appliedPropertyChanges.insert) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n\t\t\tlet baseInserted = io_basePropertyChanges.insert;\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\n\t\t\t// Insert the inserted entries\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst insertedTypeids = isPrimitiveTypeid\n\t\t\t\t? [undefined]\n\t\t\t\t: Object.keys(in_appliedPropertyChanges.insert);\n\t\t\tfor (let i = 0; i < insertedTypeids.length; i++) {\n\t\t\t\tlet typeid = insertedTypeids[i];\n\t\t\t\tconst insertedEntries = isPrimitiveTypeid\n\t\t\t\t\t? in_appliedPropertyChanges.insert\n\t\t\t\t\t: in_appliedPropertyChanges.insert[typeid];\n\t\t\t\tconst insertedKeys = Object.keys(insertedEntries);\n\t\t\t\tlet removalCS;\n\t\t\t\tif (baseRemoved) {\n\t\t\t\t\tremovalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n\t\t\t\t}\n\t\t\t\tfor (let j = 0; j < insertedKeys.length; j++) {\n\t\t\t\t\tlet key = insertedKeys[j];\n\t\t\t\t\tlet deeplyEqualCS = false;\n\n\t\t\t\t\t// If we have a complex type in the collection, we need to do a deep comparison of the two\n\t\t\t\t\t// ChangeSets to determine, whether they are equal\n\t\t\t\t\t// TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n\t\t\t\t\t// Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n\t\t\t\t\t// the insert is reinserting exactly what was removed.\n\t\t\t\t\tif (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\tisObject(removalCS) &&\n\t\t\t\t\t\tremovalCS[key] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Split out the two parts: all the keys other than remove/insert should match exactly.\n\t\t\t\t\t\t// The contents 'remove' and 'insert', if they exist, should also match.\n\t\t\t\t\t\tdeeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n\t\t\t\t\t\t// If there are 'insert' and 'remove', see if the removed data matches the inserted data\n\t\t\t\t\t\tif (deeplyEqualCS && insertedEntries[key].insert) {\n\t\t\t\t\t\t\tdeeplyEqualCS = isEqual(insertedEntries[key].insert, removalCS[key].remove);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Finally, check if the data being inserted matches the data that was removed\n\t\t\t\t\t\tconst insertedEntry = isObject(insertedEntries[key])\n\t\t\t\t\t\t\t? omit(insertedEntries[key], \"insert\")\n\t\t\t\t\t\t\t: insertedEntries[key];\n\t\t\t\t\t\tconst removedEntry = isObject(removalCS[key])\n\t\t\t\t\t\t\t? omit(removalCS[key], \"remove\")\n\t\t\t\t\t\t\t: removalCS[key];\n\t\t\t\t\t\tdeeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\t((Array.isArray(removalCS) && includes(baseRemoved, key)) ||\n\t\t\t\t\t\t\tremovalCS[key] !== undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// A remove and insert are combined into a modify for primitive types\n\n\t\t\t\t\t\t// Remove the old remove command\n\t\t\t\t\t\tlet oldValueMatches = false;\n\t\t\t\t\t\tif (Array.isArray(removalCS)) {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid] = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid],\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toldValueMatches = deeplyEqualCS || removalCS[key] === insertedEntries[key];\n\t\t\t\t\t\t\tdelete removalCS[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert a modify command instead\n\t\t\t\t\t\tif (!oldValueMatches) {\n\t\t\t\t\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[key] = insertedEntries[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] =\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] || {};\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n\t\t\t\t\t\tbaseInserted[key] = insertedEntries[key];\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\t(!baseInserted[typeid] || baseInserted[typeid][key] === undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tbaseInserted[typeid] = baseInserted[typeid] || {};\n\t\t\t\t\t\tbaseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle modification operations\n\t\tif (in_appliedPropertyChanges.modify) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tconst modifiedEntries = in_appliedPropertyChanges.modify;\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\n\t\t\t// Process the modifications\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n\t\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\t\tlet typeid = modifiedTypeids[i];\n\n\t\t\t\tconst modifyKeys = Object.keys(\n\t\t\t\t\tisPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid],\n\t\t\t\t);\n\t\t\t\tfor (let j = 0; j < modifyKeys.length; j++) {\n\t\t\t\t\tlet key = modifyKeys[j];\n\n\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\tlet newValue = modifiedEntries[key];\n\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tnewValue = newValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tbaseInserted[key] = newValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tbaseModified[key].value = newValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseModified[key] = newValue;\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\t// If this is a polymorphic collection, we can still have individual entries with\n\t\t\t\t\t\t// primitive types\n\t\t\t\t\t\tconst isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n\t\t\t\t\t\tif (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\tlet newValue = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tnewValue = modifiedEntries[typeid][key].value;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// In the case of Int64 or Uint64 we copy the array so that\n\t\t\t\t\t\t\t\t// both ChangeSets don't point to the same instance\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tnewValue = newValue.slice();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] &&\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].hasOwnProperty(\"value\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].value = newValue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] = newValue;\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\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If there was a previous modification operation, we have to merge the two\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tlet appliedVal = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = appliedVal.slice();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = modifiedEntries[typeid][key];\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\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseModified[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbaseModified[typeid] = baseModified[typeid] || {};\n\t\t\t\t\t\t\tbaseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Performs the rebase operation for set and map collections.\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for this collection.\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_useSquareBracketsInPath - If set to true, paths will be created using the angular brackets syntax (for\n\t * arrays), otherwise dots will be used (for NodeProperties).\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 * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _rebaseIndexedCollectionChangeSetForProperty = function (\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tin_typeid: string,\n\t\tin_useSquareBracketsInPath: boolean,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\tconst changesByKeys = {};\n\t\tlet modifyMap = {};\n\t\t// Helper function which stores the changes indexed by key in the changesByKeys array to\n\t\t// make it easier to compare the related changes in the two ChangeSets\n\t\tconst addChanges = function (\n\t\t\tin_collection: Record<string, any>,\n\t\t\tin_changeIdentifier: string,\n\t\t\tin_changePrefix: string,\n\t\t\tin_typeidChange?: string,\n\t\t) {\n\t\t\t// Collection didn't exist in this ChangeSet\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n\t\t\t// distinguish the two cases here\n\t\t\tconst keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n\t\t\t// Add all entries indexed with the key\n\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\tconst key = keys[j];\n\n\t\t\t\t// Store the type of the change\n\t\t\t\tchangesByKeys[key] = changesByKeys[key] || {};\n\t\t\t\tchangesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix]\n\t\t\t\t\t? `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}`\n\t\t\t\t\t: in_changeIdentifier;\n\n\t\t\t\t// If applicable store the typeid of the change\n\t\t\t\tif (in_typeidChange) {\n\t\t\t\t\tchangesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n\t\t\t\t}\n\n\t\t\t\t// Store the ChangeSet\n\t\t\t\tif (in_changePrefix === \"other\") {\n\t\t\t\t\tchangesByKeys[key].change = Array.isArray(in_collection) ? key : in_collection[key];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n\t\tconst addChangesWithTypeids = function (\n\t\t\tin_collection,\n\t\t\tin_changeIdentifier,\n\t\t\tin_changePrefix,\n\t\t) {\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Iterate over the typeids (or use dummy entry for the iteration\n\t\t\tconst addedKeyTypeids = Object.keys(in_collection);\n\t\t\tfor (let i = 0; i < addedKeyTypeids.length; i++) {\n\t\t\t\tconst Typeid = addedKeyTypeids[i];\n\t\t\t\taddChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n\t\t\t}\n\t\t};\n\n\t\t// Insert all changes from the ChangeSet into the lookup map\n\t\tif (Array.isArray(in_ownPropertyChangeSet.remove)) {\n\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t}\n\t\t}\n\n\t\tif (isPrimitiveTypeid) {\n\t\t\taddChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t} else {\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t}\n\n\t\t// Check for modifications that affect the same object\n\t\tconst changedKeys = Object.keys(changesByKeys);\n\t\tfor (let i = 0; i < changedKeys.length; i++) {\n\t\t\tconst key = changedKeys[i];\n\t\t\tconst newPath = in_useSquareBracketsInPath\n\t\t\t\t? `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]`\n\t\t\t\t: joinPaths(\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(key),\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t\t);\n\n\t\t\tconst modification = changesByKeys[key];\n\t\t\tif (modification.own && modification.other) {\n\t\t\t\t/*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n\t\t\t\t// A key was modified after it had been removed\n\t\t\t\tif (modification.own === \"modify\" && modification.other === \"modify\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisPrimitiveTypeid ||\n\t\t\t\t\t\t(TypeIdHelper.isPrimitiveType(modification.ownTypeid) &&\n\t\t\t\t\t\t\tmodification.ownTypeid !== \"String\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We have two modification operations that affect the same entry for a base type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflict\n\t\t\t\t\t\tlet ownModify = in_ownPropertyChangeSet.modify;\n\t\t\t\t\t\tlet rebasedModify = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\townModify = ownModify[modification.otherTypeid];\n\t\t\t\t\t\t\trebasedModify = rebasedModify[modification.otherTypeid];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: ownModify[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t\t// If value is the same, delete the entry\n\t\t\t\t\t\tlet ownValue = ownModify[key];\n\t\t\t\t\t\tif (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\townValue = ownValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet rebaseValue = rebasedModify[key];\n\t\t\t\t\t\tif (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\trebaseValue = rebaseValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Int64\" ||\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Uint64\" ||\n\t\t\t\t\t\t\townValue.length === 2\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// For (u)int64, values are arrays of 2 elements\n\t\t\t\t\t\t\tif (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (ownValue === rebaseValue) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\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\tthis.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[modification.ownTypeid],\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid],\n\t\t\t\t\t\t\tmodification.ownTypeid,\n\t\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"remove\" && modification.other === \"modify\") {\n\t\t\t\t\tmodifyMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.modify[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.modify;\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\tdelete modifyMap[key];\n\t\t\t\t} else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n\t\t\t\t\tif (!isPrimitiveTypeid) {\n\t\t\t\t\t\t// We have a conflicting change. A node was removed and inserted (replaced) in the original\n\t\t\t\t\t\t// ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n\t\t\t\t\t\t// can have been changed significantly by this operation, we don't know whether we can\n\t\t\t\t\t\t// apply the modification\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n\t\t\t\t\t\t\tconflictingChange:\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t(modification.own === \"modify\" || modification.own === \"remove\") &&\n\t\t\t\t\t(modification.other === \"remove\" || modification.other === \"remove_insert\")\n\t\t\t\t) {\n\t\t\t\t\tif (modification.own === \"modify\") {\n\t\t\t\t\t\tmodifyMap = modification.ownTypeid\n\t\t\t\t\t\t\t? in_ownPropertyChangeSet.modify[modification.ownTypeid]\n\t\t\t\t\t\t\t: in_ownPropertyChangeSet.modify;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.REMOVE_AFTER_MODIFY,\n\t\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have a duplicated delete, we remove it from the new ChangeSet\n\t\t\t\t\tif (modification.own === \"remove\") {\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"insert\" && modification.other === \"insert\") {\n\t\t\t\t\tif (isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(modification.ownTypeid)) {\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// We have two insert operations that affect the same key for a primitive type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflicting set\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Convert to modify\n\t\t\t\t\t\tlet oldValue;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodifyMap[key] = { value: insertMap[key], oldValue };\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n\t\t\t\t\t\t// just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"remove_insert\"\n\t\t\t\t) {\n\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t// Raise the duplicate inserts as a conflict\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t} else {\n\t\t\t\t\t// All other operations are conflicting changes, which only occur for ChangeSets that are relative\n\t\t\t\t\t// to different bases\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.INVALID_CHANGESET_BASE,\n\t\t\t\t\t\tconflictingChange: modification.change,\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Remove the change from the ChangeSet\n\t\t\t\t\tif (modification.other !== \"remove\") {\n\t\t\t\t\t\tif (modification.otherTypeid !== undefined) {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][\n\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove remove operations from the ChangeSet\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other] = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other],\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Removes empty entries from the .children collection of the ChangeSet\n\t *\n\t * @param in_propertyChanges - The ChangeSet to clean up\n\t * @param in_containsTypeids - Does this ChangeSet contain typeids\n\t * @private\n\t */\n\texport const _cleanIndexedCollectionChangeSet = function (\n\t\tin_propertyChanges: SerializedChangeSet,\n\t\tin_containsTypeids: boolean,\n\t) {\n\t\tconst changes = in_propertyChanges;\n\t\t// Clean inserts\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.insert || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n\t\t\t\t\tdelete changes.insert[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove add group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.insert)) {\n\t\t\tdelete changes.insert;\n\t\t}\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.remove || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n\t\t\t\t\tdelete changes.remove[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Remove remove group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.remove)) {\n\t\t\tdelete changes.remove;\n\t\t}\n\n\t\t// Clean modifies\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.modify || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tconst modifies = changes.modify[typeidList[j]];\n\t\t\t\tconst modifyKeys = Object.keys(modifies);\n\t\t\t\tfor (let k = 0; k < modifyKeys.length; k++) {\n\t\t\t\t\tif (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n\t\t\t\t\t\tdelete modifies[modifyKeys[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n\t\t\t\t\tdelete changes.modify[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove modify group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.modify)) {\n\t\t\tdelete changes.modify;\n\t\t}\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateValidator.d.ts","sourceRoot":"","sources":["../src/templateValidator.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"templateValidator.d.ts","sourceRoot":"","sources":["../src/templateValidator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,EAAE,sBAAsB,EAA2B,MAAM,8BAA8B,CAAC;AAM/F,KAAK,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;AAEhD,KAAK,YAAY,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,KAAK,cAAc,GAAG,YAAY,EAAE,CAAC;AAErC,MAAM,WAAW,cAAc;IAC9B,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE;QAAE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