import { am as e, U as t, ag as a, ah as s, an as r, aj as o, ao as i, a as n, ap as l, aq as p, w as c, a6 as m, ar as d, as as g } from "./index-f50c05c4.js";
import "./lodash-f1e42446.js";
import { lA as u, lR as j, lS as h } from "./ant-design-icons-b1480d8d.js";
import "./loglevel-6fb66d22.js";
import { memo as f } from "react";
import { d as b } from "./styled-components-1e696d6b.js";
import { M as v, S as y, D as w } from "./antd-04a23d13.js";
import "./axios-84bb1c75.js";
import "./redux-devtools-d38e5b33.js";
import "./alasql-0ff6dabf.js";
import "./react-router-a1807b5b.js";
import "./fontawesome-2445f580.js";
import "react-dom";
import "./dnd-kit-56a2f36f.js";
import "./dayjs-844325ae.js";
import "./numbro-c1edb412.js";
import "./papaparse-1bac8e5f.js";
import "./uuid-82f303b2.js";
import "./supabase-c27c62e3.js";
import "./fetch-a3c8ad94.js";
import "./react-draggable-60f59f09.js";
import "./remark-gfm-f2973785.js";
import "./buffer-d3713d77.js";
import "./rehype-raw-41b6145f.js";
import "./parse5-6476676e.js";
import "./rehype-sanitize-deb53e9a.js";
import "./simplebar-react-e1b123a3.js";
import "./react-best-gradient-color-picker-4dd60dac.js";
import "./ua-parser-js-094f59ba.js";
import "./clsx-469c2c43.js";
import "./crypto-js-d5eac8ba.js";
import "./codemirror-73d8c217.js";
import "./really-relaxed-json-49b6a70d.js";
import "./immer-c0428a8d.js";
import "./redux-saga-5514e228.js";
import "./hotkeys-js-0dddb21a.js";
import "./cnchar-5678e6bc.js";
import "./react-documents-eb6de859.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-5125aafe.js";
import "./react-json-view-9403d8a1.js";
import "./qrcode-react-cb73d2b6.js";
import "./katex-a34f0265.js";
import "./ecogis-maps-bb0d63f9.js";
import "./devextreme-2fa5bb9a.js";
const C = b.div`
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;

  .lang-switch {
    transition: all 0.2s;

    &:hover {
      background: #f3f4f6;
    }
  }
`, x = function() {
  const t2 = { selectedLang: n({}) };
  return new e(t2, (e2, t3) => ({ selectedLang: e2.selectedLang, updateSelection: (e3) => {
    t3(l("selectedLang", e3, true));
  } })).build();
}(), V = { options: p, defaultValue: c(m, "vi"), size: c(m, "20px"), borderRadius: c(m, "0"), selectionControl: x, onEvent: d([{ label: "onOpenChange", value: "onOpenChange", description: "" }]) }, L = f((e2) => {
  var _a;
  if ((t2 = e2.selectionControl.selectedLang) && 0 === Object.keys(t2).length && t2.constructor === Object || !((_a = e2.selectionControl.selectedLang) == null ? void 0 : _a.value)) {
    const t3 = e2.options.find((t4) => t4.value === e2.defaultValue);
    t3 && e2.selectionControl.updateSelection(t3);
  }
  var t2;
  const a2 = e2.options.map((t3) => ({ key: t3.value, label: u(v.Item, { onClick: () => {
    return a3 = t3, e2.selectionControl.updateSelection(a3), void e2.onEvent("onOpenChange");
    var a3;
  }, className: "lang-item", style: { padding: 0, backgroundColor: "transparent" }, children: j(y, { children: [u("img", { src: t3.icon, width: "16px", alt: t3.label }), t3.label] }) }) })), s2 = e2.selectionControl.selectedLang;
  return u(C, { $height: e2.size, children: u(w, { menu: { items: a2 }, className: "lang-dropdown", children: u("div", { className: "lang-switch", style: { height: `calc(${e2.size}px + 10px)`, display: "flex", alignItems: "center" }, children: s2 && u("img", { src: s2.icon, height: e2.size, style: { borderRadius: e2.borderRadius }, alt: s2.label }) }) }) });
});
let k = new t(V, (e2) => {
  const t2 = a({ ...e2 }, "LangComp");
  return u(L, { ...t2 });
}).setPropertyViewFn((e2) => j(h, { children: [j(s, { name: r.basic, children: [e2.options.getPropertyView(), e2.defaultValue.propertyView({ label: "DefaultValue" }), e2.size.propertyView({ label: "Size" }), e2.borderRadius.propertyView({ label: "borderRadius" })] }), u(s, { name: "Interaction", children: e2.onEvent.getPropertyView() })] })).build();
k = g(k, [{ method: { name: "setLanguage", description: "", params: [{ name: "lang", type: "string" }] }, execute: (e2, t2) => {
  const a2 = t2[0];
  if (a2) {
    const t3 = e2.children.options.getView().find((e3) => e3.value === a2);
    t3 && e2.children.selectionControl.children.selectedLang.dispatchChangeValueAction(t3);
  }
} }]);
const z = o(k, [new i("language", (e2) => ({ language: e2.children.selectionControl.children.selectedLang.node() }), (e2) => e2.language, "Get selected language")]);
function N() {
  return { options: { data: JSON.stringify([{ languageCode: "vi", languageName: "Tiếng Việt", flag: "https://vnpt.com.vn/design/images/icon/vi.png" }, { languageCode: "en", languageName: "English", flag: "https://vnpt.com.vn/design/images/icon/en.png" }]) } };
}
export {
  z as LangComp,
  N as defaultLangData
};
