text: /*!
   * UI development toolkit for HTML5 (OpenUI5)
   * (c) Copyright 2009-2017 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["jquery.sap.global","sap/ui/fl/Utils","sap/ui/fl/Change"],function(q,U,C){"use strict";var V=function(c,a,o){this._sComponentName=c||"";this._sAppVersion=a||U.DEFAULT_APP_VERSION;this._setChangeFileContent(o);};V.prototype.getComponentName=function(){return this._sComponentName;};V.prototype.getAppVersion=function(){return this._sAppVersion;};V.prototype._setChangeFileContent=function(c){if(!c||!c.changes||!c.changes.variantSection){this._mVariantManagement={};}else{this._mVariantManagement=c.changes.variantSection;}};V.prototype.getVariants=function(v){var a=[];function c(b,d){if(b.title<d.title){return-1;}else if(b.title>d.title){return 1;}else{return 0;}}if(this._mVariantManagement[v]){a=this._mVariantManagement[v].variants.sort(c);var i=-1;a.some(function(o,b){if(o.content.fileName===v){i=b;return true;}return false;});if(i>-1){var s=a.splice(i,1)[0];a.splice(0,0,s);}}return a;};V.prototype.getVariantChanges=function(v,s){var a=s||this._mVariantManagement[v].defaultVariant;var b=this.getVariants(v);if(b.length===0){return b;}else{var f=b.filter(function(o){if(o.content.fileName===a){return true;}});return f.reduce(function(r,o){return r.concat(o.changes);},[]);}};V.prototype.loadDefaultChanges=function(){var v;var d=[];for(var s in this._mVariantManagement){v=this._mVariantManagement[s].defaultVariant;d=d.concat(this.getVariantChanges(s,v));}return d;};V.prototype.getChangesForVariantSwitch=function(v,c,n,m){var a=this.getVariantChanges(v,c).map(function(o){return new C(o).getKey();});var b=Object.keys(m).reduce(function(d,e){var f=[];m[e].forEach(function(o){var i=a.indexOf(o.getKey());if(i!==-1){f.push(o);}});return d.concat(f);},[]);var N=this.getVariantChanges(v,n).map(function(o){return new C(o);});var r=b.slice();b.some(function(o){if(o.getKey()===N[0].getKey()){N.shift();r.shift();}else{return true;}});var s={aRevert:r.reverse(),aNew:N};return s;};V.prototype._fillVariantModel=function(){var v={};Object.keys(this._mVariantManagement).forEach(function(k){v[k]={defaultVariant:this._mVariantManagement[k].defaultVariant,variants:[]};this.getVariants(k).forEach(function(o,i){v[k].variants[i]={key:o.content.fileName,title:o.content.title,author:o.content.support.user,layer:o.content.layer,readOnly:o.content.fileName===k};});}.bind(this));return v;};return V;},true);
  