import{_ as f,b as k,d as p,e as h,f as v}from"./registry-DyIszw9-.js";import{d as w,aT as o,Q as u,bK as t,a3 as r,a2 as d,bh as i,X as m,W as L,F as b,b2 as y,aF as C,O as $}from"./vendor-reka-Edfq1EPl.js";const F=w({__name:"LocaleSwitcher",props:{currentLocale:{},languages:{},onSwitch:{type:Function}},setup(c){const e=c,_=$(()=>{const n=e.languages.find(s=>s.code===e.currentLocale);return(n==null?void 0:n.name)??e.currentLocale??""});return(n,s)=>(o(),u(f,null,{default:t(()=>[r(k,{"as-child":""},{default:t(()=>[r(p,{type:"button",variant:"outline"},{default:t(()=>[d(i(_.value)+" ",1),s[0]||(s[0]=m("svg",{class:"ml-1 h-3.5 w-3.5 opacity-60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),_:1})]),_:1}),r(h,{align:"end"},{default:t(()=>[(o(!0),L(b,null,y(c.languages,a=>(o(),u(v,{key:a.code,class:C([a.code===c.currentLocale?"font-medium":"",a.is_active?"":"opacity-60"]),onClick:g=>{var l;return(l=e.onSwitch)==null?void 0:l.call(e,a.code)}},{default:t(()=>[d(i(a.name)+i(a.is_active?"":" (inactive)"),1)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}))}});export{F as _};
