'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 n from"next/link";let DesktopMenuItem=({id:a,menu:o,arrow:s,textColor:m,menuTextColor:c,depth:u=0,maxDepth:d=2,menuBg:f,typo:h,typography:v,enableHoverEffect:x,enableDropdownHoverEffect:y})=>{let b=o?.[a];if(!b||u>d)return null;let w=u===d,k=t(h,v),D=!!b?.childrens?.length&&!w,N=D&&!!s,I=l("c",0===u?m:c),M=0===u&&x||0!==u&&y?I:r(I);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:{...k,...M},children:[b?.link?p(n,{href:b.link,title:b.title,className:"gp-w-full",children:b.title}):p("span",{children:b?.title}),N&&p("span",{dangerouslySetInnerHTML:{__html:s},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",f)},children:b?.childrens?.map(e=>p(DesktopMenuItem,{id:e,menu:o,depth:u+1,maxDepth:d,arrow:s,menuTextColor:c,menuBg:f,typo:h,typography:v,enableHoverEffect:x,enableDropdownHoverEffect:y},e))})})]})};export{DesktopMenuItem as default};
