import{usePage as f,router as _}from"./vendor/inertia-CR4tWtMT.js";import{u as b}from"./registry-DyIszw9-.js";import{_ as g}from"./HorizontalTabNavigation.vue_vue_type_script_setup_true_lang-CsRrMj9y.js";import{d as h,aT as c,W as u,a3 as k,O as r}from"./vendor-reka-Edfq1EPl.js";const y={key:0,class:"-mx-6 px-6 border-b mb-6"},x={key:1,class:"-mx-6 border-t mb-6"},K=h({__name:"SettingsTabBar",setup(N){const{normalizePath:i,isNavActive:m}=b(),n=f(),a=r(()=>{var e;return((e=(n.props.navigation??[]).find(t=>t.key==="settings"))==null?void 0:e.children)??[]}),v=r(()=>a.value.some(e=>m(e.route,n.url))),d=r(()=>{let e=null,t=-1;for(const o of a.value){if(!o.route)continue;const s=i(o.route),l=i(n.url);(l===s||l.startsWith(s+"/"))&&s.length>t&&(t=s.length,e=o.key)}return e??""});function p(e){const t=a.value.find(o=>o.key===e);t!=null&&t.route&&_.visit(t.route)}return(e,t)=>v.value?(c(),u("div",y,[k(g,{"model-value":d.value,tabs:a.value.map(o=>({key:o.key,label:o.label})),"onUpdate:modelValue":p},null,8,["model-value","tabs"])])):(c(),u("div",x))}});export{K as _};
