text: /**
   * @license
   * Copyright (c) 2014, 2020, Oracle and/or its affiliates.
   * The Universal Permissive License (UPL), Version 1.0
   * @ignore
   */
  define(["ojs/ojcore","jquery","ojs/ojthemeutils","ojs/ojcomponentcore","ojs/ojdatacollection-common","ojs/ojbutton","ojs/ojmenu","ojs/ojlistview"],function(t,e,i,n,s){"use strict";var a={properties:{as:{type:"string",value:""},currentItem:{type:"any",writeback:!0},data:{type:"object"},display:{type:"string",enumValues:["all","icons"],value:"all"},drillMode:{type:"string",enumValues:["collapsible","none","sliding"],value:"none"},edge:{type:"string",enumValues:["start","top"],value:"start"},expanded:{type:"KeySet",writeback:!0},hierarchyMenuThreshold:{type:"number",value:0},item:{type:"object",properties:{renderer:{type:"function"},selectable:{type:"function|boolean",value:!0}}},overflow:{type:"string",enumValues:["hidden","popup"],value:"hidden"},rootLabel:{type:"string",value:"Navigation List"},selection:{type:"any",writeback:!0},translations:{type:"object",value:{},properties:{defaultRootLabel:{type:"string"},hierMenuBtnLabel:{type:"string"},previousIcon:{type:"string"}}}},methods:{getContextByNode:{},refresh:{},setProperty:{},getProperty:{},setProperties:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojAnimateStart:{},ojAnimateEnd:{},ojBeforeSelect:{},ojBeforeCollapse:{},ojBeforeCurrentItem:{},ojCollapse:{},ojBeforeExpand:{},ojExpand:{}},extension:{}},o={properties:{as:{type:"string",value:""},currentItem:{type:"any",writeback:!0},data:{type:"object"},display:{type:"string",enumValues:["all","icons"],value:"all"},edge:{type:"string",enumValues:["bottom","end","start","top"],value:"start"},item:{type:"object",properties:{renderer:{type:"function"},selectable:{type:"function|boolean",value:!0}}},overflow:{type:"string",enumValues:["hidden","popup"],value:"hidden"},reorderable:{type:"string",enumValues:["disabled","enabled"],value:"disabled"},selection:{type:"any",writeback:!0},translations:{type:"object",value:{},properties:{accessibleReorderAfterItem:{type:"string"},accessibleReorderBeforeItem:{type:"string"},accessibleReorderTouchInstructionText:{type:"string"},labelCut:{type:"string"},labelPasteAfter:{type:"string"},labelPasteBefore:{type:"string"},labelRemove:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},overflowItemLabel:{type:"string"},removeCueText:{type:"string"},selectedLabel:{type:"string"}}},truncation:{type:"string",enumValues:["none","progressive"],value:"none"}},methods:{getContextByNode:{},refresh:{},setProperty:{},getProperty:{},setProperties:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojAnimateStart:{},ojAnimateEnd:{},ojBeforeSelect:{},ojBeforeCurrentItem:{},ojBeforeDeselect:{},ojDeselect:{},ojBeforeRemove:{},ojRemove:{},ojReorder:{}},extension:{}};t.DefaultNavListHandler=function(t,e,i){this.m_widget=t,this.m_root=e,this.m_component=i,this.m_widget.GetOption(this.m_widget.OPTION_EDGE)===this.m_widget.OPTION_EDGE_END&&this.m_root.addClass(this.m_widget.getNavListEndEdgeStyleClass())},t.DefaultNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListExpandedStyleClass()).removeClass(this.m_widget.getNavListVerticalStyleClass()).removeClass(this.m_widget.getNavListEndEdgeStyleClass())},t.DefaultNavListHandler.prototype.Expand=function(t,e,i){return Promise.resolve(null)},t.DefaultNavListHandler.prototype.Collapse=function(t,e,i,n){return Promise.resolve(null)},t.DefaultNavListHandler.prototype.HandleExpandAndCollapseKeys=function(t,e,i,n){return!1},t.DefaultNavListHandler.prototype.ModifyListItem=function(t,e){this.m_widget.isTabBar()&&this.m_widget.getSingleFocusableElement(t).attr("role","tab")},t.DefaultNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){t.attr("aria-selected",e?"true":"false")},t.DefaultNavListHandler.prototype.BeforeRenderComplete=function(){var t=this.m_widget.element.attr("role");t&&"presentation"!==t&&(this.m_widget.element.attr("role","presentation"),this.m_widget.isTabBar()?this.m_root.attr("role","tablist"):this.m_root.attr("role",t))},t.DefaultNavListHandler.prototype.ItemInsertComplete=function(t,e){},t.DefaultNavListHandler.prototype.ItemRemoveComplete=function(t){},t.DefaultNavListHandler.prototype.HandleArrowKeys=function(t,e,i){return l.superclass.HandleArrowKeys.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.IsArrowKey=function(t){return l.superclass.IsArrowKey.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.GetState=function(t){return l.superclass.GetState.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.SetState=function(t,e){l.superclass.SetState.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListExpandedStyleClass()).addClass(this.m_widget.getNavListVerticalStyleClass())},t.DefaultNavListHandler.prototype.IsSelectable=function(t){return l.superclass.IsSelectable.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.RestoreItem=function(t,e,i){},t.DefaultNavListHandler.prototype.SetOptions=function(t){},t.DefaultNavListHandler.prototype.HandleBlur=function(t){return l.superclass.HandleBlur.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.HandleFocus=function(t){return l.superclass.HandleFocus.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.GetNodeBySubId=function(t){return null},t.DefaultNavListHandler.prototype.GetSubIdByNode=function(t){return null},t.DefaultNavListHandler.prototype.HandleResize=function(t,e){},t.DefaultNavListHandler.prototype.NotifyAttached=function(){},t.DefaultNavListHandler.prototype.GetAnimationEffect=function(t){return l.superclass.getAnimationEffect.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.IsOptionUpdateAllowed=function(t,e,i){return!0},t.DefaultNavListHandler.prototype.OptionUpdated=function(t,e,i){},t.DefaultNavListHandler.prototype.BeforeInsertItem=function(){},t.DefaultNavListHandler.prototype.HandleClick=function(t){},t.DefaultNavListHandler.prototype.HandleKeydown=function(t){},t.DefaultNavListHandler.prototype.HandleSelectionChange=function(t){},t.HorizontalNavListHandler=function(e,i,n){this.m_duringInit=!0,t.HorizontalNavListHandler.superclass.constructor.call(this,e,i,n),this.m_widget.GetOption(this.m_widget.OPTION_EDGE)===this.m_widget.OPTION_EDGE_BOTTOM&&this.m_root.addClass(this.m_widget.getNavListBottomEdgeStyleClass())},t.Object.createSubclass(t.HorizontalNavListHandler,t.DefaultNavListHandler,"oj.HorizontalNavListHandler"),t.HorizontalNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListExpandedStyleClass()).removeClass(this.m_widget.getHorizontalNavListStyleClass()).removeClass(this.m_widget.getNavListBottomEdgeStyleClass()),this.m_root.find("."+this.m_widget.getDividerStyleClass()).remove(),this._destroyOverflowMenu(),null!=this.m_overflowMenuItem&&(this.m_overflowMenuItem.remove(),this.m_overflowMenuItem=null),this.m_overflowMenuItems=[],this.m_duringInit=!0},t.HorizontalNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){t.attr(this._isTabBar()?"aria-selected":"aria-pressed",e?"true":"false")},t.HorizontalNavListHandler.prototype._isTabBar=function(){return this.m_widget.isTabBar()},t.HorizontalNavListHandler.prototype.HandleArrowKeys=function(t,i,n){t===e.ui.keyCode.LEFT?t=this.m_widget.isRtl()?e.ui.keyCode.DOWN:e.ui.keyCode.UP:t===e.ui.keyCode.RIGHT&&(t=this.m_widget.isRtl()?e.ui.keyCode.UP:e.ui.keyCode.DOWN);var s=l.superclass.HandleArrowKeys.call(this.m_widget,t,i,n);return this.m_widget.m_active.elem[0].scrollIntoView(!1),s},t.HorizontalNavListHandler.prototype.IsArrowKey=function(t){return t===this.m_widget.UP_KEY||t===this.m_widget.DOWN_KEY||t===this.m_widget.LEFT_KEY||t===this.m_widget.RIGHT_KEY},t.HorizontalNavListHandler.prototype.ModifyListItem=function(t,e){var i=this.m_widget.getSingleFocusableElement(t);i.attr("role",this._isTabBar()?"tab":"button"),!this._isTabBar()&&i[0].hasAttribute("aria-selected")&&(i.attr("aria-pressed","false"),i.removeAttr("aria-selected"))},t.HorizontalNavListHandler.prototype.BeforeRenderComplete=function(){var t=this;this._isTabBar()?this.m_root.attr("role","tablist"):this.m_root.attr("role","toolbar"),this.m_widget.element.attr("role","presentation");var i=this.m_widget.element.find("."+this.m_widget.getItemElementStyleClass()+":visible");i.each(function(n){var s=e(this);n>0&&t._addSeparator(this,n),n===i.length-1?s.addClass(t.m_widget.getLastItemStyleClass()):s.removeClass(t.m_widget.getLastItemStyleClass())}),this.m_duringInit&&(this.m_duringInit=!1,this._handleOverflow())},t.HorizontalNavListHandler.prototype._addSeparator=function(t,i){var n=e(t),s=n.prev();i>0&&s.length&&!s.is("li."+this.m_widget.getDividerStyleClass())&&n.before('<li role="separator" class="'+this.m_widget.getDividerStyleClass()+'"></li>')},t.HorizontalNavListHandler.prototype.ItemInsertComplete=function(t,e){this._addSeparator(t,e.index),this._handleOverflow()},t.HorizontalNavListHandler.prototype.ItemRemoveComplete=function(t){var i=e(t),n=i.prev();if(n.length&&n.is("li."+this.m_widget.getDividerStyleClass()))n.remove();else{var s=i.next();s.is("li."+this.m_widget.getDividerStyleClass())&&s.remove()}this._handleOverflow()},t.HorizontalNavListHandler.prototype.IsSelectable=function(t){var i="aria-selected";return this._isTabBar()||(i="aria-pressed"),!(this.m_overflowMenuItem&&this.m_overflowMenuItem[0]===e(t)[0])&&this.m_widget.getFocusItem(e(t))[0].hasAttribute(i)},t.HorizontalNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListExpandedStyleClass()).addClass(this.m_widget.getHorizontalNavListStyleClass()),this.m_overflowMenuItems=[]},t.HorizontalNavListHandler.prototype.HandleClick=function(t){e(t.target).closest("."+this.m_widget.getOverflowItemStyleClass()+" a."+this.m_widget.getItemContentStyleClass()).length>0&&this._launchOverflowMenu(t)},t.HorizontalNavListHandler.prototype.HandleKeydown=function(t){e(t.target).closest("."+this.m_widget.getOverflowItemStyleClass()+" a."+this.m_widget.getItemContentStyleClass()).length>0&&t.keyCode===e.ui.keyCode.SPACE&&this._launchOverflowMenu(t)},t.HorizontalNavListHandler.prototype.NotifyAttached=function(){this._handleOverflow()},t.HorizontalNavListHandler.prototype.HandleResize=function(t,e){this.m_ignoreNextResize?this.m_ignoreNextResize=!1:this._handleOverflow()},t.HorizontalNavListHandler.prototype.SetOptions=function(t){var e,i,n=this.m_widget.GetOption("overflow"),s=this.m_widget.GetOption("truncation");t.overflow&&n!==t.overflow&&(e=t.overflow),t.truncation&&s!==t.truncation&&(i=t.truncation),(e||i)&&this._handleOverflow(e,i)},t.HorizontalNavListHandler.prototype.HandleSelectionChange=function(t){this.m_overflowMenuItem&&("none"===t.style.display?this._highlightUnhighlightMoreItem(!0):this._highlightUnhighlightMoreItem(!1))},t.HorizontalNavListHandler.prototype.GetAnimationEffect=function(t){return"add"===t||"remove"===t?l.superclass.getAnimationEffect.call(this.m_widget,t+"HorizontalItem"):l.superclass.getAnimationEffect.apply(this.m_widget,arguments)},t.HorizontalNavListHandler.prototype.GetNodeBySubId=function(t){var i=null;if(t.subId===this.m_widget.getItemSubIdKey()&&this.m_overflowMenuItems.length>0)for(var n=this._getOverflowMenu(),s=t.key,a=n.find(".oj-menu-item"),o=0;o<a.length;o++)if(this.m_widget.compareValues(e(a[o]).data("key"),s)){i=a[o],this._launchOverflowMenu(null);break}return i},t.HorizontalNavListHandler.prototype.GetSubIdByNode=function(t){var i=null,n=e(t).closest(".oj-menu-item");if(null!==this._getOverflowMenu()&&n.closest("."+this.m_widget.getOverflowMenuStyleClass())[0]!==this._getOverflowMenu()[0])return null;if(null!=n&&n.length>0){var s=n.data("key");null!=s&&(i={subId:this.m_widget.getItemSubIdKey(),key:s})}return i},t.HorizontalNavListHandler.prototype.OptionUpdated=function(t,e,i){"selection"===t&&this._toggleOverflowBtnSelection(e)},t.HorizontalNavListHandler.prototype.IsOptionUpdateAllowed=function(t,e,i){return"currentItem"!==t||!this.m_overflowMenuItem||this.m_overflowMenuItem.attr("id")!==e},t.HorizontalNavListHandler.prototype._handleOverflow=function(e,i){var n=-1,s=this._getItems();if(0!==s.length){e||(e=this.m_widget.GetOption("overflow")),i||(i=this.m_widget.GetOption("truncation"));var a=new t._HorizontalNavListOverflowHandler(s,e,i,this);if(!a.shouldHandleOverflow())return a.unApplyTruncation(),void this._releaseContainerWidth();this.showAllItems(s,e),a.unApplyTruncation(),a.checkForOverflow()&&a.applyTruncation()&&(n=a.getOverflowThreshold()),this._applyThreshold(n),this._releaseContainerWidth()}},t.HorizontalNavListHandler.prototype.BeforeInsertItem=function(){this._fixContainerWidth()},t.HorizontalNavListHandler.prototype._fixContainerWidth=function(){var t=this.m_widget.getListContainer(),e=t[0].getBoundingClientRect().width;0!==e&&(this.m_freezedContainerWidth=e,t.css("maxWidth",e))},t.HorizontalNavListHandler.prototype._releaseContainerWidth=function(){this.m_widget.getListContainer().css("maxWidth","none"),this.m_freezedContainerWidth&&(this.m_ignoreNextResize=!0,this.m_freezedContainerWidth=null)},t.HorizontalNavListHandler.prototype.showAllItems=function(t,i){var n=this;"popup"===i&&this._showOrHideItem(this._getOverflowMenuButton(),!0),t.each(function(t,i){n._showOrHideItem(e(i),!0)})},t.HorizontalNavListHandler.prototype._getItems=function(){return this.m_root.find("."+this.m_widget.getItemElementStyleClass()+":not(."+this.m_widget.getOverflowItemStyleClass()+")")},t.HorizontalNavListHandler.prototype._hasSeparators=function(){return this.m_root.hasClass(this.m_widget.getNavListItemsDividerStyleClass())},t.HorizontalNavListHandler.prototype._showOrHideItem=function(t,e){var i;this._hasSeparators()&&(i=t.prev("."+this.m_widget.getDividerStyleClass())),e?(t.show(),i&&i.show()):(t.hide(),i&&i.hide())},t.HorizontalNavListHandler.prototype._applyThreshold=function(t){var i,n,s=this,a=this._getItems(),o=[];if(0!==a.length){this.m_root.find("."+this.m_widget.getLastItemStyleClass()).removeClass(this.m_widget.getLastItemStyleClass()),-1===t||t>=a.length?this.m_overflowMenuItem&&this._showOrHideItem(this.m_overflowMenuItem,!1):(this._addSeparator(this._getOverflowMenuButton(),a.length),this._showOrHideItem(this._getOverflowMenuButton(),!0),n=!0),a.each(function(n,a){var l=e(a);if(-1!==t&&t<=n){l.hasClass("oj-focus")&&s.m_widget.ActiveAndFocus(s._getOverflowMenuButton(),null),l.hasClass("oj-selected")&&s._highlightUnhighlightMoreItem(!0),s._showOrHideItem(l,!1);var r={};o.push(r),r.key=s.m_widget.GetKey(a),r.label=s._getItemLabel(l),l.hasClass("oj-disabled")&&(r.disabled=!0)}else i=l,s._showOrHideItem(l,!0),l.hasClass("oj-selected")&&s._highlightUnhighlightMoreItem(!1),s.m_overflowMenuItem&&s.m_overflowMenuItem.hasClass("oj-focus")&&s.m_widget.compareValues(s.m_widget.GetKey(a),s.m_widget.GetOption("currentItem"))&&s.m_widget.ActiveAndFocus(i,null)}),n?this._getOverflowMenuButton().addClass(this.m_widget.getLastItemStyleClass()):i.addClass(this.m_widget.getLastItemStyleClass()),this.m_overflowMenuItems=o,this.m_widget.ClearCache();var l=this.m_overflowMenu&&this.m_overflowMenu.is(":visible");this._destroyOverflowMenu(),l&&this._launchOverflowMenu(null)}},t.HorizontalNavListHandler.prototype._highlightUnhighlightMoreItem=function(t){var e=this._getOverflowMenuButton();t?e.addClass("oj-selected").removeClass("oj-default"):e.removeClass("oj-selected").addClass("oj-default")},t.HorizontalNavListHandler.prototype._destroyOverflowMenu=function(){this.m_overflowMenu&&(this.m_overflowMenu.ojMenu("destroy"),this.m_overflowMenu.remove(),this.m_overflowMenu=null)},t.HorizontalNavListHandler.prototype._getOverflowMenuButton=function(){if(!this.m_overflowMenuItem){var t=e(document.createElement("li")),i=e(document.createElement("a")),n=e(document.createElement("span")),a=e(document.createElement("span")),o=this._getItems();t.uniqueId().attr("role","presentation").addClass(this.m_widget.getItemElementStyleClass()).addClass(this.m_widget.getItemStyleClass()).addClass(this.m_widget.getOverflowItemStyleClass()).addClass("oj-default").append(i),i.addClass(this.m_widget.getFocusedElementStyleClass()).addClass(this.m_widget.getItemContentStyleClass()),i.attr("role","button").attr("aria-haspopup","true").attr("aria-pressed","false").attr("tabindex","-1").attr(s._DATA_OJ_TABMOD,"-1").attr("href","#").append(a).append(n),this.m_root.find("ul:first").hasClass(this.m_widget.getHasIconsStyleClass())||i.addClass(this.m_widget.getHasNoIconStyleClass()),n.text(this.m_widget.ojContext.getTranslatedString("overflowItemLabel")).addClass(this.m_widget.getItemLabelStyleClass()),a.addClass(this.m_widget.getItemIconStyleClass()).addClass("oj-fwk-icon").addClass(this.m_widget.getOverflowItemIconStyleClass()),t[0].key=t.attr("id"),this.m_root.find("."+this.m_widget.GetStyleClass()).append(t),this._addSeparator(t,o.length),this.m_overflowMenuItem=t}return this.m_overflowMenuItem},t.HorizontalNavListHandler.prototype._getOverflowMenu=function(){var t=this.m_overflowMenuItems;if(0===t.length)return null;if(!this.m_overflowMenu){var i=e(document.createElement("ul"));i.addClass(this.m_widget.getOverflowMenuStyleClass()).hide(),this.m_root.append(i);for(var n=0;n<t.length;n++){var s=e(document.createElement("li")),a=e(document.createElement("a"));a.attr("href","#").text(t[n].label),s.data("key",t[n].key),t[n].disabled&&s.addClass("oj-disabled"),s.append(a),i.append(s)}i.ojMenu({openOptions:{display:"auto"},open:this.__handleOverflowMenuOpen.bind(this),close:this.__handleOverflowMenuClose.bind(this),select:this.__handleOverflowMenuSelection.bind(this)}),this.m_overflowMenu=i}return this.m_overflowMenu},t.HorizontalNavListHandler.prototype._launchOverflowMenu=function(t){this._getOverflowMenu().is(":visible")||(this._highlightUnhighlightMoreItem(!0),this._getOverflowMenu().ojMenu("open",t,{launcher:this._getOverflowMenuButton(),initialFocus:"firstItem",position:{my:"end bottom",at:"end top",collision:"flipfit"}}))},t.HorizontalNavListHandler.prototype._toggleOverflowBtnSelection=function(t){var e;if(this.m_overflowMenuItem&&this.m_overflowMenuItems.length>0){if(t)for(var i=0;i<this.m_overflowMenuItems.length;i++)if(this.m_widget.compareValues(this.m_overflowMenuItems[i].key,t)){e=!0;break}e||this._highlightUnhighlightMoreItem(!1)}},t.HorizontalNavListHandler.prototype.__handleOverflowMenuOpen=function(t){this._getOverflowMenuButton().find("."+this.m_widget.getItemContentStyleClass()).attr("tabindex","0")},t.HorizontalNavListHandler.prototype.__handleOverflowMenuClose=function(t){var e=this.m_widget.ojContext.option("selection");this._toggleOverflowBtnSelection(e),this._getOverflowMenuButton().find("."+this.m_widget.getItemContentStyleClass()).focus()},t.HorizontalNavListHandler.prototype.__handleOverflowMenuSelection=function(t,i){var n=i.item.data("key"),s={selection:n},a=this.m_widget.FindElementByKey(n);this.m_widget.HandleSelectionOption(s);var o=s.selection;o&&this.m_widget.SetOption("selection",o,{_context:{originalEvent:t,internalSet:!0,extraData:{items:e(a)}},changed:!0})},t.HorizontalNavListHandler.prototype._getItemLabel=function(t){var e=t.find("."+this.m_widget.getItemTitleStyleClass()+":first");return e.length>0?e.text():t.find("."+this.m_widget.getItemLabelStyleClass()+":first").text()},t._HorizontalNavListOverflowHandler=function(t,e,i,n){this._overflow=e,this._truncation=i,this._items=t,this._navlistHandler=n},t._HorizontalNavListOverflowHandler.prototype._TEXT_WIDTH_KEY="textWidth",t._HorizontalNavListOverflowHandler.prototype._ITEM_WIDTH_KEY="itemWidth",t._HorizontalNavListOverflowHandler.prototype._getOverflowMenuButton=function(){return this._navlistHandler._getOverflowMenuButton()},t._HorizontalNavListOverflowHandler.prototype._getWidget=function(){return this._navlistHandler.m_widget},t._HorizontalNavListOverflowHandler.prototype.shouldHandleOverflow=function(){return"popup"===this._overflow||"progressive"===this._truncation},t._HorizontalNavListOverflowHandler.prototype.unApplyTruncation=function(){var t=this;this._items.each(function(i,n){e(n).find("."+t._getWidget().getItemLabelStyleClass()).css("max-width","")})},t._HorizontalNavListOverflowHandler.prototype.checkForOverflow=function(){return!!this.shouldHandleOverflow()&&(this._overflowData||(this._overflowData=this._collectOverflowData()),this._isOverflowed(this._overflowData.containerEdgePos,this._overflowData.itemEdgePos,0))},t._HorizontalNavListOverflowHandler.prototype.applyTruncation=function(){"progressive"===this._truncation&&this._applyLabelMaxWidth(this._overflowData);var e=this._items.last()[0].getBoundingClientRect()["ltr"===t.DomUtils.getReadingDirection()?"right":"left"];return this._isOverflowed(this._overflowData.containerEdgePos,e,0)},t._HorizontalNavListOverflowHandler.prototype.getOverflowThreshold=function(){var t=-1;return"popup"===this._overflow&&(t=this._calculateThreshold(this._overflowData)),t},t._HorizontalNavListOverflowHandler.prototype._collectOverflowData=function(){var e,i,n="ltr"===t.DomUtils.getReadingDirection()?"right":"left",s=this._getWidget().ojContext.element,a=this._items.last();"progressive"===this._truncation&&(this._calculateItemWidths(),e=this._calculateItemNonTextWidth());var o=s[0].getBoundingClientRect()[n],l=s[0].getBoundingClientRect().width;return"popup"===this._overflow&&(i=this._getOverflowMenuButton()[0].getBoundingClientRect().width),{containerEdgePos:o,containerWidth:l,overflowItemWidth:i,itemEdgePos:a[0].getBoundingClientRect()[n],itemNonTextWidth:e}},t._HorizontalNavListOverflowHandler.prototype._calculateItemWidths=function(){var t=this;this._items.each(function(i,n){var s=e(n),a=s.find("."+t._getWidget().getItemLabelStyleClass())[0].getBoundingClientRect().width;s.data(t._TEXT_WIDTH_KEY,a),s.data(t._ITEM_WIDTH_KEY,n.getBoundingClientRect().width)})},t._HorizontalNavListOverflowHandler.prototype._calculateItemNonTextWidth=function(){var t=this._items,i=this;this._getWidget().GetRootElement().find("."+this._getWidget().getHasIconsStyleClass()).lenght>0&&(t=t.filter(function(t,n){return e(n).find("."+i._getWidget().getItemIconStyleClass()).length>0}));var n=t.filter(function(t,n){return e(n).find("."+i._getWidget().getRemovableStyleClass()).length>0}),s=n&&n.length>0?n.last():t.last(),a=s.data(i._TEXT_WIDTH_KEY);return s.data(i._ITEM_WIDTH_KEY)-a},t._HorizontalNavListOverflowHandler.prototype._isOverflowed=function(e,i,n){var s=n||0;return"ltr"===t.DomUtils.getReadingDirection()?i-e+s>.1:e-i+s>.1},t._HorizontalNavListOverflowHandler.prototype._calculateThreshold=function(e){for(var i=this._items,n="ltr"===t.DomUtils.getReadingDirection()?"right":"left",s=i.length-1,a=i[s].getBoundingClientRect()[n];this._isOverflowed(e.containerEdgePos,a,e.overflowItemWidth)&&s>0;)a=i[s-=1].getBoundingClientRect()[n];return s+1},t._HorizontalNavListOverflowHandler.prototype._applyLabelMaxWidth=function(t){var i=this._items,n=this,s=this._getMinLabelWidth(this._items),a=t.containerWidth/i.length-t.itemNonTextWidth;a<s&&(a=s);var o=0,l=0;i.each(function(t,i){var s=e(i).data(n._TEXT_WIDTH_KEY);s<a?o+=a-s:l+=s}),i.each(function(t,i){var s=e(i).data(n._TEXT_WIDTH_KEY),r=s;s>a&&(r=a+o*s/l),e(i).find("."+n._getWidget().getItemLabelStyleClass()).css({"max-width":r+"px"})})},t._HorizontalNavListOverflowHandler.prototype._getMinLabelWidth=function(t){var e=window.getComputedStyle(t.first().find("."+this._getWidget().getItemLabelStyleClass())[0],null).getPropertyValue("min-width");return e.indexOf("px")>0?parseInt(e.substring(0,e.length-2),10):0},t.CollapsibleNavListHandler=function(e,i,n){t.CollapsibleNavListHandler.superclass.constructor.call(this,e,i,n)},t.Object.createSubclass(t.CollapsibleNavListHandler,t.DefaultNavListHandler,"oj.CollapsibleNavListHandler"),t.CollapsibleNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListCollapsibleStyleClass()).removeClass(this.m_widget.getNavListVerticalStyleClass())},t.CollapsibleNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListCollapsibleStyleClass()).addClass(this.m_widget.getNavListVerticalStyleClass())},t.CollapsibleNavListHandler.prototype.Expand=function(t,e,i){return l.superclass.AnimateExpand.apply(this.m_widget,arguments)},t.CollapsibleNavListHandler.prototype.Collapse=function(t,e,i,n){return l.superclass.AnimateCollapse.apply(this.m_widget,arguments)},t.CollapsibleNavListHandler.prototype.HandleExpandAndCollapseKeys=function(t,i,n,s){var a=n.children("."+this.m_widget.getGroupStyleClass()).length>0;return i===this.m_widget.LEFT_KEY||i===this.m_widget.RIGHT_KEY?(i===this.m_widget.LEFT_KEY&&!this.m_widget.isRtl()||i===this.m_widget.RIGHT_KEY&&this.m_widget.isRtl()?this.m_widget.GetState(n)===this.m_widget.STATE_EXPANDED&&this.m_widget.CollapseItem(n,t,!0,s,!0,!0):this.m_widget.GetState(n)===this.m_widget.STATE_COLLAPSED&&this.m_widget.ExpandItem(n,t,!0,s,!0,!0,!0),!0):!(!a||i!==e.ui.keyCode.ENTER&&i!==e.ui.keyCode.SPACE)&&(!(n.length<=0)&&(this.m_widget.GetState(n)===this.m_widget.STATE_COLLAPSED?this.m_widget.ExpandItem(n,null,!0,s,!0,!0,!0):this.m_widget.GetState(n)===this.m_widget.STATE_EXPANDED&&this.m_widget.CollapseItem(n,null,!0,s,!0,!0),!0))},t.SlidingNavListHandler=function(e,i,n){t.SlidingNavListHandler.superclass.constructor.call(this,e,i,n),this.m_expanded=[]},t.Object.createSubclass(t.SlidingNavListHandler,t.CollapsibleNavListHandler,"oj.SlidingNavListHandler"),t.SlidingNavListHandler.prototype.Destroy=function(){this.m_root.removeClass("oj-navigationlist-slider").removeClass(this.m_widget.getNavListVerticalStyleClass()),this._toolbar.remove()},t.SlidingNavListHandler.prototype._slideAnimation=function(t,e,i,n,s){var a=this,o=this.m_widget.getListContainer(),l=o.hasClass("oj-focus-ancestor");l&&e&&o.removeClass("oj-focus-ancestor");var r=e?"sliderExpand":"sliderCollapse";this.m_widget.StartAnimation(o.get(0),r,this.m_widget.getAnimationEffect(r)).then(function(){a._slideAnimationComplete(t,e,i,n,l),s(null)})},t.SlidingNavListHandler.prototype._slideAnimationComplete=function(t,e,i,n,s){null!==this.m_widget.m_contentHandler&&(i&&(s&&this.m_widget.getListContainer().addClass("oj-focus-ancestor"),n&&0===n.button&&this.m_widget.AvoidFocusHighLight(!0),this.m_widget.SetCurrentItem(i,n),this.m_widget.AvoidFocusHighLight(!1)),e?this.m_widget.AnimateExpandComplete(t.children("."+this.m_widget.getGroupStyleClass())):this.m_widget.AnimateCollapseComplete(t.children("."+this.m_widget.getGroupStyleClass())))},t.SlidingNavListHandler.prototype.Expand=function(t,i,n){var s,a=new Promise(function(t){s=t}),o=e(t).parents(".oj-navigationlist-item-element:first"),l=o.children("."+this.m_widget.getGroupStyleClass()),r=null,d=o.closest("."+this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS);return d.length>0&&(d.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),o.addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),r=l.find("."+this.m_widget.getItemElementStyleClass()+":eq(0)"),this._updateHMenuOnExpand(o)),i?this._slideAnimation(o,!0,r,n,s):(this._slideAnimationComplete(o,!0,r,n,!1),s(null)),o.siblings().attr("aria-hidden","true"),o.children("."+this.m_widget.getGroupItemStyleClass()).children("."+this.m_widget.getItemContentStyleClass()).attr("aria-hidden","true"),l.removeAttr("aria-hidden"),t.css("display",""),o.addClass("oj-skipfocus"),a},t.SlidingNavListHandler.prototype._updateHMenuOnExpand=function(t){var i=t.parentsUntil(this.m_widget.element,"."+this.m_widget.getItemElementStyleClass());i=i.get().reverse(),i=e(i.concat(t)),this.m_expanded=[],this._emptyHviewMenu(),i.each(function(t,i){var n;n=0===t?this.m_widget.getRootLabel():this.m_widget.getItemLabel(this.m_expanded[t-1]);var s=e(i);this._addItemToHviewMenu(this.m_widget.GetKey(s[0]),this.m_widget.getItemLabel(s),n),this.m_expanded.push(s)}.bind(this))},t.SlidingNavListHandler.prototype.Collapse=function(t,e,i,n){var s,a=new Promise(function(t){s=t}),o=t.children("."+this.m_widget.getGroupStyleClass()),l=t.parent();return t.children("."+this.m_widget.getGroupItemStyleClass()).children("."+this.m_widget.getItemContentStyleClass()).removeAttr("aria-hidden"),o.attr("aria-hidden","true"),t.siblings().removeAttr("aria-hidden"),t.removeClass("oj-skipfocus"),t.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),0===t.closest("."+this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS).length&&(l.closest("."+this.m_widget.getItemElementStyleClass()).addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),this.m_widget.element.is(l)&&this.m_widget.element.addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS)),i?this._slideAnimation(t,!1,o.parent(),n,s):(this._slideAnimationComplete(t,!1,o.parent(),n,!1),s(null)),this._updateHMenuOnCollapse(e),a},t.SlidingNavListHandler.prototype._updateHMenuOnCollapse=function(t){var e=-1;this.m_expanded.forEach(function(i,n){var s=this.m_widget.GetKey(i[0]);t===s&&(e=n)}.bind(this)),e>-1&&this.m_expanded.splice(e),this._removeItemFromHviewMenu(t)},t.SlidingNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){e?t.attr("aria-describedby",this._selectedLabelId):t.removeAttr("aria-describedby")},t.SlidingNavListHandler.prototype.GetState=function(t){var e=this.m_widget.getFocusItem(t).attr("aria-expanded");return"true"===e?this.m_widget.STATE_EXPANDED:"false"===e?this.m_widget.STATE_COLLAPSED:this.m_widget.STATE_NONE},t.SlidingNavListHandler.prototype.SetState=function(t,e){e===this.m_widget.STATE_EXPANDED?(this.m_widget.getFocusItem(t).attr("aria-expanded","true"),t.removeClass(this.m_widget.COLLAPSED_STYLE_CLASS).addClass(this.m_widget.EXPANDED_STYLE_CLASS)):e===this.m_widget.STATE_COLLAPSED&&(this.m_widget.getFocusItem(t).attr("aria-expanded","false"),t.removeClass(this.m_widget.EXPANDED_STYLE_CLASS).addClass(this.m_widget.COLLAPSED_STYLE_CLASS))},t.SlidingNavListHandler.prototype.ModifyListItem=function(t,e){var i=this.m_widget.getFocusItem(t);t.attr("role","presentation"),i.attr("role","menuitem"),e.attr("id")||e.uniqueId();var n=t.children("."+this.m_widget.getGroupStyleClass());n.length>0&&(i.attr("aria-haspopup","true"),n.attr("role","menu"),n.css("display",""),t.removeAttr("aria-expanded"),i.attr("aria-expanded","false"))},t.SlidingNavListHandler.prototype.BeforeRenderComplete=function(){this.m_root.attr("role","menu"),this.m_widget.element.attr("role","presentation")},t.SlidingNavListHandler.prototype.Init=function(t){this.m_root.addClass("oj-navigationlist-slider").addClass(this.m_widget.getNavListVerticalStyleClass()),t.element.addClass("oj-navigationlist-current"),this._buildSlidingNavListHeader(t),this._initializeHierarchicalView()},t.SlidingNavListHandler.prototype.HandleClick=function(t){e(t.target).closest(".oj-navigationlist-previous-link, .oj-navigationlist-previous-button").length>0&&this.CollapseCurrentList(t)},t.SlidingNavListHandler.prototype.HandleKeydown=function(t){e(t.target).closest(".oj-navigationlist-previous-link, .oj-navigationlist-previous-button").length>0&&t.keyCode===e.ui.keyCode.ENTER&&this.CollapseCurrentList(t),e(t.target).closest("."+this.m_widget.GetStyleClass()).length>0&&(t.keyCode!==e.ui.keyCode.ESCAPE||t.isDefaultPrevented()||this.CollapseCurrentList(t))},t.SlidingNavListHandler.prototype._buildSlidingNavListHeader=function(t){this._toolbar=e(document.createElement("div")),this._toolbar.addClass("oj-navigationlist-toolbar"),this._previousLink=e(document.createElement("a")),this._prevButton=e(document.createElement("a")),this._prevButton.addClass("oj-navigationlist-previous-button"),this._prevButton.css("visibility","hidden").attr("tabindex","-1"),this._previousLink.addClass("oj-navigationlist-previous-link").attr("tabindex","-1"),this._headerLabel=e(document.createElement("label")),this._headerLabel.addClass("oj-navigationlist-current-header").text(this.m_widget.getRootLabel()),this._vSeparator=e(document.createElement("span")),this._vSeparator.attr("role","separator").attr("aria-orientation","vertical").addClass("oj-navigationlist-toolbar-separator"),this._hviewBtn=e(document.createElement("button")),this._hviewBtn.addClass("oj-navigationlist-hierarchical-button").attr("tabindex","-1"),this._hviewMenu=e(document.createElement("ul")),this._hviewMenu.addClass("oj-navigationlist-hierarchical-menu").hide();var i=e(document.createElement("label"));i.uniqueId().addClass("oj-helper-hidden-accessible").attr("aria-hidden","true"),this._selectedLabelId=i.attr("id"),i.text(this.m_component.getTranslatedString("selectedLabel")),this._previousLink.append(this._headerLabel),this._toolbar.append(this._prevButton),this._toolbar.append(this._previousLink).append(this._vSeparator).append(this._hviewBtn).append(this._hviewMenu).append(i),this.m_root.prepend(this._toolbar),this._showOrHideHierarchyMenu(t.hierarchyMenuDisplayThresholdLevel)},t.SlidingNavListHandler.prototype.CollapseCurrentList=function(t){var e=this.m_expanded[this.m_expanded.length-1];e&&this.m_widget.CollapseItem(e,t,!0,null,!0,!0)},t.SlidingNavListHandler.prototype._initializeHierarchicalView=function(){var t=this,i=this._hviewMenu.uniqueId().attr("id");this._hviewMenu.ojMenu({openOptions:{position:{my:"end top",at:"end bottom"}},select:function(i,n){var s=n.item.nextAll(),a=t.m_expanded,o=n.item.data("key");for(t.m_widget.signalTaskStart();a.length>0;){var l=a[a.length-1],r=t.m_widget.GetKey(l[0]);if(t.m_widget.CollapseItem(e(l),i,!0,r,!0,!0),t.m_widget.compareValues(o,r))break}s.remove(),n.item.remove(),t._hviewMenu.ojMenu("refresh"),t.m_widget.signalTaskEnd()}}),this._hviewBtn.ojButton({label:this.m_component.getTranslatedString("hierMenuBtnLabel"),display:"icons",icons:{start:"oj-fwk-icon oj-hier-icon"},menu:"#"+i,disabled:!0,chroming:"half"}),this._prevButton.ojButton({label:this.m_component.getTranslatedString("previousIcon"),display:"icons",icons:{start:"oj-navigationlist-previous-icon oj-component-icon oj-clickable-icon-nocontext"},chroming:"half"})},t.SlidingNavListHandler.prototype._emptyHviewMenu=function(){this._hviewMenu&&this._hviewMenu.find("li").remove()},t.SlidingNavListHandler.prototype._addItemToHviewMenu=function(t,i,n){var s;if(this._hviewBtn){var a=this._hviewMenu.find("li").length,o=e(document.createElement("li")),l=e(document.createElement("a"));if(l.attr("href","#"),o.append(l),a>0){for(s=0;s<a;s++)s>0&&l.append(e(document.createElement("span")).addClass("oj-navigationlist-hvitem-space"));l.append(e(document.createElement("span")).addClass("oj-menu-item-icon oj-icon oj-navigationlist-level-indicator"))}var r=e(document.createElement("span")).addClass("oj-navigationlist-hierarchical-menu-label");r.text(n),l.append(r),o.data("key",t),this._hviewMenu.append(o),this._hviewMenu.ojMenu("refresh"),this._showOrHideHierarchyMenu(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")),this._hviewBtn.ojButton("option","disabled",!1),this._prevButton.css("visibility","visible"),this.m_widget.getListContainer().hasClass("oj-focus-ancestor")&&this._prevButton.attr("tabindex","0"),this._headerLabel.text(i)}},t.SlidingNavListHandler.prototype.SetOptions=function(t){void 0!==t.hierarchyMenuDisplayThresholdLevel&&(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")!==t.hierarchyMenuDisplayThresholdLevel&&this._showOrHideHierarchyMenu(t.hierarchyMenuDisplayThresholdLevel))},t.SlidingNavListHandler.prototype._showOrHideHierarchyMenu=function(t){var e=this._hviewMenu.find("li").length;-1===t||e<t?(this._vSeparator.css("visibility","hidden"),this._hviewBtn[0]===document.activeElement&&this.m_root.focusin(),this._hviewBtn.css("visibility","hidden")):e>=t&&(this._vSeparator.css("visibility","visible"),this._hviewBtn.css("visibility","visible"))},t.SlidingNavListHandler.prototype._removeItemFromHviewMenu=function(t){var i,n;this._hviewBtn&&(this._hviewMenu.find("li").each(function(s,a){var o=e(a);o.data("key")===t?(o.remove(),n=o.children("a").text(),i=!0):i&&o.remove()}),this._hviewMenu.ojMenu("refresh"),this._showOrHideHierarchyMenu(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")),0===this._hviewMenu.children("li").length?(this._hviewBtn.ojButton("option","disabled",!0),this._prevButton.css("visibility","hidden"),this._prevButton.attr("tabindex","-1"),this._headerLabel.text(this.m_widget.getRootLabel())):this._headerLabel.text(n))},t.SlidingNavListHandler.prototype.RestoreItem=function(t,e,i){t.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),e.removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-describedby").removeAttr("aria-hidden")},t.SlidingNavListHandler.prototype._makeToolbarItemsFocusable=function(t){t?(this._hviewMenu.find("li").length&&this._prevButton.attr("tabindex","0"),this._hviewBtn.attr("tabindex","0")):(this._prevButton.attr("tabindex","-1"),this._hviewBtn.attr("tabindex","-1"))},t.SlidingNavListHandler.prototype.HandleFocus=function(t){e.contains(this._toolbar.get(0),t.target)||this._hviewMenu.get(0)===t.relatedTarget||(this._makeToolbarItemsFocusable(!0),l.superclass.HandleFocus.apply(this.m_widget,arguments))},t.SlidingNavListHandler.prototype.HandleBlur=function(t){e.contains(this._toolbar.get(0),t.relatedTarget)||this._hviewMenu.get(0)===t.relatedTarget?this.m_widget.UnhighlightActive():(null!=t.relatedTarget&&e.contains(this.m_root.get(0),t.relatedTarget)||this._makeToolbarItemsFocusable(!1),l.superclass.HandleBlur.apply(this.m_widget,arguments))},t.SlidingNavListHandler.prototype.GetNodeBySubId=function(t){return"oj-navigationlist-previous-link"===t.subId?this._prevButton?this._prevButton[0]:null:"oj-navigationlist-hierarchical-button"===t.subId?this._hviewBtn?this._hviewBtn[0]:null:"oj-navigationlist-hierarchical-menu"===t.subId&&this._hviewMenu?this._hviewMenu[0]:null},t.SlidingNavListHandler.prototype.GetSubIdByNode=function(t){return e(t).closest(this._prevButton).length>0?{subId:"oj-navigationlist-previous-link"}:e(t).closest(this._hviewBtn).length>0?{subId:"oj-navigationlist-hierarchical-button"}:e(t).closest(this._hviewMenu).length>0?{subId:"oj-navigationlist-hierarchical-menu"}:null};var l=function(i,n){var s=function(){};return t.Object.createSubclass(s,i,""),e.extend(s.prototype,n),s}(t._ojListView,{OPTION_DRILL_MODE:"drillMode",OPTION_DRILL_MODE_NONE:"none",OPTION_DRILL_MODE_COLLAPSIBLE:"collapsible",OPTION_DRILL_MODE_SLIDING:"sliding",OPTION_DISPLAY:"display",OPTION_DISPLAY_ICONS:"icons",OPTION_DISPLAY_ALL:"all",OPTION_EDGE:"edge",OPTION_EDGE_TOP:"top",OPTION_EDGE_END:"end",OPTION_EDGE_START:"start",OPTION_EDGE_BOTTOM:"bottom",OPTION_SELECTION:"selection",OPTION_CURRENT_ITEM:"currentItem",OPTION_ITEM:"item",TAG_NAME_TAB_BAR:"oj-tab-bar",NAVLIST_ITEM_SUBID_KEY:{navlist:"oj-navigationlist-item",tabbar:"oj-tabbar-item"},NAVLIST_EXPANDED_STYLE_CLASS:{navlist:"oj-navigationlist-expanded",tabbar:"oj-tabbar-expanded"},NAVLIST_COLLAPSIBLE_STYLE_CLASS:{navlist:"oj-navigationlist-collapsible",tabbar:"oj-tabbar-collapsible"},NAVLIST_VERTICAL_STYLE_CLASS:{navlist:"oj-navigationlist-vertical",tabbar:"oj-tabbar-vertical"},ITEM_CONTENT_STYLE_CLASS:{navlist:"oj-navigationlist-item-content",tabbar:"oj-tabbar-item-content"},NAVLIST_DIVIDERS_STYLE_CLASS:{navlist:"oj-navigationlist-item-dividers",tabbar:"oj-tabbar-item-dividers"},LAST_ITEM_STYLE_CLASS:{navlist:"oj-navigationlist-item-last-child",tabbar:"oj-tabbar-item-last-child"},EXPANDED_STYLE_CLASS:"oj-expanded",COLLAPSED_STYLE_CLASS:"oj-collapsed",SLIDING_NAVLIST_CURRENT_STYLE_CLASS:"oj-navigationlist-current",DIVIDER_STYLE_CLASS:{navlist:"oj-navigationlist-divider",tabbar:"oj-tabbar-divider"},NAVLIST_OVERFLOW_MENU_ITEM:{navlist:"oj-navigationlist-overflow-menu-item",tabbar:"oj-tabbar-overflow-menu-item"},NAVLIST_OVERFLOW_MENU:{navlist:"oj-navigationlist-overflow-menu",tabbar:"oj-tabbar-overflow-menu"},NAVLIST_OVERFLOW_ITEM_ICON:{navlist:"oj-navigationlist-overflow-item-icon",tabbar:"oj-tabbar-overflow-item-icon"},_CATEGORY_DIVIDER_STYLE_CLASS:{navlist:"oj-navigationlist-category-divider",tabbar:"oj-tabbar-category-divider"},_ITEM_LABEL_STYLE_CLASS:{navlist:"oj-navigationlist-item-label",tabbar:"oj-tabbar-item-label"},_ICON_ONLY_STYLE_CLASS:{navlist:"oj-navigationlist-icon-only",tabbar:"oj-tabbar-icon-only"},_ITEM_ICON_STYLE_CLASS:{navlist:"oj-navigationlist-item-icon",tabbar:"oj-tabbar-item-icon"},_HORIZONTAL_NAVLIST_STYLE_CLASS:{navlist:"oj-navigationlist-horizontal",tabbar:"oj-tabbar-horizontal"},_NAVLIST_END_EDGE_STYLE_CLASS:{navlist:"oj-navigationlist-vertical-end",tabbar:"oj-tabbar-vertical-end"},_NAVLIST_BOTTOM_EDGE_STYLE_CLASS:{navlist:"oj-navigationlist-horizontal-bottom",tabbar:"oj-tabbar-horizontal-bottom"},_NAVLIST_HAS_ICONS:{navlist:"oj-navigationlist-has-icons",tabbar:"oj-tabbar-has-icons"},_NAVLIST_ITEM_HAS_NO_ICON:{navlist:"oj-navigationlist-item-no-icon",tabbar:"oj-tabbar-item-no-icon"},_NAVLIST_ITEM_TITLE:{navlist:"oj-navigationlist-item-title",tabbar:"oj-tabbar-item-title"},_NAVLIST_STYLE_CLASS:{navlist:"oj-navigationlist",tabbar:"oj-tabbar"},_NAVLIST_TOUCH_STYLE_CLASS:{navlist:"oj-navigationlist-touch",tabbar:"oj-tabbar-touch"},_NAVLIST_LISTVIEW_CONTAINER_STYLE_CLASS:{navlist:"oj-navigationlist-listview-container",tabbar:"oj-tabbar-listview-container"},_IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION:"IsTitleAttrDueToTruncation",_APPLICATION_LEVEL_NAV_STYLE_CLASS:"oj-navigationlist-app-level",_PAGE_LEVEL_NAV_STYLE_CLASS:"oj-navigationlist-page-level",_NAVLIST_ITEM_ICON_HAS_TITLE:"navigationListItemIconHastitle",_NAVLIST_NO_FOLLOW_LINK_CLASS:{navlist:"oj-navigationlist-nofollow-link",tabbar:"oj-tabbar-nofollow-link"},_CONTAINER_STYLE_CLASS:{navlist:"oj-navigationlist-listview",tabbar:"oj-tabbar-listview"},_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-element",tabbar:"oj-tabbar-element"},_ELEMENT_EMPTY_TEXT_STYLE_CLASS:{navlist:"oj-navigationlist-empty-text",tabbar:"oj-tabbar-empty-text"},_ELEMENT_NO_DATA_MSG_STYLE_CLASS:{navlist:"oj-navigationlist-no-data-message",tabbar:"oj-tabbar-no-data-message"},_FOCUSED_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-focused-element",tabbar:"oj-tabbar-focused-element"},_ITEM_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-item-element",tabbar:"oj-tabbar-item-element"},_ITEM_STYLE_CLASS:{navlist:"oj-navigationlist-item",tabbar:"oj-tabbar-item"},_OPTION_DEFAULT_STYLE_CLASS:{navlist:"oj-navigationlist-option-defaults",tabbar:"oj-tabbar-option-defaults"},_LOADING_STATUS_ICON_STYLE_CLASS:{navlist:"oj-navigationlist-loading-icon",tabbar:"oj-tabbar-loading-icon"},_STATUS_MSG_STYLE_CLASS:{navlist:"oj-navigationlist-status-message",tabbar:"oj-tabbar-status-message"},_STATUS_STYLE_CLASS:{navlist:"oj-navigationlist-status",tabbar:"oj-tabbar-status"},getItemLabel:function(t){var i=this.getItemContentElement(t);return i.is("a")?e.trim(i.text()):e.trim(i.find("."+this.getItemTitleStyleClass()).text())},getItemContentElement:function(t){var e=t.children("."+this.getItemContentStyleClass());return 0===e.length&&0===(e=t.children("."+this.getGroupItemStyleClass()).children("."+this.getItemContentStyleClass())).length&&(e=t.children("."+this.getGroupItemStyleClass()).children(":not(."+this.getExpandIconStyleClass()+"):not(."+this.getCollapseIconStyleClass()+")")),e},isRtl:function(){return"rtl"===this.ojContext._GetReadingDirection()},_initNavigationMode:function(t){t[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR?this._navigationMode="tabbar":this._navigationMode="navlist"},_getNavigationMode:function(){return this._navigationMode},renderComplete:function(){this.m_listHandler.BeforeRenderComplete(),l.superclass.renderComplete.apply(this,arguments)},itemInsertComplete:function(t,e){this.m_listHandler.ItemInsertComplete(t,e),l.superclass.itemInsertComplete.apply(this,arguments)},itemRemoveComplete:function(t,e){this.m_listHandler.ItemRemoveComplete(t),l.superclass.itemRemoveComplete.apply(this,arguments)},_restoreContent:function(t){var i=t.children();t.removeAttr("style").removeClass(this.getHasIconsStyleClass()).removeAttr("aria-hidden");for(var n=0;n<i.length;n++){var s=i[n];if((s=e(s)).hasClass(this.getDividerStyleClass()))s.remove();else{var a=this.getItemContentElement(s);a.removeClass(this.getItemContentStyleClass()).removeClass(this.getHasNoIconStyleClass()).removeAttr("aria-haspopup");var o=a.children("."+this.getItemIconStyleClass());o&&o.length>0&&(o.removeAttr("role"),o.removeAttr("aria-label"),this._removeToolTipOnIcon(o)),s.removeClass("oj-default").removeAttr("role").removeAttr("aria-disabled").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-pressed");var l=this.getFocusItem(s);l.removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-pressed"),a.children("."+this.getItemLabelStyleClass()).contents().unwrap(),s.find("."+this.getNavListRemoveIcon()).remove(),l.data(this._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION)&&l.removeAttr("title");var r=s.children("ul");r.length>0?(this.m_listHandler.RestoreItem(s,a,r),this._restoreContent(r)):this.m_listHandler.RestoreItem(s,a)}}},GetDnDContext:function(){if(void 0!==t.NavigationListDndContext&&this.ojContext.element[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR)return new t.NavigationListDndContext(this)},IsNodeEditableOrClickable:function(t){return!(t.hasClass(this.getItemContentStyleClass())||t.hasClass(this.getExpandIconStyleClass())||t.hasClass(this.getCollapseIconStyleClass()))&&l.superclass.IsNodeEditableOrClickable.apply(this,arguments)},IsElementEditableOrClickable:function(t){return t.prop("nodeName").match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&!t.hasClass(this.getItemContentStyleClass())||t.hasClass("oj-component")},_focusable:function(t){return e(t.data).is("li")?!e(t.data).hasClass("oj-disabled"):!e(t.parentElement).hasClass("oj-disabled")},_prepareListViewOptions:function(t){var i=e.extend({},t);return i.drillMode="none"!==t.drillMode?"collapsible":"none",i.selection=null!==t.selection?[t.selection]:[],i.selectionMode="single",i.item=e.extend({focusable:this._focusable},t.item),i.element=this._list,i},updateListViewOption:function(t,i){switch(t){case this.OPTION_DRILL_MODE:this.options[this.OPTION_DRILL_MODE]="none"!==i?"collapsible":"none";break;case this.OPTION_SELECTION:this.options[this.OPTION_SELECTION]=null!==i?[i]:[];break;case this.OPTION_ITEM:this.options[this.OPTION_ITEM]=e.extend({focusable:this._focusable},i);break;default:this.options[t]=i}},getRootLabel:function(){return this.ojContext.options.rootLabel?this.ojContext.options.rootLabel:this.ojContext.getTranslatedString("defaultRootLabel")},SetAriaProperties:function(){"tabbar"===this._getNavigationMode()&&this.ojContext.element.attr("aria-multiselectable",!1)},HandleFocus:function(t){return this.m_listHandler.HandleFocus(t)},HandleBlur:function(t){return this.m_listHandler.HandleBlur(t)},SetRootElementTabIndex:function(){this.ojContext.element.attr("tabIndex",0)},RemoveRootElementTabIndex:function(){this.ojContext.element.removeAttr("tabIndex")},UnsetAriaProperties:function(){this.ojContext.element.removeAttr("aria-activedescendant").removeAttr("aria-multiselectable")},isLoadMoreOnScroll:function(){return!1},ShouldUseGridRole:function(){return!1},init:function(i){var n=this,s=i.ojContext.element;this._initNavigationMode(s),s.addClass(this.getNavListStyleClass()),t.DomUtils.isTouchSupported()&&s.addClass(this.getNavListTouchStyleClass()),this._list=s.children("ul:first"),0===this._list.length&&(this._list=e(document.createElement("ul")),s.append(this._list));var a=e(document.createElement("div"));a.addClass(this.getNavListContainerStyleClass()),a.attr("role","presentation"),this._list.wrap(a);var o=this._prepareListViewOptions(i);l.superclass.init.call(this,o),this.getListContainer().attr("role","presentation"),this.element.removeClass("oj-component-initnode"),this.ojContext._on(this.ojContext.element,{click:function(t){n.m_listHandler.HandleClick(t)},keydown:function(t){n.m_listHandler.HandleKeydown(t)},mouseup:function(t){n._clearActiveState(t)},mouseover:function(t){if(e(t.target).closest("a."+n.getItemContentStyleClass()).length>0){var i=e(t.target).closest("a."+n.getItemContentStyleClass()),s=i.find("."+n.getItemLabelStyleClass());s[0].offsetWidth<s[0].scrollWidth&&!i.attr("title")&&(i.attr("title",s.text().trim()),i.data(n._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION,"true"))}},mouseout:function(t){if(e(t.target).closest("a."+n.getItemContentStyleClass()).length>0){var i=e(t.target).closest("a."+n.getItemContentStyleClass());i.data(n._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION)&&(i.removeData(n._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION),i.removeAttr("title")),n._clearActiveState(t)}}})},_initListHandler:function(){var e=this.ojContext.options.drillMode,i=this.ojContext.options.edge;e===this.OPTION_DRILL_MODE_SLIDING?this.m_listHandler=new t.SlidingNavListHandler(this,this.ojContext.element,this.ojContext):e===this.OPTION_DRILL_MODE_COLLAPSIBLE?this.m_listHandler=new t.CollapsibleNavListHandler(this,this.ojContext.element,this.ojContext):e!==this.OPTION_DRILL_MODE_NONE||i!==this.OPTION_EDGE_TOP&&i!==this.OPTION_EDGE_BOTTOM?this.m_listHandler=new t.DefaultNavListHandler(this,this.ojContext.element,this.ojContext):this.m_listHandler=new t.HorizontalNavListHandler(this,this.ojContext.element,this.ojContext),this.m_listHandler.Init(this.options);var n=this.ojContext.options.navigationLevel;this._setNavigationLevel(n)},_setNavigationLevel:function(t){"none"===this.ojContext.options.drillMode&&("application"===t||"oj-navigation-list"===this.ojContext.element[0].tagName.toLowerCase()?(this.ojContext.element.addClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._PAGE_LEVEL_NAV_STYLE_CLASS)):"page"===t&&(this.ojContext.element.addClass(this._PAGE_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS)))},_clearActiveState:function(t){var i=this.FindItem(e(t.target));null!=i&&this.HighlightUnhighlightElem(i,"oj-active",!1)},afterCreate:function(){this._initListHandler(),l.superclass.afterCreate.apply(this,arguments)},getAnimationEffect:function(t){return this.m_listHandler.GetAnimationEffect(t)},notifyAttached:function(){l.superclass.notifyAttached.apply(this,arguments),this.m_listHandler.NotifyAttached()},ShouldRegisterResizeListener:function(){return!0},HandleResize:function(t,e){l.superclass.HandleResize.apply(this,arguments),t>0&&e>0&&null!=this.m_listHandler&&this.m_listHandler.HandleResize(t,e)},BeforeInsertItem:function(){this.m_listHandler.BeforeInsertItem()},HandleMouseDownOrTouchStart:function(t){l.superclass.HandleMouseDownOrTouchStart.apply(this,arguments);var i=this.FindItem(e(t.target));i&&!i.hasClass("oj-disabled")&&this.HighlightUnhighlightElem(i,"oj-active",!0)},HandleTouchEndOrCancel:function(t){this._clearActiveState(t),l.superclass.HandleTouchEndOrCancel.apply(this,arguments)},getItemContentStyleClass:function(){return this.ITEM_CONTENT_STYLE_CLASS[this._getNavigationMode()]},getNavListExpandedStyleClass:function(){return this.NAVLIST_EXPANDED_STYLE_CLASS[this._getNavigationMode()]},getNavListCollapsibleStyleClass:function(){return this.NAVLIST_COLLAPSIBLE_STYLE_CLASS[this._getNavigationMode()]},getNavListVerticalStyleClass:function(){return this.NAVLIST_VERTICAL_STYLE_CLASS[this._getNavigationMode()]},getNavListItemsDividerStyleClass:function(){return this.NAVLIST_DIVIDERS_STYLE_CLASS[this._getNavigationMode()]},getLastItemStyleClass:function(){return this.LAST_ITEM_STYLE_CLASS[this._getNavigationMode()]},getDividerStyleClass:function(){return this.DIVIDER_STYLE_CLASS[this._getNavigationMode()]},getOverflowItemStyleClass:function(){return this.NAVLIST_OVERFLOW_MENU_ITEM[this._getNavigationMode()]},getOverflowMenuStyleClass:function(){return this.NAVLIST_OVERFLOW_MENU[this._getNavigationMode()]},getOverflowItemIconStyleClass:function(){return this.NAVLIST_OVERFLOW_ITEM_ICON[this._getNavigationMode()]},getCategoryDividerStyleClass:function(){return this._CATEGORY_DIVIDER_STYLE_CLASS[this._getNavigationMode()]},getItemLabelStyleClass:function(){return this._ITEM_LABEL_STYLE_CLASS[this._getNavigationMode()]},getIconOnlyStyleClass:function(){return this._ICON_ONLY_STYLE_CLASS[this._getNavigationMode()]},getItemIconStyleClass:function(){return this._ITEM_ICON_STYLE_CLASS[this._getNavigationMode()]},getHorizontalNavListStyleClass:function(){return this._HORIZONTAL_NAVLIST_STYLE_CLASS[this._getNavigationMode()]},getNavListEndEdgeStyleClass:function(){return this._NAVLIST_END_EDGE_STYLE_CLASS[this._getNavigationMode()]},getNavListBottomEdgeStyleClass:function(){return this._NAVLIST_BOTTOM_EDGE_STYLE_CLASS[this._getNavigationMode()]},getHasIconsStyleClass:function(){return this._NAVLIST_HAS_ICONS[this._getNavigationMode()]},getHasNoIconStyleClass:function(){return this._NAVLIST_ITEM_HAS_NO_ICON[this._getNavigationMode()]},getItemTitleStyleClass:function(){return this._NAVLIST_ITEM_TITLE[this._getNavigationMode()]},getNavListStyleClass:function(){return this._NAVLIST_STYLE_CLASS[this._getNavigationMode()]},getNavListTouchStyleClass:function(){return this._NAVLIST_TOUCH_STYLE_CLASS[this._getNavigationMode()]},getNavListContainerStyleClass:function(){return this._NAVLIST_LISTVIEW_CONTAINER_STYLE_CLASS[this._getNavigationMode()]},getNoFollowLinkStyleClass:function(){return this._NAVLIST_NO_FOLLOW_LINK_CLASS[this._getNavigationMode()]},getItemSubIdKey:function(){return this.isTabBar()?this.NAVLIST_ITEM_SUBID_KEY.tabbar:this.NAVLIST_ITEM_SUBID_KEY.navlist},GetContainerStyleClass:function(){return this._CONTAINER_STYLE_CLASS[this._getNavigationMode()]},GetStyleClass:function(){return this._ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getEmptyTextMarkerClass:function(){return this._ELEMENT_EMPTY_TEXT_STYLE_CLASS[this._getNavigationMode()]},getEmptyTextStyleClass:function(){return this._ELEMENT_NO_DATA_MSG_STYLE_CLASS[this._getNavigationMode()]},getNavListRemoveIcon:function(){return"oj-tabbar-remove-icon"},getNavListRemoveCommand:function(){return"oj-tabbar-remove"},getRemovableStyleClass:function(){return"oj-removable"},getItemStyleClass:function(){return this._ITEM_STYLE_CLASS[this._getNavigationMode()]},getItemLayoutStyleClass:function(){return this.getItemStyleClass()},getFocusedElementStyleClass:function(){return this._FOCUSED_ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getItemElementStyleClass:function(){return this._ITEM_ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getCollapseIconStyleClass:function(){return"oj-navigationlist-collapse-icon"},getExpandIconStyleClass:function(){return"oj-navigationlist-expand-icon"},getDepthStyleClass:function(t){return"oj-navigationlist-depth-"+t},getGroupItemStyleClass:function(){return"oj-navigationlist-group-item"},getGroupStyleClass:function(){return"oj-navigationlist-group"},getGroupExpandStyleClass:function(){return"oj-navigationlist-collapsible-transition"},getGroupCollapseStyleClass:function(){return this.getGroupExpandStyleClass()},getOptionDefaultsStyleClass:function(){return this._OPTION_DEFAULT_STYLE_CLASS[this._getNavigationMode()]},getLoadingStatusIconStyleClass:function(){return this._LOADING_STATUS_ICON_STYLE_CLASS[this._getNavigationMode()]},getStatusMessageStyleClass:function(){return this._STATUS_MSG_STYLE_CLASS[this._getNavigationMode()]},getStatusStyleClass:function(){return this._STATUS_STYLE_CLASS[this._getNavigationMode()]},AnimateExpand:function(t,e,i){return this.m_listHandler.Expand(t,e,i)},AnimateCollapse:function(t,e,i,n){return this.m_listHandler.Collapse(t,e,i,n)},HandleArrowKeys:function(t,e,i){return this.m_listHandler.HandleArrowKeys(t,e,i)},IsArrowKey:function(t){return this.m_listHandler.IsArrowKey(t)},GetState:function(t){return this.m_listHandler.GetState(t)},SetState:function(t,e){this.m_listHandler.SetState(t,e)},HandleMouseClick:function(t){var i=e(t.target),n=this.FindItem(i);if(null!=n&&0!==n.length)if(i.hasClass(this.getNavListRemoveIcon())&&this.isTabBar())this._handleRemove(t,n);else if(this.SkipFocus(n))t.preventDefault();else if(!this.IsNodeEditableOrClickable(i)){var s=this.getItemContentElement(n).attr("href");s&&"#"!==s&&0===t.button&&(t.shiftKey||t.ctrlKey)||(l.superclass.HandleMouseClick.apply(this,arguments),t.preventDefault())}},HandleKeyDown:function(t){if(this.m_active){var i,n=t.keyCode,s=this.m_active.elem,a=this.m_active.key;if(n===e.ui.keyCode.HOME||n===e.ui.keyCode.END)i=n===e.ui.keyCode.HOME?this.element.find("."+this.getItemContentStyleClass()+":visible").first().closest("."+this.getItemElementStyleClass()):this.element.find("."+this.getItemContentStyleClass()+":visible").last().closest("."+this.getItemElementStyleClass()),this.SetCurrentItem(i,t),t.preventDefault();else if(n===e.ui.keyCode.DELETE&&this.isTabBar())this._handleRemove(t,s);else{var o=this.HandleSelectionOrActiveKeyDown(t),l=this.m_listHandler.HandleExpandAndCollapseKeys(t,n,s,a);(o=o||l||null!=this.m_dndContext&&this.m_dndContext.HandleKeyDown(t))&&t.preventDefault()}}},AvoidFocusHighLight:function(t){this._avoidFocusHighLight=t},RecentPointerCallback:function(){var t=this;return function(){return!!t._avoidFocusHighLight}},ShouldApplyHighlight:function(){return!0},ToggleSelection:function(t,e,i){var n=this.m_active.elem;this.IsSelectable(n[0])&&(this._isSelected(n)||this._fireBeforeSelectEvent(t,n)&&(l.superclass.ToggleSelection.apply(this,arguments),this._initiateNavigation(n)))},HighlightUnhighlightElem:function(t,i,n){var s=e(t);"oj-selected"===i&&this.m_listHandler.UpdateAriaPropertiesOnSelectedItem(this.getFocusItem(s),n);var a=s.children("."+this.getGroupItemStyleClass());a.length>0&&(s=e(a[0])),"oj-focus"===i?n?this._focusInHandler(s):this._focusOutHandler(s):n?s.addClass(i):s.removeClass(i),s.hasClass("oj-selected")||s.hasClass("oj-hover")||s.hasClass("oj-active")||s.hasClass("oj-disabled")?s.removeClass("oj-default"):s.addClass("oj-default")},IsSelectable:function(t){return!e(t).hasClass("oj-disabled")&&this.m_listHandler.IsSelectable(e(t))},Trigger:function(t,e,i){return"ready"===t||this.ojContext._trigger(t,e,i)},SetOption:function(t,e,i){if(this.m_listHandler.IsOptionUpdateAllowed(t,e,i)){var n=null;if("selection"===t){var s=i._context,a=s&&s.extraData&&s.extraData.items;a&&(this.ojContext._IsCustomElement()?0===a.length?s.extraData.item=null:s.extraData.item=a[0]:s.extraData.item=a,s.extraData.items=void 0),e&&e.length>0&&(n=e[0]),this._fireDeselectEvent(s.originalEvent,a,e)}else n=e;this.ojContext.option(t,n,i),this.options[t]=e,this.m_listHandler.OptionUpdated(t,n,i)}},ShouldRefresh:function(t){return null!=t.data||null!=t.drillMode||null!=t.item||null!=t.display||null!=t.edge},setOptions:function(t,e){var i,n={skipOptions:[]};return this.m_listHandler.SetOptions(t),void 0!==t.navigationLevel&&this._setNavigationLevel(t.navigationLevel),void 0!==t.selection&&(i=t.selection),n.needRefresh=l.superclass.setOptions.call(this,t,e),void 0!==i&&void 0===t.selection&&n.skipOptions.push("selection"),void 0!==i&&(t.selection=i),n},compareValues:function(e,i){return e===i||t.Object.compareValues(e,i)},HandleSelectionOption:function(t){if(void 0!==t.selection){var i=t.selection;if(i){var n=this.GetOption("selection");if(n&&0!==n.length&&this.compareValues(n[0],i))delete t.selection;else{var s=this.FindElementByKey(i);if(!s||this.IsSelectable(s))this._fireBeforeSelectEvent(null,e(s),i)?(this._fireDeselectEvent(null,s,i),t.selection=[i],this.m_listHandler.HandleSelectionChange(s),s&&this._initiateNavigation(e(s))):delete t.selection;else delete t.selection}}else t.selection=[]}l.superclass.HandleSelectionOption.call(this,t)},GetOption:function(t){var e=this.ojContext.option(t);return"selection"===t?e?[e]:[]:("item"!==t||e.focusable||(e.focusable=this._focusable),null===e?this.options[t]:e)},getWidgetConstructor:function(){return n.__GetWidgetConstructor(this.ojContext.element)},SelectAndFocus:function(t,e){t.hasClass("oj-disabled")||this.IsSelectable(t[0])&&(!this._isSelected(t)&&this._fireBeforeSelectEvent(e,t)?(l.superclass.SelectAndFocus.apply(this,arguments),this._initiateNavigation(t)):this.HandleClickActive(t,e))},isTabBar:function(){return this.ojContext.element[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR},_fireBeforeDeselectEvent:function(t,e,i){i||(i=this.GetKey(e[0]));var n=this.GetOption("selection"),s=this.FindElementByKey(n);return this.Trigger("beforeDeselect",t,{toItem:e,toKey:i,fromItem:s,fromKey:n})},_fireBeforeSelectEvent:function(t,e,i){var n=!0;return i||(i=this.GetKey(e[0])),this.isTabBar()&&(n=this._fireBeforeDeselectEvent(t,e,i)),n&&this.Trigger("beforeSelect",t,{item:e,key:i})},_fireRemoveEvent:function(t,e){var i=this.GetKey(e[0]);return this.Trigger("beforeRemove",t,{item:e,key:i})&&this.Trigger("remove",t,{item:e,key:i})},_fireDeselectEvent:function(t,e,i){var n=this.GetOption("selection"),s=this.FindElementByKey(n);this.Trigger("deselect",t,{toItem:e,toKey:i,fromItem:s,fromKey:n})},_initiateNavigation:function(t){if(this.ojContext.element.hasClass(this.getNoFollowLinkStyleClass()))return!1;var e=this.getItemContentElement(t),i=e.attr("href"),n=e.attr("target");return!(!i||"#"===i)&&(n&&"_self"!==n?window.open(i,n):window.location.href=i,!0)},_isSelected:function(t){var e=this.GetOption("selection"),i=this.GetKey(t[0]);return!(!e||1!==e.length||!this.compareValues(e[0],i))},_setToolTipOnIcon:function(t,e){t.attr("title")||t.attr("title",e)},_removeToolTipOnIcon:function(t){t.data(this._NAVLIST_ITEM_ICON_HAS_TITLE)?t.removeData(this._NAVLIST_ITEM_ICON_HAS_TITLE):t.removeAttr("title")},GetRootElement:function(){return this.ojContext.element},getSingleFocusableElement:function(t){var i=this,n="a, input, select, textarea, button",s=t.children(n).filter(function(){return!e(this).hasClass(i.getNavListRemoveIcon())});return 1===s.length&&0===s.first().find(n).length?s.first():t},PrepareContextMenu:function(t){var i=this.ojContext._GetContextMenu();if(null!=this.m_dndContext&&i&&this.m_dndContext.prepareContextMenu(i),t.hasClass(this.getRemovableStyleClass())&&i){this.m_contextMenu!==i&&(this.m_contextMenu=i,i.addEventListener("ojBeforeOpen",this._handleContextMenuBeforeOpen.bind(this)),i.addEventListener("ojAction",this._handleContextMenuSelect.bind(this)));var n=e(i).find("[data-oj-command="+this.getNavListRemoveCommand()+"]"),s=this.ojContext.getTranslatedString("labelRemove");this.ojContext._IsCustomElement()?n.empty().append(document.createTextNode(s)):n.empty().append(e('<a href="#"></a>').text(s)),i.refresh()}},_handleContextMenuSelect:function(t){e(t.target).attr("data-oj-command")===this.getNavListRemoveCommand()&&this._handleRemove(t,this.m_contextMenuItem)},_handleContextMenuBeforeOpen:function(t){this.m_contextMenuItem=t.detail.openOptions.launcher},_handleRemove:function(t,e){e.hasClass(this.getRemovableStyleClass())&&this._fireRemoveEvent(t,e)},_wrapInner:function(t,e){for(var i=t.childNodes;i.length>0;)e.appendChild(i[0]);t.appendChild(e)},itemRenderComplete:function(t,i){var n=e(t);if(n.hasClass(this.getCategoryDividerStyleClass()))return n.removeClass(this.getItemElementStyleClass()),n.removeClass(this.getFocusedElementStyleClass()),n.removeClass(this.getItemStyleClass()),n.removeAttr("aria-selected"),n.children().remove(),void n.attr("role","separator");var s,a=this.getGroupItemStyleClass(),o=this.getCollapseIconStyleClass(),r=this.getExpandIconStyleClass(),d=this.getItemIconStyleClass(),h=n.children("."+a);if(h.length>0){h.addClass(this.getItemStyleClass()),s=h.children(":not(."+r+"):not(."+o+")");var _=h.children("."+r);0===_.length&&(_=h.children("."+o)),_.attr("role","presentation"),_.removeAttr("aria-labelledby"),n.hasClass("oj-disabled")&&h.addClass("oj-disabled")}else s=n.children().first();if(s.length>0){s.addClass(this.getItemContentStyleClass());var u=s.find("."+d),m=document.createElement("span");if(m.classList.add(this.getItemLabelStyleClass()),this._wrapInner(s[0],m),u.length>0){if(u.insertBefore(m),u.attr("title")&&u.data(this._NAVLIST_ITEM_ICON_HAS_TITLE,u.attr("title")),"icons"===this.ojContext.options.display){this.ojContext.element.addClass(this.getIconOnlyStyleClass());var v=this.getItemLabel(n);u.attr("aria-label",v),u.attr("role","img"),this._setToolTipOnIcon(u,v)}n.closest("ul").addClass(this.getHasIconsStyleClass())}else s.addClass(this.getHasNoIconStyleClass())}if(n.hasClass("oj-disabled")?this.getFocusItem(n).attr("aria-disabled","true"):h.length>0?h.addClass("oj-default"):n.addClass("oj-default"),n.hasClass(this.getRemovableStyleClass())&&this.isTabBar()){var c=e("<a>");c.addClass(this.getNavListRemoveIcon()).addClass("oj-clickable-icon-nocontext oj-component-icon").attr("aria-label",this.ojContext.getTranslatedString("removeCueText")).attr("role","presentation").attr("aria-hidden","true"),n.append(c),s.attr("aria-describedby",c.uniqueId().attr("id"))}this.m_listHandler.ModifyListItem(n,s),l.superclass.itemRenderComplete.apply(this,arguments)},DestroyContentHandler:function(t){null===this.GetOption("data")&&this._restoreContent(this.element),l.superclass.DestroyContentHandler.apply(this,arguments)},getNodeBySubId:function(t){if(null==t)return this.ojContext.element?this.ojContext.element[0]:null;var e=this.m_listHandler.GetNodeBySubId(t);if(!e&&t.subId===this.getItemSubIdKey()){var i=t.key;e=this.FindElementByKey(i)}return e},getSubIdByNode:function(t){var e=null;if(null!=t&&!(e=this.m_listHandler.GetSubIdByNode(t))){var i=this.FindItem(t);if(null!=i&&i.length>0){var n=this.GetKey(i[0]);null!=n&&(e={subId:this.getItemSubIdKey(),key:n})}}return e},getContextByNode:function(t){var e=l.superclass.getContextByNode.call(this,t);return e&&"oj-listview-item"===e.subId?(e.subId=this.getItemSubIdKey(),e):null},refresh:function(){this._resetNavlist(),this._initListHandler(),l.superclass.refresh.apply(this,arguments)},_resetNavlist:function(){this.ojContext.element.removeClass(this.getIconOnlyStyleClass()),this.ojContext.element.removeClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._PAGE_LEVEL_NAV_STYLE_CLASS),this._restoreContent(this.element),this.m_listHandler.Destroy()},destroy:function(){this._resetNavlist(),l.superclass.destroy.apply(this,arguments),this._list.unwrap(),this._list.is(":empty")&&this._list.remove(),this.ojContext.element.removeClass(this.getNavListStyleClass()+" "+this.getNavListTouchStyleClass()),this.ojContext._off(this.element,"click"),this.ojContext._off(this.element,"focus"),this.ojContext._off(this.element,"blur"),this.ojContext._off(this.element,"mouseover"),this.ojContext._off(this.element,"mousein"),this.ojContext._off(this.element,"mouseout"),this.ojContext._off(this.element,"keydown")}});t.__registerWidget("oj.ojNavigationList",e.oj.baseComponent,{widgetEventPrefix:"oj",options:{as:"",currentItem:null,drillMode:"none",reorderable:"disabled",truncation:"none",edge:"start",hierarchyMenuDisplayThresholdLevel:0,rootLabel:null,selection:null,expanded:new t._ojListViewExpandedKeySet,data:null,display:"all",navigationLevel:"page",overflow:"hidden",item:{renderer:null,selectable:!0},animateStart:null,animateEnd:null,beforeSelect:null,beforeCollapse:null,beforeCurrentItem:null,beforeDeselect:null,collapse:null,deselect:null,beforeExpand:null,expand:null,reorder:null},_ComponentCreate:function(){this._super(),this._setup()},_AfterCreate:function(){this._super();var t=this;this.navlist._FixRendererContext=function(e){return t._FixRendererContext(e)},this.navlist._WrapCustomElementRenderer=function(e){return t._WrapCustomElementRenderer(e)},this.navlist.afterCreate()},_NotifyContextMenuGesture:function(t,e,i){this.navlist.notifyContextMenuGesture(t,e,i)},_setup:function(){this.navlist=new l;for(var t=Object.keys(this.options),i=0;i<t.length;i++){var n=t[i];this._validateOptionValues(n,this.options[n])}this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],this.options[this.navlist.OPTION_DISPLAY],this.options[this.navlist.OPTION_EDGE]);var s={};s.ojContext=this,s=e.extend(this.options,s),this.navlist.init(s)},getNodeBySubId:function(t){return this.navlist.getNodeBySubId(t)},getSubIdByNode:function(t){return this.navlist.getSubIdByNode(t)},getContextByNode:function(t){return this.navlist.getContextByNode(t)},expand:function(t,e,i){this.navlist.expandKey(t,e,!0,!0,i)},collapse:function(t,e,i){this.navlist.collapseKey(t,e,!0,i)},getExpanded:function(){return this.navlist.getExpanded()},_validateOptionsForIconsOnlyAndHorizontalList:function(t,e,i){if(t!==this.navlist.OPTION_DRILL_MODE_NONE){if(e===this.navlist.OPTION_DISPLAY_ICONS)throw new Error("Icon only navigation list should have drillMode set to 'none'.");if(i===this.navlist.OPTION_EDGE_TOP)throw new Error("Horizontal navigation list should have drillMode set to 'none'.")}},_validateOptionValues:function(t,e){var i=!0;if(t===this.navlist.OPTION_DRILL_MODE?i=e===this.navlist.OPTION_DRILL_MODE_NONE||e===this.navlist.OPTION_DRILL_MODE_COLLAPSIBLE||e===this.navlist.OPTION_DRILL_MODE_SLIDING:t===this.navlist.OPTION_DISPLAY?i=e===this.navlist.OPTION_DISPLAY_ALL||e===this.navlist.OPTION_DISPLAY_ICONS:t===this.navlist.OPTION_EDGE&&(i=this.element[0].tagName.toLowerCase()===this.navlist.TAG_NAME_TAB_BAR?e===this.navlist.OPTION_EDGE_TOP||e===this.navlist.OPTION_EDGE_START||e===this.navlist.OPTION_EDGE_END||e===this.navlist.OPTION_EDGE_BOTTOM:e===this.navlist.OPTION_EDGE_TOP||e===this.navlist.OPTION_EDGE_START),!i)throw new Error("Invalid value: "+e+" for key: "+t)},_setOption:function(t,i){var n,s;switch(this._validateOptionValues(t,i),t){case this.navlist.OPTION_DRILL_MODE:this._validateOptionsForIconsOnlyAndHorizontalList(i,this.options[this.navlist.OPTION_DISPLAY],this.options[this.navlist.OPTION_EDGE]);break;case this.navlist.OPTION_DISPLAY:this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],i,this.options[this.navlist.OPTION_EDGE]);break;case this.navlist.OPTION_EDGE:this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],this.options[this.navlist.OPTION_DISPLAY],i);break;case this.navlist.OPTION_SELECTION:case this.navlist.OPTION_CURRENT_ITEM:this.navlist.isAvailable()&&(s=this.navlist.getItems([i])[0],n={_context:{extraData:{item:this._IsCustomElement()?s:e(s)}}})}return this.navlist.updateListViewOption(t,i),n?this._super(t,i,n):this._super(t,i)},_setOptions:function(t,e){if(!this.navlist.isAvailable())return this._super(t,e),this;for(var i=this.navlist.setOptions(t,e),n={},s=Object.keys(t),a=0;a<s.length;a++){var o=s[a];i.skipOptions.indexOf(o)<0&&(n[o]=t[o])}return this._super(n,e),i.needRefresh&&this.navlist.refresh(),this},_NotifyAttached:function(){this.navlist.notifyAttached()},_NotifyDetached:function(){this.navlist.notifyDetached()},_NotifyShown:function(){this.navlist.notifyShown()},_VerifyConnectedForSetup:function(){return!0},refresh:function(){this._super(),this.navlist.refresh()},whenReady:function(){return this.navlist.whenReady()},_SetupResources:function(){this._super(),this.navlist.setupResources()},_ReleaseResources:function(){this._super(),this.navlist.releaseResources()},_destroy:function(){this.navlist.destroy(),this._super()},_CompareOptionValues:function(e,i,n){switch(e){case"currentItem":case"selection":return t.Object.compareValues(i,n);default:return this._super(e,i,n)}}}),n.setDefaultOptions({ojNavigationList:{hierarchyMenuDisplayThresholdLevel:n.createDynamicPropertyGetter(function(){return(i.parseJSONFromFontFamily("oj-navigationlist-option-defaults")||{}).hierarchyMenuDisplayThresholdLevel})}}),a.extension._WIDGET_NAME="ojNavigationList",a.extension._ALIASED_PROPS={hierarchyMenuThreshold:"hierarchyMenuDisplayThresholdLevel"},t.CustomElementBridge.register("oj-navigation-list",{metadata:a}),o.extension._WIDGET_NAME="ojNavigationList",t.CustomElementBridge.register("oj-tab-bar",{metadata:o})});