import{j as l}from"./index-CzTQZzQy.js";import{r as i}from"./vendor-L5FivjNr.js";/**
 * 2026 Paysera
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 *
 * @author Paysera <plugins@paysera.com>
 * @copyright 2026 Paysera
 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */const C="_tabPanel_iknu7_1",v="_tabBar_iknu7_6",f="_tabButton_iknu7_12",p="_tabButtonActive_iknu7_32",x="_tabContent_iknu7_38",j="_tabContentDisabled_iknu7_46",e={tabPanel:C,tabBar:v,tabButton:f,tabButtonActive:p,tabContent:x,tabContentDisabled:j},y=({tabs:n,initialTabName:a,onSelect:c,disabled:_,disabledDisclaimer:h,className:k=""})=>{var m;const[s,d]=i.useState(a||((m=n[0])==null?void 0:m.name)),u=i.useCallback(t=>{d(t),c==null||c(t)},[c]),B=i.useCallback((t,o)=>{let r=o;if(t.key==="ArrowRight")r=(o+1)%n.length;else if(t.key==="ArrowLeft")r=(o-1+n.length)%n.length;else return;t.preventDefault(),u(n[r].name)},[n,u]);i.useEffect(()=>{a&&a!==s&&d(a)},[a]);const b=n.find(t=>t.name===s);return l.jsxs("div",{className:`${e.tabPanel} ${k}`.trim(),children:[l.jsx("div",{className:e.tabBar,role:"tablist",children:n.map((t,o)=>l.jsx("button",{role:"tab",type:"button","aria-selected":t.name===s,className:`${e.tabButton} ${t.name===s?e.tabButtonActive:""}`.trim(),onClick:()=>u(t.name),onKeyDown:r=>B(r,o),tabIndex:t.name===s?0:-1,children:t.title},t.name))}),l.jsxs("div",{className:e.tabContent,role:"tabpanel",children:[_&&h,l.jsx("div",{className:_?e.tabContentDisabled:"",children:b==null?void 0:b.children})]})]})};export{y as T};
