import { co as u, f4 as m, f5 as h, b9 as s, bK as p, ba as f, bd as w, ei as x, cQ as $, bv as b, a as S, bf as C, V as o, fh as v, ea as V, P as a, bD as P, bh as i, bi as l, bj as r, a0 as y, em as I, bg as c, bk as M, bl as k, dm as D, en as E, cG as F, fi as R } from "./684d2f28.js";
import { PaddingControl as B } from "./2d5fc5ff.js";
import { MarginControl as T } from "./0f3d7a1a.js";
import { useContext as d } from "react";
import { SelectInputValidationChildren as A, SelectInputValidationSection as L } from "./1312a48b.js";
import { formDataChildren as j, FormDataPropertyView as O } from "./00dac55d.js";
import { focusMethod as U, blurMethod as W } from "./d6402597.js";
import "react-dom";
const z = (e) => u`
    &.ant-select .ant-select-selector,
    &.ant-select-multiple .ant-select-selection-item {
      border-radius: ${e.radius};
      padding: ${e.padding};	
      height: auto;	
    }	
    .ant-select-selection-search {	
      padding: ${e.padding};
    }	
    .ant-select-selection-search-input {
      font-family:${e.fontFamily} !important;
      text-transform:${e.textTransform} !important;
      text-decoration:${e.textDecoration} !important;
      font-size:${e.textSize} !important;
      font-weight:${e.textWeight};
      color:${e.text} !important;
      font-style:${e.fontStyle};
    }
    .ant-select-selector::after,	
    .ant-select-selection-placeholder,	
    .ant-select-selection-item {	
      line-height: 1.5715 !important;
    }

    &.ant-select:not(.ant-select-disabled) {
      color: ${e.text};
      .ant-select-selection-placeholder,
      .ant-select-selection-item {
        line-height: 1.5715 !important;
      }
      .ant-select-selection-placeholder,
      &.ant-select-single.ant-select-open .ant-select-selection-item {
        color: ${e.text};
        opacity: 0.4;
        width: 100%;
      }

      .ant-select-selector {
        background-color: ${e.background};
        border-color: ${e.border};
        border-width:${e.borderWidth};
      }

      &.ant-select-focused,
      &:hover {
        .ant-select-selector {
          border-color: ${e.accent};
        }
      }

      .ant-select-arrow,
      .ant-select-clear {
        background-color: ${e.background};
        color: ${e.text === "#222222" ? "#8B8FA3" : m(e.text) ? h(e.text, 0.2) : e.text};
      }

      .ant-select-clear:hover {
        color: ${e.text === "#222222" ? "#8B8FA3" : m(e.text) ? h(e.text, 0.1) : e.text};
      }

      &.ant-select-multiple .ant-select-selection-item {
        border: none;
        background-color: ${e.tags};
        color: ${e.tagsText};
        border-radius: ${e.radius};

        .ant-select-selection-item-remove {
          color: ${e.tagsText};
          opacity: 0.5;
        }
      }
    }
  `, N = (e) => u`
    padding: 8px 0;

    .ant-select-item-option-selected {
      font-weight: 600;
      background-color: transparent;
    }

    .ant-select-item {
      border-radius: 4px;
      margin: 0 8px;
      padding: 5px 8px;

      &:hover {
        background-color: rgb(242, 247, 252);
      }

      .ant-select-item-option-state {
        display: inline-flex;
        align-items: center;

        path {
          fill: ${e.multiIcon};
        }
      }
    }
  `, g = s(R)`
  width: 100%;

  ${(e) => e.$style && z(e.$style)}
`, G = s.div`
  ${(e) => e.$style && N(e.$style)}
  .ant-select-item-option-content {
    ${(e) => `padding: ${e.$style.padding}`};
  }
  .option-label img {
    min-width: 14px;
    margin-right: 0;
  }
`, H = s.span`
  display: inline-flex;
  align-items: center;
  gap: 6px;

  img {
    margin-right: -6px;
  }
`, ee = {
  label: p,
  placeholder: f,
  disabled: w,
  onEvent: x,
  options: $,
  allowClear: b,
  inputValue: S(""),
  // user's input value when search
  showSearch: b.DEFAULT_TRUE,
  viewRef: C,
  margin: T,
  padding: B,
  ...A,
  ...j
}, te = (e) => /* @__PURE__ */ o(g, {
  ref: e.viewRef,
  mode: e.mode,
  $style: e.style,
  disabled: e.disabled,
  allowClear: e.allowClear,
  placeholder: e.placeholder,
  value: e.value,
  showSearch: e.showSearch,
  filterOption: (t, n) => n == null ? void 0 : n.label.toLowerCase().includes(t.toLowerCase()),
  dropdownRender: (t) => /* @__PURE__ */ o(G, {
    $style: e.style,
    children: t
  }),
  dropdownStyle: {
    padding: 0
  },
  menuItemSelectedIcon: e.mode ? /* @__PURE__ */ o(v, {
    title: ""
  }) : "",
  onChange: e.onChange,
  onFocus: () => e.onEvent("focus"),
  onBlur: () => e.onEvent("blur"),
  onSearch: e.showSearch ? (t) => {
    e.dispatch(V("inputValue", t, !1));
  } : void 0,
  children: e.options.filter((t) => t.value !== void 0 && !t.hidden).map((t) => /* @__PURE__ */ o(g.Option, {
    value: t.value,
    label: t.label,
    disabled: t.disabled,
    children: /* @__PURE__ */ a(H, {
      className: "option-label",
      children: [e.options.findIndex((n) => P(n.prefixIcon)) > -1 && t.prefixIcon, /* @__PURE__ */ o("span", {
        children: t.label
      })]
    })
  }, t.value))
}), oe = (e) => /* @__PURE__ */ a(i, {
  children: [/* @__PURE__ */ a(l, {
    name: r.basic,
    children: [e.options.propertyView({}), e.defaultValue.propertyView({
      label: y("prop.defaultValue")
    }), I(e)]
  }), ["logic", "both"].includes(d(c).editorModeStatus) && /* @__PURE__ */ a(i, {
    children: [/* @__PURE__ */ a(i, {
      children: [/* @__PURE__ */ o(L, {
        ...e
      }), /* @__PURE__ */ o(O, {
        ...e
      })]
    }), /* @__PURE__ */ a(l, {
      name: r.interaction,
      children: [e.onEvent.getPropertyView(), M(e), k(e)]
    })]
  }), ["layout", "both"].includes(d(c).editorModeStatus) && e.label.getPropertyView(), ["logic", "both"].includes(d(c).editorModeStatus) && /* @__PURE__ */ a(l, {
    name: r.advanced,
    children: [D(e), E(e)]
  }), ["layout", "both"].includes(d(c).editorModeStatus) && /* @__PURE__ */ a(i, {
    children: [/* @__PURE__ */ o(l, {
      name: r.style,
      children: e.style.getPropertyView()
    }), /* @__PURE__ */ o(l, {
      name: r.labelStyle,
      children: e.labelStyle.getPropertyView()
    })]
  })]
}), ae = F([U, W]);
export {
  ee as SelectChildrenMap,
  oe as SelectPropertyView,
  te as SelectUIView,
  ae as baseSelectRefMethods,
  z as getStyle
};
