@fluid-experimental/property-changeset 2.70.0 → 2.72.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.
Files changed (31) hide show
  1. package/dist/changeset.d.ts.map +1 -1
  2. package/dist/changeset.js.map +1 -1
  3. package/dist/changeset_operations/array.d.ts.map +1 -1
  4. package/dist/changeset_operations/array.js.map +1 -1
  5. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  6. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  7. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  8. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  9. package/dist/pathHelper.d.ts +1 -1
  10. package/dist/pathHelper.js.map +1 -1
  11. package/dist/templateValidator.d.ts.map +1 -1
  12. package/dist/templateValidator.js.map +1 -1
  13. package/dist/test/tsconfig.cjs.tsbuildinfo +1 -1
  14. package/dist/utils.d.ts.map +1 -1
  15. package/dist/utils.js.map +1 -1
  16. package/lib/changeset.d.ts.map +1 -1
  17. package/lib/changeset.js.map +1 -1
  18. package/lib/changeset_operations/array.d.ts.map +1 -1
  19. package/lib/changeset_operations/array.js.map +1 -1
  20. package/lib/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  21. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  22. package/lib/changeset_operations/indexedCollection.d.ts.map +1 -1
  23. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  24. package/lib/pathHelper.d.ts +1 -1
  25. package/lib/pathHelper.js.map +1 -1
  26. package/lib/templateValidator.d.ts.map +1 -1
  27. package/lib/templateValidator.js.map +1 -1
  28. package/lib/test/tsconfig.tsbuildinfo +1 -1
  29. package/lib/utils.d.ts.map +1 -1
  30. package/lib/utils.js.map +1 -1
  31. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"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AC,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;;AA5NF,wDA6NC;AA5NO,4BAAK,GAAG,+CAA2B,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
+ {"version":3,"file":"arrayChangesetIterator.js","sourceRoot":"","sources":["../../src/changeset_operations/arrayChangesetIterator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,yEAAgE;AAEhE,qEAA0C;AAC1C,qEAA0C;AAM1C,2DAAkE;AAElE,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AA0D1B;;;;;GAKG;AACH,MAAa,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,YAAY,YAAiC;QAC5C,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;QAC/B,8EAA8E;QAC9E,4CA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C,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;;AA5NF,wDA6NC;AA5NO,4BAAK,GAAG,+CAA2B,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 +1 @@
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
+ {"version":3,"file":"indexedCollection.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,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":"indexed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,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,IAAA,sCAAgB,EAAC,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,mDAAnC,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
+ {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,yEAA2E;AAE3E,uEAA4C;AAC5C,qEAA0C;AAC1C,mEAAwC;AACxC,mEAAwC;AACxC,qEAA0C;AAC1C,6DAAkC;AAClC,mEAAwC;AAIxC,gEAA0D;AAC1D,oDAA8C;AAE9C,2EAA2D;AAC3D,+DAAyD;AAEzD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAU,SAAc;IAClD,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAA,qBAAQ,EAAC,SAAS,CAAC,EAAE,CAAC;QACpE,OAAO,IAAA,oBAAO,EAAC,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,IAAiB,mCAAmC,CA80BnD;AA90BD,WAAiB,mCAAmC;IACnD;;;;;;;;;;;;;OAaG;IACU,iFAA6C,GAAG,UAC5D,sBAA2C,EAC3C,yBAA8C,EAC9C,SAAiB,EACjB,UAAiC;QAEjC,MAAM,iBAAiB,GAAG,8BAAY,C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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"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type PathTree = Map<String, PathTree>;
5
+ export type PathTree = Map<string, PathTree>;
6
6
  /**
7
7
  * Helper functions for string processing
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"pathHelper.js","sourceRoot":"","sources":["../src/pathHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,aAAa;AACb,yEAAgE;AAEhE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAInD;;;GAGG;AACH,2DAA2D;AAC3D,IAAiB,UAAU,CA6gB1B;AA7gBD,WAAiB,UAAU;IAC1B,MAAM,2BAA2B,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE3D;;;;OAIG;IACH,IAAY,WAWX;IAXD,WAAY,WAAW;QACtB,6CAA6C;QAC7C,yEAAkB,CAAA;QAClB,+CAA+C;QAC/C,2DAAW,CAAA;QACX,uCAAuC;QACvC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BAAc,QAUzB;IAOD;;;;;;;;;;;OAWG;IACU,0BAAe,GAAG,UAC9B,WAAmB,EACnB,QAAkB;QAElB,yEAAyE;QACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzC,OAAO;oBACN,cAAc,EAAE,cAAc,CAAC,aAAa;oBAC5C,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBACvB,CAAC;YACH,CAAC;QACF,CAAC;QACD,sEAAsE;QACtE,mDAAmD;QACnD,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,+DAA+D;YAC/D,OAAO;gBACN,cAAc,EAAE,cAAc,CAAC,cAAc;gBAC7C,QAAQ,EAAE,KAAK;aACf,CAAC;QACH,CAAC;QAED,yDAAyD;QACzD,OAAO;YACN,cAAc,EAAE,cAAc,CAAC,SAAS;YACxC,QAAQ,EAAE,KAAK;SACf,CAAC;IACH,CAAC,CAAC;AACH,CAAC,EA7gBgB,UAAU,0BAAV,UAAU,QA6gB1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions to work with path strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nexport type PathTree = Map<String, PathTree>;\n\n/**\n * Helper functions for string processing\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace PathHelper {\n\tconst RE_ALL_OPEN_SQUARE_BRACKETS = new RegExp(\"[[]\", \"g\");\n\n\t/**\n\t * Token Types\n\t * Type of the token in the path string\n\t * @internal\n\t */\n\texport enum TOKEN_TYPES {\n\t\t/** A normal path segment, separated via . */\n\t\tPATH_SEGMENT_TOKEN,\n\t\t/** An array path segment, separated via [ ] */\n\t\tARRAY_TOKEN,\n\t\t/** A / at the beginning of the path */\n\t\tPATH_ROOT_TOKEN,\n\t\t/** A * that indicates a dereferencing operation */ // note: reversed!\n\t\tDEREFERENCE_TOKEN,\n\t\t/** A ../ that indicates one step above the current path */\n\t\tRAISE_LEVEL_TOKEN,\n\t}\n\n\t/**\n\t * Tokenizes a path string\n\t *\n\t * @param in_path - The path string to divide into tokens\n\t * @param out_types - The types of the tokens\n\t *\n\t * @returns the tokens from the path string\n\t * @internal\n\t */\n\texport const tokenizePathString = function (\n\t\tin_path: string,\n\t\tout_types?: TOKEN_TYPES[],\n\t): string[] {\n\t\tconst tokens = [];\n\t\tlet currentToken = \"\";\n\n\t\tif (out_types) {\n\t\t\t// Make sure out_types is empty\n\t\t\tout_types.splice(0, out_types.length);\n\t\t}\n\n\t\t// Handle a / at the beginning of the path by adding a special token for it\n\t\tlet path_start = 0;\n\t\tif (in_path.startsWith(\"/\")) {\n\t\t\ttokens.push(\"/\");\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(TOKEN_TYPES.PATH_ROOT_TOKEN);\n\t\t\t}\n\t\t\tpath_start = 1;\n\t\t} else if (in_path.substr(0, 3) === \"../\") {\n\t\t\t// Handle relative paths by extracting the number steps above\n\t\t\tvar extractLevel = function (current_path) {\n\t\t\t\tif (current_path.substr(0, 3) === \"../\") {\n\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\tout_types.push(TOKEN_TYPES.RAISE_LEVEL_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t\ttokens.push(\"../\");\n\t\t\t\t\textractLevel(current_path.substr(3));\n\t\t\t\t\tpath_start = path_start + 3;\n\t\t\t\t}\n\t\t\t};\n\t\t\textractLevel(in_path);\n\t\t}\n\n\t\t// Let's see if the path is simple enough to use a fast-track algorithm.\n\t\tlet hackedPath = in_path.substr(path_start);\n\t\tif (\n\t\t\tin_path.indexOf(\"\\\\\") === -1 &&\n\t\t\tin_path.indexOf('\"') === -1 &&\n\t\t\tin_path.indexOf(\"*\") === -1\n\t\t) {\n\t\t\t// Yes, we can do something faster than parsing each character one by one.\n\t\t\tlet additionalTokens: string[] = [];\n\t\t\tconst additionalTypes = [];\n\t\t\tlet token: string | string[];\n\t\t\tlet i: number;\n\t\t\t// Hack for simplicity, let's first replace all occurences of '[' by '.['\n\t\t\thackedPath = hackedPath.replace(RE_ALL_OPEN_SQUARE_BRACKETS, \".[\");\n\t\t\t// Then split on '.'\n\t\t\tadditionalTokens = hackedPath.split(\".\");\n\t\t\t// And validate each token.\n\t\t\tfor (i = 0; i < additionalTokens.length; ++i) {\n\t\t\t\ttoken = additionalTokens[i];\n\t\t\t\t// Empty tokens are considered errors... but shouldn't '' be a valid name?\n\t\t\t\tif (token.length === 0) {\n\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (token.startsWith(\"[\")) {\n\t\t\t\t\tif (token.length > 2 && token.endsWith(\"]\")) {\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.ARRAY_TOKEN);\n\t\t\t\t\t\tadditionalTokens[i] = token.substr(1, token.length - 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (token.indexOf(\"]\") !== -1) {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// It was a simple property name.\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i === additionalTokens.length) {\n\t\t\t\t// Parsed everything successfully so end function here.\n\t\t\t\tif (out_types) {\n\t\t\t\t\tfor (i = 0; i < additionalTypes.length; i++) {\n\t\t\t\t\t\tout_types.push(additionalTypes[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn tokens.concat(additionalTokens);\n\t\t\t}\n\t\t}\n\n\t\tlet inSquareBrackets = false;\n\t\tlet tokenStarted = false;\n\t\tlet lastTokenWasQuoted = false;\n\n\t\t// We are in a context where an empty token is valid\n\t\tlet atStartToken = false;\n\t\tlet allowSegmentStart = true;\n\n\t\tconst storeNextToken = function (tokenType) {\n\t\t\t// Make sure, this is not an empty token (E.g. a .. or a [] )\n\t\t\tif (!tokenStarted) {\n\t\t\t\tif (!atStartToken) {\n\t\t\t\t\tthrow new Error(MSG.EMPTY_TOKEN + in_path);\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store the token\n\t\t\ttokens.push(currentToken);\n\t\t\tcurrentToken = \"\";\n\t\t\ttokenStarted = false;\n\t\t\tatStartToken = false;\n\t\t\tlastTokenWasQuoted = false;\n\t\t\tallowSegmentStart = false;\n\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(tokenType);\n\t\t\t}\n\t\t};\n\n\t\tfor (var i = path_start; i < in_path.length; i++) {\n\t\t\tconst character = in_path[i];\n\n\t\t\tif (character === '\"') {\n\t\t\t\t// If we encounter a quotation mark, we start parsing the\n\t\t\t\t// quoted section\n\t\t\t\tif (!tokenStarted) {\n\t\t\t\t\tlet endFound = false;\n\n\t\t\t\t\t// Read the quoted token\n\t\t\t\t\tfor (i++; i < in_path.length; i++) {\n\t\t\t\t\t\tif (in_path[i] === '\"') {\n\t\t\t\t\t\t\t// We have found the end of the quoted token\n\t\t\t\t\t\t\tendFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (in_path[i] === \"\\\\\") {\n\t\t\t\t\t\t\t// Read an escaped symbol\n\t\t\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t\t\tif (in_path[i + 1] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tcurrentToken += \"\\\\\";\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else if (in_path[i + 1] === '\"') {\n\t\t\t\t\t\t\t\t\tcurrentToken += '\"';\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\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\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Everything else is just added to the token\n\t\t\t\t\t\t\tcurrentToken += in_path[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endFound) {\n\t\t\t\t\t\tthrow new Error(MSG.UNCLOSED_QUOTATION_MARKS + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tlastTokenWasQuoted = true;\n\t\t\t\t\ttokenStarted = true;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t}\n\t\t\t} else if (!inSquareBrackets) {\n\t\t\t\tswitch (character) {\n\t\t\t\t\tcase PROPERTY_PATH_DELIMITER: {\n\t\t\t\t\t\t// A dot symbols starts a new token\n\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\n\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"[\": {\n\t\t\t\t\t\t// An opening square bracket starts a new token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// And sets the state to inSquareBrackets\n\t\t\t\t\t\tinSquareBrackets = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"]\": {\n\t\t\t\t\t\tthrow new Error(MSG.CLOSING_BRACKET_WITHOUT_OPENING + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tcase \"*\": {\n\t\t\t\t\t\t// Store the last token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Create a new dereference token\n\t\t\t\t\t\ttokens.push(\"*\");\n\t\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\t\tout_types.push(TOKEN_TYPES.DEREFERENCE_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Reset the token started flag\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t\tatStartToken = true;\n\t\t\t\t\t\tallowSegmentStart = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tif (!tokenStarted && !allowSegmentStart && !inSquareBrackets) {\n\t\t\t\t\t\t\tthrow new Error(MSG.MISSING_DOT_AT_SEGMENT_START + in_path);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (character === \"]\") {\n\t\t\t\t\t// A closing square bracket starts a new token\n\t\t\t\t\tstoreNextToken(TOKEN_TYPES.ARRAY_TOKEN);\n\n\t\t\t\t\t// We now have to check the next character,\n\t\t\t\t\t// as only the combinations '][' and '].' are\n\t\t\t\t\t// valid\n\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t// We only have to check this at the end of the string\n\t\t\t\t\t\tif (in_path[i + 1] === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\t\t\t// We are no longer in square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"[\") {\n\t\t\t\t\t\t\t// We remain in square brackets\n\t\t\t\t\t\t\t// so inSquareBrackets remains true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"*\") {\n\t\t\t\t\t\t\t// We leave the square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_END_OF_SQUARE_BRACKETS + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (character === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\tthrow new Error(MSG.DOTS_IN_SQUARE_BRACKETS + in_path);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At the end of the path we have to distinguish a few error cases\n\t\tif (inSquareBrackets) {\n\t\t\t// There was a un-closed bracket at the end\n\t\t\tthrow new Error(MSG.UNCLOSED_BRACKETS + in_path);\n\t\t} else if (in_path.endsWith(PROPERTY_PATH_DELIMITER)) {\n\t\t\t// A path ended with a PROPERTY_PATH_DELIMITER\n\t\t\tthrow new Error(MSG.DOT_AT_END + in_path);\n\t\t} else if (tokenStarted) {\n\t\t\t// There was a valid, not yet ended token\n\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t}\n\n\t\treturn tokens;\n\t};\n\n\t/**\n\t * Creates a quoted string for a path seqment to make sure it parses correctly\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegment = function (in_pathSegment: string): string {\n\t\t// WARNING: I use RegExps here, as the normal replace\n\t\t// function only replaces the first occurrence\n\n\t\t// First we escape escape symbols\n\t\tin_pathSegment = in_pathSegment.replace(/\\\\/g, \"\\\\\\\\\");\n\n\t\t// Then we escape quotes\n\t\tin_pathSegment = in_pathSegment.replace(/\"/g, '\\\\\"');\n\n\t\t// And finally, we put the string into quotation marks\n\t\treturn `\"${in_pathSegment}\"`;\n\t};\n\n\t/**\n\t * Reverse a quoted/escaped string for a path seqment\n\t *\n\t * @param in_quotedPathSegment - The quoted/escaped path string to put in quotes\n\t *\n\t * @return unquoted path string\n\t * @internal\n\t */\n\texport const unquotePathSegment = function (in_quotedPathSegment: string): string {\n\t\tif (typeof in_quotedPathSegment !== \"string\") {\n\t\t\tthrow new TypeError(`Expecting a string as a path: ${in_quotedPathSegment}`);\n\t\t}\n\n\t\tif (in_quotedPathSegment.startsWith('\"') && in_quotedPathSegment.endsWith('\"')) {\n\t\t\t// We remove double quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.substr(1, in_quotedPathSegment.length - 2);\n\n\t\t\t// Then we unescape escape symbols\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\\\\/g, \"\\\\\");\n\n\t\t\t// Then we unescape quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\"/g, '\"');\n\t\t}\n\n\t\treturn in_quotedPathSegment;\n\t};\n\n\t/**\n\t * Adds quotation marks to a path string if they are needed\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegmentIfNeeded = function (in_pathSegment: string): string {\n\t\treturn in_pathSegment.indexOf(PROPERTY_PATH_DELIMITER) !== -1 ||\n\t\t\tin_pathSegment.indexOf('\"') !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"\\\\\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"/\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"*\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"[\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"]\") !== -1 ||\n\t\t\tin_pathSegment.length === 0\n\t\t\t? quotePathSegment(in_pathSegment)\n\t\t\t: in_pathSegment;\n\t};\n\n\t/**\n\t * This function checks, whether the supplied path is a valid repository absolute path.\n\t *\n\t * It has to be either an empty string, or a path starting with a /\n\t *\n\t * @param in_path - The path to check\n\t * @internal\n\t */\n\texport const checkValidRepositoryAbsolutePath = function (in_path: string) {\n\t\tif (\n\t\t\tin_path !== \"\" && // either an empty reference\n\t\t\t!in_path.startsWith(\"/\")\n\t\t) {\n\t\t\t// or an absolute path starting with /\n\t\t\tthrow new Error(MSG.INVALID_PATH_IN_REFERENCE);\n\t\t}\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of an absolute property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_absolutePath - The absolute path to make canonical\n\t * @return Absolute path in canonical form\n\t * @internal\n\t */\n\texport const convertAbsolutePathToCanonical = function (in_absolutePath: string): string {\n\t\tconst tokenTypes = [];\n\t\tconst tokens = tokenizePathString(in_absolutePath, tokenTypes);\n\t\tlet path = \"\";\n\t\tfor (let i = 0; i < tokenTypes.length; i++) {\n\t\t\tconst tokenType = tokenTypes[i];\n\t\t\tswitch (tokenType) {\n\t\t\t\tcase TOKEN_TYPES.PATH_ROOT_TOKEN:\n\t\t\t\t\t// Skip the leading '/'\n\t\t\t\t\tbreak;\n\t\t\t\tcase TOKEN_TYPES.RAISE_LEVEL_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No level up (\"../\") is expected in an absolute path: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.DEREFERENCE_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Dereference (\"*\") is not supported in canonical paths: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.ARRAY_TOKEN:\n\t\t\t\tcase TOKEN_TYPES.PATH_SEGMENT_TOKEN:\n\t\t\t\t\tpath += PROPERTY_PATH_DELIMITER + quotePathSegmentIfNeeded(tokens[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Removes the leading PROPERTY_PATH_DELIMITER.\n\t\tif (path) {\n\t\t\tpath = path.substring(1);\n\t\t}\n\t\treturn path;\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of a child property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_parentAbsolutePathCanonical - The absolute path of the parent property in canonical form\n\t * @param in_childId - The name of the child property in its parent\n\t * @returns Absolute path of the child property in canonical form\n\t * @internal\n\t */\n\texport const getChildAbsolutePathCanonical = function (\n\t\tin_parentAbsolutePathCanonical: string,\n\t\tin_childId: string,\n\t): string {\n\t\tconst childPath = quotePathSegmentIfNeeded(String(in_childId));\n\t\treturn in_parentAbsolutePathCanonical\n\t\t\t? in_parentAbsolutePathCanonical + PROPERTY_PATH_DELIMITER + childPath\n\t\t\t: childPath;\n\t};\n\n\t/**\n\t * @internal\n\t */\n\texport enum CoverageExtent {\n\t\t// The base path is not covered by any path from a given list of paths.\n\t\t// This means a property with this path and all its children would not be covered.\n\t\tUNCOVERED,\n\t\t// The base path is partially covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered, but some of its children could be uncovered.\n\t\tPARTLY_COVERED,\n\t\t// The base path is fully covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered and all of its children would be covered also.\n\t\tFULLY_COVERED,\n\t}\n\n\tinterface BasePathCoverage {\n\t\tcoverageExtent: CoverageExtent;\n\t\tpathList: string[];\n\t}\n\n\t/**\n\t * Determines if the base path is covered by the given list of paths. From that you can deduce if a\n\t * property with that path and all its children are covered by the given list of paths.\n\t *\n\t * This function uses the canonical representation of the property paths.\n\t *\n\t * @param in_basePath - The property's absolute path in canonical form\n\t * @param in_paths - The array of paths that must cover the property and its children\n\t * @returns The coverage of the property and its children. For a coverage of\n\t * 'FULLY_COVERED', only the first matching path is returned.\n\t * @internal\n\t */\n\texport const getPathCoverage = function (\n\t\tin_basePath: string,\n\t\tin_paths: string[],\n\t): BasePathCoverage {\n\t\t// First, check if the base path is entirely included in one of the paths\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_basePath.startsWith(in_paths[i])) {\n\t\t\t\treturn {\n\t\t\t\t\tcoverageExtent: CoverageExtent.FULLY_COVERED,\n\t\t\t\t\tpathList: [in_paths[i]],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t// We did not find a path including all the children of this insertion\n\t\t// Let's check if there are paths going through it.\n\t\tconst paths = [];\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_paths[i].startsWith(in_basePath)) {\n\t\t\t\tpaths.push(in_paths[i]);\n\t\t\t}\n\t\t}\n\t\tif (paths.length) {\n\t\t\t// We found at least one path including parts of the base path.\n\t\t\treturn {\n\t\t\t\tcoverageExtent: CoverageExtent.PARTLY_COVERED,\n\t\t\t\tpathList: paths,\n\t\t\t};\n\t\t}\n\n\t\t// We did not find any path covering the given base path.\n\t\treturn {\n\t\t\tcoverageExtent: CoverageExtent.UNCOVERED,\n\t\t\tpathList: paths,\n\t\t};\n\t};\n}\n"]}
1
+ {"version":3,"file":"pathHelper.js","sourceRoot":"","sources":["../src/pathHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,aAAa;AACb,yEAAgE;AAEhE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAInD;;;GAGG;AACH,2DAA2D;AAC3D,IAAiB,UAAU,CA6gB1B;AA7gBD,WAAiB,UAAU;IAC1B,MAAM,2BAA2B,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE3D;;;;OAIG;IACH,IAAY,WAWX;IAXD,WAAY,WAAW;QACtB,6CAA6C;QAC7C,yEAAkB,CAAA;QAClB,+CAA+C;QAC/C,2DAAW,CAAA;QACX,uCAAuC;QACvC,mEAAe,CAAA;QACf,mDAAmD,CAAC,kBAAkB;QACtE,uEAAiB,CAAA;QACjB,2DAA2D;QAC3D,uEAAiB,CAAA;IAClB,CAAC,EAXW,WAAW,GAAX,sBAAW,KAAX,sBAAW,QAWtB;IAED;;;;;;;;OAQG;IACU,6BAAkB,GAAG,UACjC,OAAe,EACf,SAAyB;QAEzB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,SAAS,EAAE,CAAC;YACf,+BAA+B;YAC/B,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACvC,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F,CAAC;QACD,sEAAsE;QACtE,mDAAmD;QACnD,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,+DAA+D;YAC/D,OAAO;gBACN,cAAc,EAAE,cAAc,CAAC,cAAc;gBAC7C,QAAQ,EAAE,KAAK;aACf,CAAC;QACH,CAAC;QAED,yDAAyD;QACzD,OAAO;YACN,cAAc,EAAE,cAAc,CAAC,SAAS;YACxC,QAAQ,EAAE,KAAK;SACf,CAAC;IACH,CAAC,CAAC;AACH,CAAC,EA7gBgB,UAAU,0BAAV,UAAU,QA6gB1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions to work with path strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\nexport type PathTree = Map<string, PathTree>;\n\n/**\n * Helper functions for string processing\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace PathHelper {\n\tconst RE_ALL_OPEN_SQUARE_BRACKETS = new RegExp(\"[[]\", \"g\");\n\n\t/**\n\t * Token Types\n\t * Type of the token in the path string\n\t * @internal\n\t */\n\texport enum TOKEN_TYPES {\n\t\t/** A normal path segment, separated via . */\n\t\tPATH_SEGMENT_TOKEN,\n\t\t/** An array path segment, separated via [ ] */\n\t\tARRAY_TOKEN,\n\t\t/** A / at the beginning of the path */\n\t\tPATH_ROOT_TOKEN,\n\t\t/** A * that indicates a dereferencing operation */ // note: reversed!\n\t\tDEREFERENCE_TOKEN,\n\t\t/** A ../ that indicates one step above the current path */\n\t\tRAISE_LEVEL_TOKEN,\n\t}\n\n\t/**\n\t * Tokenizes a path string\n\t *\n\t * @param in_path - The path string to divide into tokens\n\t * @param out_types - The types of the tokens\n\t *\n\t * @returns the tokens from the path string\n\t * @internal\n\t */\n\texport const tokenizePathString = function (\n\t\tin_path: string,\n\t\tout_types?: TOKEN_TYPES[],\n\t): string[] {\n\t\tconst tokens = [];\n\t\tlet currentToken = \"\";\n\n\t\tif (out_types) {\n\t\t\t// Make sure out_types is empty\n\t\t\tout_types.splice(0, out_types.length);\n\t\t}\n\n\t\t// Handle a / at the beginning of the path by adding a special token for it\n\t\tlet path_start = 0;\n\t\tif (in_path.startsWith(\"/\")) {\n\t\t\ttokens.push(\"/\");\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(TOKEN_TYPES.PATH_ROOT_TOKEN);\n\t\t\t}\n\t\t\tpath_start = 1;\n\t\t} else if (in_path.substr(0, 3) === \"../\") {\n\t\t\t// Handle relative paths by extracting the number steps above\n\t\t\tvar extractLevel = function (current_path) {\n\t\t\t\tif (current_path.substr(0, 3) === \"../\") {\n\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\tout_types.push(TOKEN_TYPES.RAISE_LEVEL_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t\ttokens.push(\"../\");\n\t\t\t\t\textractLevel(current_path.substr(3));\n\t\t\t\t\tpath_start = path_start + 3;\n\t\t\t\t}\n\t\t\t};\n\t\t\textractLevel(in_path);\n\t\t}\n\n\t\t// Let's see if the path is simple enough to use a fast-track algorithm.\n\t\tlet hackedPath = in_path.substr(path_start);\n\t\tif (\n\t\t\tin_path.indexOf(\"\\\\\") === -1 &&\n\t\t\tin_path.indexOf('\"') === -1 &&\n\t\t\tin_path.indexOf(\"*\") === -1\n\t\t) {\n\t\t\t// Yes, we can do something faster than parsing each character one by one.\n\t\t\tlet additionalTokens: string[] = [];\n\t\t\tconst additionalTypes = [];\n\t\t\tlet token: string | string[];\n\t\t\tlet i: number;\n\t\t\t// Hack for simplicity, let's first replace all occurences of '[' by '.['\n\t\t\thackedPath = hackedPath.replace(RE_ALL_OPEN_SQUARE_BRACKETS, \".[\");\n\t\t\t// Then split on '.'\n\t\t\tadditionalTokens = hackedPath.split(\".\");\n\t\t\t// And validate each token.\n\t\t\tfor (i = 0; i < additionalTokens.length; ++i) {\n\t\t\t\ttoken = additionalTokens[i];\n\t\t\t\t// Empty tokens are considered errors... but shouldn't '' be a valid name?\n\t\t\t\tif (token.length === 0) {\n\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (token.startsWith(\"[\")) {\n\t\t\t\t\tif (token.length > 2 && token.endsWith(\"]\")) {\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.ARRAY_TOKEN);\n\t\t\t\t\t\tadditionalTokens[i] = token.substr(1, token.length - 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (token.indexOf(\"]\") !== -1) {\n\t\t\t\t\t\t// There's an error somewhere. Let's abort the fast-track.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// It was a simple property name.\n\t\t\t\t\t\tadditionalTypes.push(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i === additionalTokens.length) {\n\t\t\t\t// Parsed everything successfully so end function here.\n\t\t\t\tif (out_types) {\n\t\t\t\t\tfor (i = 0; i < additionalTypes.length; i++) {\n\t\t\t\t\t\tout_types.push(additionalTypes[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn tokens.concat(additionalTokens);\n\t\t\t}\n\t\t}\n\n\t\tlet inSquareBrackets = false;\n\t\tlet tokenStarted = false;\n\t\tlet lastTokenWasQuoted = false;\n\n\t\t// We are in a context where an empty token is valid\n\t\tlet atStartToken = false;\n\t\tlet allowSegmentStart = true;\n\n\t\tconst storeNextToken = function (tokenType) {\n\t\t\t// Make sure, this is not an empty token (E.g. a .. or a [] )\n\t\t\tif (!tokenStarted) {\n\t\t\t\tif (!atStartToken) {\n\t\t\t\t\tthrow new Error(MSG.EMPTY_TOKEN + in_path);\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store the token\n\t\t\ttokens.push(currentToken);\n\t\t\tcurrentToken = \"\";\n\t\t\ttokenStarted = false;\n\t\t\tatStartToken = false;\n\t\t\tlastTokenWasQuoted = false;\n\t\t\tallowSegmentStart = false;\n\n\t\t\tif (out_types) {\n\t\t\t\tout_types.push(tokenType);\n\t\t\t}\n\t\t};\n\n\t\tfor (var i = path_start; i < in_path.length; i++) {\n\t\t\tconst character = in_path[i];\n\n\t\t\tif (character === '\"') {\n\t\t\t\t// If we encounter a quotation mark, we start parsing the\n\t\t\t\t// quoted section\n\t\t\t\tif (!tokenStarted) {\n\t\t\t\t\tlet endFound = false;\n\n\t\t\t\t\t// Read the quoted token\n\t\t\t\t\tfor (i++; i < in_path.length; i++) {\n\t\t\t\t\t\tif (in_path[i] === '\"') {\n\t\t\t\t\t\t\t// We have found the end of the quoted token\n\t\t\t\t\t\t\tendFound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (in_path[i] === \"\\\\\") {\n\t\t\t\t\t\t\t// Read an escaped symbol\n\t\t\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t\t\tif (in_path[i + 1] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tcurrentToken += \"\\\\\";\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else if (in_path[i + 1] === '\"') {\n\t\t\t\t\t\t\t\t\tcurrentToken += '\"';\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\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\tthrow new Error(MSG.INVALID_ESCAPE_SEQUENCE + in_path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Everything else is just added to the token\n\t\t\t\t\t\t\tcurrentToken += in_path[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!endFound) {\n\t\t\t\t\t\tthrow new Error(MSG.UNCLOSED_QUOTATION_MARKS + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tlastTokenWasQuoted = true;\n\t\t\t\t\ttokenStarted = true;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t}\n\t\t\t} else if (!inSquareBrackets) {\n\t\t\t\tswitch (character) {\n\t\t\t\t\tcase PROPERTY_PATH_DELIMITER: {\n\t\t\t\t\t\t// A dot symbols starts a new token\n\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\n\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"[\": {\n\t\t\t\t\t\t// An opening square bracket starts a new token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// And sets the state to inSquareBrackets\n\t\t\t\t\t\tinSquareBrackets = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"]\": {\n\t\t\t\t\t\tthrow new Error(MSG.CLOSING_BRACKET_WITHOUT_OPENING + in_path);\n\t\t\t\t\t}\n\t\t\t\t\tcase \"*\": {\n\t\t\t\t\t\t// Store the last token\n\t\t\t\t\t\tif (tokenStarted) {\n\t\t\t\t\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Create a new dereference token\n\t\t\t\t\t\ttokens.push(\"*\");\n\t\t\t\t\t\tif (out_types) {\n\t\t\t\t\t\t\tout_types.push(TOKEN_TYPES.DEREFERENCE_TOKEN);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Reset the token started flag\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t\tatStartToken = true;\n\t\t\t\t\t\tallowSegmentStart = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tif (!tokenStarted && !allowSegmentStart && !inSquareBrackets) {\n\t\t\t\t\t\t\tthrow new Error(MSG.MISSING_DOT_AT_SEGMENT_START + in_path);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (character === \"]\") {\n\t\t\t\t\t// A closing square bracket starts a new token\n\t\t\t\t\tstoreNextToken(TOKEN_TYPES.ARRAY_TOKEN);\n\n\t\t\t\t\t// We now have to check the next character,\n\t\t\t\t\t// as only the combinations '][' and '].' are\n\t\t\t\t\t// valid\n\t\t\t\t\tif (in_path.length > i + 1) {\n\t\t\t\t\t\t// We only have to check this at the end of the string\n\t\t\t\t\t\tif (in_path[i + 1] === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\t\t\t// We are no longer in square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t\tallowSegmentStart = true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"[\") {\n\t\t\t\t\t\t\t// We remain in square brackets\n\t\t\t\t\t\t\t// so inSquareBrackets remains true;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} else if (in_path[i + 1] === \"*\") {\n\t\t\t\t\t\t\t// We leave the square brackets\n\t\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error(MSG.INVALID_END_OF_SQUARE_BRACKETS + in_path);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinSquareBrackets = false;\n\t\t\t\t\t\ttokenStarted = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (character === PROPERTY_PATH_DELIMITER) {\n\t\t\t\t\tthrow new Error(MSG.DOTS_IN_SQUARE_BRACKETS + in_path);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentToken += character;\n\n\t\t\t\t\t// We have started parsing the token\n\t\t\t\t\ttokenStarted = true;\n\n\t\t\t\t\t// When a symbols appears after a closing quotation mark, we have an error\n\t\t\t\t\tif (lastTokenWasQuoted) {\n\t\t\t\t\t\tthrow new Error(MSG.QUOTES_WITHIN_TOKEN + in_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// At the end of the path we have to distinguish a few error cases\n\t\tif (inSquareBrackets) {\n\t\t\t// There was a un-closed bracket at the end\n\t\t\tthrow new Error(MSG.UNCLOSED_BRACKETS + in_path);\n\t\t} else if (in_path.endsWith(PROPERTY_PATH_DELIMITER)) {\n\t\t\t// A path ended with a PROPERTY_PATH_DELIMITER\n\t\t\tthrow new Error(MSG.DOT_AT_END + in_path);\n\t\t} else if (tokenStarted) {\n\t\t\t// There was a valid, not yet ended token\n\t\t\tstoreNextToken(TOKEN_TYPES.PATH_SEGMENT_TOKEN);\n\t\t}\n\n\t\treturn tokens;\n\t};\n\n\t/**\n\t * Creates a quoted string for a path seqment to make sure it parses correctly\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegment = function (in_pathSegment: string): string {\n\t\t// WARNING: I use RegExps here, as the normal replace\n\t\t// function only replaces the first occurrence\n\n\t\t// First we escape escape symbols\n\t\tin_pathSegment = in_pathSegment.replace(/\\\\/g, \"\\\\\\\\\");\n\n\t\t// Then we escape quotes\n\t\tin_pathSegment = in_pathSegment.replace(/\"/g, '\\\\\"');\n\n\t\t// And finally, we put the string into quotation marks\n\t\treturn `\"${in_pathSegment}\"`;\n\t};\n\n\t/**\n\t * Reverse a quoted/escaped string for a path seqment\n\t *\n\t * @param in_quotedPathSegment - The quoted/escaped path string to put in quotes\n\t *\n\t * @return unquoted path string\n\t * @internal\n\t */\n\texport const unquotePathSegment = function (in_quotedPathSegment: string): string {\n\t\tif (typeof in_quotedPathSegment !== \"string\") {\n\t\t\tthrow new TypeError(`Expecting a string as a path: ${in_quotedPathSegment}`);\n\t\t}\n\n\t\tif (in_quotedPathSegment.startsWith('\"') && in_quotedPathSegment.endsWith('\"')) {\n\t\t\t// We remove double quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.substr(1, in_quotedPathSegment.length - 2);\n\n\t\t\t// Then we unescape escape symbols\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\\\\/g, \"\\\\\");\n\n\t\t\t// Then we unescape quotes\n\t\t\tin_quotedPathSegment = in_quotedPathSegment.replace(/\\\\\"/g, '\"');\n\t\t}\n\n\t\treturn in_quotedPathSegment;\n\t};\n\n\t/**\n\t * Adds quotation marks to a path string if they are needed\n\t *\n\t * @param in_pathSegment - The path string to put in quotes\n\t *\n\t * @returns quoted path string\n\t * @internal\n\t */\n\texport const quotePathSegmentIfNeeded = function (in_pathSegment: string): string {\n\t\treturn in_pathSegment.indexOf(PROPERTY_PATH_DELIMITER) !== -1 ||\n\t\t\tin_pathSegment.indexOf('\"') !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"\\\\\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"/\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"*\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"[\") !== -1 ||\n\t\t\tin_pathSegment.indexOf(\"]\") !== -1 ||\n\t\t\tin_pathSegment.length === 0\n\t\t\t? quotePathSegment(in_pathSegment)\n\t\t\t: in_pathSegment;\n\t};\n\n\t/**\n\t * This function checks, whether the supplied path is a valid repository absolute path.\n\t *\n\t * It has to be either an empty string, or a path starting with a /\n\t *\n\t * @param in_path - The path to check\n\t * @internal\n\t */\n\texport const checkValidRepositoryAbsolutePath = function (in_path: string) {\n\t\tif (\n\t\t\tin_path !== \"\" && // either an empty reference\n\t\t\t!in_path.startsWith(\"/\")\n\t\t) {\n\t\t\t// or an absolute path starting with /\n\t\t\tthrow new Error(MSG.INVALID_PATH_IN_REFERENCE);\n\t\t}\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of an absolute property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_absolutePath - The absolute path to make canonical\n\t * @return Absolute path in canonical form\n\t * @internal\n\t */\n\texport const convertAbsolutePathToCanonical = function (in_absolutePath: string): string {\n\t\tconst tokenTypes = [];\n\t\tconst tokens = tokenizePathString(in_absolutePath, tokenTypes);\n\t\tlet path = \"\";\n\t\tfor (let i = 0; i < tokenTypes.length; i++) {\n\t\t\tconst tokenType = tokenTypes[i];\n\t\t\tswitch (tokenType) {\n\t\t\t\tcase TOKEN_TYPES.PATH_ROOT_TOKEN:\n\t\t\t\t\t// Skip the leading '/'\n\t\t\t\t\tbreak;\n\t\t\t\tcase TOKEN_TYPES.RAISE_LEVEL_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`No level up (\"../\") is expected in an absolute path: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.DEREFERENCE_TOKEN:\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Dereference (\"*\") is not supported in canonical paths: ${in_absolutePath}`,\n\t\t\t\t\t);\n\t\t\t\tcase TOKEN_TYPES.ARRAY_TOKEN:\n\t\t\t\tcase TOKEN_TYPES.PATH_SEGMENT_TOKEN:\n\t\t\t\t\tpath += PROPERTY_PATH_DELIMITER + quotePathSegmentIfNeeded(tokens[i]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Removes the leading PROPERTY_PATH_DELIMITER.\n\t\tif (path) {\n\t\t\tpath = path.substring(1);\n\t\t}\n\t\treturn path;\n\t};\n\n\t/**\n\t * This utility function provides a canonical representation of a child property path.\n\t * It is useful to compare partial checkout paths and property paths.\n\t * The canonical form of paths is not suitable for ChangeSets.\n\t *\n\t * @param in_parentAbsolutePathCanonical - The absolute path of the parent property in canonical form\n\t * @param in_childId - The name of the child property in its parent\n\t * @returns Absolute path of the child property in canonical form\n\t * @internal\n\t */\n\texport const getChildAbsolutePathCanonical = function (\n\t\tin_parentAbsolutePathCanonical: string,\n\t\tin_childId: string,\n\t): string {\n\t\tconst childPath = quotePathSegmentIfNeeded(String(in_childId));\n\t\treturn in_parentAbsolutePathCanonical\n\t\t\t? in_parentAbsolutePathCanonical + PROPERTY_PATH_DELIMITER + childPath\n\t\t\t: childPath;\n\t};\n\n\t/**\n\t * @internal\n\t */\n\texport enum CoverageExtent {\n\t\t// The base path is not covered by any path from a given list of paths.\n\t\t// This means a property with this path and all its children would not be covered.\n\t\tUNCOVERED,\n\t\t// The base path is partially covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered, but some of its children could be uncovered.\n\t\tPARTLY_COVERED,\n\t\t// The base path is fully covered by at least one path from a given list of paths.\n\t\t// This means a property with this path would be covered and all of its children would be covered also.\n\t\tFULLY_COVERED,\n\t}\n\n\tinterface BasePathCoverage {\n\t\tcoverageExtent: CoverageExtent;\n\t\tpathList: string[];\n\t}\n\n\t/**\n\t * Determines if the base path is covered by the given list of paths. From that you can deduce if a\n\t * property with that path and all its children are covered by the given list of paths.\n\t *\n\t * This function uses the canonical representation of the property paths.\n\t *\n\t * @param in_basePath - The property's absolute path in canonical form\n\t * @param in_paths - The array of paths that must cover the property and its children\n\t * @returns The coverage of the property and its children. For a coverage of\n\t * 'FULLY_COVERED', only the first matching path is returned.\n\t * @internal\n\t */\n\texport const getPathCoverage = function (\n\t\tin_basePath: string,\n\t\tin_paths: string[],\n\t): BasePathCoverage {\n\t\t// First, check if the base path is entirely included in one of the paths\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_basePath.startsWith(in_paths[i])) {\n\t\t\t\treturn {\n\t\t\t\t\tcoverageExtent: CoverageExtent.FULLY_COVERED,\n\t\t\t\t\tpathList: [in_paths[i]],\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t// We did not find a path including all the children of this insertion\n\t\t// Let's check if there are paths going through it.\n\t\tconst paths = [];\n\t\tfor (let i = 0; i < in_paths.length; i++) {\n\t\t\tif (in_paths[i].startsWith(in_basePath)) {\n\t\t\t\tpaths.push(in_paths[i]);\n\t\t\t}\n\t\t}\n\t\tif (paths.length) {\n\t\t\t// We found at least one path including parts of the base path.\n\t\t\treturn {\n\t\t\t\tcoverageExtent: CoverageExtent.PARTLY_COVERED,\n\t\t\t\tpathList: paths,\n\t\t\t};\n\t\t}\n\n\t\t// We did not find any path covering the given base path.\n\t\treturn {\n\t\t\tcoverageExtent: CoverageExtent.UNCOVERED,\n\t\t\tpathList: paths,\n\t\t};\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"templateValidator.d.ts","sourceRoot":"","sources":["../src/templateValidator.ts"],"names":[],"mappings":"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