text: /*!
   * OpenUI5
   * (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/core/Control","./shellBar/Factory","./shellBar/AdditionalContentSupport","./shellBar/ResponsiveHandler","./shellBar/Accessibility","sap/m/BarInPageEnabler","./ShellBarRenderer"],function(t,e,o,i,s,r){"use strict";var a=t.extend("sap.f.ShellBar",{metadata:{library:"sap.f",interfaces:["sap.f.IShellBar","sap.m.IBar","sap.tnt.IToolHeader"],properties:{title:{type:"string",group:"Appearance",defaultValue:""},secondTitle:{type:"string",group:"Appearance",defaultValue:""},homeIcon:{type:"sap.ui.core.URI",group:"Appearance",defaultValue:""},homeIconTooltip:{type:"string",group:"Appearance",defaultValue:""},showMenuButton:{type:"boolean",group:"Appearance",defaultValue:false},showNavButton:{type:"boolean",group:"Appearance",defaultValue:false},showCopilot:{type:"boolean",group:"Appearance",defaultValue:false},showSearch:{type:"boolean",group:"Appearance",defaultValue:false},showNotifications:{type:"boolean",group:"Appearance",defaultValue:false},showProductSwitcher:{type:"boolean",group:"Appearance",defaultValue:false},notificationsNumber:{type:"string",group:"Appearance",defaultValue:""}},aggregations:{menu:{type:"sap.m.Menu",multiple:false,forwarding:{getter:"_getMenu",aggregation:"menu"}},searchManager:{type:"sap.f.SearchManager",multiple:false},profile:{type:"sap.f.Avatar",multiple:false,forwarding:{getter:"_getProfile",aggregation:"avatar"}},additionalContent:{type:"sap.f.IShellBar",multiple:true,singularName:"additionalContent"},_overflowToolbar:{type:"sap.m.OverflowToolbar",multiple:false,visibility:"hidden"}},events:{homeIconPressed:{parameters:{icon:{type:"sap.m.Image"}}},menuButtonPressed:{parameters:{button:{type:"sap.m.Button"}}},navButtonPressed:{parameters:{button:{type:"sap.m.Button"}}},copilotPressed:{parameters:{image:{type:"sap.m.Image"}}},searchButtonPressed:{parameters:{button:{type:"sap.m.Button"}}},notificationsPressed:{parameters:{button:{type:"sap.m.Button"}}},productSwitcherPressed:{parameters:{button:{type:"sap.m.Button"}}},avatarPressed:{parameters:{avatar:{type:"sap.f.Avatar"}}}}}});o.apply(a.prototype);a.prototype.init=function(){this._oFactory=new e(this);this._bOTBUpdateNeeded=true;this._oOverflowToolbar=this._oFactory.getOverflowToolbar();this.setAggregation("_overflowToolbar",this._oOverflowToolbar);this._oToolbarSpacer=this._oFactory.getToolbarSpacer();this._oControlSpacer=this._oFactory.getControlSpacer();this._oResponsiveHandler=new i(this);this._aOverflowControls=[];this._oAcc=new s(this)};a.prototype.onBeforeRendering=function(){var t=this.getNotificationsNumber();this._assignControlsToOverflowToolbar();if(this.getShowNotifications()&&t!==undefined){this._updateNotificationsIndicators(t)}};a.prototype.exit=function(){this._oResponsiveHandler.exit();this._oFactory.destroy();this._oAcc.exit()};a.prototype.setHomeIcon=function(t){if(t){if(!this._oHomeIcon){this._oHomeIcon=this._oFactory.getHomeIcon()}this._oHomeIcon.setSrc(t)}else{this._oHomeIcon=null}this._bOTBUpdateNeeded=true;return this.setProperty("homeIcon",t)};a.prototype.setHomeIconTooltip=function(t){var e=this._oAcc.getEntityTooltip("LOGO");if(!this._oHomeIcon){this._oHomeIcon=this._oFactory.getHomeIcon()}if(t){this._oHomeIcon.setTooltip(t)}else{this._oHomeIcon.setTooltip(e)}this._bOTBUpdateNeeded=false;return this.setProperty("homeIconTooltip",t,true)};a.prototype.setTitle=function(t){this._sTitle=t;if(!t){this._oPrimaryTitle=null;this._oMegaMenu=null}else{if(!this._oMegaMenu){this._oMegaMenu=this._oFactory.getMegaMenu()}this._oMegaMenu.setText(t);if(!this._oPrimaryTitle){this._oPrimaryTitle=this._oFactory.getPrimaryTitle()}this._oPrimaryTitle.setText(t)}this._bOTBUpdateNeeded=true;return this.setProperty("title",t)};a.prototype.setSecondTitle=function(t){if(t){if(!this._oSecondTitle){this._oSecondTitle=this._oFactory.getSecondTitle()}this._oSecondTitle.setText(t)}else{this._oSecondTitle=null}this._bOTBUpdateNeeded=true;return this.setProperty("secondTitle",t)};a.prototype.setShowCopilot=function(t){if(t){if(!this._oCopilot){this._oCopilot=this._oFactory.getCopilot()}}else{this._oCopilot=null}this._bOTBUpdateNeeded=true;return this.setProperty("showCopilot",t)};a.prototype.setShowSearch=function(t){if(t){if(!this._oSearch){this._oSearch=this._oFactory.getSearch()}}else{this._oSearch=null}this._bOTBUpdateNeeded=true;return this.setProperty("showSearch",t)};a.prototype.setSearchManager=function(t){this.setAggregation("searchManager",t);if(t){if(!this._oManagedSearch){this._oManagedSearch=this._oFactory.getManagedSearch()}}else{this._oManagedSearch=null}this._bOTBUpdateNeeded=true;return this};a.prototype.setShowNotifications=function(t){if(t){if(!this._oNotifications){this._oNotifications=this._oFactory.getNotifications()}}else{this._oNotifications=null}this._bOTBUpdateNeeded=true;return this.setProperty("showNotifications",t)};a.prototype.setShowProductSwitcher=function(t){if(t){if(!this._oProductSwitcher){this._oProductSwitcher=this._oFactory.getProductSwitcher()}}else{this._oProductSwitcher=null}this._bOTBUpdateNeeded=true;return this.setProperty("showProductSwitcher",t)};a.prototype.setShowNavButton=function(t){if(t){if(!this._oNavButton){this._oNavButton=this._oFactory.getNavButton()}}else{this._oNavButton=null}this._bOTBUpdateNeeded=true;return this.setProperty("showNavButton",t)};a.prototype.setShowMenuButton=function(t){if(t){if(!this._oMenuButton){this._oMenuButton=this._oFactory.getMenuButton()}}else{this._oMenuButton=null}this._bOTBUpdateNeeded=true;return this.setProperty("showMenuButton",t)};a.prototype.setNotificationsNumber=function(t){if(this.getShowNotifications()&&t!==undefined){this._updateNotificationsIndicators(t);this._oAcc.updateNotificationsNumber(t)}return this.setProperty("notificationsNumber",t,true)};a.prototype._addOTContent=function(t){t.addStyleClass("sapFShellBarItem");this._oOverflowToolbar.addContent(t)};a.prototype._assignControlsToOverflowToolbar=function(){var t;if(!this._oOverflowToolbar){return}if(!this._bOTBUpdateNeeded){return}this._aOverflowControls=[];this._oOverflowToolbar.removeAllContent();if(this._oNavButton){this._addOTContent(this._oNavButton)}if(this._oMenuButton){this._addOTContent(this._oMenuButton)}if(this._oHomeIcon){this._addOTContent(this._oHomeIcon)}this._oTitleControl=null;if(this.getShowMenuButton()&&this._oPrimaryTitle){this._addOTContent(this._oPrimaryTitle);this._oTitleControl=this._oPrimaryTitle}else if(this._oMegaMenu){this._addOTContent(this._oMegaMenu);this._oTitleControl=this._oMegaMenu}if(this._oSecondTitle){this._addOTContent(this._oSecondTitle)}if(this._oControlSpacer){this._addOTContent(this._oControlSpacer)}if(this._oCopilot){this._addOTContent(this._oCopilot)}this._addOTContent(this._oToolbarSpacer);if(this._oManagedSearch){this._addOTContent(this._oManagedSearch);this._aOverflowControls.push(this._oManagedSearch)}if(this._oSearch){this._addOTContent(this._oSearch);this._aOverflowControls.push(this._oSearch)}if(this._oNotifications){this._addOTContent(this._oNotifications);this._aOverflowControls.push(this._oNotifications)}t=this.getAdditionalContent();if(t){t.forEach(function(t){this._addOTContent(t);this._aOverflowControls.push(t)}.bind(this))}if(this._oAvatarButton){this._addOTContent(this._oAvatarButton)}if(this._oProductSwitcher){this._addOTContent(this._oProductSwitcher)}this._bOTBUpdateNeeded=false};a.prototype._updateNotificationsIndicators=function(t){this._oOverflowToolbar._getOverflowButton().data("notifications",t,true);this._oNotifications.data("notifications",t,true)};a.prototype._getProfile=function(){this._oAvatarButton=this._oFactory.getAvatarButton();return this._oAvatarButton};a.prototype._getMenu=function(){if(!this._oMegaMenu){this._oMegaMenu=this._oFactory.getMegaMenu()}return this._oMegaMenu};a.prototype._getOverflowToolbar=function(){return this._oOverflowToolbar};a.prototype.getContext=r.prototype.getContext;a.prototype.isContextSensitive=r.prototype.isContextSensitive;a.prototype.setHTMLTag=r.prototype.setHTMLTag;a.prototype.getHTMLTag=r.prototype.getHTMLTag;a.prototype.applyTagAndContextClassFor=r.prototype.applyTagAndContextClassFor;a.prototype._applyContextClassFor=r.prototype._applyContextClassFor;a.prototype._applyTag=r.prototype._applyTag;a.prototype._getContextOptions=r.prototype._getContextOptions;a.prototype._setRootAccessibilityRole=r.prototype._setRootAccessibilityRole;a.prototype._getRootAccessibilityRole=r.prototype._getRootAccessibilityRole;a.prototype._setRootAriaLevel=r.prototype._setRootAriaLevel;a.prototype._getRootAriaLevel=r.prototype._getRootAriaLevel;return a});