"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    Breadcrumb: ()=>Breadcrumb
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const styled_namespaceObject = require("@emotion/styled");
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
const apollo_core_namespaceObject = require("@uipath/apollo-core");
const external_react_namespaceObject = require("react");
const CanvasTooltip_cjs_namespaceObject = require("../../components/CanvasTooltip.cjs");
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
const OlStyled = styled_default().ol`
  display: flex;
  flex-direction: row;
  margin: 0;
  padding: 0;
`;
const LiStyled = styled_default().li`
  display: flex;
  align-items: center;
  padding: 0;
`;
const Breadcrumb = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ items, delimiter = '>' })=>{
    const delimiterNode = 'string' == typeof delimiter ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
        "aria-hidden": "true",
        children: delimiter
    }) : delimiter;
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Row, {
        align: "center",
        style: {
            overflow: 'hidden',
            whiteSpace: 'nowrap',
            color: 'var(--color-foreground-de-emp)'
        },
        gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(OlStyled, {
            children: items.map((item, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(LiStyled, {
                    children: [
                        item.onClick ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
                            type: "button",
                            style: {
                                cursor: 'pointer',
                                background: 'none',
                                border: 'none',
                                padding: 0,
                                margin: 0,
                                color: 'inherit'
                            },
                            onClick: (e)=>item.onClick?.(e),
                            onKeyDown: (e)=>'Enter' === e.key && item.onClick?.(e),
                            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
                                overflow: "hidden",
                                align: "center",
                                gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
                                "aria-current": index === items.length - 1 ? 'page' : void 0,
                                children: [
                                    item.startAdornment,
                                    /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                                        smartTooltip: true,
                                        content: item.label,
                                        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                            className: `${index === items.length - 1 ? 'text-sm font-bold' : 'text-sm'} truncate`,
                                            "data-testid": `breadcrumb-item-${item.label}`,
                                            children: item.label
                                        })
                                    }),
                                    item.endAdornment
                                ]
                            })
                        }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
                            overflow: "hidden",
                            align: "center",
                            gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
                            "aria-current": index === items.length - 1 ? 'page' : void 0,
                            children: [
                                item.startAdornment,
                                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                                    smartTooltip: true,
                                    content: item.label,
                                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                                        className: `${index === items.length - 1 ? 'text-sm font-bold' : 'text-sm'} truncate`,
                                        "data-testid": `breadcrumb-item-${item.label}`,
                                        children: item.label
                                    })
                                }),
                                item.endAdornment
                            ]
                        }),
                        index < items.length - 1 && delimiterNode
                    ]
                }, `${item.label}-${index}`))
        })
    });
});
Breadcrumb.displayName = 'Breadcrumb';
exports.Breadcrumb = __webpack_exports__.Breadcrumb;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "Breadcrumb"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
