/* @oracle/oraclejet-preact: undefined */
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var jsxRuntime = require('preact/jsx-runtime');
var hooks = require('preact/hooks');
var compat = require('preact/compat');
require('./LayerHost-3cd73603.js');
require('./UNSAFE_Text/themes/TextStyles.css.js');
require('./Flex-3a257bc3.js');
var TabBarLayout = require('./TabBarLayout-ca8af14b.js');
require('./flexitem-fee13e26.js');
require('./dimensions-6101ca1f.js');
require('./boxalignment-e287d370.js');
require('./logger-2b636482.js');


require('./UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js');


require('./UNSAFE_Badge/themes/redwood/BadgeVariants.css.js');
require('./ConveyorBeltContext-bfe84b44.js');
require('./BusyStateContext-86f40d3c.js');
require('./TabbableModeContext-e99d527e.js');
require('preact');
var mergeProps = require('./mergeProps-e3da7237.js');


require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js');
require('./tooltipUtils-2bc15136.js');

var HiddenAccessible = require('./HiddenAccessible-087eb49a.js');
require('./BaseButton-d8f96bfa.js');
require('./ButtonLabelLayout-c876923f.js');
require('./NavigationList-d0d74565.js');
require('./useNavigationListItem-b97e76d5.js');
require('./UNSAFE_NavigationList/themes/NavigationListItemStyles.css.js');

require('./UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css.js');

require('./Floating-79cbe5ad.js');

require('./keyboardUtils-b42fe7d5.js');
require('./tabbableUtils-22a50472.js');
require('./CollectionInteractionContext-f84ff7a1.js');

require('./Sheet-1d6e8cf8.js');

require('./StyledCheckbox-9047ed7d.js');

var clientUtils = require('./clientUtils-ef5e20ce.js');
var UNSAFE_TabBarMixed_themes_TabBarMixedStyles_css = require('./UNSAFE_TabBarMixed/themes/TabBarMixedStyles.css.js');
var useTabBar = require('./useTabBar-35b73d10.js');
var LiveRegion = require('./LiveRegion-62ce9ac7.js');
var TabBarContextMenu = require('./TabBarContextMenu-d9bf65c2.js');
var ConveyorBeltFocusContext = require('./ConveyorBeltFocusContext-0e08d043.js');
var View = require('./View-ed116d78.js');
var UNSAFE_TabBarMixed_themes_TabBarMixedSeparator_css = require('./UNSAFE_TabBarMixed/themes/TabBarMixedSeparator.css.js');
var OverflowTabBarItem = require('./OverflowTabBarItem-19ad4971.js');

require('./index-0aa99b92.js');
require('./UNSAFE_Layer/themes/LayerHostStyles.css.js');


require('./vanilla-extract-recipes-createRuntimeFn.esm-d1301b2d.js');
require('./useTestId-4f53d561.js');
require('./classNames-c14c6ef3.js');
require('./flexbox-2cae9a01.js');

require('./vanilla-extract-sprinkles-createRuntimeSprinkles.esm-d68f3e0f.js');
require('./mergeInterpolations-6727b536.js');
require('./mergeDeepWithKey-210b024d.js');
require('./_curry3-18677bca.js');
require('./_curry1-e8f0d7ea.js');
require('./_curry2-c15d89cd.js');
require('./_isObject-28636267.js');


require('./size-1914356b.js');
require('./utils-c0efcd5e.js');
require('./themeContract.css-f3d431c6.js');
require('./colorUtils-01f3caa2.js');
require('./arrayUtils-7d8dcfc3.js');




require('./EnvironmentProvider-5f2435e6.js');
require('./LayerManager-c535d963.js');
require('./Layer-b60deb1b.js');
require('./UNSAFE_Layer/themes/LayerStyles.css.js');
require('./useThemeInterpolations-a37b37d9.js');
require('./useColorScheme-f8b1447d.js');
require('./useScale-db16c2b8.js');
require('./theme-dfd6a9fe.js');
require('./Theme-f06687af.js');
require('./useDensity-0b9fd9ca.js');
require('./unsafeDomAccess-c3a492f0.js');
require('./useHover-49b0430d.js');
require('./useToggle-3ebba7d8.js');
require('./useActive-6770f917.js');
require('./clientHints-c40c5250.js');
require('./UNSAFE_BaseButton/themes/redwood/BaseButtonTheme.js');
require('./UNSAFE_BaseButton/themes/BaseButtonStyles.css.js');

require('./UNSAFE_BaseButton/themes/redwood/BaseButtonVariants.css.js');

require('./useComponentTheme-082fc8e4.js');
require('./BareButton-e8a030d7.js');
require('./useBareButton-463210c9.js');
require('./usePress-886180e4.js');
require('./usePressClick-7a34624a.js');
require('./useTabbableMode-dbd254e8.js');
require('./useId-6c0eeb27.js');
require('./buttonUtils-dff2ea3e.js');
require('./id-86356250.js');
require('./Text-056f1ec5.js');
require('./useButtonLabelLayoutTheme-d09db0c9.js');
require('./UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutTheme.js');
require('./UNSAFE_ButtonLabelLayout/themes/ButtonLabelLayoutStyles.css.js');

require('./UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.css.js');

require('./UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutVariants.css.js');

require('./UNSAFE_NavigationList/themes/NavigationListStyles.css.js');

require('./collectionUtils-f1d3183f.js');
require('./keys-25710458.js');
require('./Selector-6550b8e0.js');
require('./BaseSelector-2dc69917.js');
require('./useFocus-1b288fb9.js');
require('./PRIVATE_BaseSelector/themes/SelectorStyles.css.js');
require('./useCollectionInteractionContext-6fc0200e.js');
require('./useCollectionFocusRing-bed0aa16.js');
require('./useCurrentKey-1b9e3382.js');
require('./useUser-1295b5cb.js');
require('./useContextMenuGesture-530ef8dd.js');
require('./textSelectionUtils-57082239.js');
require('./useTranslationBundle-12dd087d.js');
require('./useInteractionStyle-c203a8a0.js');
require('./UNSAFE_NavigationListCommon/themes/redwood/NavigationListItemTheme.js');
require('./UNSAFE_NavigationList/themes/redwood/NavigationListItemBaseTheme.css.js');


require('./useFloating-c753a7f9.js');
require('./positionUtils-a780137e.js');
require('./refUtils-a9872e75.js');
require('./useOutsideClick-dbf3d604.js');
require('./useModal-0739a528.js');
require('./UNSAFE_Floating/themes/redwood/FloatingTheme.js');
require('./UNSAFE_Floating/themes/FloatingStyles.css.js');

require('./UNSAFE_Floating/themes/redwood/FloatingBaseTheme.css.js');

require('./UNSAFE_Floating/themes/redwood/FloatingVariants.css.js');
require('./vanilla-extract-dynamic.esm-2e1b7c25.js');
require('./UNSAFE_Floating/themes/FloatingContract.css.js');
require('./useUnsafeDomElementRef-f22a2f0c.js');
require('./head-68d0992f.js');
require('./_arity-c228159c.js');
require('./_isArray-73160ad5.js');
require('./_isString-f4443c9e.js');
require('./Modal-b751b643.js');
require('./UNSAFE_Modal/themes/ModalStyles.css.js');

require('./popupUtils-1d123cbe.js');
require('./WindowOverlay-85d999fa.js');
require('./UNSAFE_WindowOverlay/themes/WindowOverlayStyles.css.js');

require('./UNSAFE_WindowOverlay/themes/WindowOverlayContract.css.js');
require('./UNSAFE_WindowOverlay/themes/redwood/WindowOverlayTheme.js');
require('./UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.css.js');

require('./UNSAFE_WindowOverlay/themes/redwood/WindowOverlayVariants.css.js');
require('./UNSAFE_Sheet/themes/SheetStyles.css.js');

require('./useAnimationStatus-8075dc19.js');
require('./useAnimation-65c0e455.js');
require('./animationUtils-54852d03.js');
require('./Check-1272bb86.js');
require('./Icon-56789beb.js');
require('./useTooltip-34accecc.js');
require('./useTooltipControlled-0a95856c.js');
require('./useTouch-4dec8729.js');
require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentTheme.js');
require('./hooks/UNSAFE_useTooltip/themes/TooltipContentStyles.css.js');
require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.css.js');
require('./UNSAFE_Icon/themes/IconStyle.css.js');
require('./CheckboxOff-a3ed334d.js');
require('./CheckboxOn-b5dda28b.js');
require('./CheckboxMixed-a17c8298.js');
require('./UNSAFE_Checkbox/themes/CheckboxIconContract.css.js');
require('./UNSAFE_Checkbox/themes/redwood/CheckboxIconTheme.js');
require('./UNSAFE_Checkbox/themes/CheckboxIconStyles.css.js');

require('./UNSAFE_Checkbox/themes/redwood/CheckboxIconBaseTheme.css.js');

require('./UNSAFE_Checkbox/themes/redwood/CheckboxIconVariants.css.js');



require('./useReorderableContext-92514102.js');
require('./ReorderableContext-16396e17.js');

require('./SelectMenuGroupContext-a349d259.js');
require('./Dropdown-1ba432a8.js');
require('./usePopupAnimation-f3b34413.js');
require('./popupAnimationUtils-dcace427.js');
require('./UNSAFE_Dropdown/themes/dropdownStyles.css.js');
require('./useOutsideMousedown-70f36cca.js');
require('./useEffectEvent-832ffba5.js');
require('./UNSAFE_Menu/themes/MenuStyles.css.js');

require('./UNSAFE_Menu/themes/DropdownMenuStyles.css.js');

require('./Skeleton-8e35c7d1.js');
require('./borders-4b8488cb.js');
require('./UNSAFE_Skeleton/themes/redwood/SkeletonTheme.js');
require('./UNSAFE_Skeleton/themes/SkeletonStyles.css.js');

require('./UNSAFE_Skeleton/themes/redwood/SkeletonBaseTheme.css.js');

require('./UNSAFE_Skeleton/themes/redwood/SkeletonVariants.css.js');
require('./UNSAFE_Menu/themes/MenuSkeletonStyles.css.js');

require('./UNSAFE_Menu/themes/redwood/MenuItemTheme.js');
require('./UNSAFE_Menu/themes/MenuItemStyles.css.js');

require('./UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.css.js');

require('./UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js');

require('./Separator-85962472.js');
require('./UNSAFE_Separator/themes/SeparatorStyles.css.js');



require('./UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js');
require('./tabBarUtils-54fc91af.js');
require('./colors-f3ce979a.js');
require('./padding-ba041f6a.js');
require('./aria-889aedd0.js');
require('./equals-098f7781.js');

require('./EmbeddedIconButton-cc159a01.js');
require('./Close-d99c20a7.js');
require('./NavigationListItem-b0b03089.js');
require('./NavigationListLinkItem-317a5200.js');
require('./Badge-0e522f12.js');
require('./UNSAFE_Badge/themes/redwood/BadgeTheme.js');
require('./UNSAFE_Badge/themes/BadgeStyles.css.js');
require('./UNSAFE_Badge/themes/redwood/BadgeThemeBaseTheme.css.js');
require('./WarningS-cdb0a7ad.js');
require('./ErrorS-b027f7ad.js');
require('./InformationS-b0bb102b.js');
require('./SuccessS-b6757c64.js');
require('./UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js');
require('./UNSAFE_TabBarCommon/themes/TabBarItemStyles.css.js');
require('./UNSAFE_TabBarCommon/themes/redwood/TabBarItemBaseTheme.css.js');
require('./useConveyorBeltItem-6c1771e5.js');
require('./useDetectTruncation-a5b9dd16.js');
require('./truncationUtils-2d44b04b.js');
require('./useResizeObserver-a9e97180.js');
require('./useAddBusyState-d19ae1fa.js');
require('./useBusyStateContext-362eee2a.js');
require('./UNSAFE_TabBarCommon/themes/TabBarItemContract.css.js');
require('./UNSAFE_TabBarCommon/themes/OverflowTabBarItemStyles.css.js');

/**
 * A thin wrapper around useTabBar hook
 */
function useTabBarMixed(options) {
    return useTabBar.useTabBar(options);
}

/**
 * A navigation component that enables horizontal navigation between distinct content with a mixture of static and dynamic tabs.
 *
 * @param {TabBarMixedProps} props TabBarMixed component props.
 * @returns {JSX.Element} TabBarMixed component element.
 */
const TabBarMixed = compat.forwardRef((props, focusHandleRef) => {
    const { children, onRemove, onSelect, selection, size, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby } = props;
    const rootRef = hooks.useRef(null);
    const isMobileDevice = clientUtils.isMobile();
    const defaultContextMenuConfig = hooks.useMemo(() => {
        return {
            itemsRenderer: (context) => {
                //Only if context is available, it is a mobile device and it is removable item, we will return remove context menu item
                if (context) {
                    const isRemovableItem = useTabBar.getItemAttribute(context.itemKey, rootRef.current, useTabBar.REMOVABLE_ITEM_ATTRIBUTE) != null;
                    if (isRemovableItem && isMobileDevice) {
                        const defaultItems = context.defaultMenuItems;
                        return jsxRuntime.jsx(jsxRuntime.Fragment, { children: defaultItems });
                    }
                }
                return null;
            }
        };
    }, []);
    const { rootProps, tabBarContext, menuProps, contextMenuContext, contextMenuDescription, contextMenuDescriptionId, accStatusInfo } = useTabBarMixed({
        class: UNSAFE_TabBarMixed_themes_TabBarMixedStyles_css.styles.tabBarBase,
        edge: 'bottom',
        onRemove,
        onSelect,
        ref: rootRef,
        selection,
        size,
        children,
        contextMenuConfig: defaultContextMenuConfig
    });
    const isContextMenuAvailable = defaultContextMenuConfig != null && isMobileDevice;
    //Allows to call focus on rootRef without having to expose it
    compat.useImperativeHandle(focusHandleRef, () => ({
        focus: () => {
            if (rootRef.current) {
                rootRef.current.focus();
            }
        },
        blur: () => {
            if (rootRef.current) {
                rootRef.current.blur();
            }
        }
    }));
    const [isSuppressOverflowFocus, setIsSuppressOverflowFocus] = hooks.useState(false);
    const focusTabbarRoot = hooks.useCallback(() => {
        rootRef.current?.focus();
    }, []);
    // Begin a short window where overflow div should not be focusable.
    const beginTabPass = hooks.useCallback(() => {
        setIsSuppressOverflowFocus(true);
    }, []);
    // End that window after focus moves away.
    const endTabPass = hooks.useCallback(() => {
        setIsSuppressOverflowFocus(false);
    }, []);
    const onKeyDown = hooks.useCallback((e) => {
        // We only want to suppress overflow focus when the user is tabbing.
        if (e.key === 'Tab' && !e.shiftKey) {
            // Tell conveyor to make its overflow non-focusable (tabIndex = -1)
            beginTabPass?.();
        }
    }, [beginTabPass]);
    const onBlur = hooks.useCallback(() => {
        // End that suppress overflow after focus moves away.
        endTabPass?.();
    }, [endTabPass]);
    const focusContext = hooks.useMemo(() => ({
        focusTabbarRoot,
        isSuppressOverflowFocus,
        beginTabPass,
        endTabPass
    }), [isSuppressOverflowFocus, focusTabbarRoot, beginTabPass, endTabPass]);
    const mergedRootProps = mergeProps.mergeProps(rootProps, { onKeyDown, onBlur });
    return (jsxRuntime.jsxs(ConveyorBeltFocusContext.ConveyorBeltFocusContext.Provider, { value: focusContext, children: [jsxRuntime.jsx(TabBarLayout.TabBarContext.Provider, { value: tabBarContext, children: jsxRuntime.jsx("div", { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...mergedRootProps, children: children }) }), isContextMenuAvailable && contextMenuDescriptionId && contextMenuDescription && (jsxRuntime.jsx("span", { id: contextMenuDescriptionId, children: jsxRuntime.jsx(HiddenAccessible.HiddenAccessible, { children: contextMenuDescription }) })), isContextMenuAvailable && accStatusInfo && jsxRuntime.jsx(LiveRegion.LiveRegion, { children: accStatusInfo }), isContextMenuAvailable && (jsxRuntime.jsx(TabBarContextMenu.TabBarContextMenu, { ...menuProps, contextMenuConfig: defaultContextMenuConfig, contextMenuContext: contextMenuContext }))] }));
});

/**
 * TabBarMixedSeparator is a component that renders a visual separator (displayed
 * as a vertical line) between collections of tabs within TabBarMixed.
 *
 * @param {TabBarMixedSeparatorProps} props Component props for TabBarMixedSeparator.
 * @returns {JSX.Element} Component element for TabBarMixedSeparator.
 */
function TabBarMixedSeparator(props) {
    const { padding = 0 } = props;
    return (jsxRuntime.jsx(View.View, { padding: [0, padding, 0, padding], children: jsxRuntime.jsx("div", { class: UNSAFE_TabBarMixed_themes_TabBarMixedSeparator_css.styles.separator, role: "presentation" }) }));
}

exports.TabBarLayout = TabBarLayout.TabBarLayout;
exports.OverflowTabBarItem = OverflowTabBarItem.OverflowTabBarItem;
exports.RemovableTabBarItem = OverflowTabBarItem.RemovableTabBarItem;
exports.TabBarItem = OverflowTabBarItem.TabBarItem;
exports.TabBarMixed = TabBarMixed;
exports.TabBarMixedSeparator = TabBarMixedSeparator;
//# sourceMappingURL=UNSAFE_TabBarMixed.js.map
