define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './useTranslationBundle-7c40cb58', './clientHints-fff66be9', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './classNames-08d99695', './Icon-383a68bb', './useTabBarContext-15a23bb6', './Dropdown-73238fd5', './Sheet-404b38fa', './TabBarItem-4ff2ef15', './UNSAFE_TabBarCommon/themes/OverflowTabBarItemStyles.css', './NavigationListItem-32ded4a5', './RemovableNavigationListItem-1f69907c'], (function(e,a,t,n,s,o,i,l,r,c,d,m,b,u,f,v,p){"use strict";const x=e=>a.jsx(c.Icon,{viewBox:"0 0 24 24",...e,children:a.jsx("g",{fill:"none",children:a.jsx("path",{d:"M6 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z",fill:"currentcolor"})})});const g=()=>{const{deviceType:e}=o.getClientHints();return"phone"===e};e.OverflowTabBarItem=function({overflowItemKey:e,icon:o,badge:c,overflowItems:h,isOpen:y,onClose:I}){const{selection:j,showFocusRing:C,isEdgeBottom:w,onSelect:B,onRemove:R,layout:T}=d.useTabBarContext(),K=n.useRef(!1),O=n.useRef(null),N=t.createRef(),k=n.useCallback((e=>{"pointer"===e.reason&&(K.current=!0),B?.({value:e.value}),I?.({reason:"itemAction"})}),[B,I]),F=n.useCallback((e=>{I?.({reason:e.reason})}),[I]),L=n.useCallback((()=>{I?.({reason:"dismissed"})}),[I]),S=C&&!K.current&&!g(),D=h?.find((e=>e.itemKey===j))?.tabPanelId,z=s.useTranslationBundle("@oracle/oraclejet-preact"),A=void 0!==j&&(E=j,null!=h?.find((e=>e.itemKey===E)));var E;const H=i.mergeInterpolations([...Object.values(l.flexitemInterpolations)])({flex:"stretch"===T?"1 0 auto":"0 0 auto"}),M=r.classNames([f.styles.navContainerBase]),P=n.useRef(null),U=n.useCallback((e=>{"ArrowDown"===e.key&&(e.preventDefault(),N.current?.focus())}),[N]),_=n.useCallback((()=>a.jsx("div",{onKeyDown:U,tabIndex:0,ref:P,class:M,children:a.jsx(v.NavigationList,{ref:N,selection:j,onSelectionChange:k,onRemove:R,children:h?.map((e=>e.isRemovable?a.jsx(p.RemovableNavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity}):a.jsx(v.NavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity})))})})),[U,M,N,j,k,R,h]);return a.jsxs(a.Fragment,{children:[h&&h.length>0&&a.jsx("div",{ref:O,style:H,children:a.jsx(u.BaseTabBarItem,{"aria-controls":D,itemKey:e,label:z.overflowItemLabel(),icon:o||a.jsx(x,{}),badge:c,showFocusRingOverride:S,selectionOverride:A,displayOverride:"icons","aria-haspopup":!0})}),g()?a.jsx(b.Sheet,{isOpen:y,onClose:L,children:_()}):a.jsx(m.Dropdown,{initialFocus:"firstFocusable",isOpen:y,onClose:F,placement:w?"top-end":"bottom-end",anchorRef:O,children:_()})]})}}));
//# sourceMappingURL=OverflowTabBarItem-f8128e3d.js.map
