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/m/InstanceManager','sap/f/FlexibleColumnLayout','sap/ui/base/Object','sap/ui/core/routing/History',"sap/base/Log"],function(I,F,B,H,L){"use strict";var T=B.extend("sap.f.routing.TargetHandler",{constructor:function(c){this._aQueue=[];this._oNavigationOrderPromise=Promise.resolve();if(c===undefined){this._bCloseDialogs=true;}else{this._bCloseDialogs=!!c;}}});T.prototype.setCloseDialogs=function(c){this._bCloseDialogs=!!c;return this;};T.prototype.getCloseDialogs=function(){return this._bCloseDialogs;};T.prototype.addNavigation=function(p){this._aQueue.push(p);};T.prototype.navigate=function(d){var r=this._createResultingNavigations(d.navigationIdentifier),c=false,b=this._getDirection(d),n;while(r.length){n=this._applyNavigationResult(r.shift().oParams,b);c=c||n;}if(c){this._closeDialogs();}};T.prototype._chainNavigation=function(n){this._oNavigationOrderPromise=this._oNavigationOrderPromise.then(n);return this._oNavigationOrderPromise;};T.prototype._getDirection=function(d){var t=d.viewLevel,h=H.getInstance(),b=false;if(d.direction==="Backwards"){b=true;}else if(isNaN(t)||isNaN(this._iCurrentViewLevel)||t===this._iCurrentViewLevel){if(d.askHistory){b=h.getDirection()==="Backwards";}}else{b=t<this._iCurrentViewLevel;}this._iCurrentViewLevel=t;return b;};T.prototype._createResultingNavigations=function(n){var i,c,C,o,r=[],R;while(this._aQueue.length){c=this._aQueue.shift();C=c.targetControl;o={oContainer:C,oParams:c};if(!a(C)){continue;}for(i=0;i<r.length;i++){R=r[i];if(R.oContainer!==C){continue;}}r.push(o);}return r;};T.prototype._applyNavigationResult=function(p,b){var t=p.targetControl,A=p.eventData,s=p.transition||"",o=p.transitionParameters,v=p.view.getId(),c,i=t instanceof F,S=false;if(i){c=[t.getCurrentBeginColumnPage(),t.getCurrentMidColumnPage(),t.getCurrentEndColumnPage()];S=c.some(function(C){return C&&C.getId()===v;});}if(S){L.info("navigation to view with id: "+v+" is skipped since it already is displayed by its targetControl","sap.f.routing.TargetHandler");return false;}L.info("navigation to view with id: "+v+" the targetControl is "+t.getId()+" backwards is "+b);if(b){t._safeBackToPage(v,s,A,o);}else{t.to(v,s,A,o);}return true;};T.prototype._closeDialogs=function(){if(!this._bCloseDialogs){return;}if(I.hasOpenPopover()){I.closeAllPopovers();}if(I.hasOpenDialog()){I.closeAllDialogs();}if(I.hasOpenLightBox()){I.closeAllLightBoxes();}};function a(c){return c&&c.isA(["sap.m.NavContainer","sap.m.SplitContainer","sap.f.FlexibleColumnLayout"]);}return T;});
  