'use client';
import{jsxs as e,jsx as p}from"react/jsx-runtime";import{composeTypographyStyle as t,getGlobalColorStateStyle as l,filterHoverVariables as r,cls as g,getGlobalColorResponsiveStyle as i}from"@gem-sdk/core";import a from"next/link";let n=({id:o,menu:s,arrow:c,textColor:m,menuTextColor:d,depth:u=0,maxDepth:f=2,menuBg:h,typo:v,typography:x,enableHoverEffect:y,enableDropdownHoverEffect:b})=>{let w=s?.[o];if(!w||u>f)return null;let k=u===f,N=t(v,x),D=!!w?.childrens?.length&&!k,H=l("c",0===u?m:d),j=0===u&&y||0!==u&&b?H:r(H);return e("li",{className:g("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===u,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":u>0}),style:{...N,...j},children:[w?.link?p(a,{href:w.link,title:w.title,className:"gp-w-full",children:w.title}):p("span",{children:w?.title}),D&&!!c&&p("span",{dangerouslySetInnerHTML:{__html:c},className:g("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===u})}),D&&p("div",{className:g("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===u,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===u}),children:p("ul",{className:g("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===u}),style:{...i("bgc",h)},children:w?.childrens?.map(e=>p(n,{id:e,menu:s,depth:u+1,maxDepth:f,arrow:c,menuTextColor:d,menuBg:h,typo:v,typography:x,enableHoverEffect:y,enableDropdownHoverEffect:b},e))})})]})};export{n as default};
