import"./DsnmJJEf.js";import{p as te,e as ae,f as I,a as d,b as re,d as i,s as c,r as o,g as e,t as w,j as N,c as f,k as S,h as oe}from"./qex-fw8l.js";import{d as se,s as _,a as y}from"./vzbhwc8t.js";import{i as A}from"./BnUrxEZg.js";import{s as ne,e as ie,i as de}from"./HL7kq492.js";import{s as T,c as ce}from"./CoLYeqRS.js";import{p as me}from"./pJHJUtud.js";import{i as j}from"./dc0o8kHW.js";import{c as a}from"./SIku4vVk.js";import{L as ue}from"./BKTLgJT0.js";import{C as ve}from"./CjasqOu2.js";var fe=f('<span class="hidden sm:inline"> </span>'),pe=f('<span class="ms-auto text-[0.625rem] italic text-muted-foreground/50"> </span>'),le=f('<span class="ms-auto text-[0.625rem] text-muted-foreground">default</span>'),ge=f("<button><span> </span> <span> </span> <!></button>"),_e=f('<div class="fixed inset-0 z-40"></div> <div class="absolute right-0 z-50 mt-1 min-w-[180px] rounded-md border border-border bg-popover py-1 shadow-md"></div>',1),xe=f('<div class="relative"><button><!> <span class="font-semibold uppercase"> </span> <!> <!></button> <!></div>');function Ge(M,p){te(p,!0);let X=me(p,"compact",3,!1),s=oe(!1);function H(r){N(s,!1),r!==a.activeLang&&(a.setLanguage(r),p.onchange?.(r))}function K(r){r.key==="Escape"&&N(s,!1)}var G=ae(),O=I(G);{var R=r=>{var x=xe(),m=i(x),C=i(m);ue(C,{size:14});var E=c(C,2),U=i(E,!0);o(E);var D=c(E,2);{var W=t=>{var u=fe(),b=i(u,!0);o(u),w(h=>_(b,h),[()=>a.getLanguageName(a.activeLang)]),d(t,u)};A(D,t=>{X()||t(W)})}var q=c(D,2);{let t=S(()=>e(s)?"rotate-180":"");ve(q,{size:12,get class(){return`ms-0.5 transition-transform ${e(t)??""}`}})}o(m);var B=c(m,2);{var F=t=>{var u=_e(),b=I(u),h=c(b,2);ie(h,21,()=>a.languages,de,(J,n)=>{const z=S(()=>!p.translatedLangs||p.translatedLangs.includes(e(n).code));var l=ge(),L=i(l),P=i(L,!0);o(L);var k=c(L,2),Q=i(k,!0);o(k);var V=c(k,2);{var Y=v=>{var g=pe(),$=i(g,!0);o(g),w(ee=>_($,ee),[()=>j.t("ADMIN_NEXT.LANG.NOT_TRANSLATED")]),d(v,g)},Z=v=>{var g=le();d(v,g)};A(V,v=>{e(z)?e(n).is_default&&v(Z,1):v(Y)})}o(l),w(()=>{T(l,1,`flex w-full items-center gap-2.5 px-3 py-1.5 text-start text-[0.8125rem] transition-colors
							${e(n).code===a.activeLang?"bg-accent text-accent-foreground font-medium":"text-popover-foreground hover:bg-accent/50"}`),T(L,1,`inline-flex h-5 shrink-0 items-center justify-center whitespace-nowrap rounded px-[2px] text-[0.625rem] font-bold uppercase
							${e(n).code===a.activeLang?"bg-primary text-primary-foreground":e(z)?"bg-muted text-muted-foreground":"bg-muted/50 text-muted-foreground/40"}`),_(P,e(n).code),T(k,1,ce(e(z)?"":"text-muted-foreground/60")),_(Q,e(n).native_name||e(n).name)}),y("click",l,()=>H(e(n).code)),d(J,l)}),o(h),y("click",b,()=>N(s,!1)),d(t,u)};A(B,t=>{e(s)&&t(F)})}o(x),w(t=>{T(m,1,`inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-[0.75rem] font-medium transition-colors
				${e(s)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`),ne(m,"title",t),_(U,a.activeLang)},[()=>j.t("ADMIN_NEXT.LANG.SWITCH_LANGUAGE")]),y("keydown",x,K),y("click",m,()=>N(s,!e(s))),d(r,x)};A(O,r=>{a.enabled&&a.languages.length>1&&r(R)})}d(M,G),re()}se(["keydown","click"]);export{Ge as L};
