'use client';
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{filterToolbarPreview as s}from"@gem-sdk/core";import{Children as i,isValidElement as l}from"react";import{useTab as r}from"../hooks/useTab.js";import{createAttr as m,createStyle as o,createClass as a}from"@gem-sdk/system";import{getAttr as d,getAttrContent as c}from"../common/attrs.js";import p from"../../text/components/Text.js";import{getStyleWrapper as n,getTabParentListStyle as u,getTabListStyle as h,getContainContentStyle as y,getItemStyle as f}from"../common/styles.js";import{getClassesWrapper as x,getContainClasses as N,getStyleTagClasses as g,getTabParentListClasses as v,getTabListClasses as j,getWrapperContentClasses as k,getContainContentClasses as C,getTextClasses as b,getItemClasses as T}from"../common/classes.js";let $=$=>{let{builderAttrs:q,builderProps:A,style:W,setting:F,advanced:I,children:L}=$,{cssClass:S}=I??{},{panelWidth:U,childItem:w,labelAlign:z,labelTypo:B,labelTypoV2:D}=F??{},{currentDevice:E,productID:G,dispatchEventTabActive:H,activeTab:J,setActiveKey:K,refContainer:M}=r(F,A);F&&!F?.labelWidth&&(F.labelWidth={desktop:"200px"});let O=m({...d({uid:A?.uid||""})}),P=o({...n({setting:F,style:W,uid:A?.uid,pageContext:$.pageContext??{}})}),Q=a({...x({builderProps:A,advancedCssClass:S})}),R=a({...N({setting:F})}),V=g({panelWidth:U,builderProps:A}),X=a({...v()}),Y=o({...u(F)}),Z=a({...j({setting:F})}),_=o({...h(F)}),ee=e=>a({...T({setting:F,isNotLiquid:!0,isActive:e,currentDevice:E})}),et=e=>o({...f(F,e)}),es=i.map(L,e=>e?.props?.uid),ei=a({...k()}),el=a({...C()}),er=o({...y()}),em=a({...b()}),eo=m({...c({uid:A?.uid||""})});return e("div",{ref:M,...q,...O,style:P,className:Q,children:[t("style",{children:V}),e("div",{className:R,children:[t("div",{className:X,style:Y,children:t("ul",{className:Z,style:_,children:w?.map((e,s)=>{let i=J==s;return t("li",{"aria-hidden":!0,className:ee(i),style:et(i),onClick:()=>{K(s),H(s)},children:t(p,{className:em,styles:{typo:D,typography:B,textAlign:z},setting:{text:e,htmlTag:"div",excludeFlex:!0,options:{useState:!0,uniqueId:G?`${es?.[s]}-${G}`:`${es?.[s]}`,productID:G}}})},es&&es[s])})})}),t("div",{className:ei,children:t("div",{...eo,className:el,style:er,children:i.map(s(L),(e,s)=>l(e)?t(e.type,{...e.props,isActive:s==J,parentUid:A?.uid}):null)})})]}),s(L,!0)]})};export{$ as default};
