@rpcbase/ui 0.282.0 → 0.284.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index300.js","names":["contextValue","children","innerRef","option","target","query","token","event"],"sources":["../src/components/I18nField/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport Select, {\n type MenuListProps,\n type OptionProps,\n type Props as SelectProps,\n type SelectInstance,\n type SingleValue,\n type StylesConfig,\n components as selectComponents,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\n\nexport type LanguageCode = string\n\nexport type LocalizedStringEntry<TExtra extends Record<string, unknown> = Record<string, unknown>> = {\n value: string\n updatedAt: Date\n autoTranslated?: boolean\n} & TExtra\n\nexport type LocalizedString<TExtra extends Record<string, unknown> = Record<string, unknown>> = Record<\n LanguageCode,\n LocalizedStringEntry<TExtra>\n>\n\nexport type I18nValue<TExtra extends Record<string, unknown> = Record<string, unknown>> = LocalizedString<TExtra>\n\ntype LocaleContextValue = {\n locale: LanguageCode | null\n setLocale: (next: LanguageCode) => void\n}\n\nconst I18nFieldLocaleContext = React.createContext<LocaleContextValue | null>(null)\n\ntype I18nFieldLocaleProviderProps = {\n children: React.ReactNode\n value?: LanguageCode\n defaultValue?: LanguageCode\n onChange?: (locale: LanguageCode) => void\n locales?: LanguageCode[]\n}\n\nexport function I18nFieldLocaleProvider({\n children,\n value,\n defaultValue,\n onChange,\n locales,\n}: I18nFieldLocaleProviderProps) {\n const isControlled = value !== undefined\n const defaultLocale = React.useMemo(\n () => getPreferredLocale([defaultValue, ...getEnvironmentLocales()], locales),\n [defaultValue, locales]\n )\n const [internalLocale, setInternalLocale] = React.useState<LanguageCode>(defaultLocale)\n const activeLocale = (value ?? internalLocale) as LanguageCode\n\n const setLocale = React.useCallback(\n (next: LanguageCode) => {\n if (!isControlled) {\n setInternalLocale(next)\n }\n onChange?.(next)\n },\n [isControlled, onChange]\n )\n\n React.useEffect(() => {\n if (isControlled) return\n setInternalLocale((current) => (resolveLocaleMatch(current, locales) ? current : defaultLocale))\n }, [defaultLocale, isControlled, locales])\n\n const contextValue = React.useMemo<LocaleContextValue>(\n () => ({\n locale: activeLocale,\n setLocale,\n }),\n [activeLocale, setLocale]\n )\n\n return <I18nFieldLocaleContext.Provider value={contextValue}>{children}</I18nFieldLocaleContext.Provider>\n}\n\ntype I18nFieldProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> &\n Omit<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n > & {\n value?: I18nValue\n defaultValue?: I18nValue\n locale?: LanguageCode\n defaultLocale?: LanguageCode\n onChange?: (value: I18nValue) => void\n onLocaleChange?: (locale: LanguageCode, option: LanguageOption) => void\n locales?: LanguageCode[]\n multiline?: boolean\n inputClassName?: string\n selectProps?: Partial<SelectProps<LanguageOption, false>>\n selectFooter?: React.ReactNode\n languageSelectTabIndex?: number\n }\n\ntype LanguageOption = {\n value: LanguageCode\n name: string\n code: string\n searchable: string[]\n}\n\nconst DEFAULT_LOCALE: LanguageCode = \"en\"\n\nfunction normalizeLocaleCode(code: string) {\n return code.trim().replace(/_/g, \"-\").toLowerCase()\n}\n\nfunction primaryLocaleCode(code: string) {\n return normalizeLocaleCode(code).split(\"-\")[0] ?? \"\"\n}\n\nfunction resolveLocaleMatch(locale: LanguageCode | undefined, locales: LanguageCode[] | undefined) {\n const normalizedLocale = typeof locale === \"string\" ? normalizeLocaleCode(locale) : \"\"\n if (!normalizedLocale) return null\n\n const availableLocales = (locales ?? []).filter(\n (code): code is LanguageCode => typeof code === \"string\" && code.length > 0\n )\n if (availableLocales.length === 0) return locale?.trim() ?? normalizedLocale\n\n return availableLocales.find((code) => normalizeLocaleCode(code) === normalizedLocale) ??\n availableLocales.find((code) => primaryLocaleCode(code) === primaryLocaleCode(normalizedLocale)) ??\n null\n}\n\nfunction getEnvironmentLocales() {\n const candidates: LanguageCode[] = []\n if (typeof document !== \"undefined\") {\n candidates.push(document.documentElement.lang)\n }\n if (typeof navigator !== \"undefined\") {\n candidates.push(...Array.from(navigator.languages ?? []), navigator.language)\n }\n return candidates\n}\n\nfunction getPreferredLocale(candidates: Array<LanguageCode | undefined>, locales?: LanguageCode[]) {\n for (const candidate of candidates) {\n const matchedLocale = resolveLocaleMatch(candidate, locales)\n if (matchedLocale) return matchedLocale\n }\n\n const defaultLocaleMatch = resolveLocaleMatch(DEFAULT_LOCALE, locales)\n if (defaultLocaleMatch) return defaultLocaleMatch\n\n return locales?.[0] ?? DEFAULT_LOCALE\n}\n\nfunction languageCodeToBadge(code: string) {\n const primary = code.split(\"-\")[0] ?? \"\"\n const normalized = primary.replace(/[^A-Za-z]/g, \"\")\n if (!normalized) return \"?\"\n return normalized.slice(0, 3).toUpperCase()\n}\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n}\n\nfunction normalize(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nfunction resolveLocalizedEntry(value: I18nValue, locale: LanguageCode) {\n if (Object.prototype.hasOwnProperty.call(value, locale)) {\n return value[locale]\n }\n\n const parts = locale.split(\"-\").filter(Boolean)\n while (parts.length > 1) {\n parts.pop()\n const candidate = parts.join(\"-\")\n if (Object.prototype.hasOwnProperty.call(value, candidate)) {\n return value[candidate]\n }\n }\n\n return undefined\n}\n\nfunction resolveLocalizedValue(value: I18nValue, locale: LanguageCode) {\n return resolveLocalizedEntry(value, locale)?.value ?? \"\"\n}\n\nfunction createDisplayNames(locale: string | string[] | undefined, type: \"language\") {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") return null\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type })\n } catch {\n return null\n }\n}\n\nfunction safeDisplayName(displayNames: Intl.DisplayNames | null, value: string) {\n if (!displayNames) return undefined\n try {\n return displayNames.of(value) ?? undefined\n } catch {\n return undefined\n }\n}\n\nfunction buildLanguageOptions(locale?: string | string[], allowed?: LanguageCode[]) {\n const displayNames = createDisplayNames(locale, \"language\")\n const englishDisplayNames = createDisplayNames(\"en\", \"language\")\n const pool = (allowed ?? []).filter((code): code is LanguageCode => typeof code === \"string\" && code.length > 0)\n\n return pool\n .map((code) => {\n const name = safeDisplayName(displayNames, code) ?? safeDisplayName(englishDisplayNames, code) ?? code\n return {\n value: code,\n name,\n code,\n searchable: Array.from(\n new Set([\n name,\n safeDisplayName(englishDisplayNames, code) ?? code,\n code.toLowerCase(),\n code.toUpperCase(),\n ])\n ).map((entry) => normalize(entry)),\n }\n })\n .sort((a, b) => a.name.localeCompare(b.name))\n}\n\nconst selectStyles: StylesConfig<LanguageOption, false> = {\n control: () => ({\n display: \"none\",\n }),\n menu: (provided) => ({\n ...provided,\n marginTop: 4,\n borderRadius: \"var(--radius)\",\n boxShadow: \"0 18px 36px rgba(15, 23, 42, 0.18)\",\n backgroundColor: \"hsl(var(--popover))\",\n overflow: \"hidden\",\n zIndex: 30,\n }),\n menuList: (provided) => ({\n ...provided,\n maxHeight: 280,\n padding: 0,\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }),\n option: (provided, state) => ({\n ...provided,\n fontSize: \"0.875rem\",\n backgroundColor: state.isFocused\n ? \"hsl(var(--muted))\"\n : state.isSelected\n ? \"hsl(var(--accent))\"\n : \"transparent\",\n color: state.isSelected\n ? \"hsl(var(--accent-foreground))\"\n : \"hsl(var(--foreground))\",\n cursor: \"pointer\",\n }),\n noOptionsMessage: (provided) => ({\n ...provided,\n fontSize: \"0.875rem\",\n color: \"hsl(var(--muted-foreground))\",\n }),\n}\n\nconst HiddenControl = () => <div style={{ display: \"none\" }} />\nconst NullComponent = () => null\n\ntype SearchMenuContextValue = {\n searchTerm: string\n setSearchTerm: (next: string) => void\n onSearchKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void\n searchInputRef: React.RefObject<HTMLInputElement | null>\n selectFooter?: React.ReactNode\n}\n\nconst SearchMenuContext = React.createContext<SearchMenuContextValue | null>(null)\n\n// MenuList must keep a stable component identity across renders: an inline component\n// would be remounted on every keystroke, unmounting the focused search input and\n// closing the menu through the root onBlur handler.\nfunction SearchableMenuList(props: MenuListProps<LanguageOption, false>) {\n const search = React.useContext(SearchMenuContext)\n const { children } = props\n return (\n <selectComponents.MenuList {...props} className=\"!p-0 flex flex-col overflow-hidden\">\n {search ? (\n <div className=\"border-b border-muted px-2 pb-2 pt-2\">\n <input\n ref={search.searchInputRef}\n value={search.searchTerm}\n onChange={(event) => search.setSearchTerm(event.target.value)}\n onKeyDown={search.onSearchKeyDown}\n className=\"w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n placeholder=\"Search language…\"\n />\n </div>\n ) : null}\n <div className=\"max-h-60 overflow-y-auto\">{children}</div>\n {search?.selectFooter ? (\n <div className=\"border-t border-muted bg-muted/60 px-3 py-2 text-xs text-muted-foreground\">\n {search.selectFooter}\n </div>\n ) : null}\n </selectComponents.MenuList>\n )\n}\n\nfunction Option(props: OptionProps<LanguageOption, false>) {\n const { data, innerRef, innerProps, isFocused, isSelected } = props\n return (\n <div\n ref={innerRef}\n {...innerProps}\n className={cn(\n \"flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm\",\n isSelected\n ? \"bg-accent text-accent-foreground\"\n : isFocused\n ? \"bg-muted text-foreground\"\n : \"text-foreground\"\n )}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate\">{data.name}</span>\n </span>\n <span className=\"text-xs text-muted-foreground uppercase\">{data.code}</span>\n </div>\n )\n}\n\nexport const I18nField = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, I18nFieldProps>(\n function I18nField(props, forwardedRef) {\n const {\n value: valueProp,\n defaultValue,\n locale: localeProp,\n defaultLocale,\n onChange,\n onLocaleChange,\n locales,\n multiline,\n className,\n inputClassName,\n selectProps,\n selectFooter,\n languageSelectTabIndex = -1,\n disabled,\n ...rest\n } = props\n\n type SharedProps = React.InputHTMLAttributes<HTMLInputElement> &\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & { rows?: number }\n\n const { rows, ...restProps } = rest as SharedProps\n\n const initialValue = React.useMemo<I18nValue>(() => valueProp ?? defaultValue ?? {}, [defaultValue, valueProp])\n const [internalValue, setInternalValue] = React.useState<I18nValue>(initialValue)\n const isControlled = valueProp !== undefined\n const currentValue = isControlled ? valueProp ?? {} : internalValue\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const localeContext = React.useContext(I18nFieldLocaleContext)\n\n const localePool = React.useMemo(() => {\n const pool = Array.from(new Set([...(locales ?? []), ...Object.keys(currentValue)]))\n return buildLanguageOptions(undefined, pool)\n }, [currentValue, locales])\n\n const initialLocale = React.useMemo(() => {\n const localeValues = localePool.map((option) => option.value)\n return localeProp ??\n localeContext?.locale ??\n getPreferredLocale(\n [defaultLocale, ...getEnvironmentLocales(), Object.keys(currentValue)[0] as LanguageCode | undefined],\n localeValues\n )\n }, [currentValue, defaultLocale, localeContext?.locale, localePool, localeProp])\n\n const [internalLocale, setInternalLocale] = React.useState<LanguageCode>(initialLocale)\n const activeLocale = localeProp ?? localeContext?.locale ?? internalLocale\n\n React.useEffect(() => {\n if (!isControlled) {\n setInternalValue(initialValue)\n }\n }, [initialValue, isControlled])\n\n React.useEffect(() => {\n if (localeProp && localeProp !== internalLocale) {\n setInternalLocale(localeProp)\n }\n }, [internalLocale, localeProp])\n\n React.useEffect(() => {\n if (!localeProp && localeContext?.locale && localeContext.locale !== internalLocale) {\n setInternalLocale(localeContext.locale)\n }\n }, [internalLocale, localeContext?.locale, localeProp])\n\n const selectedOption =\n localePool.find((option) => option.value === activeLocale) ??\n localePool.find((option) => option.value === DEFAULT_LOCALE) ??\n localePool[0] ??\n null\n\n const [menuOpen, setMenuOpen] = React.useState(false)\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const inputRef = React.useRef<HTMLInputElement | HTMLTextAreaElement | null>(null)\n const triggerRef = React.useRef<HTMLButtonElement | null>(null)\n const containerRef = React.useRef<HTMLDivElement | null>(null)\n const selectRef = React.useRef<SelectInstance<LanguageOption, false> | null>(null)\n const searchInputRef = React.useRef<HTMLInputElement | null>(null)\n const selectionSnapshotRef = React.useRef<{ start: number | null; end: number | null } | null>(null)\n const [menuPosition, setMenuPosition] = React.useState<{ left: number; top: number }>({ left: 0, top: 0 })\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement & HTMLTextAreaElement, [])\n\n const handleLocaleSelect = (option: SingleValue<LanguageOption>) => {\n if (!option) return\n const nextLocale = option.value\n if (!isControlled) {\n setInternalLocale(nextLocale)\n }\n onLocaleChange?.(nextLocale, option)\n localeContext?.setLocale(nextLocale)\n closeMenu(true)\n }\n\n const handleTextChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const currentEntry = currentValue[activeLocale]\n const nextValue = {\n ...currentValue,\n [activeLocale]: {\n ...(currentEntry ?? {}),\n value: event.target.value,\n updatedAt: new Date(),\n autoTranslated: false,\n },\n }\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n onChange?.(nextValue)\n }\n\n const currentText = resolveLocalizedValue(currentValue, activeLocale)\n\n const filterOption = React.useCallback(\n (option: { data: LanguageOption }) => {\n if (!searchTerm) return true\n const query = normalize(searchTerm)\n return option.data.searchable.some((token) => token.includes(query))\n },\n [searchTerm]\n )\n\n const buttonPosition = multiline ? \"left-2 top-2 -translate-y-0\" : \"left-3 top-1/2 -translate-y-1/2\"\n const inputPaddingLeft = \"pl-10 pr-3\"\n\n const updateMenuPosition = React.useCallback(() => {\n const trigger = triggerRef.current\n const container = containerRef.current\n if (!trigger || !container) return\n const triggerRect = trigger.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n setMenuPosition({\n left: triggerRect.left - containerRect.left,\n top: triggerRect.bottom - containerRect.top + 4,\n })\n }, [])\n\n const isInsideComponent = React.useCallback((target: EventTarget | null) => {\n if (!target || !(target instanceof Node)) return false\n return Boolean(rootRef.current?.contains(target))\n }, [])\n\n const restoreMainFocus = React.useCallback(() => {\n const target = inputRef.current\n if (!target) return\n target.focus()\n const selection = selectionSnapshotRef.current\n if (selection && selection.start != null && selection.end != null) {\n target.setSelectionRange(selection.start, selection.end)\n }\n }, [])\n\n React.useEffect(() => {\n if (!menuOpen) return\n const target = searchInputRef.current\n if (!target) return\n requestAnimationFrame(() => {\n if (document.activeElement === target) return\n target.focus()\n const end = target.value.length\n try {\n target.setSelectionRange(end, end)\n } catch {\n /* ignore */\n }\n })\n }, [menuOpen, searchTerm])\n\n const closeMenu = React.useCallback(\n (restoreFocus = true) => {\n setMenuOpen(false)\n setSearchTerm(\"\")\n if (restoreFocus) {\n requestAnimationFrame(() => {\n restoreMainFocus()\n })\n }\n },\n [restoreMainFocus]\n )\n\n const {\n components: userSelectComponents,\n styles: userSelectStyles,\n classNamePrefix: userClassNamePrefix,\n placeholder: selectPlaceholder,\n noOptionsMessage,\n ...forwardedSelectProps\n } = selectProps ?? {}\n\n const filteredOptions = React.useMemo(() => {\n const query = normalize(searchTerm)\n const rank = (option: LanguageOption) => {\n const code = option.code.toLowerCase()\n if (query && code === query) return 0\n if (query && code.startsWith(query)) return 1\n if (query && option.searchable.some((token) => token.startsWith(query))) return 2\n if (query && option.searchable.some((token) => token.includes(query))) return 3\n return 4\n }\n return localePool\n .filter((option) => filterOption({ data: option }))\n .sort((a, b) => {\n const diff = rank(a) - rank(b)\n if (diff !== 0) return diff\n return a.name.localeCompare(b.name)\n })\n }, [filterOption, localePool, searchTerm])\n\n const handleSearchKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Escape\") {\n event.preventDefault()\n closeMenu(true)\n return\n }\n if (event.key === \"Enter\") {\n event.preventDefault()\n const first = filteredOptions[0]\n if (first) {\n handleLocaleSelect(first)\n }\n return\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault()\n selectRef.current?.focus()\n }\n }\n\n const searchMenuContextValue: SearchMenuContextValue = {\n searchTerm,\n setSearchTerm,\n onSearchKeyDown: handleSearchKeyDown,\n searchInputRef,\n selectFooter,\n }\n\n const mergedSelectComponents = React.useMemo(\n () => ({\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n MenuList: SearchableMenuList,\n ...(userSelectComponents ?? {}),\n Option,\n }),\n [userSelectComponents]\n )\n\n const mergedSelectStyles = React.useMemo<StylesConfig<LanguageOption, false>>(\n () => ({\n ...selectStyles,\n ...(userSelectStyles ?? {}),\n }),\n [userSelectStyles]\n )\n\n React.useLayoutEffect(() => {\n if (!menuOpen) return\n updateMenuPosition()\n const handleResize = () => updateMenuPosition()\n window.addEventListener(\"resize\", handleResize)\n return () => window.removeEventListener(\"resize\", handleResize)\n }, [menuOpen, updateMenuPosition])\n\n const sharedFieldProps = {\n ...restProps,\n ref: inputRef as React.Ref<any>,\n disabled,\n value: currentText,\n onChange: handleTextChange,\n onFocus: (event: React.FocusEvent<any>) => {\n if (menuOpen) {\n closeMenu(false)\n }\n restProps.onFocus?.(event)\n },\n onBlur: (event: React.FocusEvent<any>) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n restProps.onBlur?.(event)\n },\n className: cn(\n \"w-full rounded-md border border-input bg-background text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n multiline ? \"min-h-24 py-2\" : \"h-10 py-2\",\n inputPaddingLeft,\n inputClassName\n ),\n placeholder: restProps.placeholder,\n }\n\n return (\n <div\n ref={rootRef}\n className={cn(\"relative flex flex-col\", className)}\n onBlur={(event) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n }}\n >\n <div ref={containerRef} className=\"relative\">\n {multiline ? (\n <textarea rows={rows} {...sharedFieldProps} />\n ) : (\n <input type=\"text\" {...sharedFieldProps} />\n )}\n\n <button\n type=\"button\"\n className={cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )}\n aria-label={selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }}\n tabIndex={languageSelectTabIndex}\n disabled={disabled}\n ref={triggerRef}\n >\n <span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>\n </button>\n </div>\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: menuOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n left: menuPosition.left,\n top: menuPosition.top,\n }}\n >\n <SearchMenuContext.Provider value={searchMenuContextValue}>\n <Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />\n </SearchMenuContext.Provider>\n </div>\n </div>\n )\n }\n)\n\nI18nField.displayName = \"I18nField\"\n"],"mappings":";;;;;;AAkCA,IAAM,IAAyB,EAAM,cAAyC,IAAI;AAUlF,SAAO,EAAA,GAAA;CAAA,IAAA,IAAA,EAAA,EAAA,GAAiC,EAAA,aAAA,UAAA,iBAAA,aAAA,eAAA,GAOtC,IAAqB,MAAU,KAAA,GAAS;CAAA,AAAA,EAAA,OAAA,KAAA,EAAA,OAAA,KAEhC,IAAA,EAAmB,CAAC,GAAY,GAAK,EAAsB,CAAC,GAAG,CAAO,GAAC,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,KAAA,IAAA,EAAA;CAD/E,IAAA,IACQ,GAGR,CAAA,GAAA,KAA4C,EAAK,SAAwB,CAAa,GACtF,IAAsB,KAAA,GAAwC;CAAA,AAAA,EAAA,OAAA,KAAA,EAAA,OAAA,KAG5D,KAAA,MAAA;EAIE,AAHK,KACH,EAAkB,CAAI,GAExB,IAAW,CAAI;CAAC,GACjB,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,KAAA,IAAA,EAAA;CANH,IAAA,IAAkB,GAQjB,GAAA;CAED,AAFC,EAAA,OAAA,KAAA,EAAA,OAAA,KAAA,EAAA,OAAA,KAEe,UAAA;EACV,KACJ,GAAkB,MAAc,EAAmB,GAAS,CAAiC,IAA7D,IAAA,CAA+D;CAAC,GAC/F,IAAA;EAAC;EAAe;EAAc;CAAO,GAAC,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,MAAA,MAAA,IAAA,EAAA,IAAA,IAAA,EAAA,MAHzC,EAAK,UAAW,GAGb,CAAsC;CAAC,IAAA;CAAA,AAAA,EAAA,QAAA,KA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AAC,UAAD;IACE,MAAK;IACL,WAAW,EACT,sNACA,IACA,IAAW,sDAAsD,iCACjE,IAAiB,uBAAuB,mDAC1C;IACA,cAAY,IAAiB,oBAAoB,EAAe,KAAI,KAAM;IAC1E,cAAcA,MAAUA,EAAM,eAAe;IAC7C,eAAe;KACb,IAAI,GAAU;KACd,IAAMH,IAAS,EAAS;KASxB,AARIA,MACF,GAAqB,UAAU;MAC7B,OAAOA,EAAO;MACd,KAAKA,EAAO;KACd,IAEF,EAAc,EAAE,GAChB,EAAY,EAAI,GAChB,4BAA4B;MAC1B,AAAI,EAAe,WACjB,EAAe,QAAQ,MAAM,GAC7B,EAAe,QAAQ,OAAO,KAE9B,EAAU,SAAS,MAAM;KAE7B,CAAC;IACH;IACA,UAAU;IACA;IACV,KAAK;IAEL,UAAA,kBAAC,QAAD;KAAM,eAAY;KAAQ,UAAA,IAAiB,EAAoB,EAAe,IAAI,IAAI;IAAU,CAAA;GAC1F,CAAA,CACL;EAEL,CAAA,GAAA,kBAAC,OAAD;GACE,WAAU;GACV,OAAO;IACL,eAAe,IAAW,SAAS;IACnC,OAAO;IACP,MAAM,GAAa;IACnB,KAAK,GAAa;GACpB;GAEA,UAAA,kBAAC,EAAkB,UAAnB;IAA4B,OAAO;IACjC,UAAA,kBAAC,GAAD;KACE,GAAI;KACJ,YAAY;KACZ,SAAS;KACT,OAAO;KACP,UAAU;KACV,iBAAiB,MAAuB;KACxC,YAAY;KACZ,QAAQ;KACR,aAAa;KACb,cAAc;KACd,uBAAuB;KACvB,iBAAA;KACA,0BAA0B;KAC1B,aAAa,MAAqB;KACpB;KACI;KAClB,mBAAmB,EAAU,EAAI;KACjC,KAAK;IAAU,CAAA;GAES,CAAA;EACzB,CAAA,CACF;;AAET,CACF;AAEA,EAAU,cAAc"}
1
+ {"version":3,"file":"index300.js","names":["{\n children,\n value,\n defaultValue,\n onChange,\n locales,\n}: I18nFieldLocaleProviderProps","getPreferredLocale([defaultValue, ...getEnvironmentLocales()], locales)","React.useMemo(\n () => getPreferredLocale([defaultValue, ...getEnvironmentLocales()], locales),\n [defaultValue, locales]\n )","(next: LanguageCode) => {\n if (!isControlled) {\n setInternalLocale(next)\n }\n onChange?.(next)\n }","React.useCallback(\n (next: LanguageCode) => {\n if (!isControlled) {\n setInternalLocale(next)\n }\n onChange?.(next)\n },\n [isControlled, onChange]\n )","() => {\n if (isControlled) return\n setInternalLocale((current) => (resolveLocaleMatch(current, locales) ? current : defaultLocale))\n }","[defaultLocale, isControlled, locales]","{\n locale: activeLocale,\n setLocale,\n }","React.useMemo<LocaleContextValue>(\n () => ({\n locale: activeLocale,\n setLocale,\n }),\n [activeLocale, setLocale]\n )","<I18nFieldLocaleContext.Provider value={contextValue}>{children}</I18nFieldLocaleContext.Provider>","I18nFieldLocaleContext.Provider","<div style={{ display: \"none\" }} />","cn(\n \"flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm\",\n isSelected\n ? \"bg-accent text-accent-foreground\"\n : isFocused\n ? \"bg-muted text-foreground\"\n : \"text-foreground\"\n )","isSelected\n ? \"bg-accent text-accent-foreground\"\n : isFocused\n ? \"bg-muted text-foreground\"\n : \"text-foreground\"","<span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate\">{data.name}</span>\n </span>","name","<span className=\"text-xs text-muted-foreground uppercase\">{data.code}</span>","code","<div\n ref={innerRef}\n {...innerProps}\n className={cn(\n \"flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm\",\n isSelected\n ? \"bg-accent text-accent-foreground\"\n : isFocused\n ? \"bg-muted text-foreground\"\n : \"text-foreground\"\n )}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate\">{data.name}</span>\n </span>\n <span className=\"text-xs text-muted-foreground uppercase\">{data.code}</span>\n </div>","languageSelectTabIndex = -1","rest as SharedProps","valueProp ?? defaultValue ?? {}","React.useMemo<I18nValue>(() => valueProp ?? defaultValue ?? {}, [defaultValue, valueProp])","isControlled ? valueProp ?? {} : internalValue","buildLanguageOptions(undefined, pool)","locales ?? []","React.useMemo(() => {\n const pool = Array.from(new Set([...(locales ?? []), ...Object.keys(currentValue)]))\n return buildLanguageOptions(undefined, pool)\n }, [currentValue, locales])","() => {\n const localeValues = localePool.map((option) => option.value)\n return localeProp ??\n localeContext?.locale ??\n getPreferredLocale(\n [defaultLocale, ...getEnvironmentLocales(), Object.keys(currentValue)[0] as LanguageCode | undefined],\n localeValues\n )\n }","locale","(option) => option.value","React.useMemo(() => {\n const localeValues = localePool.map((option) => option.value)\n return localeProp ??\n localeContext?.locale ??\n getPreferredLocale(\n [defaultLocale, ...getEnvironmentLocales(), Object.keys(currentValue)[0] as LanguageCode | undefined],\n localeValues\n )\n }, [currentValue, defaultLocale, localeContext?.locale, localePool, localeProp])","() => {\n if (!isControlled) {\n setInternalValue(initialValue)\n }\n }","[initialValue, isControlled]","[internalLocale, localeProp]","() => {\n if (localeProp && localeProp !== internalLocale) {\n setInternalLocale(localeProp)\n }\n }","() => {\n if (!localeProp && localeContext?.locale && localeContext.locale !== internalLocale) {\n setInternalLocale(localeContext.locale)\n }\n }","localeContext?.locale","[internalLocale, localeContext?.locale, localeProp]","localePool.find((option) => option.value === activeLocale) ??\n localePool.find((option) => option.value === DEFAULT_LOCALE) ??\n localePool[0] ??\n null","option","(option) => option.value === DEFAULT_LOCALE","{ left: 0, top: 0 }","() => inputRef.current as HTMLInputElement & HTMLTextAreaElement","[]","(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const currentEntry = currentValue[activeLocale]\n const nextValue = {\n ...currentValue,\n [activeLocale]: {\n ...(currentEntry ?? {}),\n value: event.target.value,\n updatedAt: new Date(),\n autoTranslated: false,\n },\n }\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n onChange?.(nextValue)\n }","resolveLocalizedValue(currentValue, activeLocale)","(option: { data: LanguageOption }) => {\n if (!searchTerm) return true\n const query = normalize(searchTerm)\n return option.data.searchable.some((token) => token.includes(query))\n }","React.useCallback(\n (option: { data: LanguageOption }) => {\n if (!searchTerm) return true\n const query = normalize(searchTerm)\n return option.data.searchable.some((token) => token.includes(query))\n },\n [searchTerm]\n )","() => {\n const trigger = triggerRef.current\n const container = containerRef.current\n if (!trigger || !container) return\n const triggerRect = trigger.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n setMenuPosition({\n left: triggerRect.left - containerRect.left,\n top: triggerRect.bottom - containerRect.top + 4,\n })\n }","React.useCallback(() => {\n const trigger = triggerRef.current\n const container = containerRef.current\n if (!trigger || !container) return\n const triggerRect = trigger.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n setMenuPosition({\n left: triggerRect.left - containerRect.left,\n top: triggerRect.bottom - containerRect.top + 4,\n })\n }, [])","(target: EventTarget | null) => {\n if (!target || !(target instanceof Node)) return false\n return Boolean(rootRef.current?.contains(target))\n }","React.useCallback((target: EventTarget | null) => {\n if (!target || !(target instanceof Node)) return false\n return Boolean(rootRef.current?.contains(target))\n }, [])","() => {\n const target = inputRef.current\n if (!target) return\n target.focus()\n const selection = selectionSnapshotRef.current\n if (selection && selection.start != null && selection.end != null) {\n target.setSelectionRange(selection.start, selection.end)\n }\n }","target","React.useCallback(() => {\n const target = inputRef.current\n if (!target) return\n target.focus()\n const selection = selectionSnapshotRef.current\n if (selection && selection.start != null && selection.end != null) {\n target.setSelectionRange(selection.start, selection.end)\n }\n }, [])","() => {\n if (!menuOpen) return\n const target = searchInputRef.current\n if (!target) return\n requestAnimationFrame(() => {\n if (document.activeElement === target) return\n target.focus()\n const end = target.value.length\n try {\n target.setSelectionRange(end, end)\n } catch {\n /* ignore */\n }\n })\n }","[menuOpen, searchTerm]","(restoreFocus = true) => {\n setMenuOpen(false)\n setSearchTerm(\"\")\n if (restoreFocus) {\n requestAnimationFrame(() => {\n restoreMainFocus()\n })\n }\n }","restoreFocus = true","React.useCallback(\n (restoreFocus = true) => {\n setMenuOpen(false)\n setSearchTerm(\"\")\n if (restoreFocus) {\n requestAnimationFrame(() => {\n restoreMainFocus()\n })\n }\n },\n [restoreMainFocus]\n )","selectProps ?? {}","localePool\n .filter((option) => filterOption({ data: option }))\n .sort((a, b) => {\n const diff = rank(a) - rank(b)\n if (diff !== 0) return diff\n return a.name.localeCompare(b.name)\n })","query","token","(option) => filterOption({ data: option })","React.useMemo(() => {\n const query = normalize(searchTerm)\n const rank = (option: LanguageOption) => {\n const code = option.code.toLowerCase()\n if (query && code === query) return 0\n if (query && code.startsWith(query)) return 1\n if (query && option.searchable.some((token) => token.startsWith(query))) return 2\n if (query && option.searchable.some((token) => token.includes(query))) return 3\n return 4\n }\n return localePool\n .filter((option) => filterOption({ data: option }))\n .sort((a, b) => {\n const diff = rank(a) - rank(b)\n if (diff !== 0) return diff\n return a.name.localeCompare(b.name)\n })\n }, [filterOption, localePool, searchTerm])","(event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Escape\") {\n event.preventDefault()\n closeMenu(true)\n return\n }\n if (event.key === \"Enter\") {\n event.preventDefault()\n const first = filteredOptions[0]\n if (first) {\n handleLocaleSelect(first)\n }\n return\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault()\n selectRef.current?.focus()\n }\n }","filteredOptions[0]","event","{\n searchTerm,\n setSearchTerm,\n onSearchKeyDown: handleSearchKeyDown,\n searchInputRef,\n selectFooter,\n }","userSelectComponents ?? {}","{\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n MenuList: SearchableMenuList,\n ...(userSelectComponents ?? {}),\n Option,\n }","React.useMemo(\n () => ({\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n MenuList: SearchableMenuList,\n ...(userSelectComponents ?? {}),\n Option,\n }),\n [userSelectComponents]\n )","userSelectStyles ?? {}","{\n ...selectStyles,\n ...(userSelectStyles ?? {}),\n }","React.useMemo<StylesConfig<LanguageOption, false>>(\n () => ({\n ...selectStyles,\n ...(userSelectStyles ?? {}),\n }),\n [userSelectStyles]\n )","() => {\n if (!menuOpen) return\n updateMenuPosition()\n const handleResize = () => updateMenuPosition()\n window.addEventListener(\"resize\", handleResize)\n return () => window.removeEventListener(\"resize\", handleResize)\n }","[menuOpen, updateMenuPosition]","(event: React.FocusEvent<any>) => {\n if (menuOpen) {\n closeMenu(false)\n }\n restProps.onFocus?.(event)\n }","restProps.onFocus","(event: React.FocusEvent<any>) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n restProps.onBlur?.(event)\n }","restProps.onBlur","cn(\n \"w-full rounded-md border border-input bg-background text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n multiline ? \"min-h-24 py-2\" : \"h-10 py-2\",\n inputPaddingLeft,\n inputClassName\n )","multiline ? \"min-h-24 py-2\" : \"h-10 py-2\"","{\n ...restProps,\n ref: inputRef as React.Ref<any>,\n disabled,\n value: currentText,\n onChange: handleTextChange,\n onFocus: (event: React.FocusEvent<any>) => {\n if (menuOpen) {\n closeMenu(false)\n }\n restProps.onFocus?.(event)\n },\n onBlur: (event: React.FocusEvent<any>) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n restProps.onBlur?.(event)\n },\n className: cn(\n \"w-full rounded-md border border-input bg-background text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n multiline ? \"min-h-24 py-2\" : \"h-10 py-2\",\n inputPaddingLeft,\n inputClassName\n ),\n placeholder: restProps.placeholder,\n }","cn(\"relative flex flex-col\", className)","(event) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n }","multiline ? (\n <textarea rows={rows} {...sharedFieldProps} />\n ) : (\n <input type=\"text\" {...sharedFieldProps} />\n )","cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )","disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\"","selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"","() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }","selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"","<span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>","<button\n type=\"button\"\n className={cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )}\n aria-label={selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }}\n tabIndex={languageSelectTabIndex}\n disabled={disabled}\n ref={triggerRef}\n >\n <span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>\n </button>","selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"","(event) => event.preventDefault()","<div ref={containerRef} className=\"relative\">\n {multiline ? (\n <textarea rows={rows} {...sharedFieldProps} />\n ) : (\n <input type=\"text\" {...sharedFieldProps} />\n )}\n\n <button\n type=\"button\"\n className={cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )}\n aria-label={selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }}\n tabIndex={languageSelectTabIndex}\n disabled={disabled}\n ref={triggerRef}\n >\n <span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>\n </button>\n </div>","{\n pointerEvents: menuOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n left: menuPosition.left,\n top: menuPosition.top,\n }","left","top","menuOpen ? \"auto\" : \"none\"","() => closeMenu(true)","<Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />","userClassNamePrefix ?? \"i18n-language-select\"","selectPlaceholder ?? \"\"","<SearchMenuContext.Provider value={searchMenuContextValue}>\n <Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />\n </SearchMenuContext.Provider>","SearchMenuContext.Provider","<div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: menuOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n left: menuPosition.left,\n top: menuPosition.top,\n }}\n >\n <SearchMenuContext.Provider value={searchMenuContextValue}>\n <Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />\n </SearchMenuContext.Provider>\n </div>","<div\n ref={rootRef}\n className={cn(\"relative flex flex-col\", className)}\n onBlur={(event) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n }}\n >\n <div ref={containerRef} className=\"relative\">\n {multiline ? (\n <textarea rows={rows} {...sharedFieldProps} />\n ) : (\n <input type=\"text\" {...sharedFieldProps} />\n )}\n\n <button\n type=\"button\"\n className={cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )}\n aria-label={selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }}\n tabIndex={languageSelectTabIndex}\n disabled={disabled}\n ref={triggerRef}\n >\n <span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>\n </button>\n </div>\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: menuOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n left: menuPosition.left,\n top: menuPosition.top,\n }}\n >\n <SearchMenuContext.Provider value={searchMenuContextValue}>\n <Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />\n </SearchMenuContext.Provider>\n </div>\n </div>"],"sources":["../src/components/I18nField/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport Select, {\n type MenuListProps,\n type OptionProps,\n type Props as SelectProps,\n type SelectInstance,\n type SingleValue,\n type StylesConfig,\n components as selectComponents,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\n\nexport type LanguageCode = string\n\nexport type LocalizedStringEntry<TExtra extends Record<string, unknown> = Record<string, unknown>> = {\n value: string\n updatedAt: Date\n autoTranslated?: boolean\n} & TExtra\n\nexport type LocalizedString<TExtra extends Record<string, unknown> = Record<string, unknown>> = Record<\n LanguageCode,\n LocalizedStringEntry<TExtra>\n>\n\nexport type I18nValue<TExtra extends Record<string, unknown> = Record<string, unknown>> = LocalizedString<TExtra>\n\ntype LocaleContextValue = {\n locale: LanguageCode | null\n setLocale: (next: LanguageCode) => void\n}\n\nconst I18nFieldLocaleContext = React.createContext<LocaleContextValue | null>(null)\n\ntype I18nFieldLocaleProviderProps = {\n children: React.ReactNode\n value?: LanguageCode\n defaultValue?: LanguageCode\n onChange?: (locale: LanguageCode) => void\n locales?: LanguageCode[]\n}\n\nexport function I18nFieldLocaleProvider({\n children,\n value,\n defaultValue,\n onChange,\n locales,\n}: I18nFieldLocaleProviderProps) {\n const isControlled = value !== undefined\n const defaultLocale = React.useMemo(\n () => getPreferredLocale([defaultValue, ...getEnvironmentLocales()], locales),\n [defaultValue, locales]\n )\n const [internalLocale, setInternalLocale] = React.useState<LanguageCode>(defaultLocale)\n const activeLocale = (value ?? internalLocale) as LanguageCode\n\n const setLocale = React.useCallback(\n (next: LanguageCode) => {\n if (!isControlled) {\n setInternalLocale(next)\n }\n onChange?.(next)\n },\n [isControlled, onChange]\n )\n\n React.useEffect(() => {\n if (isControlled) return\n setInternalLocale((current) => (resolveLocaleMatch(current, locales) ? current : defaultLocale))\n }, [defaultLocale, isControlled, locales])\n\n const contextValue = React.useMemo<LocaleContextValue>(\n () => ({\n locale: activeLocale,\n setLocale,\n }),\n [activeLocale, setLocale]\n )\n\n return <I18nFieldLocaleContext.Provider value={contextValue}>{children}</I18nFieldLocaleContext.Provider>\n}\n\ntype I18nFieldProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> &\n Omit<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n > & {\n value?: I18nValue\n defaultValue?: I18nValue\n locale?: LanguageCode\n defaultLocale?: LanguageCode\n onChange?: (value: I18nValue) => void\n onLocaleChange?: (locale: LanguageCode, option: LanguageOption) => void\n locales?: LanguageCode[]\n multiline?: boolean\n inputClassName?: string\n selectProps?: Partial<SelectProps<LanguageOption, false>>\n selectFooter?: React.ReactNode\n languageSelectTabIndex?: number\n }\n\ntype LanguageOption = {\n value: LanguageCode\n name: string\n code: string\n searchable: string[]\n}\n\nconst DEFAULT_LOCALE: LanguageCode = \"en\"\n\nfunction normalizeLocaleCode(code: string) {\n return code.trim().replace(/_/g, \"-\").toLowerCase()\n}\n\nfunction primaryLocaleCode(code: string) {\n return normalizeLocaleCode(code).split(\"-\")[0] ?? \"\"\n}\n\nfunction resolveLocaleMatch(locale: LanguageCode | undefined, locales: LanguageCode[] | undefined) {\n const normalizedLocale = typeof locale === \"string\" ? normalizeLocaleCode(locale) : \"\"\n if (!normalizedLocale) return null\n\n const availableLocales = (locales ?? []).filter(\n (code): code is LanguageCode => typeof code === \"string\" && code.length > 0\n )\n if (availableLocales.length === 0) return locale?.trim() ?? normalizedLocale\n\n return availableLocales.find((code) => normalizeLocaleCode(code) === normalizedLocale) ??\n availableLocales.find((code) => primaryLocaleCode(code) === primaryLocaleCode(normalizedLocale)) ??\n null\n}\n\nfunction getEnvironmentLocales() {\n const candidates: LanguageCode[] = []\n if (typeof document !== \"undefined\") {\n candidates.push(document.documentElement.lang)\n }\n if (typeof navigator !== \"undefined\") {\n candidates.push(...Array.from(navigator.languages ?? []), navigator.language)\n }\n return candidates\n}\n\nfunction getPreferredLocale(candidates: Array<LanguageCode | undefined>, locales?: LanguageCode[]) {\n for (const candidate of candidates) {\n const matchedLocale = resolveLocaleMatch(candidate, locales)\n if (matchedLocale) return matchedLocale\n }\n\n const defaultLocaleMatch = resolveLocaleMatch(DEFAULT_LOCALE, locales)\n if (defaultLocaleMatch) return defaultLocaleMatch\n\n return locales?.[0] ?? DEFAULT_LOCALE\n}\n\nfunction languageCodeToBadge(code: string) {\n const primary = code.split(\"-\")[0] ?? \"\"\n const normalized = primary.replace(/[^A-Za-z]/g, \"\")\n if (!normalized) return \"?\"\n return normalized.slice(0, 3).toUpperCase()\n}\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n}\n\nfunction normalize(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nfunction resolveLocalizedEntry(value: I18nValue, locale: LanguageCode) {\n if (Object.prototype.hasOwnProperty.call(value, locale)) {\n return value[locale]\n }\n\n const parts = locale.split(\"-\").filter(Boolean)\n while (parts.length > 1) {\n parts.pop()\n const candidate = parts.join(\"-\")\n if (Object.prototype.hasOwnProperty.call(value, candidate)) {\n return value[candidate]\n }\n }\n\n return undefined\n}\n\nfunction resolveLocalizedValue(value: I18nValue, locale: LanguageCode) {\n return resolveLocalizedEntry(value, locale)?.value ?? \"\"\n}\n\nfunction createDisplayNames(locale: string | string[] | undefined, type: \"language\") {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") return null\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type })\n } catch {\n return null\n }\n}\n\nfunction safeDisplayName(displayNames: Intl.DisplayNames | null, value: string) {\n if (!displayNames) return undefined\n try {\n return displayNames.of(value) ?? undefined\n } catch {\n return undefined\n }\n}\n\nfunction buildLanguageOptions(locale?: string | string[], allowed?: LanguageCode[]) {\n const displayNames = createDisplayNames(locale, \"language\")\n const englishDisplayNames = createDisplayNames(\"en\", \"language\")\n const pool = (allowed ?? []).filter((code): code is LanguageCode => typeof code === \"string\" && code.length > 0)\n\n return pool\n .map((code) => {\n const name = safeDisplayName(displayNames, code) ?? safeDisplayName(englishDisplayNames, code) ?? code\n return {\n value: code,\n name,\n code,\n searchable: Array.from(\n new Set([\n name,\n safeDisplayName(englishDisplayNames, code) ?? code,\n code.toLowerCase(),\n code.toUpperCase(),\n ])\n ).map((entry) => normalize(entry)),\n }\n })\n .sort((a, b) => a.name.localeCompare(b.name))\n}\n\nconst selectStyles: StylesConfig<LanguageOption, false> = {\n control: () => ({\n display: \"none\",\n }),\n menu: (provided) => ({\n ...provided,\n marginTop: 4,\n borderRadius: \"var(--radius)\",\n boxShadow: \"0 18px 36px rgba(15, 23, 42, 0.18)\",\n backgroundColor: \"hsl(var(--popover))\",\n overflow: \"hidden\",\n zIndex: 30,\n }),\n menuList: (provided) => ({\n ...provided,\n maxHeight: 280,\n padding: 0,\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n }),\n option: (provided, state) => ({\n ...provided,\n fontSize: \"0.875rem\",\n backgroundColor: state.isFocused\n ? \"hsl(var(--muted))\"\n : state.isSelected\n ? \"hsl(var(--accent))\"\n : \"transparent\",\n color: state.isSelected\n ? \"hsl(var(--accent-foreground))\"\n : \"hsl(var(--foreground))\",\n cursor: \"pointer\",\n }),\n noOptionsMessage: (provided) => ({\n ...provided,\n fontSize: \"0.875rem\",\n color: \"hsl(var(--muted-foreground))\",\n }),\n}\n\nconst HiddenControl = () => <div style={{ display: \"none\" }} />\nconst NullComponent = () => null\n\ntype SearchMenuContextValue = {\n searchTerm: string\n setSearchTerm: (next: string) => void\n onSearchKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void\n searchInputRef: React.RefObject<HTMLInputElement | null>\n selectFooter?: React.ReactNode\n}\n\nconst SearchMenuContext = React.createContext<SearchMenuContextValue | null>(null)\n\n// MenuList must keep a stable component identity across renders: an inline component\n// would be remounted on every keystroke, unmounting the focused search input and\n// closing the menu through the root onBlur handler.\nfunction SearchableMenuList(props: MenuListProps<LanguageOption, false>) {\n const search = React.useContext(SearchMenuContext)\n const { children } = props\n return (\n <selectComponents.MenuList {...props} className=\"!p-0 flex flex-col overflow-hidden\">\n {search ? (\n <div className=\"border-b border-muted px-2 pb-2 pt-2\">\n <input\n ref={search.searchInputRef}\n value={search.searchTerm}\n onChange={(event) => search.setSearchTerm(event.target.value)}\n onKeyDown={search.onSearchKeyDown}\n className=\"w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"\n placeholder=\"Search language…\"\n />\n </div>\n ) : null}\n <div className=\"max-h-60 overflow-y-auto\">{children}</div>\n {search?.selectFooter ? (\n <div className=\"border-t border-muted bg-muted/60 px-3 py-2 text-xs text-muted-foreground\">\n {search.selectFooter}\n </div>\n ) : null}\n </selectComponents.MenuList>\n )\n}\n\nfunction Option(props: OptionProps<LanguageOption, false>) {\n const { data, innerRef, innerProps, isFocused, isSelected } = props\n return (\n <div\n ref={innerRef}\n {...innerProps}\n className={cn(\n \"flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm\",\n isSelected\n ? \"bg-accent text-accent-foreground\"\n : isFocused\n ? \"bg-muted text-foreground\"\n : \"text-foreground\"\n )}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate\">{data.name}</span>\n </span>\n <span className=\"text-xs text-muted-foreground uppercase\">{data.code}</span>\n </div>\n )\n}\n\nexport const I18nField = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, I18nFieldProps>(\n function I18nField(props, forwardedRef) {\n const {\n value: valueProp,\n defaultValue,\n locale: localeProp,\n defaultLocale,\n onChange,\n onLocaleChange,\n locales,\n multiline,\n className,\n inputClassName,\n selectProps,\n selectFooter,\n languageSelectTabIndex = -1,\n disabled,\n ...rest\n } = props\n\n type SharedProps = React.InputHTMLAttributes<HTMLInputElement> &\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & { rows?: number }\n\n const { rows, ...restProps } = rest as SharedProps\n\n const initialValue = React.useMemo<I18nValue>(() => valueProp ?? defaultValue ?? {}, [defaultValue, valueProp])\n const [internalValue, setInternalValue] = React.useState<I18nValue>(initialValue)\n const isControlled = valueProp !== undefined\n const currentValue = isControlled ? valueProp ?? {} : internalValue\n const [searchTerm, setSearchTerm] = React.useState(\"\")\n const localeContext = React.useContext(I18nFieldLocaleContext)\n\n const localePool = React.useMemo(() => {\n const pool = Array.from(new Set([...(locales ?? []), ...Object.keys(currentValue)]))\n return buildLanguageOptions(undefined, pool)\n }, [currentValue, locales])\n\n const initialLocale = React.useMemo(() => {\n const localeValues = localePool.map((option) => option.value)\n return localeProp ??\n localeContext?.locale ??\n getPreferredLocale(\n [defaultLocale, ...getEnvironmentLocales(), Object.keys(currentValue)[0] as LanguageCode | undefined],\n localeValues\n )\n }, [currentValue, defaultLocale, localeContext?.locale, localePool, localeProp])\n\n const [internalLocale, setInternalLocale] = React.useState<LanguageCode>(initialLocale)\n const activeLocale = localeProp ?? localeContext?.locale ?? internalLocale\n\n React.useEffect(() => {\n if (!isControlled) {\n setInternalValue(initialValue)\n }\n }, [initialValue, isControlled])\n\n React.useEffect(() => {\n if (localeProp && localeProp !== internalLocale) {\n setInternalLocale(localeProp)\n }\n }, [internalLocale, localeProp])\n\n React.useEffect(() => {\n if (!localeProp && localeContext?.locale && localeContext.locale !== internalLocale) {\n setInternalLocale(localeContext.locale)\n }\n }, [internalLocale, localeContext?.locale, localeProp])\n\n const selectedOption =\n localePool.find((option) => option.value === activeLocale) ??\n localePool.find((option) => option.value === DEFAULT_LOCALE) ??\n localePool[0] ??\n null\n\n const [menuOpen, setMenuOpen] = React.useState(false)\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const inputRef = React.useRef<HTMLInputElement | HTMLTextAreaElement | null>(null)\n const triggerRef = React.useRef<HTMLButtonElement | null>(null)\n const containerRef = React.useRef<HTMLDivElement | null>(null)\n const selectRef = React.useRef<SelectInstance<LanguageOption, false> | null>(null)\n const searchInputRef = React.useRef<HTMLInputElement | null>(null)\n const selectionSnapshotRef = React.useRef<{ start: number | null; end: number | null } | null>(null)\n const [menuPosition, setMenuPosition] = React.useState<{ left: number; top: number }>({ left: 0, top: 0 })\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement & HTMLTextAreaElement, [])\n\n const handleLocaleSelect = (option: SingleValue<LanguageOption>) => {\n if (!option) return\n const nextLocale = option.value\n if (!isControlled) {\n setInternalLocale(nextLocale)\n }\n onLocaleChange?.(nextLocale, option)\n localeContext?.setLocale(nextLocale)\n closeMenu(true)\n }\n\n const handleTextChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const currentEntry = currentValue[activeLocale]\n const nextValue = {\n ...currentValue,\n [activeLocale]: {\n ...(currentEntry ?? {}),\n value: event.target.value,\n updatedAt: new Date(),\n autoTranslated: false,\n },\n }\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n onChange?.(nextValue)\n }\n\n const currentText = resolveLocalizedValue(currentValue, activeLocale)\n\n const filterOption = React.useCallback(\n (option: { data: LanguageOption }) => {\n if (!searchTerm) return true\n const query = normalize(searchTerm)\n return option.data.searchable.some((token) => token.includes(query))\n },\n [searchTerm]\n )\n\n const buttonPosition = multiline ? \"left-2 top-2 -translate-y-0\" : \"left-3 top-1/2 -translate-y-1/2\"\n const inputPaddingLeft = \"pl-10 pr-3\"\n\n const updateMenuPosition = React.useCallback(() => {\n const trigger = triggerRef.current\n const container = containerRef.current\n if (!trigger || !container) return\n const triggerRect = trigger.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n setMenuPosition({\n left: triggerRect.left - containerRect.left,\n top: triggerRect.bottom - containerRect.top + 4,\n })\n }, [])\n\n const isInsideComponent = React.useCallback((target: EventTarget | null) => {\n if (!target || !(target instanceof Node)) return false\n return Boolean(rootRef.current?.contains(target))\n }, [])\n\n const restoreMainFocus = React.useCallback(() => {\n const target = inputRef.current\n if (!target) return\n target.focus()\n const selection = selectionSnapshotRef.current\n if (selection && selection.start != null && selection.end != null) {\n target.setSelectionRange(selection.start, selection.end)\n }\n }, [])\n\n React.useEffect(() => {\n if (!menuOpen) return\n const target = searchInputRef.current\n if (!target) return\n requestAnimationFrame(() => {\n if (document.activeElement === target) return\n target.focus()\n const end = target.value.length\n try {\n target.setSelectionRange(end, end)\n } catch {\n /* ignore */\n }\n })\n }, [menuOpen, searchTerm])\n\n const closeMenu = React.useCallback(\n (restoreFocus = true) => {\n setMenuOpen(false)\n setSearchTerm(\"\")\n if (restoreFocus) {\n requestAnimationFrame(() => {\n restoreMainFocus()\n })\n }\n },\n [restoreMainFocus]\n )\n\n const {\n components: userSelectComponents,\n styles: userSelectStyles,\n classNamePrefix: userClassNamePrefix,\n placeholder: selectPlaceholder,\n noOptionsMessage,\n ...forwardedSelectProps\n } = selectProps ?? {}\n\n const filteredOptions = React.useMemo(() => {\n const query = normalize(searchTerm)\n const rank = (option: LanguageOption) => {\n const code = option.code.toLowerCase()\n if (query && code === query) return 0\n if (query && code.startsWith(query)) return 1\n if (query && option.searchable.some((token) => token.startsWith(query))) return 2\n if (query && option.searchable.some((token) => token.includes(query))) return 3\n return 4\n }\n return localePool\n .filter((option) => filterOption({ data: option }))\n .sort((a, b) => {\n const diff = rank(a) - rank(b)\n if (diff !== 0) return diff\n return a.name.localeCompare(b.name)\n })\n }, [filterOption, localePool, searchTerm])\n\n const handleSearchKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Escape\") {\n event.preventDefault()\n closeMenu(true)\n return\n }\n if (event.key === \"Enter\") {\n event.preventDefault()\n const first = filteredOptions[0]\n if (first) {\n handleLocaleSelect(first)\n }\n return\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault()\n selectRef.current?.focus()\n }\n }\n\n const searchMenuContextValue: SearchMenuContextValue = {\n searchTerm,\n setSearchTerm,\n onSearchKeyDown: handleSearchKeyDown,\n searchInputRef,\n selectFooter,\n }\n\n const mergedSelectComponents = React.useMemo(\n () => ({\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n MenuList: SearchableMenuList,\n ...(userSelectComponents ?? {}),\n Option,\n }),\n [userSelectComponents]\n )\n\n const mergedSelectStyles = React.useMemo<StylesConfig<LanguageOption, false>>(\n () => ({\n ...selectStyles,\n ...(userSelectStyles ?? {}),\n }),\n [userSelectStyles]\n )\n\n React.useLayoutEffect(() => {\n if (!menuOpen) return\n updateMenuPosition()\n const handleResize = () => updateMenuPosition()\n window.addEventListener(\"resize\", handleResize)\n return () => window.removeEventListener(\"resize\", handleResize)\n }, [menuOpen, updateMenuPosition])\n\n const sharedFieldProps = {\n ...restProps,\n ref: inputRef as React.Ref<any>,\n disabled,\n value: currentText,\n onChange: handleTextChange,\n onFocus: (event: React.FocusEvent<any>) => {\n if (menuOpen) {\n closeMenu(false)\n }\n restProps.onFocus?.(event)\n },\n onBlur: (event: React.FocusEvent<any>) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n restProps.onBlur?.(event)\n },\n className: cn(\n \"w-full rounded-md border border-input bg-background text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n multiline ? \"min-h-24 py-2\" : \"h-10 py-2\",\n inputPaddingLeft,\n inputClassName\n ),\n placeholder: restProps.placeholder,\n }\n\n return (\n <div\n ref={rootRef}\n className={cn(\"relative flex flex-col\", className)}\n onBlur={(event) => {\n if (!isInsideComponent(event.relatedTarget)) {\n closeMenu(false)\n }\n }}\n >\n <div ref={containerRef} className=\"relative\">\n {multiline ? (\n <textarea rows={rows} {...sharedFieldProps} />\n ) : (\n <input type=\"text\" {...sharedFieldProps} />\n )}\n\n <button\n type=\"button\"\n className={cn(\n \"absolute flex h-6 w-6 items-center justify-center rounded border text-xs font-semibold leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n buttonPosition,\n disabled ? \"cursor-not-allowed opacity-50 pointer-events-none\" : \"cursor-pointer hover:bg-muted\",\n selectedOption ? \"border-transparent\" : \"border-dashed border-border text-muted-foreground\"\n )}\n aria-label={selectedOption ? `Select language (${selectedOption.code})` : \"Select language\"}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (disabled) return\n const target = inputRef.current\n if (target) {\n selectionSnapshotRef.current = {\n start: target.selectionStart,\n end: target.selectionEnd,\n }\n }\n setSearchTerm(\"\")\n setMenuOpen(true)\n requestAnimationFrame(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus()\n searchInputRef.current.select()\n } else {\n selectRef.current?.focus()\n }\n })\n }}\n tabIndex={languageSelectTabIndex}\n disabled={disabled}\n ref={triggerRef}\n >\n <span aria-hidden=\"true\">{selectedOption ? languageCodeToBadge(selectedOption.code) : \"?\"}</span>\n </button>\n </div>\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: menuOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n left: menuPosition.left,\n top: menuPosition.top,\n }}\n >\n <SearchMenuContext.Provider value={searchMenuContextValue}>\n <Select<LanguageOption, false>\n {...forwardedSelectProps}\n menuIsOpen={menuOpen}\n options={filteredOptions}\n value={null}\n onChange={handleLocaleSelect}\n classNamePrefix={userClassNamePrefix ?? \"i18n-language-select\"}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue\n menuShouldScrollIntoView={false}\n placeholder={selectPlaceholder ?? \"\"}\n filterOption={filterOption}\n noOptionsMessage={noOptionsMessage}\n onMenuClose={() => closeMenu(true)}\n ref={selectRef}\n />\n </SearchMenuContext.Provider>\n </div>\n </div>\n )\n }\n)\n\nI18nField.displayName = \"I18nField\"\n"],"mappings":";;;;;;AAkCA,IAAM,KAAyB,EAAM,cAAyC,IAAI;AAUlF,SAAgB,EAAA,GAMiB;gBANO,EACtC,aACA,UACA,iBACA,aACA,eALsCA,GAOhC,IAAe,MAAU,KAAA,GAEvBC;CAAoB,AAAA,EAAA,OAAA,KAAA,EAAA,OAA2C,KAA/D,IAAA,EAAmB,CAAC,GAAc,GAAG,EAAsB,CAAC,GAAG,CAAO,GAAlD,EAAA,KAAA,GAA2C,EAAA,KAAA;CADvE,IAAM,IAAgBC,GAIhB,CAAC,IAAgB,KAAqB,EAAM,SAAuB,CAAa,GAChF,KAAgB,KAAS,IAG7BC;CACO,AAAA,EAAA,OAAA,KAAA,EAAA,OAGL,KAJF,KAAC,MAAuB;EAItB,AAHK,KACH,EAAkB,CAAI,GAExB,IAAW,CAAI;CACjB,GAJO,EAAA,KAAA,GAGL,EAAA,KAAA;CALJ,IAAM,IAAYC,GAUFC,IAGbC;CAHH,AAEmF,EAAA,OAAA,KAAA,EAAA,OAD7E,KAAA,EAAA,OACwD,KAF9C,WAAM;EAChB,KACJ,GAAmB,MAAa,EAAmB,GAAS,CAAO,IAAI,IAAU,CAAc;CACjG,GAAG,KAAA;EAAC;EAAe;EAAc;CAAO,GAD2C,EAAA,KAAA,GAD7E,EAAA,KAAA,GACwD,EAAA,KAAA,qDAF9D,EAAM,UAAUD,IAGbC,EAAsC;CAGhCC,IAAAA;CACG,AAAA,EAAA,QAAA,MAAA,EAAA,QACR,KAFK,KAAA;EACL,QAAQ;EACR;CACF,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