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

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var vue = require('vue');
var pick = require('lodash/pick');
var isArray = require('lodash/isArray');
var isFunction = require('lodash/isFunction');
var debounce = require('lodash/debounce');
var cloneDeep = require('lodash/cloneDeep');
var get = require('lodash/get');
var intersection = require('lodash/intersection');
var commonComponents_fakeArrow = require('../common-components/fake-arrow.js');
var selectInput_index = require('../select-input/index.js');
var form_hooks = require('../form/hooks.js');
var hooks_useDefaultValue = require('../hooks/useDefaultValue.js');
var hooks_useVModel = require('../hooks/useVModel.js');
var hooks_tnode = require('../hooks/tnode.js');
var hooks_useConfig = require('../hooks/useConfig.js');
var select_props = require('./props.js');
var select_selectPanel = require('./select-panel.js');
var select_helper = require('./helper.js');
var select_hooks_useSelectOptions = require('./hooks/useSelectOptions.js');
var configProvider_useConfig = require('../config-provider/useConfig.js');
require('../utils/withInstall.js');
require('../select-input/select-input.js');
require('../popup/index.js');
require('../popup/popup.js');
require('@popperjs/core');
require('lodash/isObject');
require('lodash/isString');
require('../utils/dom.js');
require('../_chunks/dep-7f0559c3.js');
require('../utils/easing.js');
require('../_common/js/utils/set-style.js');
require('../popup/container.js');
require('../hooks/useResizeObserver.js');
require('../popup/props.js');
require('../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('dayjs');
require('lodash/kebabCase');
require('lodash/camelCase');
require('../utils/render-tnode.js');
require('lodash/isEmpty');
require('../select-input/props.js');
require('../select-input/useSingle.js');
require('../input/index.js');
require('../input/input.js');
require('@ldesign/icons-vue-next');
require('lodash/isUndefined');
require('../hooks/useGlobalIcon.js');
require('../input/props.js');
require('../input/useInput.js');
require('../form/const.js');
require('../input/useLengthLimit.js');
require('lodash/isNumber');
require('../_common/js/log/log.js');
require('../_common/js/utils/helper.js');
require('lodash/isNull');
require('../input/useInputEventHandler.js');
require('../input/useInputWidth.js');
require('../input/input-group.js');
require('../input/input-group-props.js');
require('../loading/index.js');
require('../loading/directive.js');
require('../loading/plugin.js');
require('../loading/loading.js');
require('../hooks/useTeleport.js');
require('../loading/props.js');
require('../loading/icon/gradient.js');
require('../_common/js/loading/circle-adapter.js');
require('../select-input/useMultiple.js');
require('../tag-input/index.js');
require('../tag-input/tag-input.js');
require('../tag-input/props.js');
require('../tag-input/hooks/useTagScroll.js');
require('../tag-input/useTagList.js');
require('../tag/index.js');
require('../tag/tag.js');
require('../tag/props.js');
require('../tag/check-tag.js');
require('../tag/check-tag-props.js');
require('../tag-input/hooks/useHover.js');
require('../tag-input/hooks/useDragSorter.js');
require('../select-input/useOverlayInnerStyle.js');
require('lodash/omit');
require('./option.js');
require('../checkbox/index.js');
require('../checkbox/checkbox.js');
require('../hooks/useRipple.js');
require('../utils/set-style.js');
require('../hooks/useKeepAnimation.js');
require('../checkbox/props.js');
require('../checkbox/constants.js');
require('../checkbox/group.js');
require('../hooks/slot.js');
require('../checkbox/checkbox-group-props.js');
require('./option-props.js');
require('./optionGroup.js');
require('./option-group-props.js');
require('./hooks/usePanelVirtualScroll.js');
require('../hooks/useVirtualScroll.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick);
var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction);
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
var intersection__default = /*#__PURE__*/_interopDefaultLegacy(intersection);

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__default["default"](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 = vue.defineComponent({
  name: "TSelect",
  props: _objectSpread({}, select_props["default"]),
  setup: function setup(props2, _ref) {
    var slots = _ref.slots;
    var classPrefix = hooks_useConfig.usePrefixClass();
    var disabled = form_hooks.useFormDisabled();
    var renderTNodeJSX = hooks_tnode.useTNodeJSX();
    var COMPONENT_NAME = hooks_useConfig.usePrefixClass("select");
    var _useConfig = configProvider_useConfig.useConfig("select"),
      globalConfig = _useConfig.globalConfig,
      t = _useConfig.t;
    var _toRefs = vue.toRefs(props2),
      popupVisible = _toRefs.popupVisible,
      inputValue = _toRefs.inputValue,
      modelValue = _toRefs.modelValue,
      value = _toRefs.value;
    var _useVModel = hooks_useVModel["default"](value, modelValue, props2.defaultValue, props2.onChange),
      _useVModel2 = _slicedToArray__default["default"](_useVModel, 2),
      orgValue = _useVModel2[0],
      setOrgValue = _useVModel2[1];
    var selectPanelRef = vue.ref(null);
    var selectInputRef = vue.ref(null);
    var keys = vue.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 = select_hooks_useSelectOptions.useSelectOptions(props2, keys),
      options = _useSelectOptions.options,
      optionsMap = _useSelectOptions.optionsMap,
      optionsList = _useSelectOptions.optionsList,
      optionsCache = _useSelectOptions.optionsCache;
    var innerValue = vue.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__default["default"](_ref2, value2, get__default["default"](option, value2)), _defineProperty__default["default"](_ref2, label, get__default["default"](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 = hooks_useDefaultValue["default"](inputValue, props2.defaultInputValue, props2.onInputChange, "inputValue"),
      _useDefaultValue2 = _slicedToArray__default["default"](_useDefaultValue, 2),
      innerInputValue = _useDefaultValue2[0],
      setInputValue = _useDefaultValue2[1];
    var _useDefaultValue3 = hooks_useDefaultValue["default"](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__default["default"](_useDefaultValue3, 2),
      innerPopupVisible = _useDefaultValue4[0],
      setInnerPopupVisible = _useDefaultValue4[1];
    var placeholderText = vue.computed(function () {
      var _ref3;
      return (_ref3 = !props2.multiple && innerPopupVisible.value && select_helper.getSingleContent(innerValue.value, optionsMap) || props2.placeholder) !== null && _ref3 !== void 0 ? _ref3 : t(globalConfig.value.placeholder);
    });
    var displayText = vue.computed(function () {
      return props2.multiple ? select_helper.getMultipleContent(innerValue.value, optionsMap) : select_helper.getSingleContent(innerValue.value, optionsMap);
    });
    var valueDisplayParams = vue.computed(function () {
      var val = props2.multiple && isArray__default["default"](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 = vue.computed(function () {
      return Boolean(props2.filterable || globalConfig.value.filterable || isFunction__default["default"](props2.filter));
    });
    var removeTag = function removeTag(index, e) {
      var _props2$onRemove;
      e && e.stopPropagation();
      var selectValue = cloneDeep__default["default"](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 = vue.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 = select_helper.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 = vue.computed(function () {
      var _selectInputRef$value;
      return (_selectInputRef$value = selectInputRef.value) === null || _selectInputRef$value === void 0 ? void 0 : _selectInputRef$value.popupRef.getOverlay();
    });
    var optionalList = vue.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__default["default"](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 = vue.computed(function () {
      var values = optionalList.value.map(function (item) {
        return item.value;
      });
      var n = intersection__default["default"](innerValue.value, values);
      return n.length;
    });
    var isCheckAll = vue.computed(function () {
      return intersectionLen.value === optionalList.value.length;
    });
    var indeterminate = vue.computed(function () {
      return !isCheckAll.value && intersectionLen.value !== 0;
    });
    var SelectProvide = vue.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
      };
    });
    vue.provide(select_helper.selectInjectKey, SelectProvide);
    var checkValueInvalid = function checkValueInvalid() {
      if (!props2.multiple && isArray__default["default"](orgValue.value)) setOrgValue(void 0);
      if (props2.multiple && !isArray__default["default"](orgValue.value)) setOrgValue([]);
    };
    var handleSearch = debounce__default["default"](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__default["default"](optionsCache.value))));
      } else {
        var _option = optionsMap.value.get(val);
        if (_option) optionsCache.value = Array.from( /* @__PURE__ */new Set([_option].concat(_toConsumableArray__default["default"](optionsCache.value))));
      }
    };
    vue.watch(orgValue, function (val) {
      checkValueInvalid();
      vue.nextTick(function () {
        addCache(val);
      });
    }, {
      immediate: true
    });
    vue.watch(function () {
      return props2.multiple;
    }, function () {
      checkValueInvalid();
    });
    vue.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"));
      vue.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;
        }
      });
    };
    vue.provide("updateScrollTop", updateScrollTop);
    return function () {
      var _ref5 = props2.popupProps || {},
        overlayClassName = _ref5.overlayClassName,
        restPopupProps = _objectWithoutProperties__default["default"](_ref5, _excluded);
      return vue.createVNode("div", {
        "class": "".concat(COMPONENT_NAME.value, "__wrap")
      }, [vue.createVNode(selectInput_index.SelectInput, vue.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 && vue.createVNode(commonComponents_fakeArrow["default"], {
            "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 vue.createVNode(select_selectPanel["default"], vue.mergeProps({
            "ref": selectPanelRef
          }, pick__default["default"](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
      })]);
    };
  }
});

exports["default"] = _Select;
//# sourceMappingURL=select.js.map
