"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const factory = require("../../core/factory/factory.cjs");
const getParsedComboboxData = require("../Combobox/get-parsed-combobox-data/get-parsed-combobox-data.cjs");
const ComboboxChevron = require("../Combobox/ComboboxChevron/ComboboxChevron.cjs");
const InputBase = require("../InputBase/InputBase.cjs");
const NativeSelectOption = require("./NativeSelectOption.cjs");
const defaultProps = {
  rightSectionPointerEvents: "none"
};
const NativeSelect = factory.factory((props, ref) => {
  const { data, children, size, error, rightSection, unstyled, ...others } = useProps.useProps(
    "NativeSelect",
    defaultProps,
    props
  );
  const options = getParsedComboboxData.getParsedComboboxData(data).map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(NativeSelectOption.NativeSelectOption, { data: item }, index));
  return /* @__PURE__ */ jsxRuntime.jsx(
    InputBase.InputBase,
    {
      component: "select",
      ref,
      ...others,
      __staticSelector: "NativeSelect",
      size,
      pointer: true,
      error,
      unstyled,
      rightSection: rightSection || /* @__PURE__ */ jsxRuntime.jsx(ComboboxChevron.ComboboxChevron, { size, error, unstyled }),
      children: children || options
    }
  );
});
NativeSelect.classes = InputBase.InputBase.classes;
NativeSelect.displayName = "@mantine/core/NativeSelect";
exports.NativeSelect = NativeSelect;
