'use strict';

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

var vue = require('vue');
require('../../../utils/index.js');
var antDesignVue = require('ant-design-vue');
var tagGroup = require('./tag-group.js');
var index = require('../../empty/index.js');
var createNamespace = require('../../../utils/create-namespace.js');

"use strict";
const _hoisted_1 = ["onClick"];
const _hoisted_2 = ["onClick"];
const _hoisted_3 = ["onClick"];
const itemHeight = 36;
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlTagGroup" },
  __name: "tag-group",
  props: tagGroup.tagGroupProps,
  emits: tagGroup.tagGroupEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const bem = createNamespace.createNamespace("tag-group");
    const formItemContext = antDesignVue.Form.useInjectFormItemContext();
    const loading = vue.ref(false);
    const inputValue = vue.ref("");
    const visible = vue.ref(false);
    const inputRef = vue.ref();
    const more = vue.ref(0);
    const mouseMove = vue.ref(false);
    const tagsTypeRef = vue.ref(null);
    const tagContainerRef = vue.ref(null);
    const tagRefs = vue.reactive([]);
    const filterOptionsValue = vue.ref([]);
    const sessionBaseOptions = vue.ref([]);
    const customOptions = vue.ref([]);
    const tagsTypeWidth = vue.ref(0);
    const shownArr = vue.ref([]);
    const btnRef = vue.ref();
    const popoverRef = vue.ref();
    const selectBoxRef = vue.ref(null);
    const popoverStyle = vue.ref({});
    const arrowStyle = vue.ref({});
    const moreRef = vue.ref();
    const morePopoverRef = vue.ref();
    const morePopoverStyle = vue.ref({});
    const moreArrowStyle = vue.ref({});
    const moreVisible = vue.ref(false);
    const moreIsHovering = vue.ref(false);
    let moreHideTimer = null;
    let animationFrameId = null;
    let moreAnimationFrameId = null;
    const value = vue.computed({
      get: () => {
        return props.value;
      },
      set: (val) => {
        emits("update:value", val);
        emits("change", val);
      }
    });
    const exceededMaxTagCount = vue.computed(() => {
      return props.maxTagCount > 0 && value.value.length >= props.maxTagCount;
    });
    const innerOptions = vue.computed(() => {
      return props.options || [];
    });
    const concatOptions = vue.computed(() => {
      const set = /* @__PURE__ */ new Set([
        ...customOptions.value,
        ...innerOptions.value,
        ...value.value
      ]);
      return Array.from(set);
    });
    const sortTags = (tags) => {
      if (props.sortBy === "alphabetical") {
        return [...tags].sort((a, b) => {
          return a.localeCompare(b, "zh-CN", { sensitivity: "base" });
        });
      }
      return tags;
    };
    const sortedValue = vue.computed(() => {
      return sortTags(value.value);
    });
    const hiddenTags = vue.computed(() => {
      if (props.overflowDisplay !== "collapse") return [];
      if (shownArr.value.length === 0) return sortedValue.value;
      return sortedValue.value.filter((item) => !shownArr.value.includes(item));
    });
    const getTagRefs = (i) => {
      return (el) => {
        if (el) {
          tagRefs[i] = vue.toRef(el);
        } else {
          tagRefs.splice(i, 1);
        }
      };
    };
    let resizeObserver = null;
    const getWidth = () => {
      if (tagsTypeRef.value) {
        tagsTypeWidth.value = tagsTypeRef.value.offsetWidth - 90;
      }
    };
    const handleEnter = () => {
      const val = inputValue.value.trim();
      if (!val) return;
      if (exceededMaxTagCount.value) return;
      if (!props.allowCreate && !concatOptions.value.includes(val)) return;
      if (props.allowCreate && !concatOptions.value.includes(val)) {
        customOptions.value.push(val);
        emits("update:options", concatOptions.value);
        const prevScrollTop = selectBoxRef.value?.scrollTop ?? 0;
        sessionBaseOptions.value = [val, ...sessionBaseOptions.value];
        filterOptionsValue.value = [val, ...filterOptionsValue.value];
        if (prevScrollTop > 0) {
          vue.nextTick(() => {
            const box = selectBoxRef.value;
            if (box) {
              box.scrollTop = prevScrollTop + itemHeight;
              scrollTop.value = prevScrollTop + itemHeight;
            }
          });
        }
      }
      if (concatOptions.value.includes(val)) {
        const arr = [...value.value];
        const idx = arr.indexOf(val);
        if (idx < 0) {
          arr.push(val);
        } else {
          arr.splice(idx, 1);
        }
        value.value = arr;
      }
      inputValue.value = "";
    };
    const handleFilter = () => {
      if (props.filter && typeof props.filter === "function" && inputValue.value) {
        filterOptionsValue.value = props.filter(
          inputValue.value,
          sessionBaseOptions.value
        );
      } else {
        filterOptionsValue.value = sessionBaseOptions.value;
      }
    };
    const removeCustomOption = (item) => {
      if (!customOptions.value.includes(item)) return;
      customOptions.value = customOptions.value.filter((o) => o !== item);
      sessionBaseOptions.value = sessionBaseOptions.value.filter((o) => o !== item);
      filterOptionsValue.value = filterOptionsValue.value.filter((o) => o !== item);
      emits("update:options", concatOptions.value);
    };
    const handleDelByValue = (tag) => {
      if (!tag) return;
      removeCustomOption(tag);
      value.value = value.value.filter((e) => e !== tag);
    };
    const handleClickFilter = (item) => {
      let arr = [...value.value];
      if (arr.indexOf(item) >= 0) {
        arr = arr.filter((e) => e !== item);
        value.value = arr;
        removeCustomOption(item);
      } else {
        if (exceededMaxTagCount.value) {
          return;
        }
        arr.push(item);
        value.value = arr;
      }
      inputValue.value = "";
    };
    const scrollTop = vue.ref(0);
    const totalHeight = vue.computed(() => {
      return filterOptionsValue.value.length * itemHeight + (props.listLoading ? itemHeight : 0);
    });
    const visibleData = vue.computed(() => {
      const totalCount = filterOptionsValue.value.length + (props.listLoading ? 1 : 0);
      const visibleCount = Math.ceil(180 / itemHeight) + 4;
      let start = Math.floor(scrollTop.value / itemHeight);
      if (totalCount > 0 && start >= totalCount) {
        start = Math.max(0, totalCount - visibleCount);
      }
      const end = Math.min(start + visibleCount, totalCount);
      const result = [];
      for (let i = start; i < end; i++) {
        const isLoader = i === filterOptionsValue.value.length && props.listLoading;
        result.push({
          index: i,
          value: isLoader ? "" : filterOptionsValue.value[i],
          isLoader
        });
      }
      return result;
    });
    const offsetTop = vue.computed(() => {
      if (visibleData.value.length === 0) return 0;
      return visibleData.value[0].index * itemHeight;
    });
    const scrollbarVisible = vue.ref(false);
    const isHovering = vue.ref(false);
    let scrollTimer = null;
    const showScrollbar = () => {
      scrollbarVisible.value = true;
      if (scrollTimer) clearTimeout(scrollTimer);
    };
    const hideScrollbarWithDelay = () => {
      if (scrollTimer) clearTimeout(scrollTimer);
      scrollTimer = setTimeout(() => {
        if (!isHovering.value) {
          scrollbarVisible.value = false;
        }
      }, 3e3);
    };
    const handleMouseEnterList = () => {
      isHovering.value = true;
      showScrollbar();
    };
    const handleMouseLeaveList = () => {
      isHovering.value = false;
      hideScrollbarWithDelay();
    };
    const handleScroll = (e) => {
      const target = e.target;
      scrollTop.value = target.scrollTop;
      const { clientHeight, scrollHeight } = target;
      if (target.scrollTop + clientHeight >= scrollHeight - props.triggerDistance) {
        emits("scroll-bottom");
      }
      showScrollbar();
      hideScrollbarWithDelay();
    };
    const updatePosition = () => {
      if (!visible.value || !btnRef.value || !popoverRef.value) {
        if (animationFrameId !== null) {
        }
        if (visible.value) animationFrameId = requestAnimationFrame(updatePosition);
        return;
      }
      const rect = btnRef.value.getBoundingClientRect();
      const popRect = popoverRef.value.getBoundingClientRect();
      let left = rect.left + rect.width / 2 - popRect.width / 2;
      const top = rect.bottom + 12;
      if (left < 10) left = 10;
      if (left + popRect.width > window.innerWidth - 10) {
        left = window.innerWidth - popRect.width - 10;
      }
      popoverStyle.value = {
        position: "fixed",
        left: `${left}px`,
        top: `${top}px`,
        zIndex: 2e3
      };
      const btnCenter = rect.left + rect.width / 2;
      const arrowLeft = btnCenter - left;
      arrowStyle.value = {
        left: `${arrowLeft}px`
      };
      animationFrameId = requestAnimationFrame(updatePosition);
    };
    const updateMorePosition = () => {
      if (!moreVisible.value || !moreRef.value || !morePopoverRef.value) {
        if (moreVisible.value) {
          moreAnimationFrameId = requestAnimationFrame(updateMorePosition);
        }
        return;
      }
      const rect = moreRef.value.getBoundingClientRect();
      const popRect = morePopoverRef.value.getBoundingClientRect();
      let left = rect.left + rect.width / 2 - popRect.width / 2;
      const top = rect.bottom + 12;
      if (left < 10) left = 10;
      if (left + popRect.width > window.innerWidth - 10) {
        left = window.innerWidth - popRect.width - 10;
      }
      morePopoverStyle.value = {
        position: "fixed",
        left: `${left}px`,
        top: `${top}px`,
        zIndex: 2e3
      };
      const btnCenter = rect.left + rect.width / 2;
      const arrowLeft = btnCenter - left;
      moreArrowStyle.value = {
        left: `${arrowLeft}px`
      };
      moreAnimationFrameId = requestAnimationFrame(updateMorePosition);
    };
    const toggleVisible = () => {
      visible.value = !visible.value;
    };
    const handleClickOutside = (e) => {
      if (!visible.value) return;
      const target = e.target;
      if (popoverRef.value && popoverRef.value.contains(target) || btnRef.value && btnRef.value.contains(target)) {
        return;
      }
      visible.value = false;
    };
    const showMorePopover = () => {
      if (props.overflowDisplay !== "collapse") return;
      if (hiddenTags.value.length === 0) return;
      moreVisible.value = true;
      if (moreHideTimer) {
        clearTimeout(moreHideTimer);
        moreHideTimer = null;
      }
      vue.nextTick(() => {
        updateMorePosition();
      });
    };
    const hideMorePopoverImmediate = () => {
      moreVisible.value = false;
      if (moreHideTimer) {
        clearTimeout(moreHideTimer);
        moreHideTimer = null;
      }
      if (moreAnimationFrameId !== null) {
        cancelAnimationFrame(moreAnimationFrameId);
        moreAnimationFrameId = null;
      }
    };
    const hideMorePopoverWithDelay = () => {
      if (moreHideTimer) clearTimeout(moreHideTimer);
      moreHideTimer = setTimeout(() => {
        if (!moreIsHovering.value) {
          moreVisible.value = false;
          if (moreAnimationFrameId !== null) {
            cancelAnimationFrame(moreAnimationFrameId);
            moreAnimationFrameId = null;
          }
        }
      }, 150);
    };
    const handleMoreMouseEnter = () => {
      moreIsHovering.value = true;
      showMorePopover();
    };
    const handleMoreMouseLeave = () => {
      moreIsHovering.value = false;
      hideMorePopoverWithDelay();
    };
    const handleMorePopoverEnter = () => {
      moreIsHovering.value = true;
      showMorePopover();
    };
    const handleMorePopoverLeave = () => {
      moreIsHovering.value = false;
      hideMorePopoverWithDelay();
    };
    vue.watch(visible, (val) => {
      if (val) {
        scrollTop.value = 0;
        const all = concatOptions.value;
        const selectedSet = new Set(value.value);
        const selected = sortTags(all.filter((i) => selectedSet.has(i)));
        const unselected = all.filter((i) => !selectedSet.has(i));
        sessionBaseOptions.value = [...selected, ...unselected];
        filterOptionsValue.value = sessionBaseOptions.value;
        window.addEventListener("mousedown", handleClickOutside);
        vue.nextTick(() => {
          updatePosition();
          if (selectBoxRef.value) {
            selectBoxRef.value.scrollTop = 0;
          }
          setTimeout(() => {
            inputRef.value?.focus();
          }, 100);
        });
      } else {
        inputValue.value = "";
        window.removeEventListener("mousedown", handleClickOutside);
        if (animationFrameId !== null) {
          cancelAnimationFrame(animationFrameId);
          animationFrameId = null;
        }
      }
    });
    vue.watch(
      [filterOptionsValue, () => props.listLoading],
      () => {
        if (!visible.value) return;
        const maxScrollTopByData = Math.max(
          0,
          (filterOptionsValue.value.length + (props.listLoading ? 1 : 0) - 1) * itemHeight
        );
        if (scrollTop.value > maxScrollTopByData) {
          scrollTop.value = maxScrollTopByData;
        }
        vue.nextTick(() => {
          const box = selectBoxRef.value;
          if (!box) return;
          const maxScrollTop = Math.max(0, box.scrollHeight - box.clientHeight);
          if (box.scrollTop > maxScrollTop) {
            box.scrollTop = maxScrollTop;
          }
          scrollTop.value = box.scrollTop;
        });
      },
      { deep: true }
    );
    vue.watch(
      [
        () => props.overflowDisplay,
        () => more.value,
        () => hiddenTags.value.length
      ],
      () => {
        if (props.overflowDisplay !== "collapse" || more.value <= 0) {
          hideMorePopoverImmediate();
          return;
        }
        if (hiddenTags.value.length === 0) {
          hideMorePopoverImmediate();
        }
      }
    );
    vue.watch(
      () => props.options,
      (newOpts) => {
        if (!visible.value) return;
        const incoming = newOpts || [];
        const allKnown = /* @__PURE__ */ new Set([
          ...value.value,
          ...customOptions.value,
          ...incoming
        ]);
        const kept = sessionBaseOptions.value.filter((item) => allKnown.has(item));
        const keptSet = new Set(kept);
        const addedSet = new Set(incoming.filter((item) => !keptSet.has(item)));
        sessionBaseOptions.value = [...kept, ...addedSet];
        handleFilter();
      },
      { deep: true }
    );
    vue.watch(
      [
        () => value.value.length,
        tagsTypeWidth,
        () => props.sortBy,
        () => props.overflowDisplay,
        () => props.collapseThreshold
      ],
      async (n, o) => {
        await vue.nextTick();
        const checkValidate = () => {
          if (o && o[0]) {
            if (n[0] !== o[0]) {
              formItemContext.onFieldChange();
              formItemContext.onFieldBlur();
            }
          }
        };
        if (props.overflowDisplay === "wrap") {
          shownArr.value = sortedValue.value;
          more.value = 0;
          checkValidate();
          return;
        }
        if (props.overflowDisplay === "collapse" && props.collapseThreshold > 0) {
          const sorted2 = sortedValue.value;
          shownArr.value = sorted2.slice(0, props.collapseThreshold);
          const diff2 = sorted2.length - props.collapseThreshold;
          more.value = diff2 > 0 ? diff2 : 0;
          checkValidate();
          return;
        }
        const arr = [];
        let moreLeftValue = 0;
        const sorted = sortedValue.value;
        for (let i = 0; i < sorted.length; i++) {
          const tagEl = tagRefs[i]?.value;
          if (!tagEl) continue;
          const targetWidth = tagEl.offsetWidth + 10;
          if (moreLeftValue + targetWidth >= n[1]) {
            break;
          } else {
            moreLeftValue += targetWidth;
            arr.push(sorted[i]);
          }
        }
        const diff = n[0] - arr.length;
        more.value = diff > 0 ? diff : 0;
        shownArr.value = arr;
        checkValidate();
      },
      {
        deep: true,
        immediate: true
      }
    );
    vue.watch(inputValue, () => {
      emits("input", inputValue.value);
      handleFilter();
    });
    vue.onMounted(() => {
      vue.nextTick(() => {
        getWidth();
      });
      if (tagsTypeRef.value) {
        resizeObserver = new ResizeObserver(getWidth);
        resizeObserver.observe(tagsTypeRef.value);
      }
    });
    vue.onUnmounted(() => {
      resizeObserver?.disconnect();
      resizeObserver = null;
      window.removeEventListener("mousedown", handleClickOutside);
      if (animationFrameId !== null) {
        cancelAnimationFrame(animationFrameId);
        animationFrameId = null;
      }
      hideMorePopoverImmediate();
    });
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_ll_input = vue.resolveComponent("ll-input");
      const _component_a_spin = vue.resolveComponent("a-spin");
      return vue.openBlock(), vue.createBlock(_component_a_spin, { spinning: loading.value }, {
        default: vue.withCtx(() => [
          vue.createElementVNode(
            "div",
            {
              ref_key: "tagsTypeRef",
              ref: tagsTypeRef,
              class: vue.normalizeClass([
                vue.unref(bem).b(),
                props.size ? vue.unref(bem).m(props.size) : "",
                props.overflowDisplay === "wrap" ? vue.unref(bem).is("wrap") : ""
              ])
            },
            [
              vue.createElementVNode(
                "div",
                {
                  ref_key: "tagContainerRef",
                  ref: tagContainerRef,
                  class: vue.normalizeClass([vue.unref(bem).e("tag-container")])
                },
                [
                  (vue.openBlock(true), vue.createElementBlock(
                    vue.Fragment,
                    null,
                    vue.renderList(sortedValue.value, (item, i) => {
                      return vue.openBlock(), vue.createElementBlock(
                        "div",
                        {
                          key: i,
                          ref_for: true,
                          ref: getTagRefs(i),
                          class: vue.normalizeClass([
                            vue.unref(bem).m("item"),
                            !shownArr.value.includes(item) ? vue.unref(bem).is("hidden") : ""
                          ])
                        },
                        [
                          vue.createElementVNode(
                            "div",
                            {
                              class: vue.normalizeClass(vue.unref(bem).m("text"))
                            },
                            vue.toDisplayString(item),
                            3
                            /* TEXT, CLASS */
                          ),
                          vue.createElementVNode("span", {
                            class: vue.normalizeClass([vue.unref(bem).m("close"), props.disabled ? vue.unref(bem).m("disabled") : ""]),
                            onClick: ($event) => handleDelByValue(item)
                          }, [
                            vue.createVNode(_component_ll_icon, {
                              "icon-name": "icon-close2",
                              "class-name": vue.unref(bem).m("close-icon")
                            }, null, 8, ["class-name"])
                          ], 10, _hoisted_1)
                        ],
                        2
                        /* CLASS */
                      );
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  )),
                  more.value > 0 ? (vue.openBlock(), vue.createElementBlock(
                    "div",
                    {
                      key: 0,
                      ref_key: "moreRef",
                      ref: moreRef,
                      class: vue.normalizeClass(vue.unref(bem).m("more")),
                      onMouseenter: handleMoreMouseEnter,
                      onMouseleave: handleMoreMouseLeave
                    },
                    " +" + vue.toDisplayString(more.value),
                    35
                    /* TEXT, CLASS, NEED_HYDRATION */
                  )) : vue.createCommentVNode("v-if", true),
                  (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
                    moreVisible.value ? (vue.openBlock(), vue.createElementBlock(
                      "div",
                      {
                        key: 0,
                        ref_key: "morePopoverRef",
                        ref: morePopoverRef,
                        class: vue.normalizeClass(vue.unref(bem).e("more-popover")),
                        style: vue.normalizeStyle(morePopoverStyle.value),
                        onMouseenter: handleMorePopoverEnter,
                        onMouseleave: handleMorePopoverLeave
                      },
                      [
                        vue.createElementVNode(
                          "div",
                          {
                            class: vue.normalizeClass(vue.unref(bem).e("arrow")),
                            style: vue.normalizeStyle(moreArrowStyle.value)
                          },
                          null,
                          6
                          /* CLASS, STYLE */
                        ),
                        vue.createElementVNode(
                          "div",
                          {
                            class: vue.normalizeClass(vue.unref(bem).e("more-list"))
                          },
                          [
                            (vue.openBlock(true), vue.createElementBlock(
                              vue.Fragment,
                              null,
                              vue.renderList(hiddenTags.value, (item, i) => {
                                return vue.openBlock(), vue.createElementBlock(
                                  "div",
                                  {
                                    key: i,
                                    class: vue.normalizeClass(vue.unref(bem).e("more-item"))
                                  },
                                  [
                                    vue.createElementVNode(
                                      "span",
                                      null,
                                      vue.toDisplayString(item),
                                      1
                                      /* TEXT */
                                    ),
                                    vue.createVNode(_component_ll_icon, {
                                      "icon-name": "icon-delete",
                                      onClick: vue.withModifiers(($event) => handleDelByValue(item), ["stop"])
                                    }, null, 8, ["onClick"])
                                  ],
                                  2
                                  /* CLASS */
                                );
                              }),
                              128
                              /* KEYED_FRAGMENT */
                            ))
                          ],
                          2
                          /* CLASS */
                        )
                      ],
                      38
                      /* CLASS, STYLE, NEED_HYDRATION */
                    )) : vue.createCommentVNode("v-if", true)
                  ])),
                  vue.createElementVNode(
                    "div",
                    {
                      class: vue.normalizeClass(vue.unref(bem).e("add-container"))
                    },
                    [
                      vue.createElementVNode(
                        "div",
                        {
                          ref_key: "btnRef",
                          ref: btnRef,
                          class: vue.normalizeClass([
                            mouseMove.value || visible.value ? vue.unref(bem).is("active") : "",
                            vue.unref(bem).m("add-item"),
                            props.disabled ? vue.unref(bem).m("disabled") : ""
                          ]),
                          onClick: vue.withModifiers(toggleVisible, ["stop"]),
                          onMouseover: _cache[0] || (_cache[0] = ($event) => mouseMove.value = true),
                          onMouseleave: _cache[1] || (_cache[1] = ($event) => mouseMove.value = false)
                        },
                        [
                          vue.createVNode(_component_ll_icon, {
                            "icon-name": _ctx.addIcon || "icon-add",
                            color: "#666",
                            "class-name": vue.unref(bem).m("add-icon")
                          }, null, 8, ["icon-name", "class-name"]),
                          _ctx.addText ? (vue.openBlock(), vue.createElementBlock(
                            "span",
                            {
                              key: 0,
                              class: vue.normalizeClass(vue.unref(bem).m("add-text"))
                            },
                            vue.toDisplayString(_ctx.addText),
                            3
                            /* TEXT, CLASS */
                          )) : vue.createCommentVNode("v-if", true)
                        ],
                        34
                        /* CLASS, NEED_HYDRATION */
                      ),
                      (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
                        visible.value ? (vue.openBlock(), vue.createElementBlock(
                          "div",
                          {
                            key: 0,
                            ref_key: "popoverRef",
                            ref: popoverRef,
                            class: vue.normalizeClass([
                              vue.unref(bem).e("popover"),
                              exceededMaxTagCount.value ? vue.unref(bem).m("exceeded") : ""
                            ]),
                            style: vue.normalizeStyle(popoverStyle.value),
                            onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
                            }, ["stop"])),
                            onMousedown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
                            }, ["stop"]))
                          },
                          [
                            vue.createElementVNode(
                              "div",
                              {
                                class: vue.normalizeClass(vue.unref(bem).e("arrow")),
                                style: vue.normalizeStyle(arrowStyle.value)
                              },
                              null,
                              6
                              /* CLASS, STYLE */
                            ),
                            vue.createVNode(_component_ll_input, {
                              ref_key: "inputRef",
                              ref: inputRef,
                              value: inputValue.value,
                              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => inputValue.value = $event),
                              size: props.size,
                              class: vue.normalizeClass(vue.unref(bem).e("search")),
                              "is-gray": props.isGray,
                              placeholder: props.placeholder,
                              "prefix-icon": `icon-search`,
                              onPressEnter: vue.withModifiers(handleEnter, ["prevent"])
                            }, null, 8, ["value", "size", "class", "is-gray", "placeholder"]),
                            filterOptionsValue.value.length > 0 || props.listLoading ? (vue.openBlock(), vue.createElementBlock(
                              "div",
                              {
                                key: 0,
                                class: vue.normalizeClass(vue.unref(bem).m("select-box-container")),
                                style: vue.normalizeStyle({
                                  paddingRight: scrollbarVisible.value ? "6px" : "12px"
                                })
                              },
                              [
                                props.virtual ? (vue.openBlock(), vue.createElementBlock(
                                  "div",
                                  {
                                    key: 0,
                                    ref_key: "selectBoxRef",
                                    ref: selectBoxRef,
                                    class: vue.normalizeClass([
                                      vue.unref(bem).m("select-box"),
                                      !scrollbarVisible.value ? vue.unref(bem).is("scrollbar-hidden") : ""
                                    ]),
                                    style: { "position": "relative" },
                                    onScroll: handleScroll,
                                    onMouseenter: handleMouseEnterList,
                                    onMouseleave: handleMouseLeaveList
                                  },
                                  [
                                    vue.createElementVNode(
                                      "div",
                                      {
                                        style: vue.normalizeStyle({
                                          height: `${totalHeight.value}px`,
                                          width: "100%"
                                        })
                                      },
                                      null,
                                      4
                                      /* STYLE */
                                    ),
                                    vue.createElementVNode(
                                      "ul",
                                      {
                                        style: vue.normalizeStyle({
                                          transform: `translateY(${offsetTop.value}px)`,
                                          position: "absolute",
                                          top: 0,
                                          left: 0,
                                          width: "100%"
                                        })
                                      },
                                      [
                                        (vue.openBlock(true), vue.createElementBlock(
                                          vue.Fragment,
                                          null,
                                          vue.renderList(visibleData.value, (item) => {
                                            return vue.openBlock(), vue.createElementBlock("li", {
                                              key: item.index,
                                              class: vue.normalizeClass([
                                                vue.unref(bem).m("select-item"),
                                                value.value.indexOf(item.value) >= 0 && item.value ? vue.unref(bem).m("select-check") : ""
                                              ]),
                                              style: vue.normalizeStyle(
                                                item.isLoader ? "justify-content: center; margin: 0; width: 100%" : ""
                                              ),
                                              onClick: ($event) => !item.isLoader && handleClickFilter(item.value)
                                            }, [
                                              vue.createElementVNode(
                                                "span",
                                                {
                                                  class: vue.normalizeClass(vue.unref(bem).m("select-text"))
                                                },
                                                vue.toDisplayString(item.value),
                                                3
                                                /* TEXT, CLASS */
                                              ),
                                              vue.createVNode(_component_ll_icon, {
                                                "icon-name": "icon-check",
                                                color: "#1890FF"
                                              })
                                            ], 14, _hoisted_2);
                                          }),
                                          128
                                          /* KEYED_FRAGMENT */
                                        ))
                                      ],
                                      4
                                      /* STYLE */
                                    ),
                                    props.listLoading ? (vue.openBlock(), vue.createElementBlock(
                                      "li",
                                      {
                                        key: 0,
                                        class: vue.normalizeClass(vue.unref(bem).m("select-item")),
                                        style: { "justify-content": "center", "margin": "0", "width": "100%" }
                                      },
                                      [
                                        vue.createVNode(_component_a_spin)
                                      ],
                                      2
                                      /* CLASS */
                                    )) : vue.createCommentVNode("v-if", true)
                                  ],
                                  34
                                  /* CLASS, NEED_HYDRATION */
                                )) : (vue.openBlock(), vue.createElementBlock(
                                  "ul",
                                  {
                                    key: 1,
                                    ref_key: "selectBoxRef",
                                    ref: selectBoxRef,
                                    class: vue.normalizeClass([
                                      vue.unref(bem).m("select-box"),
                                      !scrollbarVisible.value ? vue.unref(bem).is("scrollbar-hidden") : ""
                                    ]),
                                    onScroll: handleScroll,
                                    onMouseenter: handleMouseEnterList,
                                    onMouseleave: handleMouseLeaveList
                                  },
                                  [
                                    (vue.openBlock(true), vue.createElementBlock(
                                      vue.Fragment,
                                      null,
                                      vue.renderList(filterOptionsValue.value, (item, i) => {
                                        return vue.openBlock(), vue.createElementBlock("li", {
                                          key: i,
                                          class: vue.normalizeClass([
                                            vue.unref(bem).m("select-item"),
                                            value.value.indexOf(item) >= 0 && item ? vue.unref(bem).m("select-check") : ""
                                          ]),
                                          onClick: ($event) => handleClickFilter(item)
                                        }, [
                                          vue.createElementVNode(
                                            "span",
                                            {
                                              class: vue.normalizeClass(vue.unref(bem).m("select-text"))
                                            },
                                            vue.toDisplayString(item),
                                            3
                                            /* TEXT, CLASS */
                                          ),
                                          vue.createVNode(_component_ll_icon, {
                                            "icon-name": "icon-check",
                                            color: "#1890FF"
                                          })
                                        ], 10, _hoisted_3);
                                      }),
                                      128
                                      /* KEYED_FRAGMENT */
                                    )),
                                    props.listLoading ? (vue.openBlock(), vue.createElementBlock(
                                      "li",
                                      {
                                        key: 0,
                                        class: vue.normalizeClass(vue.unref(bem).m("select-item")),
                                        style: { "justify-content": "center", "margin": "0", "width": "100%" }
                                      },
                                      [
                                        vue.createVNode(_component_a_spin)
                                      ],
                                      2
                                      /* CLASS */
                                    )) : vue.createCommentVNode("v-if", true)
                                  ],
                                  34
                                  /* CLASS, NEED_HYDRATION */
                                ))
                              ],
                              6
                              /* CLASS, STYLE */
                            )) : (vue.openBlock(), vue.createElementBlock(
                              "div",
                              {
                                key: 1,
                                class: vue.normalizeClass(vue.unref(bem).e("empty"))
                              },
                              [
                                vue.createVNode(vue.unref(index.LlEmpty), {
                                  title: props.emptyText
                                }, null, 8, ["title"])
                              ],
                              2
                              /* CLASS */
                            ))
                          ],
                          38
                          /* CLASS, STYLE, NEED_HYDRATION */
                        )) : vue.createCommentVNode("v-if", true)
                      ]))
                    ],
                    2
                    /* CLASS */
                  )
                ],
                2
                /* CLASS */
              )
            ],
            2
            /* CLASS */
          )
        ]),
        _: 1
        /* STABLE */
      }, 8, ["spinning"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=tag-group.vue2.js.map
