import { m as r, j as d, U as S, l as V } from "./index-CsBCemCF.js";
import { memo as x, useCallback as U } from "react";
import { u as h } from "./useBasicWidgetState-KOlq_goV.js";
const j = (t, e) => t.getStringValue(e), v = (t) => t.options.length === 0 || r(t.default) ? null : t.options[t.default], w = (t) => t.rawValue ?? null, y = (t, e, o, a) => {
  e.setStringValue(t, o.value, {
    fromUi: o.fromUi
  }, a);
}, C = ({
  disabled: t,
  element: e,
  widgetMgr: o,
  fragmentId: a
}) => {
  const {
    options: s,
    help: i,
    label: u,
    labelVisibility: n,
    placeholder: c,
    acceptNewOptions: f
  } = e, [p, l] = h({
    getStateFromWidgetMgr: j,
    getDefaultStateFromProto: v,
    getCurrStateFromProto: w,
    updateWidgetMgrState: y,
    element: e,
    widgetMgr: o,
    fragmentId: a
  }), g = U((b) => {
    l({
      value: b,
      fromUi: !0
    });
  }, [l]), m = r(e.default) && !t;
  return /* @__PURE__ */ d.jsx(S, { label: u, labelVisibility: V(n?.value), options: s, disabled: t, onChange: g, value: p, help: i, placeholder: c, clearable: m, acceptNewOptions: f ?? !1 });
}, P = x(C);
export {
  P as default
};
//# sourceMappingURL=index-CuLrbTLp.js.map
