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 y,c as f,h as S,i as oe}from"./BfUaJvxP.js";import{d as ne,s as _,a as k}from"./Bci9YmGs.js";import{p as se,i as A}from"./C8yDvkQM.js";import{s as ie,e as de,i as ce}from"./CuIpA3jY.js";import{s as T,c as ue}from"./VWvGCFra.js";import{i as j}from"./CF1ujZlL.js";import{c as a}from"./BIGexYH6.js";import{L as me}from"./ChftTLu-.js";import{C as ve}from"./fmRQoJYL.js";var fe=f('<span class="hidden sm:inline"> </span>'),pe=f('<span class="ml-auto text-[10px] italic text-muted-foreground/50"> </span>'),le=f('<span class="ml-auto text-[10px] 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 ze(M,p){te(p,!0);let X=se(p,"compact",3,!1),n=oe(!1);function H(r){y(n,!1),r!==a.activeLang&&(a.setLanguage(r),p.onchange?.(r))}function K(r){r.key==="Escape"&&y(n,!1)}var G=ae(),O=I(G);{var R=r=>{var x=xe(),u=i(x),C=i(u);me(C,{size:14});var E=c(C,2),U=i(E,!0);o(E);var D=c(E,2);{var W=t=>{var m=fe(),b=i(m,!0);o(m),w(h=>_(b,h),[()=>a.getLanguageName(a.activeLang)]),d(t,m)};A(D,t=>{X()||t(W)})}var q=c(D,2);{let t=S(()=>e(n)?"rotate-180":"");ve(q,{size:12,get class(){return`ml-0.5 transition-transform ${e(t)??""}`}})}o(u);var B=c(u,2);{var F=t=>{var m=_e(),b=I(m),h=c(b,2);de(h,21,()=>a.languages,ce,(J,s)=>{const z=S(()=>!p.translatedLangs||p.translatedLangs.includes(e(s).code));var l=ge(),L=i(l),P=i(L,!0);o(L);var N=c(L,2),Q=i(N,!0);o(N);var V=c(N,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(s).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-left text-[13px] transition-colors
							${e(s).code===a.activeLang?"bg-accent text-accent-foreground font-medium":"text-popover-foreground hover:bg-accent/50"}`),T(L,1,`inline-flex h-5 w-6 items-center justify-center rounded text-[10px] font-bold uppercase
							${e(s).code===a.activeLang?"bg-primary text-primary-foreground":e(z)?"bg-muted text-muted-foreground":"bg-muted/50 text-muted-foreground/40"}`),_(P,e(s).code),T(N,1,ue(e(z)?"":"text-muted-foreground/60")),_(Q,e(s).native_name||e(s).name)}),k("click",l,()=>H(e(s).code)),d(J,l)}),o(h),k("click",b,()=>y(n,!1)),d(t,m)};A(B,t=>{e(n)&&t(F)})}o(x),w(t=>{T(u,1,`inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-2.5 text-[12px] font-medium transition-colors
				${e(n)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`),ie(u,"title",t),_(U,a.activeLang)},[()=>j.t("ADMIN_NEXT.LANG.SWITCH_LANGUAGE")]),k("keydown",x,K),k("click",u,()=>y(n,!e(n))),d(r,x)};A(O,r=>{a.enabled&&a.languages.length>1&&r(R)})}d(M,G),re()}ne(["keydown","click"]);export{ze as L};
