/*!
 * SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5)
 * (c) Copyright 2009-2015 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/core/IconPool'],function(q,I){"use strict";var a={};a._aAllIconColors=['sapMITBFilterCritical','sapMITBFilterPositive','sapMITBFilterNegative','sapMITBFilterDefault'];a.render=function(r,c){if(!c.getVisible()){return;}var i=c.getItems(),t=c._checkTextOnly(i),n=c._checkNoText(i),R=sap.ui.getCore().getLibraryResourceBundle('sap.m');var o=c.getParent();var u=o&&o instanceof sap.m.IconTabBar&&o.getUpperCase();r.write("<div role='tablist' ");r.addClass("sapMITH");if(c._scrollable){r.addClass("sapMITBScrollable");if(c._bPreviousScrollForward){r.addClass("sapMITBScrollForward");}else{r.addClass("sapMITBNoScrollForward");}if(c._bPreviousScrollBack){r.addClass("sapMITBScrollBack");}else{r.addClass("sapMITBNoScrollBack");}}else{r.addClass("sapMITBNotScrollable");}if(u){r.addClass("sapMITBTextUpperCase");}r.writeControlData(c);r.writeClasses();r.write(">");r.renderControl(c._getScrollingArrow("left"));if(c._bDoScroll){r.write("<div id='"+c.getId()+"-scrollContainer' class='sapMITBScrollContainer'>");}r.write("<div id='"+c.getId()+"-head'");r.addClass("sapMITBHead");if(t){r.addClass("sapMITBTextOnly");}if(n){r.addClass("sapMITBNoText");}r.writeClasses();r.write(">");q.each(i,function(b,d){if(!(d instanceof sap.m.IconTabSeparator)&&!d.getVisible()){return;}var T='';if(d instanceof sap.m.IconTabSeparator){if(d.getIcon()){T+='role="img" aria-label="'+R.getText("ICONTABBAR_NEXTSTEP")+'"';}else{T+='role="separator"';}}else{T+='role="tab" aria-controls="'+c.getParent().sId+'-content" ';if(d){var s=d.getIconColor();var e=s==='Positive'||s==='Critical'||s==='Negative';if(d.getText().length||d.getCount()!==""||d.getIcon()){T+='aria-labelledby="';var f=[];if(d.getText().length){f.push(d.getId()+'-text');}if(d.getCount()!==""){f.push(d.getId()+'-count');}if(d.getIcon()){f.push(d.getId()+'-icon');}if(e){f.push(d.getId()+'-iconColor');}T+=f.join(' ');T+='"';}}}r.write('<div '+T+' ');r.writeElementData(d);r.addClass("sapMITBItem");if(d instanceof sap.m.IconTabFilter){if(d.getDesign()===sap.m.IconTabFilterDesign.Vertical){r.addClass("sapMITBVertical");}else if(d.getDesign()===sap.m.IconTabFilterDesign.Horizontal){r.addClass("sapMITBHorizontal");}if(d.getShowAll()){r.addClass("sapMITBAll");}else{r.addClass("sapMITBFilter");r.addClass("sapMITBFilter"+d.getIconColor());}if(!d.getEnabled()){r.addClass("sapMITBDisabled");}var g=d.getTooltip_AsString();if(g){r.writeAttributeEscaped("title",g);}r.writeClasses();r.write(">");r.write("<div id='"+d.getId()+"-tab' class='sapMITBTab'>");if(!d.getShowAll()||!d.getIcon()){if(e){r.write('<div id="'+d.getId()+'-iconColor" style="display: none;">'+R.getText('ICONTABBAR_ICONCOLOR_'+s.toUpperCase())+'</div>');}r.renderControl(d._getImageControl(['sapMITBFilterIcon','sapMITBFilter'+d.getIconColor()],c,a._aAllIconColors));}if(!d.getShowAll()&&!d.getIcon()&&!t){r.write("<span class='sapMITBFilterNoIcon'> </span>");}if(d.getDesign()===sap.m.IconTabFilterDesign.Horizontal){r.write("</div>");r.write("<div class='sapMITBHorizontalWrapper'>");}r.write("<span id='"+d.getId()+"-count' ");r.addClass("sapMITBCount");r.writeClasses();r.write(">");if((d.getCount()==="")&&(d.getDesign()===sap.m.IconTabFilterDesign.Horizontal)){r.write("&nbsp;");}else{r.writeEscaped(d.getCount());}r.write("</span>");if(d.getDesign()===sap.m.IconTabFilterDesign.Vertical){r.write("</div>");}if(d.getText().length){r.write("<div id='"+d.getId()+"-text' ");r.addClass("sapMITBText");if(u){r.addClass("sapMITBTextUpperCase");}r.writeClasses();r.write(">");r.writeEscaped(d.getText());r.write("</div>");}if(d.getDesign()===sap.m.IconTabFilterDesign.Horizontal){r.write("</div>");}r.write("<div class='sapMITBContentArrow'></div>");}else{r.addClass("sapMITBSep");if(!d.getIcon()){r.addClass("sapMITBSepLine");}r.writeClasses();r.write(">");if(d.getIcon()){r.renderControl(d._getImageControl(['sapMITBSepIcon'],c));}}r.write("</div>");});r.write("</div>");if(c._bDoScroll){r.write("</div>");}r.renderControl(c._getScrollingArrow("right"));r.write("</div>");};return a;},true);
