PageSourceSearch

https://opencode.ai/_build/assets/language-picker-Bs0jmBPR.js

js opencode.ai collected 2026-10-01 08:27:44 UTC 1,768 bytes, 51 lines download raw bytes

1import { q as createSignal, R as getNextElement, W as insert, i as createComponent, F as For, ae as template } from "./tr-pkHAcXFO.js";
2import { a as DropdownItem, D as Dropdown } from "./dropdown-DSzmBMZk.js";
3import { b as useLanguage, r as route, s as strip } from "./i18n-CawYd3iN.js";
4import { o as useNavigate, l as useLocation } from "./query-LvP-HwZU.js";
5var _tmpl$ = /* @__PURE__ */ template(`<div data-component=language-picker>`);
6function LanguagePicker(props = {}) {
7  const language = useLanguage();
8  const navigate = useNavigate();
9  const location = useLocation();
10  const [open, setOpen] = createSignal(false);
11  return (() => {
12    var _el$ = getNextElement(_tmpl$);
13    insert(_el$, createComponent(Dropdown, {
14      get trigger() {
15        return language.label(language.locale());
16      },
17      get align() {
18        return props.align ?? "left";
19      },
20      get open() {
21        return open();
22      },
23      onOpenChange: setOpen,
24      get children() {
25        return createComponent(For, {
26          get each() {
27            return language.locales;
28          },
29          children: (locale) => createComponent(DropdownItem, {
30            get selected() {
31              return locale === language.locale();
32            },
33            onClick: () => {
34              language.setLocale(locale);
35              const href = `${route(locale, strip(location.pathname))}${location.search}${location.hash}`;
36              if (href !== `${location.pathname}${location.search}${location.hash}`) navigate(href);
37              setOpen(false);
38            },
39            get children() {
40              return language.label(locale);
41            }
42          })
43        });
44      }
45    }));
46    return _el$;
47  })();
48}
49export {
50  LanguagePicker as L
51};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.