@fluid-experimental/property-properties 1.1.0 → 1.2.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 (34) hide show
  1. package/dist/properties/abstractStaticCollectionProperty.d.ts +1 -1
  2. package/dist/properties/abstractStaticCollectionProperty.js +1 -1
  3. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  4. package/dist/properties/arrayProperty.d.ts +2 -1
  5. package/dist/properties/arrayProperty.d.ts.map +1 -1
  6. package/dist/properties/arrayProperty.js +5 -2
  7. package/dist/properties/arrayProperty.js.map +1 -1
  8. package/dist/properties/mapProperty.d.ts +2 -1
  9. package/dist/properties/mapProperty.d.ts.map +1 -1
  10. package/dist/properties/mapProperty.js +4 -2
  11. package/dist/properties/mapProperty.js.map +1 -1
  12. package/dist/properties/setProperty.d.ts +1 -1
  13. package/dist/properties/setProperty.js +2 -2
  14. package/dist/properties/setProperty.js.map +1 -1
  15. package/dist/properties/stringProperty.js +1 -1
  16. package/dist/properties/stringProperty.js.map +1 -1
  17. package/dist/test/tsconfig.tsbuildinfo +1 -1
  18. package/lib/properties/abstractStaticCollectionProperty.d.ts +1 -1
  19. package/lib/properties/abstractStaticCollectionProperty.js +1 -1
  20. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  21. package/lib/properties/arrayProperty.d.ts +2 -1
  22. package/lib/properties/arrayProperty.d.ts.map +1 -1
  23. package/lib/properties/arrayProperty.js +5 -2
  24. package/lib/properties/arrayProperty.js.map +1 -1
  25. package/lib/properties/mapProperty.d.ts +2 -1
  26. package/lib/properties/mapProperty.d.ts.map +1 -1
  27. package/lib/properties/mapProperty.js +4 -2
  28. package/lib/properties/mapProperty.js.map +1 -1
  29. package/lib/properties/setProperty.d.ts +1 -1
  30. package/lib/properties/setProperty.js +2 -2
  31. package/lib/properties/setProperty.js.map +1 -1
  32. package/lib/properties/stringProperty.js +1 -1
  33. package/lib/properties/stringProperty.js.map +1 -1
  34. package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AAC,MAAM,CAAC;SACtB;IACL,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI,MAAM,CAAC,GAAG;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;CACJ;AA1lDD,sCA0lDC;AAED,aAAa,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;AAC7C,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the array property class\n */\nconst {\n ArrayChangeSetIterator,\n ChangeSet,\n PathHelper,\n TypeIdHelper,\n} = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { UniversalDataArray, ConsoleUtils } = require('@fluid-experimental/property-common');\nconst fastestJSONCopy = require('fastest-json-copy');\nconst _ = require('lodash');\nconst { deserializeNonPrimitiveArrayElements } = require('../containerSerializer');\nconst { validationsEnabled } = require('../enableValidations');\nconst { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');\nconst { BaseProperty } = require('./baseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst deepCopy = fastestJSONCopy.copy;\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If there are no entries in the pending and\n// dirty changesets, but the array still has a pending or dirty state\n// flag we use these objects to indicate this state. This happens for custom\n// type array, for which the children have been changed.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar DIRTY_AND_PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\nvar DIRTY_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar DIRTY_STATE_FLAGS_ARRAY = [\n undefined,\n PENDING_CHILD_CHANGES,\n DIRTY_CHILD_CHANGES,\n DIRTY_AND_PENDING_CHILD_CHANGES,\n];\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * Given a list of non-overlapping, unordered segments, each identified by its start point and length,\n * this function computes the longest monotone, increasing sub-sequence of segments.\n *\n * Currently, this is O(n^2) in the worst case, it could be implemented in O(n log n), but I would have\n * to implement a binary search tree for this. If this becomes a bottle-neck, we should replace\n * the insertions and binary searches below, with a search tree.\n *\n * @param {Array.<number>} in_segmentStarts - The starting points of the segments\n * @param {Array.<number>} in_segmentLengths - The lengths of the segments\n *\n * @return {Array.<Number>} List of the selected segments, given as indices of the segments\n * @private\n */\nvar _getLongestIncreasingSubsequenceSegments = function(in_segmentStarts, in_segmentLengths) {\n if (in_segmentStarts.length === 0) {\n return [];\n }\n\n // Contains the already found sub sequences, sorted by their length\n // in increasing order. These sub-sequences have the invariant that\n // the last entry in each of the sequences is smaller than the last\n // entry in longer sequences (so the list is also sorted according to\n // the sequenceLastEntry member of the structs)\n var foundSubSequences = [];\n\n for (var i = 0; i < in_segmentStarts.length; i++) {\n var currentSegmentStart = in_segmentStarts[i];\n\n // Perform a binary search to find the largest entry in the list of found sub\n // sequences that has a sequenceEnd that is smaller or equal than currentSegmentStart\n var index = _.sortedIndexBy(foundSubSequences, { sequenceLastEntry: currentSegmentStart }, 'sequenceLastEntry');\n var lastEntry = index > 0 ? foundSubSequences[index - 1] : undefined;\n\n // Create a new entry that is obtained by concatenating the longest sequence found so far\n // with the new segment\n var newEntry = {\n sequenceLength: in_segmentLengths[i] + (lastEntry ? lastEntry.sequenceLength : 0),\n segmentIndex: i,\n sequenceLastEntry: currentSegmentStart + in_segmentLengths[i] - 1,\n previousEntry: lastEntry,\n };\n\n // Search for the insertion position for this entry\n var insertionPoint = _.sortedIndexBy(foundSubSequences, newEntry, 'sequenceLength');\n if (foundSubSequences[insertionPoint] !== undefined &&\n foundSubSequences[insertionPoint].sequenceLength === newEntry.sequenceLength) {\n insertionPoint++;\n }\n\n // We have to delete all entries from the foundSubSequences array, which\n // are shorter, but have a higher sequenceLastEntry (we can do that, since\n // it would be a better choice to use the new entry instead of these old\n // entries). This will preserve the invariant on the foundSubSequences\n // that they are sorted with respect to the sequenceLastEntry.\n var lowerLengthBoundary = newEntry.sequenceLength - in_segmentLengths[i];\n\n var j = insertionPoint - 1;\n for (; j >= 0 && foundSubSequences[j].sequenceLength > lowerLengthBoundary; j--) {\n if (foundSubSequences[j].sequenceLastEntry >= newEntry.sequenceLastEntry) {\n foundSubSequences.splice(j, 1);\n insertionPoint--;\n }\n }\n\n // Insert the entry as a new entry into the list of subsequences\n foundSubSequences.splice(insertionPoint, 0, newEntry); // TODO: this should be done via a binary tree\n }\n\n // This should always be the case, as we checked for empty inputs above\n ConsoleUtils.assert(foundSubSequences.length > 0);\n\n // Extract the result\n var longestSequence = [];\n var currentSegment = _.last(foundSubSequences);\n while (currentSegment) {\n longestSequence.unshift(currentSegment.segmentIndex);\n currentSegment = currentSegment.previousEntry;\n }\n\n return longestSequence;\n};\n\nexport class ArrayProperty extends AbstractStaticCollectionProperty {\n /**\n * Default constructor for ArrayProperty\n * @param {Object} [in_params] - the parameters\n * @param {Number} [in_params.length = 0] the length of the array, if applicable\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n * @protected\n */\n constructor(in_params, in_scope) {\n super(in_params);\n var length = in_params.size || in_params.length || 0;\n\n // changesets\n this._dirty = undefined;\n\n // We only need the scope for custom type array properties\n if (!this._isPrimitive) {\n this._scope = in_scope;\n }\n\n this._dataArrayCreate(length);\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string|undefined} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n var index = this._dataArrayGetBuffer().indexOf(in_childNode);\n if (index === -1) {\n throw new Error(MSG.GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY);\n }\n\n return '[' + index + ']';\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n if (in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN) {\n var index = Math.floor(in_segment);\n\n // Specifying a non-integer index is regarded a mal-formed path and thus throws an exception\n if (!isFinite(index)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.INVALID_NON_NUMERIC_SEGMENT_IN_PATH + in_segment);\n }\n\n // Accessing an entry outside of the array is just a non existing property and thus\n // returns undefined\n if (index < 0 || index >= this._dataArrayGetLength()) {\n return undefined;\n }\n return this._dataArrayGetValue(index);\n } else {\n return AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);\n }\n }\n\n /**\n * Insert into the array at a given position.\n * It will not overwrite the existing values, it will push them to the right.\n * @param {number} in_position target index\n * @param {*} in_value inserted value or property\n * @throws if in_position is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is a root property\n */\n insert(in_position, in_value) {\n this.insertRange(in_position, [in_value]);\n }\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} True if it is a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * Add one or more values at the end of the array\n * @param {Array<property-properties.BaseProperty>|property-properties.BaseProperty|*|Array<*>} in_values\n * the item or items to be pushed (either properties or values). If an array is passed, .push\n * will be called on each item in the array.\n * @throws if trying to push a property that is a root property\n * @return {number} new length of the array\n */\n push(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(this._dataArrayGetLength(), in_values);\n } else {\n this.insertRange(this._dataArrayGetLength(), [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Add elements to the end of the queue (array)\n */\n enqueue(...args) {\n return this.push(...args);\n }\n\n /**\n * Add a value at the front of the array or letters to the beginning of a string (for StringProperty)\n * It can also add multiple values to an array if you pass in an array of values.\n * @param {Array<*>|*|Array<property-properties.BaseProperty>|property-properties.BaseProperty} in_values the values\n * or properties to be pushed\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to insert a root property\n * @throws if trying to modify a referenced property.\n * @return {number} new length of the array\n */\n unshift(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(0, in_values);\n } else {\n this.insertRange(0, [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Removes an element of the array (or a letter in a StringProperty) and shifts remaining elements to the left\n * E.g. [1, 2, 3] .remove(1) => [1, 3]\n * E.g. (StringProperty) 'ABCDE' .remove(1) => 'ACDE'\n * @param {number} in_position the index that will be removed\n * @throws if in_position is not a number\n * @throws if trying to remove something that does not exist\n * @throws if trying to remove an item with a parent\n * @return {property-properties.BaseProperty | * } the value that was removed.\n */\n remove(in_position) {\n var value = this.get(in_position);\n this.removeRange(in_position, 1);\n return value;\n }\n\n /**\n * Removes the last element of the array or the last letter of a string (for StringProperty)\n * @throws if trying to modify a referenced property\n * @return {property-properties.BaseProperty|*} deleted element.\n */\n pop() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(this._dataArrayGetLength() - 1,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(this._dataArrayGetLength() - 1);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes an element from the front of the array or a letter from the beginning of a string (for StringProperty)\n * @return {*|property-properties.BaseProperty} the element removed.\n */\n shift() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(0, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(0);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes elements from the front of the queue (array)\n */\n dequeue() {\n return this.shift();\n }\n\n /**\n * Change an existing element of the array. This will overwrite an existing element.\n * E.g. [1, 2, 3] .set(1, 8) => [1, 8, 3]\n * @param {number} in_position the target index\n * @param {*} in_value the new property or value\n * @throws if in_position is not a number\n * @throws if in_position is smaller than zero\n */\n set(in_position, in_value) {\n if (_.isArray(in_value)) {\n throw new TypeError(MSG.ARRAY_SET_ONE_ELEMENT + in_value);\n }\n this.setRange(in_position, [in_value]);\n }\n\n /**\n * Sets the values of items in the array.\n * If values are typed, iterates through the values and creates a property with the defined type and value.\n * @see {setValues}\n * @param {Array<*>} in_values - The list of typed values.\n * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @protected\n * @override\n */\n _setValues(in_values, in_typed, in_initial) {\n if (in_typed) {\n if (!this._isPrimitive) {\n ConsoleUtils.assert(_.isArray(in_values), MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty._setValues');\n\n var arr = [];\n for (var i = 0; i < in_values.length; i++) {\n var prop = in_values[i];\n\n if (in_values[i] instanceof BaseProperty) {\n prop = in_values[i];\n } else {\n prop = Property.PropertyFactory._createProperty(\n in_values[i].typeid || this._typeid, null, in_values[i].value, this._getScope());\n }\n arr.push(prop);\n }\n\n this._setValuesInternal(arr);\n } else {\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, in_typed, in_initial);\n }\n } else {\n this._setValuesInternal(in_values);\n }\n }\n\n /**\n * @param {Array<*>|Object} in_values an array or object containing the values to be set.\n * @see {setValues}\n */\n _setValuesInternal(in_values) {\n this._checkIsNotReadOnly(true);\n\n if (!this._isPrimitive) {\n if (_.isArray(in_values)) {\n this.clear();\n this.insertRange(0, in_values);\n } else {\n AbstractStaticCollectionProperty.prototype.setValues.call(this, in_values);\n }\n } else {\n if (_.isArray(in_values) && in_values.length < this._dataArrayGetLength()) {\n this.removeRange(in_values.length, this._dataArrayGetLength() - in_values.length);\n }\n\n var that = this;\n var maxIndex = this._dataArrayGetLength() - 1;\n _.each(in_values, function(value, index) {\n if (index > maxIndex) {\n that.insert(index, value);\n } else {\n if (that._dataArrayGetValue(index) !== value) {\n that.set(index, value);\n }\n }\n });\n }\n }\n\n /**\n * Sets the values of items in the array.\n * If called using an array (e.g. setValues([prop1, prop2])), it will overwrite the whole array.\n * If called using an object with indexes (e.g. setValues{0: prop1}), it will only overwrite the\n * items at those indexes.\n * For arrays of Properties, this can be used to set nested values in properties found in the array.\n * For example: setValues({0: {position: {x: 2, y:3}}});\n * @param {Array<*>|Object} in_values an array or object containing the values to be set.\n * @throws if one of the path in in_values does not correspond to a path in the property\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n }\n }\n\n /**\n * Deletes all values from an array\n */\n clear() {\n if (this.getLength()) {\n this.removeRange(0, this.getLength());\n }\n }\n\n /**\n * @return {Array<*> | String} all values in the ArrayProperty\n * If called on StringProperty, it returns the whole string\n * WARNING: the returned array must be read only, data written to it\n * will get lost.\n */\n getEntriesReadOnly() {\n return this._dataArrayGetBuffer();\n }\n\n /**\n * Private helper function to update the internal dirty and pending changes\n * is overwritten by StringProperty\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n var pendingChanges = this._getPendingChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n\n var dirtyChanges = this._getDirtyChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Returns the pending changeset for this object\n * @return {property-properties.SerializedChangeSet} The pending changes\n */\n _getPendingChanges() {\n return (this._dirty && this._dirty.pending) || {};\n }\n\n /**\n * Returns the dirty changeset for this object\n * @return {property-properties.SerializedChangeSet} The dirty changes\n */\n _getDirtyChanges() {\n return (this._dirty && this._dirty.dirty) || {};\n }\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n var oldFlags = this._dirty ? this._dirty.flags : 0;\n\n if (this._dirty &&\n this._dirty === DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty = undefined;\n }\n\n if (in_pending !== null) {\n if (!_.isEmpty(in_pending)) {\n this._dirty = this._dirty || {};\n this._dirty.pending = in_pending;\n } else if (this._dirty) {\n this._dirty.pending = undefined;\n }\n }\n\n if (in_dirty !== null) {\n if (!_.isEmpty(in_dirty)) {\n this._dirty = this._dirty || {};\n this._dirty.dirty = in_dirty;\n } else if (this._dirty) {\n this._dirty.dirty = undefined;\n }\n }\n\n if (this._dirty) {\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined) {\n if (oldFlags === 0) {\n this._dirty = undefined;\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n }\n } else {\n this._dirty.flags = oldFlags;\n }\n } else if (oldFlags) {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n }\n }\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty) {\n if (this._dirty !== DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty.flags = in_flags;\n\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined &&\n (this._dirty.flags === 0 || this._dirty.flags === undefined)) {\n this._dirty = undefined;\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n }\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === undefined) {\n return 0;\n }\n\n return this._dirty.flags;\n }\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is not an array.\n * @throws if trying to insert a root property.\n */\n insertRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.insertRange');\n }\n\n if (validationsEnabled.enabled) {\n for (var i = 0; i < in_array.length; i++) {\n if (in_array[i] instanceof BaseProperty) {\n in_array[i]._validateInsertIn(this);\n }\n }\n this._checkIsNotReadOnly(true);\n }\n this._insertRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * inserts the content of a given array, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @param {Boolean=} [in_setParents=true] If true, set parent of inserted properties.\n * If false, caller has already set parents.\n * @private\n */\n _insertRangeWithoutDirtying(in_offset, in_array, in_setParents) {\n if (in_setParents === undefined) {\n in_setParents = true;\n }\n if (in_offset < 0 || in_offset > this.length || !_.isNumber(in_offset)) {\n throw Error(MSG.START_OFFSET_INVALID + in_offset);\n }\n if (in_setParents && !this._isPrimitive) {\n var arr = [];\n for (var i = 0; i < in_array.length; ++i) {\n var prop = in_array[i];\n if (!(in_array[i] instanceof BaseProperty)) {\n prop = Property.PropertyFactory._createProperty(this._typeid, null, in_array[i], this._getScope());\n }\n\n if (prop.getParent()) {\n throw new Error(MSG.NO_INSERT_WITH_PARENT);\n } else {\n prop._setParent(this);\n }\n arr.push(prop);\n }\n\n in_array = arr;\n }\n this._dataArrayInsertRange(in_offset, in_array);\n\n // Insert entry into changesets\n var changeSet = {\n 'insert': [[in_offset, this._serializeArray(in_array)]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Removes a given number of elements from the array property (or given number of letters from a StringProperty)\n * and shifts remaining values to the left.\n * E.g. [1, 2, 3, 4, 5] .removeRange(1, 3) => [1, 5]\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {Array<*>| Array<property-properties.BaseProperty>} an array containing the values or\n * properties removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER +\n 'in_offset, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = [];\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result.push(this.get(i));\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n }\n\n /**\n * removes a given number of elements from the array property, and ensures, if this is not\n * a primitive array, that any existing properties have their parent pointer cleared.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @private\n */\n _clearRange(in_offset, in_deleteCount) {\n if (!this._isPrimitive) {\n for (var i = 0; i < in_deleteCount; ++i) {\n if (this._dataArrayGetValue(in_offset + i).getParent() !== this) {\n throw new Error(MSG.CANNOT_REMOVE_WITH_DIFFERENT_PARENT);\n } else {\n this._dataArrayGetValue(in_offset + i)._setParent(undefined);\n }\n }\n }\n\n this._dataArrayRemoveRange(in_offset, in_deleteCount);\n }\n\n /**\n * removes a given number of elements from the array property, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @private\n */\n _removeRangeWithoutDirtying(in_offset, in_deleteCount) {\n this._clearRange(in_offset, in_deleteCount);\n\n // Insert entry into changesets\n var changeSet = {\n 'remove': [[in_offset, in_deleteCount]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * E.g. [1, 2, 3, 4, 5] .setRange(1, [7, 8]) => [1, 7, 8, 4, 5]\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array) && !_.isString(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.setRange');\n }\n in_offset = Math.floor(in_offset);\n if (!isFinite(in_offset)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.NOT_NUMBER + 'in_offset, method: ArrayProperty.setRange or .set');\n }\n ConsoleUtils.assert(in_offset >= -1 && (in_offset + in_array.length) <= this.getLength(),\n MSG.SET_OUT_OF_BOUNDS + 'Cannot set ' + in_array.length + ' items starting at index ' + in_offset +\n '. Array length: ' + this.getLength());\n this._checkIsNotReadOnly(true);\n this._setRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset target start index\n * @param {Array<*>} in_array contains the elements to be set\n */\n _setRangeWithoutDirtying(in_offset, in_array) {\n this._modifyRangeWithoutDirtying(in_offset, in_array);\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset target start index\n * @param {Array<*>} in_array contains the elements to be set\n */\n _modifyRangeWithoutDirtying(in_offset, in_array) {\n // Has to be overloaded for arrays of properties!\n if (in_offset < 0) {\n throw Error(MSG.START_OFFSET_NEGATIVE + in_offset);\n }\n var changeSet = {};\n var changeArray = [];\n\n if (!this._isPrimitive) {\n // for custom array properties, we have to do a remove/insert instead:\n this._removeRangeWithoutDirtying(in_offset, in_array.length);\n this._insertRangeWithoutDirtying(in_offset, in_array);\n } else {\n // does the reference array property not have a _dataArrayRef ??\n // go through all the elements of in_array to check if the content of the given array\n // is same as value of the array properties. If the values are same, we don't change it.\n // Otherwise, we set them and generate corresponding changeset.\n var j;\n for (var i = 0; i < in_array.length; i++) {\n if (this._dataArrayGetValue(in_offset + i) !== in_array[i]) {\n for (j = i + 1; j < in_array.length; j++) {\n if (this._dataArrayGetValue(in_offset + j) === in_array[j]) {\n break;\n }\n }\n this._dataArraySetRange(in_offset + i, in_array.slice(i, j));\n changeArray.push([in_offset + i, this._serializeArray(in_array.slice(i, j))]);\n i = j;\n }\n }\n changeSet['modify'] = changeArray;\n this._updateChanges(changeSet);\n }\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n * Numerical indexes from the array will be returned as strings.\n * E.g. ['0', '1', '2']\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return Object.keys(this._dataArrayGetBuffer());\n }\n\n /**\n * Checks whether a property or data exists at the given position.\n *\n * @param {string} in_position - index of the property\n * @return {boolean} True if the property or data exists. Otherwise false.\n */\n has(in_position) {\n return this._dataArrayGetBuffer()[in_position] !== undefined;\n }\n\n /**\n * Gets the array element at a given index\n * @param {number | array<string|number>} in_position the target index\n * if an array is passed, elements in the array will be treated as part of a path.\n * The first item in an array should be a position in the array.\n * For example, .get([0,'position','x']) is the equivalent of .get(0).get('position').get('x')\n * If it encounters a ReferenceProperty, .get will, by default, resolve the property it refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if in_position is an array and the first item in the array is not a number\n * @throws if in_position is neither an array nor a number.\n * @throws if in_position is smaller than zero or larger than the length of the array.\n * @return {* | property-properties.BaseProperty | undefined} the element at that index - either a property or a value.\n * or undefined if nothing was found.\n */\n get(in_position, in_options) {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n var prop = this;\n if (_.isArray(in_position)) {\n var iterationStart = 0;\n var prop = this;\n if (in_position[0] === PATH_TOKENS.UP) {\n prop = prop.getParent();\n iterationStart = 1;\n } else if (in_position[0] === PATH_TOKENS.ROOT) {\n prop = prop.getRoot();\n iterationStart = 1;\n } else {\n var pos = Math.floor(in_position[0]);\n ConsoleUtils.assert(isFinite(pos), MSG.FIRST_ITEM_MUST_BE_NUMBER);\n var mode = in_options.referenceResolutionMode;\n ConsoleUtils.assert(pos >= 0 && pos < this.getLength(),\n MSG.GET_OUT_OF_RANGE + in_position[0]);\n }\n for (var i = iterationStart; i < in_position.length && prop; i++) {\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS) {\n mode = i !== in_position.length - 1 ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n if (in_position[i + 1] === PATH_TOKENS.REF) {\n mode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n prop = prop.get(in_position[i], { referenceResolutionMode: mode });\n if (prop === undefined && i < in_position.length - 1) {\n return undefined;\n }\n }\n return prop;\n }\n\n if (in_position === PATH_TOKENS.ROOT) {\n return prop.getRoot();\n } else if (in_position === PATH_TOKENS.UP) {\n return prop.getParent();\n } else if (in_position === PATH_TOKENS.REF) {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n } else {\n var pos = Math.floor(in_position);\n ConsoleUtils.assert(isFinite(pos), MSG.IN_POSITION_MUST_BE_NUMBER);\n var result = this._dataArrayGetValue(pos);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (result instanceof Property.ReferenceProperty) {\n result = result.ref;\n }\n }\n return result;\n }\n }\n\n /**\n * Returns an object with all the nested values contained in this property\n * @return {array<object> | array<*>} an array of objects or values representing the values of your property\n * for example: [\n * {\n * position: {\n * x: 2,\n * y: 5\n * }\n * },\n * {\n * position: {\n * x: 1,\n * y: -8\n * }\n * }]\n * or for a Value Array: [1, 3, 6]\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n result.push(child.getValues());\n }\n return result;\n }\n\n /**\n * @return {Number} the current length of the array\n */\n getLength() {\n return this._dataArrayGetLength();\n }\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n this._checkIsNotReadOnly(false);\n\n // Iterator to process the changes in the ChangeSet in the correct order\n var arrayIterator = new ArrayChangeSetIterator(in_changeSet);\n\n if (!this._isPrimitive) {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var insertedPropertyInstances = [];\n var scope = this._getScope();\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n // Set parent so scope is defined for deserialization\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false);\n insertedPropertyInstances.push(createdProperty);\n }\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(insertedPropertyInstances), false);\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var numRemoved = arrayIterator.opDescription.operation[1];\n if (!_.isNumber(numRemoved)) {\n numRemoved = numRemoved.length;\n }\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, numRemoved);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var startIndex = arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset;\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var modifiedProperty = this.get(startIndex + i,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n if (!modifiedProperty) {\n throw new Error(MSG.INDEX_INVALID + (startIndex + i));\n }\n modifiedProperty._applyChangeset(propertyDescriptions[i], false);\n }\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n } else {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var removeLength = arrayIterator.opDescription.operation[1];\n if (_.isArray(removeLength) || _.isString(removeLength)) {\n removeLength = removeLength.length;\n }\n\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, removeLength);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n this._modifyRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n }\n\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(in_reportToView);\n }\n\n /**\n * @inheritdoc\n */\n _reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n this._checkIsNotReadOnly(false);\n\n this._setChanges(in_pendingChangeSet, in_dirtyChangeSet);\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(false);\n }\n\n /**\n * Removes the dirtiness flag from this property\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean, if none are supplied all\n * will be removed\n * @private\n */\n _cleanDirty(in_flags) {\n // Invoke parent - cleans own dirty flag\n BaseProperty.prototype._cleanDirty.call(this, in_flags);\n\n // null means no change, undefined means reset the changes\n var pendingChanges = null,\n dirtyChanges = null;\n\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) !== 0) {\n pendingChanges = undefined;\n }\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.DIRTY) !== 0) {\n dirtyChanges = undefined;\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Removes the dirtiness flag from this property and recursively from all of its children\n *\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The flags to clean,\n * if none are supplied all will be removed\n */\n cleanDirty(in_dirtinessType) {\n if (!this._isPrimitive) {\n for (var i = 0; i < this._dataArrayGetLength(); ++i) {\n this._dataArrayGetValue(i).cleanDirty(in_dirtinessType);\n }\n }\n // after all paths are clean, we are also clean!\n this._cleanDirty(in_dirtinessType);\n }\n\n /**\n * Internal helper function that implements the deserialize algorithm for an array of named properties.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The serialized changeset to apply. This\n * has to be a normalized change-set (only containing inserts. Removes and Modifies are forbidden).\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {property-properties.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n * deserialization\n */\n _deserializeNamedPropertyArray(in_serializedObj, in_reportToView) {\n if (!_.isArray(in_serializedObj.insert[0][1])) {\n throw new TypeError(MSG.INVALID_CHANGESET);\n }\n\n // When the array contains named properties, we can use an efficient diffing algorithm, which\n // takes advantage of the ability to identify entries in an unique way\n var targetArray = in_serializedObj.insert[0][1];\n\n // The algorithm below finds the mapping between the two given arrays which requires the smallest number of\n // inserted and removed entries. These operations are determined via the following strategy:\n // 1) We search for all consecutive segments in the input data, which map to a consecutive segments in the\n // target array.\n // 2) We search for the longest sequence of consecutive segments in the input data which are all starting at\n // monotone increasing points in the target array. These are the segments which will remain unmodified\n // by insertion/removals\n // 3) Finally, we determine the necessary insertion and remove operations to fill in/remove the entries between\n // these segments and compute modify instructions within the segments.\n\n // 1) Map the GUIDs in the input ChangeSet to indices\n var resultGuidToIndexMap = {};\n for (var i = 0; i < targetArray.length; i++) {\n var insertedProperty = targetArray[i];\n if (insertedProperty['String'] === undefined ||\n insertedProperty['String']['guid'] === undefined) {\n throw new Error(MSG.MISSING_GUID_IN_NORMALIZED_CHANGESET);\n }\n\n var guid = insertedProperty['String']['guid'];\n // since the spec allows alternatively other changeset formats for strings, we have to support them here:\n if (!_.isString(guid) && insertedProperty['String']['guid'].insert) {\n guid = insertedProperty['String']['guid'].insert[0][1];\n }\n resultGuidToIndexMap[guid] = i;\n }\n\n var initialArrayLength = this._dataArrayGetLength();\n\n // Collect consecutive segments\n var segmentStartPointsInInitialArray = [];\n var segmentStartPointsInTargetArray = [];\n var segmentLengths = [];\n var segmentInterrupted = false;\n for (var i = 0; i < initialArrayLength; i++) {\n // Get the GUID of the entry\n var guid = this._dataArrayGetValue(i).getGuid();\n\n // Check where it is stored in the target array\n var index = resultGuidToIndexMap[guid];\n if (index !== undefined) {\n // Check whether we can append the entry to the existing sequence\n if (!segmentInterrupted &&\n segmentStartPointsInTargetArray.length > 0 &&\n _.last(segmentStartPointsInTargetArray) + _.last(segmentLengths) === index) {\n // In that case we just increase the length of the segment\n segmentLengths[segmentLengths.length - 1]++;\n } else {\n // Create a new segment\n segmentStartPointsInInitialArray.push(i);\n segmentStartPointsInTargetArray.push(index);\n segmentLengths.push(1);\n segmentInterrupted = false;\n }\n } else {\n segmentInterrupted = true;\n }\n }\n\n // 2) Get all segments in the array which we will keep (we try to keep as many as possible, so this maps\n // to finding the longest monotone increasing sequence of sub-segments)\n var orderedSegments = _getLongestIncreasingSubsequenceSegments(segmentStartPointsInTargetArray, segmentLengths);\n\n // 3) Now we have to convert this sequence of ordered segments to insert and remove commands\n var changes = {};\n\n var lastPositionInInitialArray = 0;\n var lastPositionInTargetArray = 0;\n var offset = 0;\n for (var i = 0; i <= orderedSegments.length; i++) {\n var startPointInInitialArray, startPointInTargetArray, segmentLength;\n var offsetChange = 0;\n if (i < orderedSegments.length) {\n // Extract the information about the currently processed segment.\n startPointInInitialArray = segmentStartPointsInInitialArray[orderedSegments[i]];\n startPointInTargetArray = segmentStartPointsInTargetArray[orderedSegments[i]];\n segmentLength = segmentLengths[orderedSegments[i]];\n } else {\n // Special case to handle the end of the sequence: We add a segment of length 0 at the end\n startPointInInitialArray = initialArrayLength;\n startPointInTargetArray = targetArray.length;\n segmentLength = 0;\n }\n\n // If the start point of the segment in the initial array is larger than the last point we processed, we have\n // to remove the elements between the two points\n if (startPointInInitialArray > lastPositionInInitialArray) {\n changes.remove = changes.remove || [];\n changes.remove.push([lastPositionInInitialArray, startPointInInitialArray - lastPositionInInitialArray]);\n this._removeRangeWithoutDirtying(lastPositionInInitialArray + offset,\n startPointInInitialArray - lastPositionInInitialArray);\n offsetChange -= startPointInInitialArray - lastPositionInInitialArray;\n }\n\n // If the start point of the segment in the target array is larger than the last point we processed, we have\n // to insert the elements between the two points\n if (startPointInTargetArray > lastPositionInTargetArray) {\n changes.insert = changes.insert || [];\n let elementsToInsert = targetArray.slice(lastPositionInTargetArray, startPointInTargetArray);\n changes.insert.push([\n lastPositionInInitialArray,\n deepCopy(elementsToInsert),\n ]);\n var scope = this._getScope();\n var insertedProperties = deserializeNonPrimitiveArrayElements(elementsToInsert, scope);\n this._insertRangeWithoutDirtying(lastPositionInInitialArray + offset, insertedProperties);\n offsetChange += insertedProperties.length;\n }\n\n // Update the last processed points\n lastPositionInInitialArray = startPointInInitialArray + segmentLength;\n lastPositionInTargetArray = startPointInTargetArray + segmentLength;\n offset += offsetChange;\n\n // Recursively check the entries within the segment for modifications\n for (var j = 0; j < segmentLength; j++) {\n var existingEntry = this._dataArrayGetValue(startPointInInitialArray + j + offset);\n var entryChanges = existingEntry._deserialize(targetArray[startPointInTargetArray + j],\n false, undefined, true);\n\n // We had changes which we have to report back\n if (!ChangeSet.isEmptyChangeSet(entryChanges)) {\n // Make sure, the ChangeSet contains the typeid of the modified entry\n entryChanges.typeid = existingEntry.getFullTypeid();\n\n if (!changes.modify) {\n changes.modify = [[startPointInInitialArray + j, [entryChanges]]];\n } else {\n var lastModifiedSequence = _.last(changes.modify);\n if (lastModifiedSequence[0] + lastModifiedSequence[1].length === startPointInInitialArray + j) {\n lastModifiedSequence[1].push(entryChanges);\n } else {\n changes.modify.push([startPointInInitialArray + j, [entryChanges]]);\n }\n }\n }\n }\n }\n\n // If there were any changes, we have to mark this property as dirty\n if (!ChangeSet.isEmptyChangeSet(changes)) {\n this._setDirty(in_reportToView);\n }\n return changes;\n }\n\n /**\n * Function to deserialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {*} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n // we have to convert the propertySet objects to changesets\n return in_obj._serialize(false, true);\n }\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var len = in_array.length;\n var result = new Array(len);\n if (this._isPrimitive) {\n for (var i = 0; i < len; i++) {\n result[i] = this._serializeValue(in_array[i]);\n }\n } else {\n for (var i = 0; i < len; i++) {\n result[i] = {};\n }\n }\n return result;\n }\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n this._checkIsNotReadOnly(false);\n\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isArray(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var arrayLength = this._dataArrayGetLength();\n\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (arrayLength > 0) {\n this._clearRange(0, arrayLength);\n this._setDirty(in_reportToView);\n var removeChangeSet = {\n remove: [[0, arrayLength]],\n };\n this._updateChanges(removeChangeSet);\n return removeChangeSet;\n } else {\n // the array was already empty, nothing has changed\n return {};\n }\n }\n\n var scope = this._getScope();\n\n if (Property.PropertyFactory.inheritsFrom(this.getTypeid(), 'NamedProperty', { scope: scope })) {\n return this._deserializeNamedPropertyArray(in_serializedObj, in_reportToView);\n } else {\n // most simplistic diff method: Remove all existing data and insert the new data\n\n // The changes we will report as result of this function\n var simpleChanges = {\n insert: in_createChangeSet ? deepCopy(in_serializedObj.insert) : in_serializedObj.insert,\n };\n if (arrayLength > 0) {\n simpleChanges.remove = [[0, arrayLength]];\n }\n\n if (!this._isPrimitive) {\n var propertyDescriptions = in_serializedObj.insert[0][1];\n var result = [];\n\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false, in_filteringOptions, false);\n result.push(createdProperty);\n }\n this._clearRange(0, this._dataArrayGetLength());\n this._dataArrayInsertRange(0, result);\n } else {\n // Check, whether there has been any change in the array at all\n if (in_serializedObj.insert[0][1].length === this._dataArrayGetLength()) {\n // We have to compare the two buffers\n var buffer = this._dataArrayGetBuffer();\n var changeSetArray = in_serializedObj.insert[0][1];\n var len = buffer.length;\n var i = 0;\n if (this._typeid === 'Int64' || this._typeid === 'Uint64') {\n // For (u)int64, we will compare (Ui/I)nt64 objects with arrays [low, high]\n for (i = 0; i < len; i++) {\n if (changeSetArray[i][0] !== buffer[i].getValueLow() || changeSetArray[i][1] !== buffer[i].getValueHigh()) {\n break;\n }\n }\n } else {\n for (i = 0; i < len; i++) {\n if (buffer[i] !== changeSetArray[i]) {\n break;\n }\n }\n }\n if (i === len) {\n return {};\n }\n }\n // set the actual array values to our array\n this._dataArrayDeserialize(this._deserializeArray(in_serializedObj.insert[0][1]));\n }\n\n // Update the dirty and pending changes\n this._updateChanges(simpleChanges);\n\n // Finally report the dirtiness to the view (we postponed this above)\n this._setDirty(in_reportToView);\n\n return simpleChanges;\n }\n }\n\n _getChangesetForCustomTypeArray(in_basePropertyChangeset,\n in_dirtinessType,\n in_includeReferencedRepositories) {\n var result = {};\n if (in_basePropertyChangeset.remove && in_basePropertyChangeset.remove.length > 0) {\n result.remove = deepCopy(in_basePropertyChangeset.remove);\n }\n // get the iterator over the changes:\n var iterator = new ArrayChangeSetIterator(in_basePropertyChangeset);\n var currentArrayIndex = 0;\n var currentArraySize = this._dataArrayGetLength();\n var op, opStartIndex;\n while (!iterator.atEnd() || currentArrayIndex < currentArraySize) {\n if (!iterator.atEnd()) {\n op = iterator.opDescription;\n opStartIndex = op.operation[0] + op.offset;\n } else {\n // no more ops\n op = { offset: iterator.opDescription.offset };\n opStartIndex = Number.MAX_VALUE;\n }\n\n if (currentArrayIndex < opStartIndex) {\n // not in the influence of an insert or remove\n\n // we have to check if the element was modified (since that is not tracked)\n if (this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n // check if we can combine modifies:\n var lastModify = undefined;\n if (result.modify && result.modify.length > 0) {\n lastModify = result.modify[result.modify.length - 1];\n if (lastModify[0] + lastModify[1].length === currentArrayIndex - op.offset) {\n // we need to combine, keep lastModify\n } else {\n lastModify = undefined;\n }\n }\n\n if (lastModify) {\n lastModify[1].push(this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n } else {\n // begin new modify\n if (!result.modify) {\n result.modify = [];\n }\n result.modify.push([currentArrayIndex - op.offset,\n [this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n })]]);\n }\n currentArrayIndex++;\n // add more immediate modifies if possible\n while (currentArrayIndex < currentArraySize && currentArrayIndex < opStartIndex &&\n this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n result.modify[result.modify.length - 1][1].push(\n this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }),\n );\n currentArrayIndex++;\n }\n } else {\n currentArrayIndex++;\n }\n } else if (currentArrayIndex === opStartIndex) {\n // handle the op\n if (op.type === ArrayChangeSetIterator.types.REMOVE) {\n // no need to do something (removes are just copied)\n iterator.next(); // we've completely consumed that op\n } else if (op.type === ArrayChangeSetIterator.types.INSERT) {\n // we have to convert the inserts:\n var currentInsert = op.operation;\n var newInsert = [currentInsert[0], []];\n for (var j = 0; j < currentInsert[1].length; ++j) {\n // TODO: we don't use the data from the changeset anymore, since we directly\n // TODO: read the data from the array now - remove the data from the op and\n // TODO: replace it with just the length instead\n if (!this._dataArrayGetValue(opStartIndex + j)) {\n throw new Error('insert: invalid index');\n }\n newInsert[1].push(this._dataArrayGetValue(opStartIndex + j).serialize(\n {\n 'dirtyOnly': false, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n }\n if (!result.insert) {\n result.insert = [];\n }\n result.insert.push(newInsert);\n currentArrayIndex += currentInsert[1].length; // we've read and used these entries above\n iterator.next(); // we've completely consumed that op\n } else if (op.type === ArrayChangeSetIterator.types.MODIFY) {\n // Prevent from looping infinitly\n // TODO: Might want to decide if there's something to do here\n iterator.next(); // we've completely consumed that op\n }\n }\n }\n return result;\n }\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the _serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n var result = AbstractStaticCollectionProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories);\n\n if (!this._isPrimitive) {\n if (in_dirtyOnly) {\n _.extend(result, in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n this._getChangesetForCustomTypeArray(this._getPendingChanges(), in_dirtinessType,\n in_includeReferencedRepositories) :\n this._getChangesetForCustomTypeArray(this._getDirtyChanges(), in_dirtinessType,\n in_includeReferencedRepositories));\n\n return result;\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n // we have to convert the propertySet objects to changesets\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._dataArrayGetValue(i)._serialize(false, true, in_dirtinessType,\n in_includeReferencedRepositories));\n }\n }\n return result;\n }\n } else if (in_dirtyOnly) {\n return in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n deepCopy(this._getPendingChanges()) : deepCopy(this._getDirtyChanges());\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._serializeValue(this._dataArrayGetValue(i)));\n }\n }\n return result;\n }\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property and of its sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n if (!this._isPrimitive) {\n this._prettyPrintChildren(indent, printFct);\n } else {\n var childIndent = indent + ' ';\n var prefix = '';\n var suffix = '';\n if (this.getTypeid() === 'String') {\n prefix = '\"';\n suffix = '\"';\n }\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n printFct(childIndent + i + ': ' + prefix + this._dataArrayGetValue(i) + suffix);\n }\n }\n printFct(indent + ']');\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property's sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrintChildren(indent, printFct) {\n indent += ' ';\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })\n ._prettyPrint(indent, ids[i] + ': ', printFct);\n }\n }\n\n /**\n * Return a JSON representation of the array and its items.\n * @return {object} A JSON representation of the array and its items.\n * @private\n */\n _toJson() {\n var json = {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: [],\n };\n\n if (!this._isPrimitive) {\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n json.value.push(\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })._toJson(),\n );\n }\n } else {\n json.value = this.getValues();\n }\n\n return json;\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the array type id, if not\n * omitted by parameters\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n if (in_hideCollection) {\n return this._typeid;\n } else {\n return TypeIdHelper.createSerializationTypeId(this._typeid, 'array');\n }\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n // This really creates a generic array for custom type arrays. For primitive arrays, like\n // 'StringArrayProperty' or 'Float32ArrayProperty', you need to overload this function.\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n var element = Property.PropertyFactory._createProperty(this.getTypeid(), null, undefined, this._scope);\n element._setParent(this);\n this._dataArraySetValue(i, element);\n }\n }\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n }\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef.getBuffer();\n }\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_index - Position in the array\n *\n * @return {*} The value at index in_index\n */\n _dataArrayGetValue(in_index) {\n return this._dataArrayRef.getValue(in_index);\n }\n\n /**\n * Sets an entry in the data array\n * @param {Number} in_index - Position in the array\n * @param {*} in_value - The new value at index in_index\n */\n _dataArraySetValue(in_index, in_value) {\n this._dataArrayRef.setValue(in_index, in_value);\n }\n\n /**\n * Set the array to the given new array\n * @param {Array} in_newArray - The new contents of the array\n */\n _dataArrayDeserialize(in_newArray) {\n this._dataArrayRef.deserialize(in_newArray);\n }\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {Array} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef.insertRange(in_position, in_range);\n }\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n this._dataArrayRef.removeRange(in_position, in_length);\n }\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Array} in_range - The array to overwrite\n */\n _dataArraySetRange(in_position, in_range) {\n this._dataArrayRef.set(in_position, in_range);\n }\n\n /**\n * Get the scope to which this property belongs to.\n * @return {string|undefined} The guid representing the scope in which the\n * map belongs to. If there is a workspace scope return it, else return the scope of this array.\n * @override\n * @private\n */\n _getScope() {\n var scope = AbstractStaticCollectionProperty.prototype._getScope.call(this);\n\n if (scope !== undefined) {\n return scope;\n } else {\n return this._scope;\n }\n }\n\n /**\n * returns the length of the current array property\n */\n get length() {\n return this.getLength();\n }\n set length(len) {\n throw new Error(MSG.MODIFY_READ_ONLY);\n }\n}\n\nArrayProperty.prototype._staticChildren = {};\nArrayProperty.prototype._context = 'array';\n"]}
1
+ {"version":3,"file":"arrayProperty.js","sourceRoot":"","sources":["../../src/properties/arrayProperty.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EACF,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,YAAY,GACf,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACtD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,oCAAoC,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACnF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC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,QAAQ;QACvC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,WAAW,EAAE,SAAS;QACxC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,QAAQ;QACpC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACL,IAAI,KAAK,GAAG,gCAAgC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5E,IAAI,KAAK,KAAK,SAAS,EAAE;YACrB,OAAO,KAAK,CAAC;SAChB;aAAM;YACH,OAAO,IAAI,CAAC,MAAM,CAAC;SACtB;IACL,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI,MAAM,CAAC,GAAG;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;CACJ;AA7lDD,sCA6lDC;AAED,aAAa,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;AAC7C,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the array property class\n */\nconst {\n ArrayChangeSetIterator,\n ChangeSet,\n PathHelper,\n TypeIdHelper,\n} = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { UniversalDataArray, ConsoleUtils } = require('@fluid-experimental/property-common');\nconst fastestJSONCopy = require('fastest-json-copy');\nconst _ = require('lodash');\nconst { deserializeNonPrimitiveArrayElements } = require('../containerSerializer');\nconst { validationsEnabled } = require('../enableValidations');\nconst { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');\nconst { BaseProperty } = require('./baseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst deepCopy = fastestJSONCopy.copy;\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If there are no entries in the pending and\n// dirty changesets, but the array still has a pending or dirty state\n// flag we use these objects to indicate this state. This happens for custom\n// type array, for which the children have been changed.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar DIRTY_AND_PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\nvar DIRTY_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar DIRTY_STATE_FLAGS_ARRAY = [\n undefined,\n PENDING_CHILD_CHANGES,\n DIRTY_CHILD_CHANGES,\n DIRTY_AND_PENDING_CHILD_CHANGES,\n];\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * Given a list of non-overlapping, unordered segments, each identified by its start point and length,\n * this function computes the longest monotone, increasing sub-sequence of segments.\n *\n * Currently, this is O(n^2) in the worst case, it could be implemented in O(n log n), but I would have\n * to implement a binary search tree for this. If this becomes a bottle-neck, we should replace\n * the insertions and binary searches below, with a search tree.\n *\n * @param {Array.<number>} in_segmentStarts - The starting points of the segments\n * @param {Array.<number>} in_segmentLengths - The lengths of the segments\n *\n * @return {Array.<Number>} List of the selected segments, given as indices of the segments\n * @private\n */\nvar _getLongestIncreasingSubsequenceSegments = function(in_segmentStarts, in_segmentLengths) {\n if (in_segmentStarts.length === 0) {\n return [];\n }\n\n // Contains the already found sub sequences, sorted by their length\n // in increasing order. These sub-sequences have the invariant that\n // the last entry in each of the sequences is smaller than the last\n // entry in longer sequences (so the list is also sorted according to\n // the sequenceLastEntry member of the structs)\n var foundSubSequences = [];\n\n for (var i = 0; i < in_segmentStarts.length; i++) {\n var currentSegmentStart = in_segmentStarts[i];\n\n // Perform a binary search to find the largest entry in the list of found sub\n // sequences that has a sequenceEnd that is smaller or equal than currentSegmentStart\n var index = _.sortedIndexBy(foundSubSequences, { sequenceLastEntry: currentSegmentStart }, 'sequenceLastEntry');\n var lastEntry = index > 0 ? foundSubSequences[index - 1] : undefined;\n\n // Create a new entry that is obtained by concatenating the longest sequence found so far\n // with the new segment\n var newEntry = {\n sequenceLength: in_segmentLengths[i] + (lastEntry ? lastEntry.sequenceLength : 0),\n segmentIndex: i,\n sequenceLastEntry: currentSegmentStart + in_segmentLengths[i] - 1,\n previousEntry: lastEntry,\n };\n\n // Search for the insertion position for this entry\n var insertionPoint = _.sortedIndexBy(foundSubSequences, newEntry, 'sequenceLength');\n if (foundSubSequences[insertionPoint] !== undefined &&\n foundSubSequences[insertionPoint].sequenceLength === newEntry.sequenceLength) {\n insertionPoint++;\n }\n\n // We have to delete all entries from the foundSubSequences array, which\n // are shorter, but have a higher sequenceLastEntry (we can do that, since\n // it would be a better choice to use the new entry instead of these old\n // entries). This will preserve the invariant on the foundSubSequences\n // that they are sorted with respect to the sequenceLastEntry.\n var lowerLengthBoundary = newEntry.sequenceLength - in_segmentLengths[i];\n\n var j = insertionPoint - 1;\n for (; j >= 0 && foundSubSequences[j].sequenceLength > lowerLengthBoundary; j--) {\n if (foundSubSequences[j].sequenceLastEntry >= newEntry.sequenceLastEntry) {\n foundSubSequences.splice(j, 1);\n insertionPoint--;\n }\n }\n\n // Insert the entry as a new entry into the list of subsequences\n foundSubSequences.splice(insertionPoint, 0, newEntry); // TODO: this should be done via a binary tree\n }\n\n // This should always be the case, as we checked for empty inputs above\n ConsoleUtils.assert(foundSubSequences.length > 0);\n\n // Extract the result\n var longestSequence = [];\n var currentSegment = _.last(foundSubSequences);\n while (currentSegment) {\n longestSequence.unshift(currentSegment.segmentIndex);\n currentSegment = currentSegment.previousEntry;\n }\n\n return longestSequence;\n};\n\nexport class ArrayProperty extends AbstractStaticCollectionProperty {\n /**\n * Default constructor for ArrayProperty\n * @param {Object} [in_params] - the parameters\n * @param {Number} [in_params.length = 0] the length of the array, if applicable\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n * @protected\n */\n constructor(in_params, in_scope) {\n super(in_params);\n var length = in_params.size || in_params.length || 0;\n\n // changesets\n this._dirty = undefined;\n\n // We only need the scope for custom type array properties\n if (!this._isPrimitive) {\n this._scope = in_scope;\n }\n\n this._dataArrayCreate(length);\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string|undefined} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n var index = this._dataArrayGetBuffer().indexOf(in_childNode);\n if (index === -1) {\n throw new Error(MSG.GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY);\n }\n\n return '[' + index + ']';\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n if (in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN) {\n var index = Math.floor(in_segment);\n\n // Specifying a non-integer index is regarded a mal-formed path and thus throws an exception\n if (!isFinite(index)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.INVALID_NON_NUMERIC_SEGMENT_IN_PATH + in_segment);\n }\n\n // Accessing an entry outside of the array is just a non existing property and thus\n // returns undefined\n if (index < 0 || index >= this._dataArrayGetLength()) {\n return undefined;\n }\n return this._dataArrayGetValue(index);\n } else {\n return AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);\n }\n }\n\n /**\n * Insert into the array at a given position.\n * It will not overwrite the existing values, it will push them to the right.\n * @param {number} in_position target index\n * @param {*} in_value inserted value or property\n * @throws if in_position is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is a root property\n */\n insert(in_position, in_value) {\n this.insertRange(in_position, [in_value]);\n }\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} True if it is a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * Add one or more values at the end of the array\n * @param {Array<property-properties.BaseProperty>|property-properties.BaseProperty|*|Array<*>} in_values\n * the item or items to be pushed (either properties or values). If an array is passed, .push\n * will be called on each item in the array.\n * @throws if trying to push a property that is a root property\n * @return {number} new length of the array\n */\n push(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(this._dataArrayGetLength(), in_values);\n } else {\n this.insertRange(this._dataArrayGetLength(), [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Add elements to the end of the queue (array)\n */\n enqueue(...args) {\n return this.push(...args);\n }\n\n /**\n * Add a value at the front of the array or letters to the beginning of a string (for StringProperty)\n * It can also add multiple values to an array if you pass in an array of values.\n * @param {Array<*>|*|Array<property-properties.BaseProperty>|property-properties.BaseProperty} in_values the values\n * or properties to be pushed\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to insert a root property\n * @throws if trying to modify a referenced property.\n * @return {number} new length of the array\n */\n unshift(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(0, in_values);\n } else {\n this.insertRange(0, [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Removes an element of the array (or a letter in a StringProperty) and shifts remaining elements to the left\n * E.g. [1, 2, 3] .remove(1) => [1, 3]\n * E.g. (StringProperty) 'ABCDE' .remove(1) => 'ACDE'\n * @param {number} in_position the index that will be removed\n * @throws if in_position is not a number\n * @throws if trying to remove something that does not exist\n * @throws if trying to remove an item with a parent\n * @return {property-properties.BaseProperty | * } the value that was removed.\n */\n remove(in_position) {\n var value = this.get(in_position);\n this.removeRange(in_position, 1);\n return value;\n }\n\n /**\n * Removes the last element of the array or the last letter of a string (for StringProperty)\n * @throws if trying to modify a referenced property\n * @return {property-properties.BaseProperty|*} deleted element.\n */\n pop() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(this._dataArrayGetLength() - 1,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(this._dataArrayGetLength() - 1);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes an element from the front of the array or a letter from the beginning of a string (for StringProperty)\n * @return {*|property-properties.BaseProperty} the element removed.\n */\n shift() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(0, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(0);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes elements from the front of the queue (array)\n */\n dequeue() {\n return this.shift();\n }\n\n /**\n * Change an existing element of the array. This will overwrite an existing element.\n * E.g. [1, 2, 3] .set(1, 8) => [1, 8, 3]\n * @param {number} in_position the target index\n * @param {*} in_value the new property or value\n * @throws if in_position is not a number\n * @throws if in_position is smaller than zero\n */\n set(in_position, in_value) {\n if (_.isArray(in_value)) {\n throw new TypeError(MSG.ARRAY_SET_ONE_ELEMENT + in_value);\n }\n this.setRange(in_position, [in_value]);\n }\n\n /**\n * Sets the values of items in the array.\n * If values are typed, iterates through the values and creates a property with the defined type and value.\n *\n * See {@link ArrayProperty.setValues}\n *\n * @param {Array<*>} in_values - The list of typed values.\n * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @protected\n * @override\n */\n _setValues(in_values, in_typed, in_initial) {\n if (in_typed) {\n if (!this._isPrimitive) {\n ConsoleUtils.assert(_.isArray(in_values), MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty._setValues');\n\n var arr = [];\n for (var i = 0; i < in_values.length; i++) {\n var prop = in_values[i];\n\n if (in_values[i] instanceof BaseProperty) {\n prop = in_values[i];\n } else {\n prop = Property.PropertyFactory._createProperty(\n in_values[i].typeid || this._typeid, null, in_values[i].value, this._getScope());\n }\n arr.push(prop);\n }\n\n this._setValuesInternal(arr);\n } else {\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, in_typed, in_initial);\n }\n } else {\n this._setValuesInternal(in_values);\n }\n }\n\n /**\n * See {@link ArrayProperty.setValues}\n *\n * @param {Array<*>|Object} in_values an array or object containing the values to be set.\n */\n _setValuesInternal(in_values) {\n this._checkIsNotReadOnly(true);\n\n if (!this._isPrimitive) {\n if (_.isArray(in_values)) {\n this.clear();\n this.insertRange(0, in_values);\n } else {\n AbstractStaticCollectionProperty.prototype.setValues.call(this, in_values);\n }\n } else {\n if (_.isArray(in_values) && in_values.length < this._dataArrayGetLength()) {\n this.removeRange(in_values.length, this._dataArrayGetLength() - in_values.length);\n }\n\n var that = this;\n var maxIndex = this._dataArrayGetLength() - 1;\n _.each(in_values, function(value, index) {\n if (index > maxIndex) {\n that.insert(index, value);\n } else {\n if (that._dataArrayGetValue(index) !== value) {\n that.set(index, value);\n }\n }\n });\n }\n }\n\n /**\n * Sets the values of items in the array.\n * If called using an array (e.g. setValues([prop1, prop2])), it will overwrite the whole array.\n * If called using an object with indexes (e.g. setValues{0: prop1}), it will only overwrite the\n * items at those indexes.\n * For arrays of Properties, this can be used to set nested values in properties found in the array.\n * For example: setValues({0: {position: {x: 2, y:3}}});\n * @param {Array<*>|Object} in_values an array or object containing the values to be set.\n * @throws if one of the path in in_values does not correspond to a path in the property\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n }\n }\n\n /**\n * Deletes all values from an array\n */\n clear() {\n if (this.getLength()) {\n this.removeRange(0, this.getLength());\n }\n }\n\n /**\n * @return {Array<*> | String} all values in the ArrayProperty\n * If called on StringProperty, it returns the whole string\n * WARNING: the returned array must be read only, data written to it\n * will get lost.\n */\n getEntriesReadOnly() {\n return this._dataArrayGetBuffer();\n }\n\n /**\n * Private helper function to update the internal dirty and pending changes\n * is overwritten by StringProperty\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n var pendingChanges = this._getPendingChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n\n var dirtyChanges = this._getDirtyChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Returns the pending changeset for this object\n * @return {property-properties.SerializedChangeSet} The pending changes\n */\n _getPendingChanges() {\n return (this._dirty && this._dirty.pending) || {};\n }\n\n /**\n * Returns the dirty changeset for this object\n * @return {property-properties.SerializedChangeSet} The dirty changes\n */\n _getDirtyChanges() {\n return (this._dirty && this._dirty.dirty) || {};\n }\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending\n * The pending changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty\n * The dirty changeset. If null is passed, no change will be\n * applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n var oldFlags = this._dirty ? this._dirty.flags : 0;\n\n if (this._dirty &&\n this._dirty === DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty = undefined;\n }\n\n if (in_pending !== null) {\n if (!_.isEmpty(in_pending)) {\n this._dirty = this._dirty || {};\n this._dirty.pending = in_pending;\n } else if (this._dirty) {\n this._dirty.pending = undefined;\n }\n }\n\n if (in_dirty !== null) {\n if (!_.isEmpty(in_dirty)) {\n this._dirty = this._dirty || {};\n this._dirty.dirty = in_dirty;\n } else if (this._dirty) {\n this._dirty.dirty = undefined;\n }\n }\n\n if (this._dirty) {\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined) {\n if (oldFlags === 0) {\n this._dirty = undefined;\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n }\n } else {\n this._dirty.flags = oldFlags;\n }\n } else if (oldFlags) {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n }\n }\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty) {\n if (this._dirty !== DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty.flags = in_flags;\n\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined &&\n (this._dirty.flags === 0 || this._dirty.flags === undefined)) {\n this._dirty = undefined;\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n }\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === undefined) {\n return 0;\n }\n\n return this._dirty.flags;\n }\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is not an array.\n * @throws if trying to insert a root property.\n */\n insertRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.insertRange');\n }\n\n if (validationsEnabled.enabled) {\n for (var i = 0; i < in_array.length; i++) {\n if (in_array[i] instanceof BaseProperty) {\n in_array[i]._validateInsertIn(this);\n }\n }\n this._checkIsNotReadOnly(true);\n }\n this._insertRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * inserts the content of a given array, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset target index\n * @param {Array<*>} in_array the array to be inserted\n * @param {Boolean=} [in_setParents=true] If true, set parent of inserted properties.\n * If false, caller has already set parents.\n * @private\n */\n _insertRangeWithoutDirtying(in_offset, in_array, in_setParents) {\n if (in_setParents === undefined) {\n in_setParents = true;\n }\n if (in_offset < 0 || in_offset > this.length || !_.isNumber(in_offset)) {\n throw Error(MSG.START_OFFSET_INVALID + in_offset);\n }\n if (in_setParents && !this._isPrimitive) {\n var arr = [];\n for (var i = 0; i < in_array.length; ++i) {\n var prop = in_array[i];\n if (!(in_array[i] instanceof BaseProperty)) {\n prop = Property.PropertyFactory._createProperty(this._typeid, null, in_array[i], this._getScope());\n }\n\n if (prop.getParent()) {\n throw new Error(MSG.NO_INSERT_WITH_PARENT);\n } else {\n prop._setParent(this);\n }\n arr.push(prop);\n }\n\n in_array = arr;\n }\n this._dataArrayInsertRange(in_offset, in_array);\n\n // Insert entry into changesets\n var changeSet = {\n 'insert': [[in_offset, this._serializeArray(in_array)]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Removes a given number of elements from the array property (or given number of letters from a StringProperty)\n * and shifts remaining values to the left.\n * E.g. [1, 2, 3, 4, 5] .removeRange(1, 3) => [1, 5]\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {Array<*>| Array<property-properties.BaseProperty>} an array containing the values or\n * properties removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER +\n 'in_offset, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = [];\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result.push(this.get(i));\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n }\n\n /**\n * removes a given number of elements from the array property, and ensures, if this is not\n * a primitive array, that any existing properties have their parent pointer cleared.\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @private\n */\n _clearRange(in_offset, in_deleteCount) {\n if (!this._isPrimitive) {\n for (var i = 0; i < in_deleteCount; ++i) {\n if (this._dataArrayGetValue(in_offset + i).getParent() !== this) {\n throw new Error(MSG.CANNOT_REMOVE_WITH_DIFFERENT_PARENT);\n } else {\n this._dataArrayGetValue(in_offset + i)._setParent(undefined);\n }\n }\n }\n\n this._dataArrayRemoveRange(in_offset, in_deleteCount);\n }\n\n /**\n * removes a given number of elements from the array property, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset target start index\n * @param {number} in_deleteCount number of elements to be deleted\n * @private\n */\n _removeRangeWithoutDirtying(in_offset, in_deleteCount) {\n this._clearRange(in_offset, in_deleteCount);\n\n // Insert entry into changesets\n var changeSet = {\n 'remove': [[in_offset, in_deleteCount]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * E.g. [1, 2, 3, 4, 5] .setRange(1, [7, 8]) => [1, 7, 8, 4, 5]\n * @param {number} in_offset target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array) && !_.isString(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.setRange');\n }\n in_offset = Math.floor(in_offset);\n if (!isFinite(in_offset)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.NOT_NUMBER + 'in_offset, method: ArrayProperty.setRange or .set');\n }\n ConsoleUtils.assert(in_offset >= -1 && (in_offset + in_array.length) <= this.getLength(),\n MSG.SET_OUT_OF_BOUNDS + 'Cannot set ' + in_array.length + ' items starting at index ' + in_offset +\n '. Array length: ' + this.getLength());\n this._checkIsNotReadOnly(true);\n this._setRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset target start index\n * @param {Array<*>} in_array contains the elements to be set\n */\n _setRangeWithoutDirtying(in_offset, in_array) {\n this._modifyRangeWithoutDirtying(in_offset, in_array);\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset target start index\n * @param {Array<*>} in_array contains the elements to be set\n */\n _modifyRangeWithoutDirtying(in_offset, in_array) {\n // Has to be overloaded for arrays of properties!\n if (in_offset < 0) {\n throw Error(MSG.START_OFFSET_NEGATIVE + in_offset);\n }\n var changeSet = {};\n var changeArray = [];\n\n if (!this._isPrimitive) {\n // for custom array properties, we have to do a remove/insert instead:\n this._removeRangeWithoutDirtying(in_offset, in_array.length);\n this._insertRangeWithoutDirtying(in_offset, in_array);\n } else {\n // does the reference array property not have a _dataArrayRef ??\n // go through all the elements of in_array to check if the content of the given array\n // is same as value of the array properties. If the values are same, we don't change it.\n // Otherwise, we set them and generate corresponding changeset.\n var j;\n for (var i = 0; i < in_array.length; i++) {\n if (this._dataArrayGetValue(in_offset + i) !== in_array[i]) {\n for (j = i + 1; j < in_array.length; j++) {\n if (this._dataArrayGetValue(in_offset + j) === in_array[j]) {\n break;\n }\n }\n this._dataArraySetRange(in_offset + i, in_array.slice(i, j));\n changeArray.push([in_offset + i, this._serializeArray(in_array.slice(i, j))]);\n i = j;\n }\n }\n changeSet['modify'] = changeArray;\n this._updateChanges(changeSet);\n }\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n * Numerical indexes from the array will be returned as strings.\n * E.g. ['0', '1', '2']\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return Object.keys(this._dataArrayGetBuffer());\n }\n\n /**\n * Checks whether a property or data exists at the given position.\n *\n * @param {string} in_position - index of the property\n * @return {boolean} True if the property or data exists. Otherwise false.\n */\n has(in_position) {\n return this._dataArrayGetBuffer()[in_position] !== undefined;\n }\n\n /**\n * Gets the array element at a given index\n * @param {number | array<string|number>} in_position the target index\n * if an array is passed, elements in the array will be treated as part of a path.\n * The first item in an array should be a position in the array.\n * For example, .get([0,'position','x']) is the equivalent of .get(0).get('position').get('x')\n * If it encounters a ReferenceProperty, .get will, by default, resolve the property it refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if in_position is an array and the first item in the array is not a number\n * @throws if in_position is neither an array nor a number.\n * @throws if in_position is smaller than zero or larger than the length of the array.\n * @return {* | property-properties.BaseProperty | undefined} the element at that index - either a property or a value.\n * or undefined if nothing was found.\n */\n get(in_position, in_options) {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n var prop = this;\n if (_.isArray(in_position)) {\n var iterationStart = 0;\n var prop = this;\n if (in_position[0] === PATH_TOKENS.UP) {\n prop = prop.getParent();\n iterationStart = 1;\n } else if (in_position[0] === PATH_TOKENS.ROOT) {\n prop = prop.getRoot();\n iterationStart = 1;\n } else {\n var pos = Math.floor(in_position[0]);\n ConsoleUtils.assert(isFinite(pos), MSG.FIRST_ITEM_MUST_BE_NUMBER);\n var mode = in_options.referenceResolutionMode;\n ConsoleUtils.assert(pos >= 0 && pos < this.getLength(),\n MSG.GET_OUT_OF_RANGE + in_position[0]);\n }\n for (var i = iterationStart; i < in_position.length && prop; i++) {\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS) {\n mode = i !== in_position.length - 1 ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n if (in_position[i + 1] === PATH_TOKENS.REF) {\n mode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n prop = prop.get(in_position[i], { referenceResolutionMode: mode });\n if (prop === undefined && i < in_position.length - 1) {\n return undefined;\n }\n }\n return prop;\n }\n\n if (in_position === PATH_TOKENS.ROOT) {\n return prop.getRoot();\n } else if (in_position === PATH_TOKENS.UP) {\n return prop.getParent();\n } else if (in_position === PATH_TOKENS.REF) {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n } else {\n var pos = Math.floor(in_position);\n ConsoleUtils.assert(isFinite(pos), MSG.IN_POSITION_MUST_BE_NUMBER);\n var result = this._dataArrayGetValue(pos);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (result instanceof Property.ReferenceProperty) {\n result = result.ref;\n }\n }\n return result;\n }\n }\n\n /**\n * Returns an object with all the nested values contained in this property\n * @return {array<object> | array<*>} an array of objects or values representing the values of your property\n * for example: [\n * {\n * position: {\n * x: 2,\n * y: 5\n * }\n * },\n * {\n * position: {\n * x: 1,\n * y: -8\n * }\n * }]\n * or for a Value Array: [1, 3, 6]\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n result.push(child.getValues());\n }\n return result;\n }\n\n /**\n * @return {Number} the current length of the array\n */\n getLength() {\n return this._dataArrayGetLength();\n }\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n this._checkIsNotReadOnly(false);\n\n // Iterator to process the changes in the ChangeSet in the correct order\n var arrayIterator = new ArrayChangeSetIterator(in_changeSet);\n\n if (!this._isPrimitive) {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var insertedPropertyInstances = [];\n var scope = this._getScope();\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n // Set parent so scope is defined for deserialization\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false);\n insertedPropertyInstances.push(createdProperty);\n }\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(insertedPropertyInstances), false);\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var numRemoved = arrayIterator.opDescription.operation[1];\n if (!_.isNumber(numRemoved)) {\n numRemoved = numRemoved.length;\n }\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, numRemoved);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var startIndex = arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset;\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var modifiedProperty = this.get(startIndex + i,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n if (!modifiedProperty) {\n throw new Error(MSG.INDEX_INVALID + (startIndex + i));\n }\n modifiedProperty._applyChangeset(propertyDescriptions[i], false);\n }\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n } else {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var removeLength = arrayIterator.opDescription.operation[1];\n if (_.isArray(removeLength) || _.isString(removeLength)) {\n removeLength = removeLength.length;\n }\n\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, removeLength);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n this._modifyRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n }\n\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(in_reportToView);\n }\n\n /**\n * @inheritdoc\n */\n _reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n this._checkIsNotReadOnly(false);\n\n this._setChanges(in_pendingChangeSet, in_dirtyChangeSet);\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(false);\n }\n\n /**\n * Removes the dirtiness flag from this property\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean, if none are supplied all\n * will be removed\n * @private\n */\n _cleanDirty(in_flags) {\n // Invoke parent - cleans own dirty flag\n BaseProperty.prototype._cleanDirty.call(this, in_flags);\n\n // null means no change, undefined means reset the changes\n var pendingChanges = null,\n dirtyChanges = null;\n\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) !== 0) {\n pendingChanges = undefined;\n }\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.DIRTY) !== 0) {\n dirtyChanges = undefined;\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Removes the dirtiness flag from this property and recursively from all of its children\n *\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The flags to clean,\n * if none are supplied all will be removed\n */\n cleanDirty(in_dirtinessType) {\n if (!this._isPrimitive) {\n for (var i = 0; i < this._dataArrayGetLength(); ++i) {\n this._dataArrayGetValue(i).cleanDirty(in_dirtinessType);\n }\n }\n // after all paths are clean, we are also clean!\n this._cleanDirty(in_dirtinessType);\n }\n\n /**\n * Internal helper function that implements the deserialize algorithm for an array of named properties.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The serialized changeset to apply. This\n * has to be a normalized change-set (only containing inserts. Removes and Modifies are forbidden).\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {property-properties.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n * deserialization\n */\n _deserializeNamedPropertyArray(in_serializedObj, in_reportToView) {\n if (!_.isArray(in_serializedObj.insert[0][1])) {\n throw new TypeError(MSG.INVALID_CHANGESET);\n }\n\n // When the array contains named properties, we can use an efficient diffing algorithm, which\n // takes advantage of the ability to identify entries in an unique way\n var targetArray = in_serializedObj.insert[0][1];\n\n // The algorithm below finds the mapping between the two given arrays which requires the smallest number of\n // inserted and removed entries. These operations are determined via the following strategy:\n // 1) We search for all consecutive segments in the input data, which map to a consecutive segments in the\n // target array.\n // 2) We search for the longest sequence of consecutive segments in the input data which are all starting at\n // monotone increasing points in the target array. These are the segments which will remain unmodified\n // by insertion/removals\n // 3) Finally, we determine the necessary insertion and remove operations to fill in/remove the entries between\n // these segments and compute modify instructions within the segments.\n\n // 1) Map the GUIDs in the input ChangeSet to indices\n var resultGuidToIndexMap = {};\n for (var i = 0; i < targetArray.length; i++) {\n var insertedProperty = targetArray[i];\n if (insertedProperty['String'] === undefined ||\n insertedProperty['String']['guid'] === undefined) {\n throw new Error(MSG.MISSING_GUID_IN_NORMALIZED_CHANGESET);\n }\n\n var guid = insertedProperty['String']['guid'];\n // since the spec allows alternatively other changeset formats for strings, we have to support them here:\n if (!_.isString(guid) && insertedProperty['String']['guid'].insert) {\n guid = insertedProperty['String']['guid'].insert[0][1];\n }\n resultGuidToIndexMap[guid] = i;\n }\n\n var initialArrayLength = this._dataArrayGetLength();\n\n // Collect consecutive segments\n var segmentStartPointsInInitialArray = [];\n var segmentStartPointsInTargetArray = [];\n var segmentLengths = [];\n var segmentInterrupted = false;\n for (var i = 0; i < initialArrayLength; i++) {\n // Get the GUID of the entry\n var guid = this._dataArrayGetValue(i).getGuid();\n\n // Check where it is stored in the target array\n var index = resultGuidToIndexMap[guid];\n if (index !== undefined) {\n // Check whether we can append the entry to the existing sequence\n if (!segmentInterrupted &&\n segmentStartPointsInTargetArray.length > 0 &&\n _.last(segmentStartPointsInTargetArray) + _.last(segmentLengths) === index) {\n // In that case we just increase the length of the segment\n segmentLengths[segmentLengths.length - 1]++;\n } else {\n // Create a new segment\n segmentStartPointsInInitialArray.push(i);\n segmentStartPointsInTargetArray.push(index);\n segmentLengths.push(1);\n segmentInterrupted = false;\n }\n } else {\n segmentInterrupted = true;\n }\n }\n\n // 2) Get all segments in the array which we will keep (we try to keep as many as possible, so this maps\n // to finding the longest monotone increasing sequence of sub-segments)\n var orderedSegments = _getLongestIncreasingSubsequenceSegments(segmentStartPointsInTargetArray, segmentLengths);\n\n // 3) Now we have to convert this sequence of ordered segments to insert and remove commands\n var changes = {};\n\n var lastPositionInInitialArray = 0;\n var lastPositionInTargetArray = 0;\n var offset = 0;\n for (var i = 0; i <= orderedSegments.length; i++) {\n var startPointInInitialArray, startPointInTargetArray, segmentLength;\n var offsetChange = 0;\n if (i < orderedSegments.length) {\n // Extract the information about the currently processed segment.\n startPointInInitialArray = segmentStartPointsInInitialArray[orderedSegments[i]];\n startPointInTargetArray = segmentStartPointsInTargetArray[orderedSegments[i]];\n segmentLength = segmentLengths[orderedSegments[i]];\n } else {\n // Special case to handle the end of the sequence: We add a segment of length 0 at the end\n startPointInInitialArray = initialArrayLength;\n startPointInTargetArray = targetArray.length;\n segmentLength = 0;\n }\n\n // If the start point of the segment in the initial array is larger than the last point we processed, we have\n // to remove the elements between the two points\n if (startPointInInitialArray > lastPositionInInitialArray) {\n changes.remove = changes.remove || [];\n changes.remove.push([lastPositionInInitialArray, startPointInInitialArray - lastPositionInInitialArray]);\n this._removeRangeWithoutDirtying(lastPositionInInitialArray + offset,\n startPointInInitialArray - lastPositionInInitialArray);\n offsetChange -= startPointInInitialArray - lastPositionInInitialArray;\n }\n\n // If the start point of the segment in the target array is larger than the last point we processed, we have\n // to insert the elements between the two points\n if (startPointInTargetArray > lastPositionInTargetArray) {\n changes.insert = changes.insert || [];\n let elementsToInsert = targetArray.slice(lastPositionInTargetArray, startPointInTargetArray);\n changes.insert.push([\n lastPositionInInitialArray,\n deepCopy(elementsToInsert),\n ]);\n var scope = this._getScope();\n var insertedProperties = deserializeNonPrimitiveArrayElements(elementsToInsert, scope);\n this._insertRangeWithoutDirtying(lastPositionInInitialArray + offset, insertedProperties);\n offsetChange += insertedProperties.length;\n }\n\n // Update the last processed points\n lastPositionInInitialArray = startPointInInitialArray + segmentLength;\n lastPositionInTargetArray = startPointInTargetArray + segmentLength;\n offset += offsetChange;\n\n // Recursively check the entries within the segment for modifications\n for (var j = 0; j < segmentLength; j++) {\n var existingEntry = this._dataArrayGetValue(startPointInInitialArray + j + offset);\n var entryChanges = existingEntry._deserialize(targetArray[startPointInTargetArray + j],\n false, undefined, true);\n\n // We had changes which we have to report back\n if (!ChangeSet.isEmptyChangeSet(entryChanges)) {\n // Make sure, the ChangeSet contains the typeid of the modified entry\n entryChanges.typeid = existingEntry.getFullTypeid();\n\n if (!changes.modify) {\n changes.modify = [[startPointInInitialArray + j, [entryChanges]]];\n } else {\n var lastModifiedSequence = _.last(changes.modify);\n if (lastModifiedSequence[0] + lastModifiedSequence[1].length === startPointInInitialArray + j) {\n lastModifiedSequence[1].push(entryChanges);\n } else {\n changes.modify.push([startPointInInitialArray + j, [entryChanges]]);\n }\n }\n }\n }\n }\n\n // If there were any changes, we have to mark this property as dirty\n if (!ChangeSet.isEmptyChangeSet(changes)) {\n this._setDirty(in_reportToView);\n }\n return changes;\n }\n\n /**\n * Function to deserialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {*} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n // we have to convert the propertySet objects to changesets\n return in_obj._serialize(false, true);\n }\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var len = in_array.length;\n var result = new Array(len);\n if (this._isPrimitive) {\n for (var i = 0; i < len; i++) {\n result[i] = this._serializeValue(in_array[i]);\n }\n } else {\n for (var i = 0; i < len; i++) {\n result[i] = {};\n }\n }\n return result;\n }\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj the serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n this._checkIsNotReadOnly(false);\n\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isArray(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var arrayLength = this._dataArrayGetLength();\n\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (arrayLength > 0) {\n this._clearRange(0, arrayLength);\n this._setDirty(in_reportToView);\n var removeChangeSet = {\n remove: [[0, arrayLength]],\n };\n this._updateChanges(removeChangeSet);\n return removeChangeSet;\n } else {\n // the array was already empty, nothing has changed\n return {};\n }\n }\n\n var scope = this._getScope();\n\n if (Property.PropertyFactory.inheritsFrom(this.getTypeid(), 'NamedProperty', { scope: scope })) {\n return this._deserializeNamedPropertyArray(in_serializedObj, in_reportToView);\n } else {\n // most simplistic diff method: Remove all existing data and insert the new data\n\n // The changes we will report as result of this function\n var simpleChanges = {\n insert: in_createChangeSet ? deepCopy(in_serializedObj.insert) : in_serializedObj.insert,\n };\n if (arrayLength > 0) {\n simpleChanges.remove = [[0, arrayLength]];\n }\n\n if (!this._isPrimitive) {\n var propertyDescriptions = in_serializedObj.insert[0][1];\n var result = [];\n\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false, in_filteringOptions, false);\n result.push(createdProperty);\n }\n this._clearRange(0, this._dataArrayGetLength());\n this._dataArrayInsertRange(0, result);\n } else {\n // Check, whether there has been any change in the array at all\n if (in_serializedObj.insert[0][1].length === this._dataArrayGetLength()) {\n // We have to compare the two buffers\n var buffer = this._dataArrayGetBuffer();\n var changeSetArray = in_serializedObj.insert[0][1];\n var len = buffer.length;\n var i = 0;\n if (this._typeid === 'Int64' || this._typeid === 'Uint64') {\n // For (u)int64, we will compare (Ui/I)nt64 objects with arrays [low, high]\n for (i = 0; i < len; i++) {\n if (changeSetArray[i][0] !== buffer[i].getValueLow() || changeSetArray[i][1] !== buffer[i].getValueHigh()) {\n break;\n }\n }\n } else {\n for (i = 0; i < len; i++) {\n if (buffer[i] !== changeSetArray[i]) {\n break;\n }\n }\n }\n if (i === len) {\n return {};\n }\n }\n // set the actual array values to our array\n this._dataArrayDeserialize(this._deserializeArray(in_serializedObj.insert[0][1]));\n }\n\n // Update the dirty and pending changes\n this._updateChanges(simpleChanges);\n\n // Finally report the dirtiness to the view (we postponed this above)\n this._setDirty(in_reportToView);\n\n return simpleChanges;\n }\n }\n\n _getChangesetForCustomTypeArray(in_basePropertyChangeset,\n in_dirtinessType,\n in_includeReferencedRepositories) {\n var result = {};\n if (in_basePropertyChangeset.remove && in_basePropertyChangeset.remove.length > 0) {\n result.remove = deepCopy(in_basePropertyChangeset.remove);\n }\n // get the iterator over the changes:\n var iterator = new ArrayChangeSetIterator(in_basePropertyChangeset);\n var currentArrayIndex = 0;\n var currentArraySize = this._dataArrayGetLength();\n var op, opStartIndex;\n while (!iterator.atEnd() || currentArrayIndex < currentArraySize) {\n if (!iterator.atEnd()) {\n op = iterator.opDescription;\n opStartIndex = op.operation[0] + op.offset;\n } else {\n // no more ops\n op = { offset: iterator.opDescription.offset };\n opStartIndex = Number.MAX_VALUE;\n }\n\n if (currentArrayIndex < opStartIndex) {\n // not in the influence of an insert or remove\n\n // we have to check if the element was modified (since that is not tracked)\n if (this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n // check if we can combine modifies:\n var lastModify = undefined;\n if (result.modify && result.modify.length > 0) {\n lastModify = result.modify[result.modify.length - 1];\n if (lastModify[0] + lastModify[1].length === currentArrayIndex - op.offset) {\n // we need to combine, keep lastModify\n } else {\n lastModify = undefined;\n }\n }\n\n if (lastModify) {\n lastModify[1].push(this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n } else {\n // begin new modify\n if (!result.modify) {\n result.modify = [];\n }\n result.modify.push([currentArrayIndex - op.offset,\n [this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n })]]);\n }\n currentArrayIndex++;\n // add more immediate modifies if possible\n while (currentArrayIndex < currentArraySize && currentArrayIndex < opStartIndex &&\n this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n result.modify[result.modify.length - 1][1].push(\n this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }),\n );\n currentArrayIndex++;\n }\n } else {\n currentArrayIndex++;\n }\n } else if (currentArrayIndex === opStartIndex) {\n // handle the op\n if (op.type === ArrayChangeSetIterator.types.REMOVE) {\n // no need to do something (removes are just copied)\n iterator.next(); // we've completely consumed that op\n } else if (op.type === ArrayChangeSetIterator.types.INSERT) {\n // we have to convert the inserts:\n var currentInsert = op.operation;\n var newInsert = [currentInsert[0], []];\n for (var j = 0; j < currentInsert[1].length; ++j) {\n // TODO: we don't use the data from the changeset anymore, since we directly\n // TODO: read the data from the array now - remove the data from the op and\n // TODO: replace it with just the length instead\n if (!this._dataArrayGetValue(opStartIndex + j)) {\n throw new Error('insert: invalid index');\n }\n newInsert[1].push(this._dataArrayGetValue(opStartIndex + j).serialize(\n {\n 'dirtyOnly': false, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n }\n if (!result.insert) {\n result.insert = [];\n }\n result.insert.push(newInsert);\n currentArrayIndex += currentInsert[1].length; // we've read and used these entries above\n iterator.next(); // we've completely consumed that op\n } else if (op.type === ArrayChangeSetIterator.types.MODIFY) {\n // Prevent from looping infinitly\n // TODO: Might want to decide if there's something to do here\n iterator.next(); // we've completely consumed that op\n }\n }\n }\n return result;\n }\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy - has no effect for ArrayProperty\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the _serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n var result = AbstractStaticCollectionProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories);\n\n if (!this._isPrimitive) {\n if (in_dirtyOnly) {\n _.extend(result, in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n this._getChangesetForCustomTypeArray(this._getPendingChanges(), in_dirtinessType,\n in_includeReferencedRepositories) :\n this._getChangesetForCustomTypeArray(this._getDirtyChanges(), in_dirtinessType,\n in_includeReferencedRepositories));\n\n return result;\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n // we have to convert the propertySet objects to changesets\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._dataArrayGetValue(i)._serialize(false, true, in_dirtinessType,\n in_includeReferencedRepositories));\n }\n }\n return result;\n }\n } else if (in_dirtyOnly) {\n return in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n deepCopy(this._getPendingChanges()) : deepCopy(this._getDirtyChanges());\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._serializeValue(this._dataArrayGetValue(i)));\n }\n }\n return result;\n }\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property and of its sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level.\n * Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n if (!this._isPrimitive) {\n this._prettyPrintChildren(indent, printFct);\n } else {\n var childIndent = indent + ' ';\n var prefix = '';\n var suffix = '';\n if (this.getTypeid() === 'String') {\n prefix = '\"';\n suffix = '\"';\n }\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n printFct(childIndent + i + ': ' + prefix + this._dataArrayGetValue(i) + suffix);\n }\n }\n printFct(indent + ']');\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property's sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrintChildren(indent, printFct) {\n indent += ' ';\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })\n ._prettyPrint(indent, ids[i] + ': ', printFct);\n }\n }\n\n /**\n * Return a JSON representation of the array and its items.\n * @return {object} A JSON representation of the array and its items.\n * @private\n */\n _toJson() {\n var json = {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: [],\n };\n\n if (!this._isPrimitive) {\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n json.value.push(\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })._toJson(),\n );\n }\n } else {\n json.value = this.getValues();\n }\n\n return json;\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the array type id, if not\n * omitted by parameters\n * @param {boolean} [in_hideCollection=false] - if true the collection type (if applicable) will be omitted\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n if (in_hideCollection) {\n return this._typeid;\n } else {\n return TypeIdHelper.createSerializationTypeId(this._typeid, 'array');\n }\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length the initial length of the array\n */\n _dataArrayCreate(in_length) {\n // This really creates a generic array for custom type arrays. For primitive arrays, like\n // 'StringArrayProperty' or 'Float32ArrayProperty', you need to overload this function.\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n var element = Property.PropertyFactory._createProperty(this.getTypeid(), null, undefined, this._scope);\n element._setParent(this);\n this._dataArraySetValue(i, element);\n }\n }\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n }\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef.getBuffer();\n }\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_index - Position in the array\n *\n * @return {*} The value at index in_index\n */\n _dataArrayGetValue(in_index) {\n return this._dataArrayRef.getValue(in_index);\n }\n\n /**\n * Sets an entry in the data array\n * @param {Number} in_index - Position in the array\n * @param {*} in_value - The new value at index in_index\n */\n _dataArraySetValue(in_index, in_value) {\n this._dataArrayRef.setValue(in_index, in_value);\n }\n\n /**\n * Set the array to the given new array\n * @param {Array} in_newArray - The new contents of the array\n */\n _dataArrayDeserialize(in_newArray) {\n this._dataArrayRef.deserialize(in_newArray);\n }\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {Array} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef.insertRange(in_position, in_range);\n }\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n this._dataArrayRef.removeRange(in_position, in_length);\n }\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Array} in_range - The array to overwrite\n */\n _dataArraySetRange(in_position, in_range) {\n this._dataArrayRef.set(in_position, in_range);\n }\n\n /**\n * Get the scope to which this property belongs to.\n * @return {string|undefined} The guid representing the scope in which the\n * map belongs to. If there is a workspace scope return it, else return the scope of this array.\n * @override\n * @private\n */\n _getScope() {\n var scope = AbstractStaticCollectionProperty.prototype._getScope.call(this);\n\n if (scope !== undefined) {\n return scope;\n } else {\n return this._scope;\n }\n }\n\n /**\n * returns the length of the current array property\n */\n get length() {\n return this.getLength();\n }\n set length(len) {\n throw new Error(MSG.MODIFY_READ_ONLY);\n }\n}\n\nArrayProperty.prototype._staticChildren = {};\nArrayProperty.prototype._context = 'array';\n"]}
@@ -25,10 +25,11 @@ export class MapProperty extends IndexedCollectionBaseProperty {
25
25
  /**
26
26
  * Sets multiple values in a map.
27
27
  *
28
+ * See {@link MapProperty.setValues}
29
+ *
28
30
  * @param {object} in_values to assign to the collection
29
31
  * @param {Boolean} in_typed - If the map's items have a typeid and a value then create the
30
32
  * properties with that typeid, else use the set's typeid (support polymorphic items).
31
- * @see {setValues}
32
33
  * @private
33
34
  */
34
35
  private _setValuesInternal;
@@ -1 +1 @@
1
- {"version":3,"file":"mapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AAEH;;GAEG;AACH;IACI;;;;;;;;OAQG;IACH,wBAQC;IALG,eAAsB;IACtB,qBAA2D;IAE3D,6CAA6C;IAC7C,qBAA0B;IA2B9B;;;;;;;;OAQG;IACH,2BAsCC;IA+FD;;;;;;;;;;;;OAYG;IACH,eAPW,MAAM,0BAsBhB;IAED;;;;;;OAMG;IACH,eAJW,MAAM,OAQhB;IAED;;;;;;;;;;OAUG;IACH,YANW,MAAM,0BAwBhB;IAwED;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IA8BD;;OAEG;IACH,cAKC;CACJ"}
1
+ {"version":3,"file":"mapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAmBA;;;;;GAKG;AAEH;;GAEG;AACH;IACI;;;;;;;;OAQG;IACH,wBAQC;IALG,eAAsB;IACtB,qBAA2D;IAE3D,6CAA6C;IAC7C,qBAA0B;IA2B9B;;;;;;;;;OASG;IACH,2BAsCC;IAgGD;;;;;;;;;;;;OAYG;IACH,eAPW,MAAM,0BAsBhB;IAED;;;;;;OAMG;IACH,eAJW,MAAM,OAQhB;IAED;;;;;;;;;;OAUG;IACH,YANW,MAAM,0BAwBhB;IAwED;;;;;;;OAOG;IACH,cAHY,eAAe,CAK1B;IA8BD;;OAEG;IACH,cAKC;CACJ"}