(function(){"use strict";u8.Crm.Widgets.KPIInfoAreaSelector=function(e,t){this.InfoAreaSelector(e,$.extend({},u8.Crm.Widgets.KPIInfoAreaSelector.defaults,t))};u8.Crm.Widgets.KPIInfoAreaSelector.defaults={};$.extend(u8.Crm.Widgets.KPIInfoAreaSelector.prototype,{_createItemModel:function(){if(this.infoAreaIds){return this._createItems(this.infoAreaIds)}var e=this;u8.services.kpis.getInfoAreasAllowedForKPIDefinition(function(t){var r=e._createItems(t);e._combo.setItems(r)});return[]},_createItems:function(e){var t=this.showPlural;var r=u8.services.schema;var s=[];for(var o=0;o<e.length;o++){var a=e[o];var i=r.getInfoArea(a);if(!this.showLockedInfoAreas&&!i.canView()||!this.showVirtualInfoAreas&&i.isVirtualInfoArea){continue}var n=t?i.labelPlural:i.label;if(!n){n=a}else if(this.idPostfix){n+=" ("+a+")"}s.push({key:a,text:n})}s.sort(u8._.cmp("text"));if(this.prependEmptyValue){s.insert(0,{key:"",text:""})}return s}});u8.Crm.Widgets.KPIInfoAreaSelector.makeClass({name:"KPIInfoAreaSelector",deriveFrom:u8.Crm.Widgets.InfoAreaSelector,events:["ValueChange"]})})();