import{r as a,u as e,j as o}from"./react-B_SyE9nW.js";import{o as s,aN as n,G as t,n as r,aO as l,y as i,z as u}from"./index-Flm6m8Wj.js";import{u as m}from"./embla-carousel-react.esm-NewS-kch.js";import{F as d}from"./FldAutocomplete-ChAHnf57.js";import{L as g}from"./LanguageIco-BsXO7aZv.js";import{U as p}from"./ItemLoading-wir9MCjq.js";import{h as c}from"./index-C6Ujt1Uk.js";const f=s((function({register:s=!0,inline:f=!1,autoload:h=!0,onChangeRoute:j,showStartIco:b,forceOnTable:x}){const L=m(),C=a.useContext(p),{pathname:v}=e(),{form:{language:I},onLanguagesChanged:O}=C,y=a.useMemo((()=>n(O,300)),[]);a.useEffect((()=>(C.loadLanguages(),()=>y.cancel())),[]);const S=a.useMemo((()=>t.isTablet&&!x?C.languages.map((({value:a,data:e})=>({label:a.toString().toUpperCase(),value:a,data:e}))):C.languages),[C.languages]);return o.jsx(d,{hiddenLabel:f,disableClearable:!0,ignoreListBox:!0,required:!0,readOnly:!0,validateOnBlur:!0,disabled:!C.isThirdStep&&s,popupIcon:f?void 0:o.jsx(g,{}),startAdornment:b?o.jsx(g,{}):void 0,label:r("language"),fieldState:I,options:S,renderOption:(e,s)=>a.createElement("li",{...e,key:s.label},o.jsx(c,{noWrap:!0,children:s.label})),onChangeInput:y,onChange:a=>{const e=l(v,a);if(h)return i.push(e+(()=>{const a=Array.from(L.entries());let e=a.length>0?"?":"";return a.forEach((([a,o])=>{e+=`&${a}=${o}`})),e})()),void u(a);null==j||j(e)}})}));export{f as L};