"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../tslib.es6-C4EgNkz1.js"),e=require("react"),C=require("classnames"),f=require("../icons/ebay-icon-chevron-right-12/index.js"),k=t=>{var{a11yHeadingText:a="Page navigation",a11yHeadingTag:r="h2",id:l="ebay-breadcrumb",children:n=[],className:o,onSelect:d=()=>{}}=t,s=m.__rest(t,["a11yHeadingText","a11yHeadingTag","id","children","className","onSelect"]);const c=`${l}-breadcrumbs-heading`,b=e.Children.count(n)-1,u=r,g=e.Children.toArray(n).some(i=>i.props.href)?"a":"button";return e.createElement("nav",Object.assign({},s,{"aria-labelledby":c,className:C("breadcrumbs",o),role:"navigation"}),e.createElement(u,{id:c,className:"clipped"},a),e.createElement("ul",null,e.Children.map(n,(i,h)=>{const y=h===b,{href:I,children:v}=i.props,E={tag:g,isLastItem:y,href:I,children:v,onClick:p=>d(p)};return e.cloneElement(i,E)})))},j=t=>{var{tag:a="button",isLastItem:r=!1,href:l,children:n,onClick:o}=t,d=m.__rest(t,["tag","isLastItem","href","children","onClick"]);const s=a==="a",c=Object.assign(Object.assign(Object.assign({},d),r?{"aria-current":"location"}:{}),{href:s?l:void 0,onClick:s?void 0:o});return e.createElement("li",null,e.createElement(a,Object.assign({},c),n),!r&&e.createElement(f.EbayIconChevronRight12,null))};exports.EbayBreadcrumbItem=j;exports.EbayBreadcrumbs=k;
