function _getControlChangesForVariantSwitch(mPropertyBag) {
		var aCurrentVariantChanges = VariantManagementState.getControlChangesForVariant(
			Object.assign(
				_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
					changeInstance: true,
					vReference: mPropertyBag.currentVReference
				}
			)
		);
		var aNewChanges = VariantManagementState.getControlChangesForVariant(
			Object.assign(
				_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
					changeInstance: true,
					vReference: mPropertyBag.newVReference
				}
			)
		);
		var aMapChanges = Object.keys(mPropertyBag.changesMap).reduce(function(aControlChanges, sControlId) {
			return aControlChanges.concat(mPropertyBag.changesMap[sControlId]);
		}, []);
		var aChangeKeysFromMap = aMapChanges.map(function(oCurrentVariantChange) {
			return oCurrentVariantChange.getId();
		});

		var aFilteredChangesFromMap = aCurrentVariantChanges.reduce(function(aFilteredChanges, oChange) {
			var iMapIndex = aChangeKeysFromMap.indexOf(oChange.getId());
			if (iMapIndex > -1) {
				aFilteredChanges = aFilteredChanges.concat(aMapChanges[iMapIndex]);
			}
			return aFilteredChanges;
		}, []);

		var aRevertChanges = [];
		if (aNewChanges.length > 0) {
			aRevertChanges = aFilteredChangesFromMap.slice();
			aFilteredChangesFromMap.some(function(oChange) {
				if (aNewChanges[0] && oChange.getId() === aNewChanges[0].getId()) {
					aNewChanges.shift();
					aRevertChanges.shift();
				} else {
					return true;
				}
			});
		} else {
			aRevertChanges = aFilteredChangesFromMap;
		}

		var mSwitches = {
			changesToBeReverted: aRevertChanges.reverse(),
			changesToBeApplied: aNewChanges
		};

		return mSwitches;
	}
/**
	 * Returns the map with all changes to be reverted and applied when switching variants.
	 *
	 * @param {object} mPropertyBag - Additional properties for variant switch
	 * @param {string} mPropertyBag.vmReference - Variant management ID
	 * @param {string} mPropertyBag.currentVReference - The ID of the currently used variant
	 * @param {string} mPropertyBag.newVReference - ID of the newly selected variant
	 * @param {object} mPropertyBag.changesMap - Changes inside the current changes map
	 *
	 * @typedef {object} sap.ui.fl.variants.SwitchChanges
	 * @property {array} changesToBeReverted - Array of changes to be reverted
	 * @property {array} changesToBeApplied - Array of changes to be applied
	 *
	 * @returns {sap.ui.fl.variants.SwitchChanges} Map containing all changes to be reverted and all new changes
	 * @private
	 * @ui5-restricted
	 */
Returns the map with all changes to be reverted and applied when switching variants.

@typedef {object} sap.ui.fl.variants.SwitchChanges
@property {array} changesToBeReverted - Array of changes to be reverted
@property {array} changesToBeApplied - Array of changes to be applied

@returns {sap.ui.fl.variants.SwitchChanges} Map containing all changes to be reverted and all new changes
@private
@ui5-restricted
Returns the map with all changes to be reverted and applied when switching variants . @typedef { object } sap . ui . fl . variants . SwitchChanges @property { array } changesToBeReverted - Array of changes to be reverted @property { array } changesToBeApplied - Array of changes to be applied @returns { sap . ui . fl . variants . SwitchChanges } Map containing all changes to be reverted and all new changes @private @ui5 - restricted
function _getControlChangesForVariantSwitch(mPropertyBag) {
		var aCurrentVariantChanges = VariantManagementState.getControlChangesForVariant(
			Object.assign(
				_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
					changeInstance: true,
					vReference: mPropertyBag.currentVReference
				}
			)
		);
		var aNewChanges = VariantManagementState.getControlChangesForVariant(
			Object.assign(
				_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
					changeInstance: true,
					vReference: mPropertyBag.newVReference
				}
			)
		);
		var aMapChanges = Object.keys(mPropertyBag.changesMap).reduce(function(aControlChanges, sControlId) {
			return aControlChanges.concat(mPropertyBag.changesMap[sControlId]);
		}, []);
		var aChangeKeysFromMap = aMapChanges.map(function(oCurrentVariantChange) {
			return oCurrentVariantChange.getId();
		});
		var aFilteredChangesFromMap = aCurrentVariantChanges.reduce(function(aFilteredChanges, oChange) {
			var iMapIndex = aChangeKeysFromMap.indexOf(oChange.getId());
			if (iMapIndex > -1) {
				aFilteredChanges = aFilteredChanges.concat(aMapChanges[iMapIndex]);
			}
			return aFilteredChanges;
		}, []);
		var aRevertChanges = [];
		if (aNewChanges.length > 0) {
			aRevertChanges = aFilteredChangesFromMap.slice();
			aFilteredChangesFromMap.some(function(oChange) {
				if (aNewChanges[0] && oChange.getId() === aNewChanges[0].getId()) {
					aNewChanges.shift();
					aRevertChanges.shift();
				} else {
					return true;
				}
			});
		} else {
			aRevertChanges = aFilteredChangesFromMap;
		}
		var mSwitches = {
			changesToBeReverted: aRevertChanges.reverse(),
			changesToBeApplied: aNewChanges
		};
		return mSwitches;
	}
function _getControlChangesForVariantSwitch ( mPropertyBag ) { var aCurrentVariantChanges = VariantManagementState . getControlChangesForVariant ( Object . assign ( _pick ( mPropertyBag , [ "vmReference" , "variantsMap" , "reference" ] ) , { changeInstance : true , vReference : mPropertyBag . currentVReference } ) ) ; var aNewChanges = VariantManagementState . getControlChangesForVariant ( Object . assign ( _pick ( mPropertyBag , [ "vmReference" , "variantsMap" , "reference" ] ) , { changeInstance : true , vReference : mPropertyBag . newVReference } ) ) ; var aMapChanges = Object . keys ( mPropertyBag . changesMap ) . reduce ( function ( aControlChanges , sControlId ) { return aControlChanges . concat ( mPropertyBag . changesMap [ sControlId ] ) ; } , [ ] ) ; var aChangeKeysFromMap = aMapChanges . map ( function ( oCurrentVariantChange ) { return oCurrentVariantChange . getId ( ) ; } ) ; var aFilteredChangesFromMap = aCurrentVariantChanges . reduce ( function ( aFilteredChanges , oChange ) { var iMapIndex = aChangeKeysFromMap . indexOf ( oChange . getId ( ) ) ; if ( iMapIndex > - 1 ) { aFilteredChanges = aFilteredChanges . concat ( aMapChanges [ iMapIndex ] ) ; } return aFilteredChanges ; } , [ ] ) ; var aRevertChanges = [ ] ; if ( aNewChanges . length > 0 ) { aRevertChanges = aFilteredChangesFromMap . slice ( ) ; aFilteredChangesFromMap . some ( function ( oChange ) { if ( aNewChanges [ 0 ] && oChange . getId ( ) === aNewChanges [ 0 ] . getId ( ) ) { aNewChanges . shift ( ) ; aRevertChanges . shift ( ) ; } else { return true ; } } ) ; } else { aRevertChanges = aFilteredChangesFromMap ; } var mSwitches = { changesToBeReverted : aRevertChanges . reverse ( ) , changesToBeApplied : aNewChanges } ; return mSwitches ; }
Returns the map with all changes to be reverted and applied when switching variants.
Returns the map with all changes to be reverted and applied when switching variants .