import{j as o,r as u}from"./fields-wnm5Jtc6.js";import{a as n,R as f}from"./vendor-D21mNUGX.js";import{P as l}from"./index-pmrLY__j.js";const c=({title:b,style:p,children:a})=>o.jsx("div",{children:a});c.propTypes={title:l.string.isRequired};const v=({handleClick:b,defaultActiveTab:p=0,children:a,halfMargin:m})=>{const[e,i]=n.useState(p),r=u(),$=t=>{i(t),b&&b(t)};return n.useEffect(()=>{i(p)},[p]),o.jsx("div",{className:"acpt-tabs",id:`tabs-${r}`,children:a&&(a==null?void 0:a.length)>0&&o.jsxs(f.Fragment,{children:[o.jsx("ul",{role:"tablist",className:`tablist ${m?"mb-12":"mb-24"}`,children:a==null?void 0:a.map((t,s)=>t?o.jsx("li",{"data-cy":`tab-${r}-${s+1}`,id:`tab-${r}-${s+1}`,"aria-selected":e===s,"aria-controls":`tabpanel-${r}-${s+1}`,tabIndex:s+1,role:"tab",className:`acpt-accordion-tab ${t.props.style?t.props.style:""} ${e===s?"active":""}`,onClick:y=>$(s),children:t.props&&t.props.title?t.props.title:`Tab ${s+1}`},s):null)}),a[e]&&o.jsx("div",{"data-cy":`tabpanel-${r}-${e+1}`,id:`tabpanel-${r}-${e+1}`,className:"tab-panel",role:"tabpanel",tabIndex:e+1,"aria-labelledby":`tab-${r}-${e+1}`,children:a[e]})]})})};v.propTypes={handleClick:l.func,defaultActiveTab:l.number,setDefaultActiveTab:l.func,halfMargin:l.bool,children:l.arrayOf(c)};export{v as T,c as a};
