'use client';
import{jsx as r}from"react/jsx-runtime";import{useMemo as e}from"react";import{useBreadcrumb as m}from"../hooks/useBreadcrumb.js";import s from"./BreadcrumbItem.js";import{createAttr as t,createStyle as o,createClass as a}from"@gem-sdk/system";import{getAttr as l,getNavAttr as c}from"../common/attrs.js";import{getBreadcrumbStyles as i,getSpacingStyles as d}from"../common/styles.js";import{getBreadcrumbClasses as n,getNavClasses as p}from"../common/classes.js";import{makeGlobalSize as u,makeStyleResponsive as f}from"@gem-sdk/core";let Breadcrumb=({className:g,setting:b={},style:j,styles:h={},builderAttrs:y,builderProps:B,advanced:k})=>{let{background:x,align:I}=b||{},{currentBreadcrumb:N}=m(),v=e(()=>{let e=N.length;return N.length?N.map((m,t)=>r(s,{lengthOfBreadcrumb:e,templateName:m,breadcrumbItemIndex:t,setting:b,styles:h},t)):null},[N,b,h]),C=t({...l({uid:B?.uid??"",builderAttrs:y})}),z=o({...i(j,{background:x,align:I})}),O=a({...n(g),...k?.cssClass&&{[k.cssClass]:!0}}),S=a({...p()}),q=t({...c()}),w=o({...u(b?.globalSize).padding,...d(b?.spacing),...f("jc",I)});return r("div",{...C,style:z,className:O,children:r("nav",{style:w,className:S,...q,children:v})})};export{Breadcrumb as default};
