/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, toRefs, ref, computed, provide, watch, nextTick, createVNode, mergeProps } from 'vue';
import pick from 'lodash/pick';
import isArray from 'lodash/isArray';
import isFunction from 'lodash/isFunction';
import debounce from 'lodash/debounce';
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import intersection from 'lodash/intersection';
import FakeArrow from '../common-components/fake-arrow.js';
import { SelectInput } from '../select-input/index.js';
import { useFormDisabled } from '../form/hooks.js';
import useDefaultValue from '../hooks/useDefaultValue.js';
import useVModel from '../hooks/useVModel.js';
import { useTNodeJSX } from '../hooks/tnode.js';
import { usePrefixClass } from '../hooks/useConfig.js';
import props from './props.js';
import SelectPanel from './select-panel.js';
import { getSingleContent, getMultipleContent, getNewMultipleValue, selectInjectKey } from './helper.js';
import { useSelectOptions } from './hooks/useSelectOptions.js';
import { useConfig } from '../config-provider/useConfig.js';
import '../utils/withInstall.js';
import '../select-input/select-input.js';
import '../popup/index.js';
import '../popup/popup.js';
import '@popperjs/core';
import 'lodash/isObject';
import 'lodash/isString';
import '../hooks/index.js';
import '../hooks/icon.js';
import '../hooks/slot.js';
import '../hooks/useCommonClassName.js';
import '../hooks/useDestroyOnClose.js';
import '../hooks/useKeepAnimation.js';
import '../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-2e5d8948.js';
import 'dayjs';
import '../_chunks/dep-4580aabe.js';
import '../hooks/useRipple.js';
import '../utils/set-style.js';
import '../hooks/useVirtualScroll.js';
import '../utils/dom.js';
import '../utils/easing.js';
import '../_common/js/utils/set-style.js';
import '../popup/container.js';
import '../hooks/useResizeObserver.js';
import '../popup/props.js';
import '../popup/style';
import '../popup/type.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../utils/render-tnode.js';
import 'lodash/isEmpty';
import '../config-provider/type.js';
import '../select-input/props.js';
import '../select-input/useSingle.js';
import '../input/index.js';
import '../input/input.js';
import '@ldesign/icons-vue-next';
import 'lodash/isUndefined';
import '../hooks/useGlobalIcon.js';
import '../input/props.js';
import '../input/useInput.js';
import '../form/const.js';
import '../input/useLengthLimit.js';
import 'lodash/isNumber';
import '../_common/js/log/index.js';
import '../_common/js/log/log.js';
import '../_common/js/utils/helper.js';
import 'lodash/isNull';
import '../input/useInputEventHandler.js';
import '../input/useInputWidth.js';
import '../input/input-group.js';
import '../input/input-group-props.js';
import '../input/style';
import '../input/type.js';
import '../loading/index.js';
import '../loading/directive.js';
import '../loading/plugin.js';
import '../loading/loading.js';
import '../hooks/useTeleport.js';
import '../loading/props.js';
import '../loading/icon/gradient.js';
import '../_common/js/loading/circle-adapter.js';
import '../loading/style';
import '../loading/type.js';
import '../select-input/useMultiple.js';
import '../tag-input/index.js';
import '../tag-input/tag-input.js';
import '../tag-input/props.js';
import '../tag-input/hooks/useTagScroll.js';
import '../tag-input/useTagList.js';
import '../tag/index.js';
import '../tag/tag.js';
import '../tag/props.js';
import '../tag/check-tag.js';
import '../tag/check-tag-props.js';
import '../tag/style';
import '../tag/type.js';
import '../tag-input/hooks/useHover.js';
import '../tag-input/hooks/useDragSorter.js';
import '../tag-input/style';
import '../tag-input/type.js';
import '../select-input/useOverlayInnerStyle.js';
import '../select-input/style';
import '../select-input/type.js';
import 'lodash/omit';
import './option.js';
import '../checkbox/index.js';
import '../checkbox/checkbox.js';
import '../checkbox/props.js';
import '../checkbox/constants.js';
import '../checkbox/group.js';
import '../checkbox/checkbox-group-props.js';
import '../checkbox/style';
import '../checkbox/type.js';
import './option-props.js';
import './optionGroup.js';
import './option-group-props.js';
import './hooks/usePanelVirtualScroll.js';

var _excluded = ["overlayClassName"];
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _Select = defineComponent({
  name: "TSelect",
  props: _objectSpread({}, props),
  setup: function setup(props2, _ref) {
    var slots = _ref.slots;
    var classPrefix = usePrefixClass();
    var disabled = useFormDisabled();
    var renderTNodeJSX = useTNodeJSX();
    var COMPONENT_NAME = usePrefixClass("select");
    var _useConfig = useConfig("select"),
      globalConfig = _useConfig.globalConfig,
      t = _useConfig.t;
    var _toRefs = toRefs(props2),
      popupVisible = _toRefs.popupVisible,
      inputValue = _toRefs.inputValue,
      modelValue = _toRefs.modelValue,
      value = _toRefs.value;
    var _useVModel = useVModel(value, modelValue, props2.defaultValue, props2.onChange),
      _useVModel2 = _slicedToArray(_useVModel, 2),
      orgValue = _useVModel2[0],
      setOrgValue = _useVModel2[1];
    var selectPanelRef = ref(null);
    var selectInputRef = ref(null);
    var keys = computed(function () {
      var _props2$keys, _props2$keys2;
      return {
        label: ((_props2$keys = props2.keys) === null || _props2$keys === void 0 ? void 0 : _props2$keys.label) || "label",
        value: ((_props2$keys2 = props2.keys) === null || _props2$keys2 === void 0 ? void 0 : _props2$keys2.value) || "value"
      };
    });
    var _useSelectOptions = useSelectOptions(props2, keys),
      options = _useSelectOptions.options,
      optionsMap = _useSelectOptions.optionsMap,
      optionsList = _useSelectOptions.optionsList,
      optionsCache = _useSelectOptions.optionsCache;
    var innerValue = computed(function () {
      if (orgValue.value === void 0) return props2.multiple ? [] : void 0;
      if (props2.valueType === "object") {
        return !props2.multiple ? orgValue.value[keys.value.value] : orgValue.value.map(function (option) {
          return option[keys.value.value];
        });
      }
      return orgValue.value;
    });
    var setInnerValue = function setInnerValue(newVal, e) {
      if (props2.valueType === "object") {
        var _keys$value = keys.value,
          value2 = _keys$value.value,
          label = _keys$value.label;
        var getOption = function getOption(val) {
          var _ref2;
          if (val === void 0) return void 0;
          var option = optionsMap.value.get(val);
          return _ref2 = {}, _defineProperty(_ref2, value2, get(option, value2)), _defineProperty(_ref2, label, get(option, label)), _ref2;
        };
        newVal = props2.multiple ? newVal.map(function (val) {
          return getOption(val);
        }) : getOption(newVal);
      }
      if (newVal === orgValue.value) return;
      setOrgValue(newVal, {
        selectedOptions: getSelectedOptions(newVal),
        trigger: e.trigger,
        e: e.e
      });
    };
    var _useDefaultValue = useDefaultValue(inputValue, props2.defaultInputValue, props2.onInputChange, "inputValue"),
      _useDefaultValue2 = _slicedToArray(_useDefaultValue, 2),
      innerInputValue = _useDefaultValue2[0],
      setInputValue = _useDefaultValue2[1];
    var _useDefaultValue3 = useDefaultValue(popupVisible, false, function (visible, context) {
        var _props2$onPopupVisibl;
        (_props2$onPopupVisibl = props2.onPopupVisibleChange) === null || _props2$onPopupVisibl === void 0 ? void 0 : _props2$onPopupVisibl.call(props2, visible, context);
      }, "popupVisible"),
      _useDefaultValue4 = _slicedToArray(_useDefaultValue3, 2),
      innerPopupVisible = _useDefaultValue4[0],
      setInnerPopupVisible = _useDefaultValue4[1];
    var placeholderText = computed(function () {
      var _ref3;
      return (_ref3 = !props2.multiple && innerPopupVisible.value && getSingleContent(innerValue.value, optionsMap) || props2.placeholder) !== null && _ref3 !== void 0 ? _ref3 : t(globalConfig.value.placeholder);
    });
    var displayText = computed(function () {
      return props2.multiple ? getMultipleContent(innerValue.value, optionsMap) : getSingleContent(innerValue.value, optionsMap);
    });
    var valueDisplayParams = computed(function () {
      var val = props2.multiple && isArray(innerValue.value) ? innerValue.value.map(function (value2) {
        var _optionsMap$value$get;
        return {
          value: value2,
          label: (_optionsMap$value$get = optionsMap.value.get(value2)) === null || _optionsMap$value$get === void 0 ? void 0 : _optionsMap$value$get.label
        };
      }) : innerValue.value;
      var params = {
        value: val,
        onClose: props2.multiple ? function (index) {
          return removeTag(index);
        } : function () {}
      };
      if (props2.minCollapsedNum && props2.multiple) {
        var _val$slice;
        return _objectSpread(_objectSpread({}, params), {}, {
          displayValue: val === null || val === void 0 ? void 0 : (_val$slice = val.slice) === null || _val$slice === void 0 ? void 0 : _val$slice.call(val, 0, props2.minCollapsedNum)
        });
      }
      return params;
    });
    var isFilterable = computed(function () {
      return Boolean(props2.filterable || globalConfig.value.filterable || isFunction(props2.filter));
    });
    var removeTag = function removeTag(index, e) {
      var _props2$onRemove;
      e && e.stopPropagation();
      var selectValue = cloneDeep(innerValue.value);
      var value2 = selectValue[index];
      selectValue.splice(index, 1);
      setInnerValue(selectValue, {
        selectedOptions: getSelectedOptions(selectValue),
        trigger: "tag-remove",
        e: e
      });
      (_props2$onRemove = props2.onRemove) === null || _props2$onRemove === void 0 ? void 0 : _props2$onRemove.call(props2, {
        value: value2,
        data: optionsMap.value.get(value2),
        e: e
      });
    };
    var handleCreate = function handleCreate() {
      var _props2$onCreate;
      if (!innerInputValue.value) return;
      (_props2$onCreate = props2.onCreate) === null || _props2$onCreate === void 0 ? void 0 : _props2$onCreate.call(props2, innerInputValue.value);
      setInputValue("");
    };
    var hoverIndex = ref(-1);
    var handleKeyDown = function handleKeyDown(e) {
      var _optionsList$value$ne, _optionsList$value$ne2;
      var optionsListLength = optionsList.value.length;
      var newIndex = hoverIndex.value;
      switch (e.code) {
        case "ArrowUp":
          e.preventDefault();
          if (hoverIndex.value === -1) newIndex = 0;else if (hoverIndex.value === 0) newIndex = optionsListLength - 1;else newIndex--;
          if ((_optionsList$value$ne = optionsList.value[newIndex]) !== null && _optionsList$value$ne !== void 0 && _optionsList$value$ne.disabled) newIndex--;
          hoverIndex.value = newIndex;
          break;
        case "ArrowDown":
          e.preventDefault();
          if (hoverIndex.value === -1 || hoverIndex.value === optionsListLength - 1) newIndex = 0;else newIndex++;
          if ((_optionsList$value$ne2 = optionsList.value[newIndex]) !== null && _optionsList$value$ne2 !== void 0 && _optionsList$value$ne2.disabled) newIndex++;
          hoverIndex.value = newIndex;
          break;
        case "Enter":
          if (hoverIndex.value === -1) break;
          if (!innerPopupVisible.value) {
            setInnerPopupVisible(true, {
              e: e
            });
            break;
          }
          if (!props2.multiple) {
            setInnerValue(optionsList.value[hoverIndex.value].value, {
              selectedOptions: getSelectedOptions(optionsList.value[hoverIndex.value].value),
              trigger: "check",
              e: e
            });
            setInnerPopupVisible(false, {
              e: e
            });
          } else {
            var _optionsList$value$ho;
            if (hoverIndex.value === -1) return;
            var optionValue = (_optionsList$value$ho = optionsList.value[hoverIndex.value]) === null || _optionsList$value$ho === void 0 ? void 0 : _optionsList$value$ho.value;
            if (!optionValue) return;
            var newValue = getNewMultipleValue(innerValue.value, optionValue);
            setInnerValue(newValue.value, {
              selectedOptions: getSelectedOptions(newValue.value),
              trigger: newValue.isCheck ? "check" : "uncheck",
              e: e
            });
          }
          break;
        case "Escape":
          setInnerPopupVisible(false, {
            e: e
          });
          break;
      }
    };
    var popupContentRef = computed(function () {
      var _selectInputRef$value;
      return (_selectInputRef$value = selectInputRef.value) === null || _selectInputRef$value === void 0 ? void 0 : _selectInputRef$value.popupRef.getOverlay();
    });
    var optionalList = computed(function () {
      return optionsList.value.filter(function (item) {
        return !item.disabled && !item["check-all"] && !item.checkAll;
      });
    });
    var getSelectedOptions = function getSelectedOptions() {
      var selectValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : innerValue.value;
      return optionsList.value.filter(function (option) {
        if (option.checkAll) return;
        if (isArray(selectValue)) return selectValue.includes(option.value);
        return selectValue === option.value;
      });
    };
    var onCheckAllChange = function onCheckAllChange(checked) {
      if (!props2.multiple) return;
      var value2 = checked ? optionalList.value.map(function (option) {
        return option.value;
      }) : [];
      setInnerValue(value2, {
        selectedOptions: getSelectedOptions(value2),
        trigger: checked ? "check" : "clear"
      });
    };
    var intersectionLen = computed(function () {
      var values = optionalList.value.map(function (item) {
        return item.value;
      });
      var n = intersection(innerValue.value, values);
      return n.length;
    });
    var isCheckAll = computed(function () {
      return intersectionLen.value === optionalList.value.length;
    });
    var indeterminate = computed(function () {
      return !isCheckAll.value && intersectionLen.value !== 0;
    });
    var SelectProvide = computed(function () {
      return {
        max: props2.max,
        multiple: props2.multiple,
        hoverIndex: hoverIndex.value,
        selectValue: innerValue.value,
        reserveKeyword: props2.reserveKeyword,
        handleValueChange: setInnerValue,
        handlerInputChange: setInputValue,
        handlePopupVisibleChange: setInnerPopupVisible,
        handleCreate: handleCreate,
        size: props2.size,
        popupContentRef: popupContentRef,
        indeterminate: indeterminate.value,
        isCheckAll: isCheckAll.value,
        onCheckAllChange: onCheckAllChange,
        getSelectedOptions: getSelectedOptions
      };
    });
    provide(selectInjectKey, SelectProvide);
    var checkValueInvalid = function checkValueInvalid() {
      if (!props2.multiple && isArray(orgValue.value)) setOrgValue(void 0);
      if (props2.multiple && !isArray(orgValue.value)) setOrgValue([]);
    };
    var handleSearch = debounce(function (value2, _ref4) {
      var _props2$onSearch;
      var e = _ref4.e;
      (_props2$onSearch = props2.onSearch) === null || _props2$onSearch === void 0 ? void 0 : _props2$onSearch.call(props2, "".concat(value2), {
        e: e
      });
    }, 300);
    var addCache = function addCache(val) {
      if (props2.multiple) {
        var newCache = [];
        var _iterator = _createForOfIteratorHelper(val || []),
          _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done;) {
            var item = _step.value;
            var option = optionsMap.value.get(item);
            if (option) newCache.push(option);
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        optionsCache.value = Array.from( /* @__PURE__ */new Set([].concat(newCache, _toConsumableArray(optionsCache.value))));
      } else {
        var _option = optionsMap.value.get(val);
        if (_option) optionsCache.value = Array.from( /* @__PURE__ */new Set([_option].concat(_toConsumableArray(optionsCache.value))));
      }
    };
    watch(orgValue, function (val) {
      checkValueInvalid();
      nextTick(function () {
        addCache(val);
      });
    }, {
      immediate: true
    });
    watch(function () {
      return props2.multiple;
    }, function () {
      checkValueInvalid();
    });
    watch(innerPopupVisible, function (value2) {
      if (value2) {
        hoverIndex.value = -1;
      } else {
        if (innerInputValue.value) setInputValue("");
      }
    });
    var updateScrollTop = function updateScrollTop(content) {
      var _selectPanelRef$value, _selectPanelRef$value2;
      if (!selectPanelRef.value) return;
      var firstSelectedNode = (_selectPanelRef$value = selectPanelRef.value) === null || _selectPanelRef$value === void 0 ? void 0 : (_selectPanelRef$value2 = _selectPanelRef$value.innerRef) === null || _selectPanelRef$value2 === void 0 ? void 0 : _selectPanelRef$value2.querySelector(".".concat(classPrefix.value, "-is-selected"));
      nextTick(function () {
        if (firstSelectedNode && content) {
          var _getComputedStyle = getComputedStyle(firstSelectedNode),
            paddingBottom = _getComputedStyle.paddingBottom;
          var _getComputedStyle2 = getComputedStyle(content),
            marginBottom = _getComputedStyle2.marginBottom;
          var elementBottomHeight = parseInt(paddingBottom, 10) + parseInt(marginBottom, 10);
          var updateValue = firstSelectedNode.offsetTop - content.offsetTop - (content.clientHeight - firstSelectedNode.clientHeight) + elementBottomHeight;
          content.scrollTop = updateValue;
        }
      });
    };
    provide("updateScrollTop", updateScrollTop);
    return function () {
      var _ref5 = props2.popupProps || {},
        overlayClassName = _ref5.overlayClassName,
        restPopupProps = _objectWithoutProperties(_ref5, _excluded);
      return createVNode("div", {
        "class": "".concat(COMPONENT_NAME.value, "__wrap")
      }, [createVNode(SelectInput, mergeProps({
        autoWidth: props2.autoWidth,
        readonly: props2.readonly,
        borderless: props2.borderless,
        multiple: props2.multiple,
        clearable: props2.clearable,
        loading: props2.loading,
        status: props2.status,
        tips: props2.tips,
        minCollapsedNum: props2.minCollapsedNum,
        autofocus: props2.autofocus,
        suffix: props2.suffix
      }, {
        "ref": selectInputRef,
        "class": COMPONENT_NAME.value,
        "value": displayText.value,
        "disabled": disabled.value,
        "popupVisible": innerPopupVisible.value,
        "inputValue": innerPopupVisible.value ? innerInputValue.value : "",
        "placeholder": "".concat(placeholderText.value),
        "allowInput": isFilterable.value,
        "collapsed-items": props2.collapsedItems,
        "inputProps": _objectSpread(_objectSpread({
          size: props2.size
        }, props2.inputProps), {}, {
          onkeydown: handleKeyDown
        }),
        "tagInputProps": _objectSpread({
          size: props2.size
        }, props2.tagInputProps),
        "onTagChange": function onTagChange(val, ctx) {
          removeTag(ctx.index);
        },
        "tagProps": _objectSpread({}, props2.tagProps),
        "popupProps": _objectSpread({
          overlayClassName: ["".concat(COMPONENT_NAME.value, "__dropdown"), overlayClassName]
        }, restPopupProps),
        "label": function label() {
          return renderTNodeJSX("prefixIcon");
        },
        "suffixIcon": function suffixIcon() {
          if (props2.suffixIcon || slots.suffixIcon) return renderTNodeJSX("suffixIcon");
          return props2.showArrow && createVNode(FakeArrow, {
            "overlayClassName": "".concat(COMPONENT_NAME.value, "__right-icon"),
            "isActive": innerPopupVisible.value
          }, null);
        },
        "valueDisplay": function valueDisplay() {
          return renderTNodeJSX("valueDisplay", {
            params: valueDisplayParams.value
          });
        },
        "onPopupVisibleChange": function onPopupVisibleChange(val, context) {
          setInnerPopupVisible(val, context);
        },
        "onInputChange": function onInputChange(value2, context) {
          if (!innerPopupVisible.value || context.trigger === "blur") return;
          setInputValue(value2);
          handleSearch("".concat(value2), {
            e: context.e
          });
        },
        "onClear": function onClear(_ref6) {
          var _props2$onClear;
          var e = _ref6.e;
          setInnerValue(props2.multiple ? [] : void 0, {
            selectedOptions: getSelectedOptions(props2.multiple ? [] : void 0),
            trigger: "clear",
            e: e
          });
          (_props2$onClear = props2.onClear) === null || _props2$onClear === void 0 ? void 0 : _props2$onClear.call(props2, {
            e: e
          });
        },
        "onEnter": function onEnter(inputValue2, _ref7) {
          var _props2$onEnter;
          var e = _ref7.e;
          (_props2$onEnter = props2.onEnter) === null || _props2$onEnter === void 0 ? void 0 : _props2$onEnter.call(props2, {
            inputValue: "".concat(innerInputValue.value),
            e: e,
            value: innerValue.value
          });
          handleCreate();
        },
        "onBlur": function onBlur(inputValue2, _ref8) {
          var _props2$onBlur;
          var e = _ref8.e;
          (_props2$onBlur = props2.onBlur) === null || _props2$onBlur === void 0 ? void 0 : _props2$onBlur.call(props2, {
            e: e,
            value: innerValue.value
          });
        },
        "onFocus": function onFocus(inputValue2, _ref9) {
          var _props2$onFocus;
          var e = _ref9.e;
          (_props2$onFocus = props2.onFocus) === null || _props2$onFocus === void 0 ? void 0 : _props2$onFocus.call(props2, {
            e: e,
            value: innerValue.value
          });
        }
      }, props2.selectInputProps), {
        panel: function panel() {
          return createVNode(SelectPanel, mergeProps({
            "ref": selectPanelRef
          }, pick(props2, ["size", "multiple", "empty", "loading", "loadingText", "filterable", "creatable", "panelTopContent", "panelBottomContent", "filter", "scroll"]), {
            "options": options.value,
            "inputValue": innerInputValue.value
          }), slots);
        },
        collapsedItems: slots.collapsedItems,
        suffix: slots.suffix
      })]);
    };
  }
});

export { _Select as default };
//# sourceMappingURL=select.js.map
