import { b9 as b, bP as s, bK as f, bd as h, cK as C, cQ as p, bB as S, cR as v, bf as x, U as w, V as a, bD as y, P as n, bh as m, bi as o, bj as i, a0 as u, bg as d, bk as V, bl as $, bn as I, bo as P, bp as D, co as k, cS as E, bA as M } from "./684d2f28.js";
import { formDataChildren as B, FormDataPropertyView as R } from "./00dac55d.js";
import { SelectInputValidationChildren as F, useSelectInputValidate as j, SelectInputValidationSection as N, selectDivRefMethods as O, SelectInputInvalidConfig as q } from "./1312a48b.js";
import { useContext as l } from "react";
import { fixOldInputCompData as z } from "./0c4ef413.js";
import "react-dom";
import "./d6402597.js";
const A = (e) => k`
    &.ant-segmented:not(.ant-segmented-disabled) {
      background-color: ${e.background};

      &,
      .ant-segmented-item-selected,
      .ant-segmented-thumb,
      .ant-segmented-item:hover,
      .ant-segmented-item:focus {
        color: ${e.text};
        border-radius: ${e.radius};
      }
      .ant-segmented-item {
        padding: ${e.padding};
      }
      .ant-segmented-item-selected,
      .ant-segmented-thumb {
        background-color: ${e.indicatorBackground};
      }
    }

    &.ant-segmented,
    .ant-segmented-item-selected {
      border-radius: ${e.radius};
    }
    &.ant-segmented, .ant-segmented-item-label {
      font-family:${e.fontFamily};
      font-style:${e.fontStyle};
      font-size:${e.textSize};
      font-weight:${e.textWeight};
      text-transform:${e.textTransform};
      text-decoration:${e.textDecoration};
    }
  `, K = b(E)`
  width: 100%;
  min-height: 24px; // keep the height unchanged when there are no options
  ${(e) => e.$style && A(e.$style)}
`, U = {
  defaultValue: s("value"),
  value: s("value"),
  label: f,
  disabled: h,
  onEvent: C,
  options: p,
  style: S(v),
  viewRef: x,
  ...F,
  ...B
};
let r = function() {
  return new w(U, (e) => {
    const [g, c] = j(e);
    return e.label({
      required: e.required,
      style: e.style,
      children: /* @__PURE__ */ a(K, {
        ref: e.viewRef,
        block: !0,
        disabled: e.disabled,
        value: e.value.value,
        $style: e.style,
        onChange: (t) => {
          c(t.toString());
        },
        options: e.options.filter((t) => t.value !== void 0 && !t.hidden).map((t) => ({
          label: t.label,
          value: t.value,
          disabled: t.disabled,
          icon: y(t.prefixIcon) && t.prefixIcon
        }))
      }),
      ...g
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ n(m, {
    children: [/* @__PURE__ */ n(o, {
      name: i.basic,
      children: [e.options.propertyView({}), e.defaultValue.propertyView({
        label: u("prop.defaultValue")
      })]
    }), ["logic", "both"].includes(l(d).editorModeStatus) && /* @__PURE__ */ n(m, {
      children: [/* @__PURE__ */ a(N, {
        ...e
      }), /* @__PURE__ */ a(R, {
        ...e
      }), /* @__PURE__ */ n(o, {
        name: i.interaction,
        children: [e.onEvent.getPropertyView(), V(e), $(e)]
      })]
    }), ["layout", "both"].includes(l(d).editorModeStatus) && e.label.getPropertyView(), ["layout", "both"].includes(l(d).editorModeStatus) && /* @__PURE__ */ a(o, {
      name: i.style,
      children: e.style.getPropertyView()
    })]
  })).setExposeMethodConfigs(O).build();
}();
r = M(r, z);
const X = I(r, [new P("value", u("selectInput.valueDesc")), q, ...D]);
export {
  X as SegmentedControlComp
};
