try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`3ac4fc02-0336-40a4-8fcc-540e36ed9bd7`,e._sentryDebugIdIdentifier=`sentry-dbid-3ac4fc02-0336-40a4-8fcc-540e36ed9bd7`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Qm as r,Um as i,Yh as a,Zh as o,Zm as s,_r as c,ei as l,ng as u,pi as d,zh as f}from"./entry.client-mpghtlrl.js";import{x as p}from"./xds-react-components-ihgca01z.js";import{u as m}from"./xds-icons-m106f2fc.js";import{t as h}from"./labels-i94hzg75.js";import{t as g}from"./languageTranslations-nc0szlnz.js";import{n as _}from"./SettingsDialog-0l6new0i.js";import{t as v}from"./Section-bmjy0l2a.js";import{t as y}from"./TabContentLayout-c956lcpz.js";var b=n(),x=e(d(),1),S=u(),C=c(e=>{let n=(0,b.c)(21),{onLocaleSelect:r}=e,{t:i}=t(`SettingLanguagesTab`),a;n[0]===i?a=n[1]:(a=i(`All languages`,{shortKey:`all_languages_section_label`}),n[0]=i,n[1]=a);let o=a,s,c,l,u,d,m;if(n[2]!==o||n[3]!==i||n[4]!==r){let e=[...f].sort(w),t=e.length;d=v,m=o,s=`listbox`,c=o,n[11]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,x.default)(`text-noninteractive-content-primary-content`,_),n[11]=l):l=n[11],u=e.map((e,n)=>{let a=g(e,i);return(0,S.jsx)(p,{as:`button`,background:`invisible`,label1:h(e),label2:a,"aria-label":a,role:`option`,"aria-posinset":n+1,"aria-setsize":t,onPress:()=>r(e)},e)}),n[2]=o,n[3]=i,n[4]=r,n[5]=s,n[6]=c,n[7]=l,n[8]=u,n[9]=d,n[10]=m}else s=n[5],c=n[6],l=n[7],u=n[8],d=n[9],m=n[10];let y;n[12]!==s||n[13]!==c||n[14]!==l||n[15]!==u?(y=(0,S.jsx)(`div`,{role:s,"aria-label":c,className:l,children:u}),n[12]=s,n[13]=c,n[14]=l,n[15]=u,n[16]=y):y=n[16];let C;return n[17]!==d||n[18]!==m||n[19]!==y?(C=(0,S.jsx)(d,{label:m,children:y}),n[17]=d,n[18]=m,n[19]=y,n[20]=C):C=n[20],C},()=>{let{systems:{internationalization:{queries:{locale:e},mutations:{setLocale:t}}}}=i(),{data:n}=o(e.getOptions()),{trackUserAction:s}=r(),{mutate:c}=a(t.getOptions());return{onLocaleSelect:e=>{s(`LanguageList`,{oldValue:n,newValue:e},`Change`),c(e)}}});function w(e,t){return h(e).localeCompare(h(t))}var T=c(e=>{let n=(0,b.c)(25),{currentLocale:r}=e,{t:i}=t(`SettingLanguagesTab`),a;n[0]===i?a=n[1]:(a=i(`Your language`,{shortKey:`your_language_section_label`}),n[0]=i,n[1]=a);let o;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,x.default)(`flex justify-between px-component-item-list-container-padding-right-and-left py-component-item-list-container-padding-top-and-bottom text-noninteractive-content-primary-content`,_),n[2]=o):o=n[2];let s;n[3]===r?s=n[4]:(s=h(r),n[3]=r,n[4]=s);let c;n[5]===s?c=n[6]:(c=(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`text-noninteractive-content-primary-content type-subtitle2`,children:s}),n[5]=s,n[6]=c);let u;n[7]!==r||n[8]!==i?(u=g(r,i),n[7]=r,n[8]=i,n[9]=u):u=n[9];let d;n[10]===u?d=n[11]:(d=(0,S.jsx)(`span`,{className:`text-noninteractive-content-secondary-content type-caption`,children:u}),n[10]=u,n[11]=d);let f;n[12]!==c||n[13]!==d?(f=(0,S.jsxs)(`div`,{className:`flex flex-col`,children:[c,d]}),n[12]=c,n[13]=d,n[14]=f):f=n[14];let p;n[15]===i?p=n[16]:(p=i(`Selected language`,{shortKey:`selected_language_indicator`}),n[15]=i,n[16]=p);let y;n[17]===p?y=n[18]:(y=(0,S.jsx)(l,{icon:(0,S.jsx)(m,{"aria-label":p,role:`img`}),size:`subtitle2`}),n[17]=p,n[18]=y);let C;n[19]!==f||n[20]!==y?(C=(0,S.jsxs)(`div`,{className:o,children:[f,y]}),n[19]=f,n[20]=y,n[21]=C):C=n[21];let w;return n[22]!==a||n[23]!==C?(w=(0,S.jsx)(v,{label:a,children:C}),n[22]=a,n[23]=C,n[24]=w):w=n[24],w},()=>{let{internationalization:{queries:{locale:e}}}=s(),{data:t}=o(e.getOptions());return{currentLocale:t}}),E=()=>{let e=(0,b.c)(7),t=T.useComponent(),n=C.useComponent(),r;e[0]===t?r=e[1]:(r=(0,S.jsx)(t,{}),e[0]=t,e[1]=r);let i;e[2]===n?i=e[3]:(i=(0,S.jsx)(n,{}),e[2]=n,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,S.jsxs)(y,{telemetryLocation:`LanguagesTab`,children:[r,i]}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a};export{E as LanguagesTab};