import '@das-fed/upf-ui/packages/components/select-list/style.css';
import { withInstall as wi } from "@das-fed/upf-utils/with-install/index";
import { i18n as je, setI18nRule as Si } from "@das-fed/upf-web/packages/i18n/index";
import { ElInfiniteScroll as Ei } from "element-plus/es";
import "element-plus/es/components/base/style/css";
import "element-plus/es/components/infinite-scroll/style/css";
import { pushScopeId as Di, popScopeId as _i, nextTick as et, openBlock as A, createBlock as le, withScopeId as Ii, markRaw as Ti, shallowReactive as Oi, resolveComponent as Ci, resolveDirective as xi, withDirectives as Se, createElementBlock as W, normalizeClass as oe, renderSlot as he, createCommentVNode as G, resolveDynamicComponent as Rt, normalizeStyle as Jt, withCtx as tt, Fragment as Et, renderList as Dt, mergeProps as zi, toHandlers as Ai, createVNode as ki, ref as ke, computed as Pe, onMounted as Zt, onBeforeUnmount as Pi, watch as Ft, defineComponent as Ni, useCssVars as $i, createElementVNode as Oe, toDisplayString as Ce, unref as E, createTextVNode as Le } from "vue";
import { vDasTooltip as ut } from "@das-fed/upf-ui/packages/components/text-tooltip/index";
import { DasButton as Mi } from "@das-fed/upf-ui/packages/components/button/index";
import { vOverlay as Vi } from "@das-fed/upf-ui/packages/components/overlay/index";
import { DasIconClose2 as dt } from "@das-fed/upf-ui/packages/icons/close-2/index";
import { DasIconDrag as Ri } from "@das-fed/upf-ui/packages/icons/drag/index";
import { useModelValue as Qt } from "@das-fed/upf-utils/vue";
import { SizeWatcher as Fi } from "@das-fed/upf-utils/size-watcher";
import "@das-fed/upf-ui/packages/global/theme";
import "@das-fed/upf-ui/packages/global/style";
function Hi() {
  var t = window.navigator.userAgent, e = t.indexOf("MSIE ");
  if (e > 0)
    return parseInt(t.substring(e + 5, t.indexOf(".", e)), 10);
  var i = t.indexOf("Trident/");
  if (i > 0) {
    var n = t.indexOf("rv:");
    return parseInt(t.substring(n + 3, t.indexOf(".", n)), 10);
  }
  var r = t.indexOf("Edge/");
  return r > 0 ? parseInt(t.substring(r + 5, t.indexOf(".", r)), 10) : -1;
}
let Ke;
function _t() {
  _t.init || (_t.init = !0, Ke = Hi() !== -1);
}
var at = {
  name: "ResizeObserver",
  props: {
    emitOnMount: {
      type: Boolean,
      default: !1
    },
    ignoreWidth: {
      type: Boolean,
      default: !1
    },
    ignoreHeight: {
      type: Boolean,
      default: !1
    }
  },
  emits: [
    "notify"
  ],
  mounted() {
    _t(), et(() => {
      this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize();
    });
    const t = document.createElement("object");
    this._resizeObject = t, t.setAttribute("aria-hidden", "true"), t.setAttribute("tabindex", -1), t.onload = this.addResizeHandlers, t.type = "text/html", Ke && this.$el.appendChild(t), t.data = "about:blank", Ke || this.$el.appendChild(t);
  },
  beforeUnmount() {
    this.removeResizeHandlers();
  },
  methods: {
    compareAndNotify() {
      (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize());
    },
    emitSize() {
      this.$emit("notify", {
        width: this._w,
        height: this._h
      });
    },
    addResizeHandlers() {
      this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify();
    },
    removeResizeHandlers() {
      this._resizeObject && this._resizeObject.onload && (!Ke && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null);
    }
  }
};
const Li = /* @__PURE__ */ Ii("data-v-b329ee4c");
Di("data-v-b329ee4c");
const Bi = {
  class: "resize-observer",
  tabindex: "-1"
};
_i();
const Yi = /* @__PURE__ */ Li((t, e, i, n, r, o) => (A(), le("div", Bi)));
at.render = Yi;
at.__scopeId = "data-v-b329ee4c";
at.__file = "src/components/ResizeObserver.vue";
function Ge(t) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ge = function(e) {
    return typeof e;
  } : Ge = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ge(t);
}
function Xi(t, e) {
  if (!(t instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Wi(t, e) {
  for (var i = 0; i < e.length; i++) {
    var n = e[i];
    n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
  }
}
function ji(t, e, i) {
  return Wi(t.prototype, e), t;
}
function Ht(t) {
  return Ki(t) || Gi(t) || Ui(t) || qi();
}
function Ki(t) {
  if (Array.isArray(t)) return It(t);
}
function Gi(t) {
  if (typeof Symbol < "u" && Symbol.iterator in Object(t)) return Array.from(t);
}
function Ui(t, e) {
  if (t) {
    if (typeof t == "string") return It(t, e);
    var i = Object.prototype.toString.call(t).slice(8, -1);
    if (i === "Object" && t.constructor && (i = t.constructor.name), i === "Map" || i === "Set") return Array.from(t);
    if (i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return It(t, e);
  }
}
function It(t, e) {
  (e == null || e > t.length) && (e = t.length);
  for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
  return n;
}
function qi() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Ji(t) {
  var e;
  return typeof t == "function" ? e = {
    callback: t
  } : e = t, e;
}
function Zi(t, e) {
  var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, r, o, l = function(s) {
    for (var u = arguments.length, d = new Array(u > 1 ? u - 1 : 0), c = 1; c < u; c++)
      d[c - 1] = arguments[c];
    if (o = d, !(n && s === r)) {
      var p = i.leading;
      typeof p == "function" && (p = p(s, r)), (!n || s !== r) && p && t.apply(void 0, [s].concat(Ht(o))), r = s, clearTimeout(n), n = setTimeout(function() {
        t.apply(void 0, [s].concat(Ht(o))), n = 0;
      }, e);
    }
  };
  return l._clear = function() {
    clearTimeout(n), n = null;
  }, l;
}
function ei(t, e) {
  if (t === e) return !0;
  if (Ge(t) === "object") {
    for (var i in t)
      if (!ei(t[i], e[i]))
        return !1;
    return !0;
  }
  return !1;
}
var Qi = /* @__PURE__ */ function() {
  function t(e, i, n) {
    Xi(this, t), this.el = e, this.observer = null, this.frozen = !1, this.createObserver(i, n);
  }
  return ji(t, [{
    key: "createObserver",
    value: function(i, n) {
      var r = this;
      if (this.observer && this.destroyObserver(), !this.frozen) {
        if (this.options = Ji(i), this.callback = function(a, s) {
          r.options.callback(a, s), a && r.options.once && (r.frozen = !0, r.destroyObserver());
        }, this.callback && this.options.throttle) {
          var o = this.options.throttleOptions || {}, l = o.leading;
          this.callback = Zi(this.callback, this.options.throttle, {
            leading: function(s) {
              return l === "both" || l === "visible" && s || l === "hidden" && !s;
            }
          });
        }
        this.oldResult = void 0, this.observer = new IntersectionObserver(function(a) {
          var s = a[0];
          if (a.length > 1) {
            var u = a.find(function(c) {
              return c.isIntersecting;
            });
            u && (s = u);
          }
          if (r.callback) {
            var d = s.isIntersecting && s.intersectionRatio >= r.threshold;
            if (d === r.oldResult) return;
            r.oldResult = d, r.callback(d, s);
          }
        }, this.options.intersection), et(function() {
          r.observer && r.observer.observe(r.el);
        });
      }
    }
  }, {
    key: "destroyObserver",
    value: function() {
      this.observer && (this.observer.disconnect(), this.observer = null), this.callback && this.callback._clear && (this.callback._clear(), this.callback = null);
    }
  }, {
    key: "threshold",
    get: function() {
      return this.options.intersection && typeof this.options.intersection.threshold == "number" ? this.options.intersection.threshold : 0;
    }
  }]), t;
}();
function ti(t, e, i) {
  var n = e.value;
  if (n && !(typeof IntersectionObserver > "u")) {
    var r = new Qi(t, n, i);
    t._vue_visibilityState = r;
  }
}
function en(t, e, i) {
  var n = e.value, r = e.oldValue;
  if (!ei(n, r)) {
    var o = t._vue_visibilityState;
    if (!n) {
      ii(t);
      return;
    }
    o ? o.createObserver(n, i) : ti(t, {
      value: n
    }, i);
  }
}
function ii(t) {
  var e = t._vue_visibilityState;
  e && (e.destroyObserver(), delete t._vue_visibilityState);
}
var tn = {
  beforeMount: ti,
  updated: en,
  unmounted: ii
}, nn = {
  itemsLimit: 1e3
}, rn = /(auto|scroll)/;
function ni(t, e) {
  return t.parentNode === null ? e : ni(t.parentNode, e.concat([t]));
}
var ct = function(e, i) {
  return getComputedStyle(e, null).getPropertyValue(i);
}, on = function(e) {
  return ct(e, "overflow") + ct(e, "overflow-y") + ct(e, "overflow-x");
}, ln = function(e) {
  return rn.test(on(e));
};
function Lt(t) {
  if (t instanceof HTMLElement || t instanceof SVGElement) {
    for (var e = ni(t.parentNode, []), i = 0; i < e.length; i += 1)
      if (ln(e[i]))
        return e[i];
    return document.scrollingElement || document.documentElement;
  }
}
function Tt(t) {
  "@babel/helpers - typeof";
  return Tt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Tt(t);
}
var an = {
  items: {
    type: Array,
    required: !0
  },
  keyField: {
    type: String,
    default: "id"
  },
  direction: {
    type: String,
    default: "vertical",
    validator: function(e) {
      return ["vertical", "horizontal"].includes(e);
    }
  },
  listTag: {
    type: String,
    default: "div"
  },
  itemTag: {
    type: String,
    default: "div"
  }
};
function sn() {
  return this.items.length && Tt(this.items[0]) !== "object";
}
var Ot = !1;
if (typeof window < "u") {
  Ot = !1;
  try {
    var un = Object.defineProperty({}, "passive", {
      get: function() {
        Ot = !0;
      }
    });
    window.addEventListener("test", null, un);
  } catch {
  }
}
let dn = 0;
var kt = {
  name: "RecycleScroller",
  components: {
    ResizeObserver: at
  },
  directives: {
    ObserveVisibility: tn
  },
  props: {
    ...an,
    itemSize: {
      type: Number,
      default: null
    },
    gridItems: {
      type: Number,
      default: void 0
    },
    itemSecondarySize: {
      type: Number,
      default: void 0
    },
    minItemSize: {
      type: [Number, String],
      default: null
    },
    sizeField: {
      type: String,
      default: "size"
    },
    typeField: {
      type: String,
      default: "type"
    },
    buffer: {
      type: Number,
      default: 200
    },
    pageMode: {
      type: Boolean,
      default: !1
    },
    prerender: {
      type: Number,
      default: 0
    },
    emitUpdate: {
      type: Boolean,
      default: !1
    },
    updateInterval: {
      type: Number,
      default: 0
    },
    skipHover: {
      type: Boolean,
      default: !1
    },
    listTag: {
      type: String,
      default: "div"
    },
    itemTag: {
      type: String,
      default: "div"
    },
    listClass: {
      type: [String, Object, Array],
      default: ""
    },
    itemClass: {
      type: [String, Object, Array],
      default: ""
    }
  },
  emits: [
    "resize",
    "visible",
    "hidden",
    "update",
    "scroll-start",
    "scroll-end"
  ],
  data() {
    return {
      pool: [],
      totalSize: 0,
      ready: !1,
      hoverKey: null
    };
  },
  computed: {
    sizes() {
      if (this.itemSize === null) {
        const t = {
          "-1": { accumulator: 0 }
        }, e = this.items, i = this.sizeField, n = this.minItemSize;
        let r = 1e4, o = 0, l;
        for (let a = 0, s = e.length; a < s; a++)
          l = e[a][i] || n, l < r && (r = l), o += l, t[a] = { accumulator: o, size: l };
        return this.$_computedMinItemSize = r, t;
      }
      return [];
    },
    simpleArray: sn,
    itemIndexByKey() {
      const { keyField: t, items: e } = this, i = {};
      for (let n = 0, r = e.length; n < r; n++)
        i[e[n][t]] = n;
      return i;
    }
  },
  watch: {
    items() {
      this.updateVisibleItems(!0);
    },
    pageMode() {
      this.applyPageMode(), this.updateVisibleItems(!1);
    },
    sizes: {
      handler() {
        this.updateVisibleItems(!1);
      },
      deep: !0
    },
    gridItems() {
      this.updateVisibleItems(!0);
    },
    itemSecondarySize() {
      this.updateVisibleItems(!0);
    }
  },
  created() {
    this.$_startIndex = 0, this.$_endIndex = 0, this.$_views = /* @__PURE__ */ new Map(), this.$_unusedViews = /* @__PURE__ */ new Map(), this.$_scrollDirty = !1, this.$_lastUpdateScrollPosition = 0, this.prerender && (this.$_prerender = !0, this.updateVisibleItems(!1)), this.gridItems && this.itemSize;
  },
  mounted() {
    this.applyPageMode(), this.$nextTick(() => {
      this.$_prerender = !1, this.updateVisibleItems(!0), this.ready = !0;
    });
  },
  activated() {
    const t = this.$_lastUpdateScrollPosition;
    typeof t == "number" && this.$nextTick(() => {
      this.scrollToPosition(t);
    });
  },
  beforeUnmount() {
    this.removeListeners();
  },
  methods: {
    addView(t, e, i, n, r) {
      const o = Ti({
        id: dn++,
        index: e,
        used: !0,
        key: n,
        type: r
      }), l = Oi({
        item: i,
        position: 0,
        nr: o
      });
      return t.push(l), l;
    },
    unuseView(t, e = !1) {
      const i = this.$_unusedViews, n = t.nr.type;
      let r = i.get(n);
      r || (r = [], i.set(n, r)), r.push(t), e || (t.nr.used = !1, t.position = -9999);
    },
    handleResize() {
      this.$emit("resize"), this.ready && this.updateVisibleItems(!1);
    },
    handleScroll(t) {
      if (!this.$_scrollDirty) {
        if (this.$_scrollDirty = !0, this.$_updateTimeout) return;
        const e = () => requestAnimationFrame(() => {
          this.$_scrollDirty = !1;
          const { continuous: i } = this.updateVisibleItems(!1, !0);
          i || (clearTimeout(this.$_refreshTimout), this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100));
        });
        e(), this.updateInterval && (this.$_updateTimeout = setTimeout(() => {
          this.$_updateTimeout = 0, this.$_scrollDirty && e();
        }, this.updateInterval));
      }
    },
    handleVisibilityChange(t, e) {
      this.ready && (t || e.boundingClientRect.width !== 0 || e.boundingClientRect.height !== 0 ? (this.$emit("visible"), requestAnimationFrame(() => {
        this.updateVisibleItems(!1);
      })) : this.$emit("hidden"));
    },
    updateVisibleItems(t, e = !1) {
      const i = this.itemSize, n = this.gridItems || 1, r = this.itemSecondarySize || i, o = this.$_computedMinItemSize, l = this.typeField, a = this.simpleArray ? null : this.keyField, s = this.items, u = s.length, d = this.sizes, c = this.$_views, p = this.$_unusedViews, D = this.pool, S = this.itemIndexByKey;
      let g, _, V, C, m;
      if (!u)
        g = _ = C = m = V = 0;
      else if (this.$_prerender)
        g = C = 0, _ = m = Math.min(this.prerender, s.length), V = null;
      else {
        const I = this.getScroll();
        if (e) {
          let z = I.start - this.$_lastUpdateScrollPosition;
          if (z < 0 && (z = -z), i === null && z < o || z < i)
            return {
              continuous: !0
            };
        }
        this.$_lastUpdateScrollPosition = I.start;
        const R = this.buffer;
        I.start -= R, I.end += R;
        let P = 0;
        if (this.$refs.before && (P = this.$refs.before.scrollHeight, I.start -= P), this.$refs.after) {
          const z = this.$refs.after.scrollHeight;
          I.end += z;
        }
        if (i === null) {
          let z, J = 0, de = u - 1, F = ~~(u / 2), pe;
          do
            pe = F, z = d[F].accumulator, z < I.start ? J = F : F < u - 1 && d[F + 1].accumulator > I.start && (de = F), F = ~~((J + de) / 2);
          while (F !== pe);
          for (F < 0 && (F = 0), g = F, V = d[u - 1].accumulator, _ = F; _ < u && d[_].accumulator < I.end; _++) ;
          for (_ === -1 ? _ = s.length - 1 : (_++, _ > u && (_ = u)), C = g; C < u && P + d[C].accumulator < I.start; C++) ;
          for (m = C; m < u && P + d[m].accumulator < I.end; m++) ;
        } else {
          g = ~~(I.start / i * n);
          const z = g % n;
          g -= z, _ = Math.ceil(I.end / i * n), C = Math.max(0, Math.floor((I.start - P) / i * n)), m = Math.floor((I.end - P) / i * n), g < 0 && (g = 0), _ > u && (_ = u), C < 0 && (C = 0), m > u && (m = u), V = Math.ceil(u / n) * i;
        }
      }
      _ - g > nn.itemsLimit && this.itemsLimitError(), this.totalSize = V;
      let h;
      const x = g <= this.$_endIndex && _ >= this.$_startIndex;
      if (x)
        for (let I = 0, R = D.length; I < R; I++)
          h = D[I], h.nr.used && (t && (h.nr.index = S[h.item[a]]), (h.nr.index == null || h.nr.index < g || h.nr.index >= _) && this.unuseView(h));
      const Y = x ? null : /* @__PURE__ */ new Map();
      let v, B, $;
      for (let I = g; I < _; I++) {
        v = s[I];
        const R = a ? v[a] : v;
        if (R == null)
          throw new Error(`Key is ${R} on item (keyField is '${a}')`);
        if (h = c.get(R), !i && !d[I].size) {
          h && this.unuseView(h);
          continue;
        }
        B = v[l];
        let P = p.get(B), z = !1;
        if (!h)
          x ? P && P.length ? h = P.pop() : h = this.addView(D, I, v, R, B) : ($ = Y.get(B) || 0, (!P || $ >= P.length) && (h = this.addView(D, I, v, R, B), this.unuseView(h, !0), P = p.get(B)), h = P[$], Y.set(B, $ + 1)), c.delete(h.nr.key), h.nr.used = !0, h.nr.index = I, h.nr.key = R, h.nr.type = B, c.set(R, h), z = !0;
        else if (!h.nr.used && (h.nr.used = !0, z = !0, P)) {
          const J = P.indexOf(h);
          J !== -1 && P.splice(J, 1);
        }
        h.item = v, z && (I === s.length - 1 && this.$emit("scroll-end"), I === 0 && this.$emit("scroll-start")), i === null ? (h.position = d[I - 1].accumulator, h.offset = 0) : (h.position = Math.floor(I / n) * i, h.offset = I % n * r);
      }
      return this.$_startIndex = g, this.$_endIndex = _, this.emitUpdate && this.$emit("update", g, _, C, m), clearTimeout(this.$_sortTimer), this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300), {
        continuous: x
      };
    },
    getListenerTarget() {
      let t = Lt(this.$el);
      return window.document && (t === window.document.documentElement || t === window.document.body) && (t = window), t;
    },
    getScroll() {
      const { $el: t, direction: e } = this, i = e === "vertical";
      let n;
      if (this.pageMode) {
        const r = t.getBoundingClientRect(), o = i ? r.height : r.width;
        let l = -(i ? r.top : r.left), a = i ? window.innerHeight : window.innerWidth;
        l < 0 && (a += l, l = 0), l + a > o && (a = o - l), n = {
          start: l,
          end: l + a
        };
      } else i ? n = {
        start: t.scrollTop,
        end: t.scrollTop + t.clientHeight
      } : n = {
        start: t.scrollLeft,
        end: t.scrollLeft + t.clientWidth
      };
      return n;
    },
    applyPageMode() {
      this.pageMode ? this.addListeners() : this.removeListeners();
    },
    addListeners() {
      this.listenerTarget = this.getListenerTarget(), this.listenerTarget.addEventListener("scroll", this.handleScroll, Ot ? {
        passive: !0
      } : !1), this.listenerTarget.addEventListener("resize", this.handleResize);
    },
    removeListeners() {
      this.listenerTarget && (this.listenerTarget.removeEventListener("scroll", this.handleScroll), this.listenerTarget.removeEventListener("resize", this.handleResize), this.listenerTarget = null);
    },
    scrollToItem(t) {
      let e;
      const i = this.gridItems || 1;
      this.itemSize === null ? e = t > 0 ? this.sizes[t - 1].accumulator : 0 : e = Math.floor(t / i) * this.itemSize, this.scrollToPosition(e);
    },
    scrollToPosition(t) {
      const e = this.direction === "vertical" ? { scroll: "scrollTop", start: "top" } : { scroll: "scrollLeft", start: "left" };
      let i, n, r;
      if (this.pageMode) {
        const o = Lt(this.$el), l = o.tagName === "HTML" ? 0 : o[e.scroll], a = o.getBoundingClientRect(), u = this.$el.getBoundingClientRect()[e.start] - a[e.start];
        i = o, n = e.scroll, r = t + l + u;
      } else
        i = this.$el, n = e.scroll, r = t;
      i[n] = r;
    },
    itemsLimitError() {
      throw setTimeout(() => {
      }), new Error("Rendered items limit reached");
    },
    sortViews() {
      this.pool.sort((t, e) => t.nr.index - e.nr.index);
    }
  }
};
const cn = {
  key: 0,
  ref: "before",
  class: "vue-recycle-scroller__slot"
}, fn = {
  key: 1,
  ref: "after",
  class: "vue-recycle-scroller__slot"
};
function hn(t, e, i, n, r, o) {
  const l = Ci("ResizeObserver"), a = xi("observe-visibility");
  return Se((A(), W(
    "div",
    {
      class: oe(["vue-recycle-scroller", {
        ready: r.ready,
        "page-mode": i.pageMode,
        [`direction-${t.direction}`]: !0
      }]),
      onScrollPassive: e[0] || (e[0] = (...s) => o.handleScroll && o.handleScroll(...s))
    },
    [
      t.$slots.before ? (A(), W(
        "div",
        cn,
        [
          he(t.$slots, "before")
        ],
        512
        /* NEED_PATCH */
      )) : G("v-if", !0),
      (A(), le(Rt(i.listTag), {
        ref: "wrapper",
        style: Jt({ [t.direction === "vertical" ? "minHeight" : "minWidth"]: r.totalSize + "px" }),
        class: oe(["vue-recycle-scroller__item-wrapper", i.listClass])
      }, {
        default: tt(() => [
          (A(!0), W(
            Et,
            null,
            Dt(r.pool, (s) => (A(), le(Rt(i.itemTag), zi({
              key: s.nr.id,
              style: r.ready ? {
                transform: `translate${t.direction === "vertical" ? "Y" : "X"}(${s.position}px) translate${t.direction === "vertical" ? "X" : "Y"}(${s.offset}px)`,
                width: i.gridItems ? `${t.direction === "vertical" && i.itemSecondarySize || i.itemSize}px` : void 0,
                height: i.gridItems ? `${t.direction === "horizontal" && i.itemSecondarySize || i.itemSize}px` : void 0
              } : null,
              class: ["vue-recycle-scroller__item-view", [
                i.itemClass,
                {
                  hover: !i.skipHover && r.hoverKey === s.nr.key
                }
              ]]
            }, Ai(i.skipHover ? {} : {
              mouseenter: () => {
                r.hoverKey = s.nr.key;
              },
              mouseleave: () => {
                r.hoverKey = null;
              }
            })), {
              default: tt(() => [
                he(t.$slots, "default", {
                  item: s.item,
                  index: s.nr.index,
                  active: s.nr.used
                })
              ]),
              _: 2
              /* DYNAMIC */
            }, 1040, ["style", "class"]))),
            128
            /* KEYED_FRAGMENT */
          )),
          he(t.$slots, "empty")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["style", "class"])),
      t.$slots.after ? (A(), W(
        "div",
        fn,
        [
          he(t.$slots, "after")
        ],
        512
        /* NEED_PATCH */
      )) : G("v-if", !0),
      ki(l, { onNotify: o.handleResize }, null, 8, ["onNotify"])
    ],
    34
    /* CLASS, HYDRATE_EVENTS */
  )), [
    [a, o.handleVisibilityChange]
  ]);
}
kt.render = hn;
kt.__file = "src/components/RecycleScroller.vue";
const mn = (t, e) => {
  const i = ke(), n = ke(), r = Qt(t, "modelValue"), o = t.valueKey, l = Pe(() => t.selectedNum ? t.selectedNum : `${t.customTitle || je("das-select-list-selected").value}${je("das-select-list-parentheses-left").value}${r.value.length}${je("das-select-list-parentheses-right").value}`), a = Pe(() => ({
    disabled: "disabled",
    disableDrag: "disableDrag",
    disableDelete: "disableDelete",
    ...t.props
  })), s = (m) => {
    let h = !1;
    return typeof a.value.disabled == "string" ? h = m[a.value.disabled] : h = a.value.disabled(m) ?? !1, h;
  }, u = (m) => {
    let h = !1;
    return typeof a.value.disableDrag == "string" ? h = m[a.value.disableDrag] : h = a.value.disableDrag(m) ?? !1, h;
  }, d = (m) => {
    let h = !1;
    return typeof a.value.disableDelete == "string" ? h = m[a.value.disableDelete] : h = a.value.disableDelete(m) ?? !1, h;
  }, c = Pe({
    get: () => t.selectdValue,
    set: (m) => {
      e("update:selectdValue", m);
    }
  }), p = (m) => {
    t.isView || s(m) || (c.value = m[o], e("select-item", m));
  }, D = (m) => {
    const h = r.value.filter((x) => x[o] !== m[o]);
    e("item-remove", m), e("update:modelValue", h);
  }, S = () => {
    const m = r.value.filter((x) => !s(x)), h = r.value.filter((x) => s(x));
    e("remove-all", m), e("update:modelValue", h);
  }, g = () => {
    t.infiniteScroll && t.infiniteScroll().then((m) => {
      if (m && m.length) {
        let h = [];
        h = m, h = h.filter(
          (Y) => !r.value.map((v) => v[t.valueKey]).includes(Y[t.valueKey])
        );
        const x = r.value.concat(h);
        e("update:modelValue", x);
      }
    });
  };
  let _ = 0;
  const V = (m) => {
    var x;
    const h = ((x = n.value) == null ? void 0 : x.offsetHeight) || 0;
    _ !== 0 && m === 0 && g(), _ = m, m !== 0 && m - h < 10 && g();
  }, C = ke();
  return Zt(() => {
    var h;
    if (t.infiniteDisabled) return;
    const m = (h = n.value) == null ? void 0 : h.querySelector(".selected-group");
    C.value = Fi((x) => {
      V(x.height);
    }, m);
  }), Pi(() => {
    var m;
    (m = C.value) == null || m.disconnect();
  }), {
    selectListRef: i,
    $list: n,
    disabledFlag: s,
    disabledDrag: u,
    disableDelete: d,
    itemGroups: r,
    selectedLabel: l,
    itemRemove: D,
    removeAll: S,
    innerSelectdValue: c,
    selectItem: p,
    infiniteLoad: g
  };
};
/**!
 * Sortable 1.15.6
 * @author	RubaXa   <trash@rubaxa.org>
 * @author	owenm    <owen23355@gmail.com>
 * @license MIT
 */
function Bt(t, e) {
  var i = Object.keys(t);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(t);
    e && (n = n.filter(function(r) {
      return Object.getOwnPropertyDescriptor(t, r).enumerable;
    })), i.push.apply(i, n);
  }
  return i;
}
function re(t) {
  for (var e = 1; e < arguments.length; e++) {
    var i = arguments[e] != null ? arguments[e] : {};
    e % 2 ? Bt(Object(i), !0).forEach(function(n) {
      pn(t, n, i[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Bt(Object(i)).forEach(function(n) {
      Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(i, n));
    });
  }
  return t;
}
function Ue(t) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ue = function(e) {
    return typeof e;
  } : Ue = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ue(t);
}
function pn(t, e, i) {
  return e in t ? Object.defineProperty(t, e, {
    value: i,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : t[e] = i, t;
}
function se() {
  return se = Object.assign || function(t) {
    for (var e = 1; e < arguments.length; e++) {
      var i = arguments[e];
      for (var n in i)
        Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
    }
    return t;
  }, se.apply(this, arguments);
}
function gn(t, e) {
  if (t == null) return {};
  var i = {}, n = Object.keys(t), r, o;
  for (o = 0; o < n.length; o++)
    r = n[o], !(e.indexOf(r) >= 0) && (i[r] = t[r]);
  return i;
}
function vn(t, e) {
  if (t == null) return {};
  var i = gn(t, e), n, r;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(t);
    for (r = 0; r < o.length; r++)
      n = o[r], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (i[n] = t[n]);
  }
  return i;
}
var bn = "1.15.6";
function ae(t) {
  if (typeof window < "u" && window.navigator)
    return !!/* @__PURE__ */ navigator.userAgent.match(t);
}
var ue = ae(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Fe = ae(/Edge/i), Yt = ae(/firefox/i), Ne = ae(/safari/i) && !ae(/chrome/i) && !ae(/android/i), Pt = ae(/iP(ad|od|hone)/i), ri = ae(/chrome/i) && ae(/android/i), oi = {
  capture: !1,
  passive: !1
};
function O(t, e, i) {
  t.addEventListener(e, i, !ue && oi);
}
function T(t, e, i) {
  t.removeEventListener(e, i, !ue && oi);
}
function it(t, e) {
  if (e) {
    if (e[0] === ">" && (e = e.substring(1)), t)
      try {
        if (t.matches)
          return t.matches(e);
        if (t.msMatchesSelector)
          return t.msMatchesSelector(e);
        if (t.webkitMatchesSelector)
          return t.webkitMatchesSelector(e);
      } catch {
        return !1;
      }
    return !1;
  }
}
function li(t) {
  return t.host && t !== document && t.host.nodeType ? t.host : t.parentNode;
}
function ie(t, e, i, n) {
  if (t) {
    i = i || document;
    do {
      if (e != null && (e[0] === ">" ? t.parentNode === i && it(t, e) : it(t, e)) || n && t === i)
        return t;
      if (t === i) break;
    } while (t = li(t));
  }
  return null;
}
var Xt = /\s+/g;
function Z(t, e, i) {
  if (t && e)
    if (t.classList)
      t.classList[i ? "add" : "remove"](e);
    else {
      var n = (" " + t.className + " ").replace(Xt, " ").replace(" " + e + " ", " ");
      t.className = (n + (i ? " " + e : "")).replace(Xt, " ");
    }
}
function b(t, e, i) {
  var n = t && t.style;
  if (n) {
    if (i === void 0)
      return document.defaultView && document.defaultView.getComputedStyle ? i = document.defaultView.getComputedStyle(t, "") : t.currentStyle && (i = t.currentStyle), e === void 0 ? i : i[e];
    !(e in n) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), n[e] = i + (typeof i == "string" ? "" : "px");
  }
}
function _e(t, e) {
  var i = "";
  if (typeof t == "string")
    i = t;
  else
    do {
      var n = b(t, "transform");
      n && n !== "none" && (i = n + " " + i);
    } while (!e && (t = t.parentNode));
  var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  return r && new r(i);
}
function ai(t, e, i) {
  if (t) {
    var n = t.getElementsByTagName(e), r = 0, o = n.length;
    if (i)
      for (; r < o; r++)
        i(n[r], r);
    return n;
  }
  return [];
}
function ne() {
  var t = document.scrollingElement;
  return t || document.documentElement;
}
function L(t, e, i, n, r) {
  if (!(!t.getBoundingClientRect && t !== window)) {
    var o, l, a, s, u, d, c;
    if (t !== window && t.parentNode && t !== ne() ? (o = t.getBoundingClientRect(), l = o.top, a = o.left, s = o.bottom, u = o.right, d = o.height, c = o.width) : (l = 0, a = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, c = window.innerWidth), (e || i) && t !== window && (r = r || t.parentNode, !ue))
      do
        if (r && r.getBoundingClientRect && (b(r, "transform") !== "none" || i && b(r, "position") !== "static")) {
          var p = r.getBoundingClientRect();
          l -= p.top + parseInt(b(r, "border-top-width")), a -= p.left + parseInt(b(r, "border-left-width")), s = l + o.height, u = a + o.width;
          break;
        }
      while (r = r.parentNode);
    if (n && t !== window) {
      var D = _e(r || t), S = D && D.a, g = D && D.d;
      D && (l /= g, a /= S, c /= S, d /= g, s = l + d, u = a + c);
    }
    return {
      top: l,
      left: a,
      bottom: s,
      right: u,
      width: c,
      height: d
    };
  }
}
function Wt(t, e, i) {
  for (var n = me(t, !0), r = L(t)[e]; n; ) {
    var o = L(n)[i], l = void 0;
    if (l = r >= o, !l) return n;
    if (n === ne()) break;
    n = me(n, !1);
  }
  return !1;
}
function Ie(t, e, i, n) {
  for (var r = 0, o = 0, l = t.children; o < l.length; ) {
    if (l[o].style.display !== "none" && l[o] !== y.ghost && (n || l[o] !== y.dragged) && ie(l[o], i.draggable, t, !1)) {
      if (r === e)
        return l[o];
      r++;
    }
    o++;
  }
  return null;
}
function Nt(t, e) {
  for (var i = t.lastElementChild; i && (i === y.ghost || b(i, "display") === "none" || e && !it(i, e)); )
    i = i.previousElementSibling;
  return i || null;
}
function ee(t, e) {
  var i = 0;
  if (!t || !t.parentNode)
    return -1;
  for (; t = t.previousElementSibling; )
    t.nodeName.toUpperCase() !== "TEMPLATE" && t !== y.clone && (!e || it(t, e)) && i++;
  return i;
}
function jt(t) {
  var e = 0, i = 0, n = ne();
  if (t)
    do {
      var r = _e(t), o = r.a, l = r.d;
      e += t.scrollLeft * o, i += t.scrollTop * l;
    } while (t !== n && (t = t.parentNode));
  return [e, i];
}
function yn(t, e) {
  for (var i in t)
    if (t.hasOwnProperty(i)) {
      for (var n in e)
        if (e.hasOwnProperty(n) && e[n] === t[i][n]) return Number(i);
    }
  return -1;
}
function me(t, e) {
  if (!t || !t.getBoundingClientRect) return ne();
  var i = t, n = !1;
  do
    if (i.clientWidth < i.scrollWidth || i.clientHeight < i.scrollHeight) {
      var r = b(i);
      if (i.clientWidth < i.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || i.clientHeight < i.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
        if (!i.getBoundingClientRect || i === document.body) return ne();
        if (n || e) return i;
        n = !0;
      }
    }
  while (i = i.parentNode);
  return ne();
}
function wn(t, e) {
  if (t && e)
    for (var i in e)
      e.hasOwnProperty(i) && (t[i] = e[i]);
  return t;
}
function ft(t, e) {
  return Math.round(t.top) === Math.round(e.top) && Math.round(t.left) === Math.round(e.left) && Math.round(t.height) === Math.round(e.height) && Math.round(t.width) === Math.round(e.width);
}
var $e;
function si(t, e) {
  return function() {
    if (!$e) {
      var i = arguments, n = this;
      i.length === 1 ? t.call(n, i[0]) : t.apply(n, i), $e = setTimeout(function() {
        $e = void 0;
      }, e);
    }
  };
}
function Sn() {
  clearTimeout($e), $e = void 0;
}
function ui(t, e, i) {
  t.scrollLeft += e, t.scrollTop += i;
}
function di(t) {
  var e = window.Polymer, i = window.jQuery || window.Zepto;
  return e && e.dom ? e.dom(t).cloneNode(!0) : i ? i(t).clone(!0)[0] : t.cloneNode(!0);
}
function ci(t, e, i) {
  var n = {};
  return Array.from(t.children).forEach(function(r) {
    var o, l, a, s;
    if (!(!ie(r, e.draggable, t, !1) || r.animated || r === i)) {
      var u = L(r);
      n.left = Math.min((o = n.left) !== null && o !== void 0 ? o : 1 / 0, u.left), n.top = Math.min((l = n.top) !== null && l !== void 0 ? l : 1 / 0, u.top), n.right = Math.max((a = n.right) !== null && a !== void 0 ? a : -1 / 0, u.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, u.bottom);
    }
  }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
}
var q = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function En() {
  var t = [], e;
  return {
    captureAnimationState: function() {
      if (t = [], !!this.options.animation) {
        var n = [].slice.call(this.el.children);
        n.forEach(function(r) {
          if (!(b(r, "display") === "none" || r === y.ghost)) {
            t.push({
              target: r,
              rect: L(r)
            });
            var o = re({}, t[t.length - 1].rect);
            if (r.thisAnimationDuration) {
              var l = _e(r, !0);
              l && (o.top -= l.f, o.left -= l.e);
            }
            r.fromRect = o;
          }
        });
      }
    },
    addAnimationState: function(n) {
      t.push(n);
    },
    removeAnimationState: function(n) {
      t.splice(yn(t, {
        target: n
      }), 1);
    },
    animateAll: function(n) {
      var r = this;
      if (!this.options.animation) {
        clearTimeout(e), typeof n == "function" && n();
        return;
      }
      var o = !1, l = 0;
      t.forEach(function(a) {
        var s = 0, u = a.target, d = u.fromRect, c = L(u), p = u.prevFromRect, D = u.prevToRect, S = a.rect, g = _e(u, !0);
        g && (c.top -= g.f, c.left -= g.e), u.toRect = c, u.thisAnimationDuration && ft(p, c) && !ft(d, c) && // Make sure animatingRect is on line between toRect & fromRect
        (S.top - c.top) / (S.left - c.left) === (d.top - c.top) / (d.left - c.left) && (s = _n(S, p, D, r.options)), ft(c, d) || (u.prevFromRect = d, u.prevToRect = c, s || (s = r.options.animation), r.animate(u, S, c, s)), s && (o = !0, l = Math.max(l, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
          u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
        }, s), u.thisAnimationDuration = s);
      }), clearTimeout(e), o ? e = setTimeout(function() {
        typeof n == "function" && n();
      }, l) : typeof n == "function" && n(), t = [];
    },
    animate: function(n, r, o, l) {
      if (l) {
        b(n, "transition", ""), b(n, "transform", "");
        var a = _e(this.el), s = a && a.a, u = a && a.d, d = (r.left - o.left) / (s || 1), c = (r.top - o.top) / (u || 1);
        n.animatingX = !!d, n.animatingY = !!c, b(n, "transform", "translate3d(" + d + "px," + c + "px,0)"), this.forRepaintDummy = Dn(n), b(n, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), b(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
          b(n, "transition", ""), b(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
        }, l);
      }
    }
  };
}
function Dn(t) {
  return t.offsetWidth;
}
function _n(t, e, i, n) {
  return Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) / Math.sqrt(Math.pow(e.top - i.top, 2) + Math.pow(e.left - i.left, 2)) * n.animation;
}
var ye = [], ht = {
  initializeByDefault: !0
}, He = {
  mount: function(e) {
    for (var i in ht)
      ht.hasOwnProperty(i) && !(i in e) && (e[i] = ht[i]);
    ye.forEach(function(n) {
      if (n.pluginName === e.pluginName)
        throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
    }), ye.push(e);
  },
  pluginEvent: function(e, i, n) {
    var r = this;
    this.eventCanceled = !1, n.cancel = function() {
      r.eventCanceled = !0;
    };
    var o = e + "Global";
    ye.forEach(function(l) {
      i[l.pluginName] && (i[l.pluginName][o] && i[l.pluginName][o](re({
        sortable: i
      }, n)), i.options[l.pluginName] && i[l.pluginName][e] && i[l.pluginName][e](re({
        sortable: i
      }, n)));
    });
  },
  initializePlugins: function(e, i, n, r) {
    ye.forEach(function(a) {
      var s = a.pluginName;
      if (!(!e.options[s] && !a.initializeByDefault)) {
        var u = new a(e, i, e.options);
        u.sortable = e, u.options = e.options, e[s] = u, se(n, u.defaults);
      }
    });
    for (var o in e.options)
      if (e.options.hasOwnProperty(o)) {
        var l = this.modifyOption(e, o, e.options[o]);
        typeof l < "u" && (e.options[o] = l);
      }
  },
  getEventProperties: function(e, i) {
    var n = {};
    return ye.forEach(function(r) {
      typeof r.eventProperties == "function" && se(n, r.eventProperties.call(i[r.pluginName], e));
    }), n;
  },
  modifyOption: function(e, i, n) {
    var r;
    return ye.forEach(function(o) {
      e[o.pluginName] && o.optionListeners && typeof o.optionListeners[i] == "function" && (r = o.optionListeners[i].call(e[o.pluginName], n));
    }), r;
  }
};
function In(t) {
  var e = t.sortable, i = t.rootEl, n = t.name, r = t.targetEl, o = t.cloneEl, l = t.toEl, a = t.fromEl, s = t.oldIndex, u = t.newIndex, d = t.oldDraggableIndex, c = t.newDraggableIndex, p = t.originalEvent, D = t.putSortable, S = t.extraEventProperties;
  if (e = e || i && i[q], !!e) {
    var g, _ = e.options, V = "on" + n.charAt(0).toUpperCase() + n.substr(1);
    window.CustomEvent && !ue && !Fe ? g = new CustomEvent(n, {
      bubbles: !0,
      cancelable: !0
    }) : (g = document.createEvent("Event"), g.initEvent(n, !0, !0)), g.to = l || i, g.from = a || i, g.item = r || i, g.clone = o, g.oldIndex = s, g.newIndex = u, g.oldDraggableIndex = d, g.newDraggableIndex = c, g.originalEvent = p, g.pullMode = D ? D.lastPutMode : void 0;
    var C = re(re({}, S), He.getEventProperties(n, e));
    for (var m in C)
      g[m] = C[m];
    i && i.dispatchEvent(g), _[V] && _[V].call(e, g);
  }
}
var Tn = ["evt"], U = function(e, i) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, o = vn(n, Tn);
  He.pluginEvent.bind(y)(e, i, re({
    dragEl: f,
    parentEl: M,
    ghostEl: w,
    rootEl: k,
    nextEl: be,
    lastDownEl: qe,
    cloneEl: N,
    cloneHidden: fe,
    dragStarted: xe,
    putSortable: X,
    activeSortable: y.active,
    originalEvent: r,
    oldIndex: De,
    oldDraggableIndex: Me,
    newIndex: Q,
    newDraggableIndex: ce,
    hideGhostForTarget: pi,
    unhideGhostForTarget: gi,
    cloneNowHidden: function() {
      fe = !0;
    },
    cloneNowShown: function() {
      fe = !1;
    },
    dispatchSortableEvent: function(a) {
      K({
        sortable: i,
        name: a,
        originalEvent: r
      });
    }
  }, o));
};
function K(t) {
  In(re({
    putSortable: X,
    cloneEl: N,
    targetEl: f,
    rootEl: k,
    oldIndex: De,
    oldDraggableIndex: Me,
    newIndex: Q,
    newDraggableIndex: ce
  }, t));
}
var f, M, w, k, be, qe, N, fe, De, Q, Me, ce, Be, X, Ee = !1, nt = !1, rt = [], ge, te, mt, pt, Kt, Gt, xe, we, Ve, Re = !1, Ye = !1, Je, j, gt = [], Ct = !1, ot = [], st = typeof document < "u", Xe = Pt, Ut = Fe || ue ? "cssFloat" : "float", On = st && !ri && !Pt && "draggable" in document.createElement("div"), fi = function() {
  if (st) {
    if (ue)
      return !1;
    var t = document.createElement("x");
    return t.style.cssText = "pointer-events:auto", t.style.pointerEvents === "auto";
  }
}(), hi = function(e, i) {
  var n = b(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), o = Ie(e, 0, i), l = Ie(e, 1, i), a = o && b(o), s = l && b(l), u = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + L(o).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + L(l).width;
  if (n.display === "flex")
    return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
  if (n.display === "grid")
    return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
  if (o && a.float && a.float !== "none") {
    var c = a.float === "left" ? "left" : "right";
    return l && (s.clear === "both" || s.clear === c) ? "vertical" : "horizontal";
  }
  return o && (a.display === "block" || a.display === "flex" || a.display === "table" || a.display === "grid" || u >= r && n[Ut] === "none" || l && n[Ut] === "none" && u + d > r) ? "vertical" : "horizontal";
}, Cn = function(e, i, n) {
  var r = n ? e.left : e.top, o = n ? e.right : e.bottom, l = n ? e.width : e.height, a = n ? i.left : i.top, s = n ? i.right : i.bottom, u = n ? i.width : i.height;
  return r === a || o === s || r + l / 2 === a + u / 2;
}, xn = function(e, i) {
  var n;
  return rt.some(function(r) {
    var o = r[q].options.emptyInsertThreshold;
    if (!(!o || Nt(r))) {
      var l = L(r), a = e >= l.left - o && e <= l.right + o, s = i >= l.top - o && i <= l.bottom + o;
      if (a && s)
        return n = r;
    }
  }), n;
}, mi = function(e) {
  function i(o, l) {
    return function(a, s, u, d) {
      var c = a.options.group.name && s.options.group.name && a.options.group.name === s.options.group.name;
      if (o == null && (l || c))
        return !0;
      if (o == null || o === !1)
        return !1;
      if (l && o === "clone")
        return o;
      if (typeof o == "function")
        return i(o(a, s, u, d), l)(a, s, u, d);
      var p = (l ? a : s).options.group.name;
      return o === !0 || typeof o == "string" && o === p || o.join && o.indexOf(p) > -1;
    };
  }
  var n = {}, r = e.group;
  (!r || Ue(r) != "object") && (r = {
    name: r
  }), n.name = r.name, n.checkPull = i(r.pull, !0), n.checkPut = i(r.put), n.revertClone = r.revertClone, e.group = n;
}, pi = function() {
  !fi && w && b(w, "display", "none");
}, gi = function() {
  !fi && w && b(w, "display", "");
};
st && !ri && document.addEventListener("click", function(t) {
  if (nt)
    return t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.stopImmediatePropagation && t.stopImmediatePropagation(), nt = !1, !1;
}, !0);
var ve = function(e) {
  if (f) {
    e = e.touches ? e.touches[0] : e;
    var i = xn(e.clientX, e.clientY);
    if (i) {
      var n = {};
      for (var r in e)
        e.hasOwnProperty(r) && (n[r] = e[r]);
      n.target = n.rootEl = i, n.preventDefault = void 0, n.stopPropagation = void 0, i[q]._onDragOver(n);
    }
  }
}, zn = function(e) {
  f && f.parentNode[q]._isOutsideThisEl(e.target);
};
function y(t, e) {
  if (!(t && t.nodeType && t.nodeType === 1))
    throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
  this.el = t, this.options = e = se({}, e), t[q] = this;
  var i = {
    group: null,
    sort: !0,
    disabled: !1,
    store: null,
    handle: null,
    draggable: /^[uo]l$/i.test(t.nodeName) ? ">li" : ">*",
    swapThreshold: 1,
    // percentage; 0 <= x <= 1
    invertSwap: !1,
    // invert always
    invertedSwapThreshold: null,
    // will be set to same as swapThreshold if default
    removeCloneOnHide: !0,
    direction: function() {
      return hi(t, this.options);
    },
    ghostClass: "sortable-ghost",
    chosenClass: "sortable-chosen",
    dragClass: "sortable-drag",
    ignore: "a, img",
    filter: null,
    preventOnFilter: !0,
    animation: 0,
    easing: null,
    setData: function(l, a) {
      l.setData("Text", a.textContent);
    },
    dropBubble: !1,
    dragoverBubble: !1,
    dataIdAttr: "data-id",
    delay: 0,
    delayOnTouchOnly: !1,
    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
    forceFallback: !1,
    fallbackClass: "sortable-fallback",
    fallbackOnBody: !1,
    fallbackTolerance: 0,
    fallbackOffset: {
      x: 0,
      y: 0
    },
    // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
    supportPointer: y.supportPointer !== !1 && "PointerEvent" in window && (!Ne || Pt),
    emptyInsertThreshold: 5
  };
  He.initializePlugins(this, t, i);
  for (var n in i)
    !(n in e) && (e[n] = i[n]);
  mi(e);
  for (var r in this)
    r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
  this.nativeDraggable = e.forceFallback ? !1 : On, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? O(t, "pointerdown", this._onTapStart) : (O(t, "mousedown", this._onTapStart), O(t, "touchstart", this._onTapStart)), this.nativeDraggable && (O(t, "dragover", this), O(t, "dragenter", this)), rt.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), se(this, En());
}
y.prototype = /** @lends Sortable.prototype */
{
  constructor: y,
  _isOutsideThisEl: function(e) {
    !this.el.contains(e) && e !== this.el && (we = null);
  },
  _getDirection: function(e, i) {
    return typeof this.options.direction == "function" ? this.options.direction.call(this, e, i, f) : this.options.direction;
  },
  _onTapStart: function(e) {
    if (e.cancelable) {
      var i = this, n = this.el, r = this.options, o = r.preventOnFilter, l = e.type, a = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (a || e).target, u = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, d = r.filter;
      if (Rn(n), !f && !(/mousedown|pointerdown/.test(l) && e.button !== 0 || r.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Ne && s && s.tagName.toUpperCase() === "SELECT") && (s = ie(s, r.draggable, n, !1), !(s && s.animated) && qe !== s)) {
        if (De = ee(s), Me = ee(s, r.draggable), typeof d == "function") {
          if (d.call(this, e, s, this)) {
            K({
              sortable: i,
              rootEl: u,
              name: "filter",
              targetEl: s,
              toEl: n,
              fromEl: n
            }), U("filter", i, {
              evt: e
            }), o && e.preventDefault();
            return;
          }
        } else if (d && (d = d.split(",").some(function(c) {
          if (c = ie(u, c.trim(), n, !1), c)
            return K({
              sortable: i,
              rootEl: c,
              name: "filter",
              targetEl: s,
              fromEl: n,
              toEl: n
            }), U("filter", i, {
              evt: e
            }), !0;
        }), d)) {
          o && e.preventDefault();
          return;
        }
        r.handle && !ie(u, r.handle, n, !1) || this._prepareDragStart(e, a, s);
      }
    }
  },
  _prepareDragStart: function(e, i, n) {
    var r = this, o = r.el, l = r.options, a = o.ownerDocument, s;
    if (n && !f && n.parentNode === o) {
      var u = L(n);
      if (k = o, f = n, M = f.parentNode, be = f.nextSibling, qe = n, Be = l.group, y.dragged = f, ge = {
        target: f,
        clientX: (i || e).clientX,
        clientY: (i || e).clientY
      }, Kt = ge.clientX - u.left, Gt = ge.clientY - u.top, this._lastX = (i || e).clientX, this._lastY = (i || e).clientY, f.style["will-change"] = "all", s = function() {
        if (U("delayEnded", r, {
          evt: e
        }), y.eventCanceled) {
          r._onDrop();
          return;
        }
        r._disableDelayedDragEvents(), !Yt && r.nativeDraggable && (f.draggable = !0), r._triggerDragStart(e, i), K({
          sortable: r,
          name: "choose",
          originalEvent: e
        }), Z(f, l.chosenClass, !0);
      }, l.ignore.split(",").forEach(function(d) {
        ai(f, d.trim(), vt);
      }), O(a, "dragover", ve), O(a, "mousemove", ve), O(a, "touchmove", ve), l.supportPointer ? (O(a, "pointerup", r._onDrop), !this.nativeDraggable && O(a, "pointercancel", r._onDrop)) : (O(a, "mouseup", r._onDrop), O(a, "touchend", r._onDrop), O(a, "touchcancel", r._onDrop)), Yt && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), U("delayStart", this, {
        evt: e
      }), l.delay && (!l.delayOnTouchOnly || i) && (!this.nativeDraggable || !(Fe || ue))) {
        if (y.eventCanceled) {
          this._onDrop();
          return;
        }
        l.supportPointer ? (O(a, "pointerup", r._disableDelayedDrag), O(a, "pointercancel", r._disableDelayedDrag)) : (O(a, "mouseup", r._disableDelayedDrag), O(a, "touchend", r._disableDelayedDrag), O(a, "touchcancel", r._disableDelayedDrag)), O(a, "mousemove", r._delayedDragTouchMoveHandler), O(a, "touchmove", r._delayedDragTouchMoveHandler), l.supportPointer && O(a, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, l.delay);
      } else
        s();
    }
  },
  _delayedDragTouchMoveHandler: function(e) {
    var i = e.touches ? e.touches[0] : e;
    Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
  },
  _disableDelayedDrag: function() {
    f && vt(f), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
  },
  _disableDelayedDragEvents: function() {
    var e = this.el.ownerDocument;
    T(e, "mouseup", this._disableDelayedDrag), T(e, "touchend", this._disableDelayedDrag), T(e, "touchcancel", this._disableDelayedDrag), T(e, "pointerup", this._disableDelayedDrag), T(e, "pointercancel", this._disableDelayedDrag), T(e, "mousemove", this._delayedDragTouchMoveHandler), T(e, "touchmove", this._delayedDragTouchMoveHandler), T(e, "pointermove", this._delayedDragTouchMoveHandler);
  },
  _triggerDragStart: function(e, i) {
    i = i || e.pointerType == "touch" && e, !this.nativeDraggable || i ? this.options.supportPointer ? O(document, "pointermove", this._onTouchMove) : i ? O(document, "touchmove", this._onTouchMove) : O(document, "mousemove", this._onTouchMove) : (O(f, "dragend", this), O(k, "dragstart", this._onDragStart));
    try {
      document.selection ? Ze(function() {
        document.selection.empty();
      }) : window.getSelection().removeAllRanges();
    } catch {
    }
  },
  _dragStarted: function(e, i) {
    if (Ee = !1, k && f) {
      U("dragStarted", this, {
        evt: i
      }), this.nativeDraggable && O(document, "dragover", zn);
      var n = this.options;
      !e && Z(f, n.dragClass, !1), Z(f, n.ghostClass, !0), y.active = this, e && this._appendGhost(), K({
        sortable: this,
        name: "start",
        originalEvent: i
      });
    } else
      this._nulling();
  },
  _emulateDragOver: function() {
    if (te) {
      this._lastX = te.clientX, this._lastY = te.clientY, pi();
      for (var e = document.elementFromPoint(te.clientX, te.clientY), i = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(te.clientX, te.clientY), e !== i); )
        i = e;
      if (f.parentNode[q]._isOutsideThisEl(e), i)
        do {
          if (i[q]) {
            var n = void 0;
            if (n = i[q]._onDragOver({
              clientX: te.clientX,
              clientY: te.clientY,
              target: e,
              rootEl: i
            }), n && !this.options.dragoverBubble)
              break;
          }
          e = i;
        } while (i = li(i));
      gi();
    }
  },
  _onTouchMove: function(e) {
    if (ge) {
      var i = this.options, n = i.fallbackTolerance, r = i.fallbackOffset, o = e.touches ? e.touches[0] : e, l = w && _e(w, !0), a = w && l && l.a, s = w && l && l.d, u = Xe && j && jt(j), d = (o.clientX - ge.clientX + r.x) / (a || 1) + (u ? u[0] - gt[0] : 0) / (a || 1), c = (o.clientY - ge.clientY + r.y) / (s || 1) + (u ? u[1] - gt[1] : 0) / (s || 1);
      if (!y.active && !Ee) {
        if (n && Math.max(Math.abs(o.clientX - this._lastX), Math.abs(o.clientY - this._lastY)) < n)
          return;
        this._onDragStart(e, !0);
      }
      if (w) {
        l ? (l.e += d - (mt || 0), l.f += c - (pt || 0)) : l = {
          a: 1,
          b: 0,
          c: 0,
          d: 1,
          e: d,
          f: c
        };
        var p = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
        b(w, "webkitTransform", p), b(w, "mozTransform", p), b(w, "msTransform", p), b(w, "transform", p), mt = d, pt = c, te = o;
      }
      e.cancelable && e.preventDefault();
    }
  },
  _appendGhost: function() {
    if (!w) {
      var e = this.options.fallbackOnBody ? document.body : k, i = L(f, !0, Xe, !0, e), n = this.options;
      if (Xe) {
        for (j = e; b(j, "position") === "static" && b(j, "transform") === "none" && j !== document; )
          j = j.parentNode;
        j !== document.body && j !== document.documentElement ? (j === document && (j = ne()), i.top += j.scrollTop, i.left += j.scrollLeft) : j = ne(), gt = jt(j);
      }
      w = f.cloneNode(!0), Z(w, n.ghostClass, !1), Z(w, n.fallbackClass, !0), Z(w, n.dragClass, !0), b(w, "transition", ""), b(w, "transform", ""), b(w, "box-sizing", "border-box"), b(w, "margin", 0), b(w, "top", i.top), b(w, "left", i.left), b(w, "width", i.width), b(w, "height", i.height), b(w, "opacity", "0.8"), b(w, "position", Xe ? "absolute" : "fixed"), b(w, "zIndex", "100000"), b(w, "pointerEvents", "none"), y.ghost = w, e.appendChild(w), b(w, "transform-origin", Kt / parseInt(w.style.width) * 100 + "% " + Gt / parseInt(w.style.height) * 100 + "%");
    }
  },
  _onDragStart: function(e, i) {
    var n = this, r = e.dataTransfer, o = n.options;
    if (U("dragStart", this, {
      evt: e
    }), y.eventCanceled) {
      this._onDrop();
      return;
    }
    U("setupClone", this), y.eventCanceled || (N = di(f), N.removeAttribute("id"), N.draggable = !1, N.style["will-change"] = "", this._hideClone(), Z(N, this.options.chosenClass, !1), y.clone = N), n.cloneId = Ze(function() {
      U("clone", n), !y.eventCanceled && (n.options.removeCloneOnHide || k.insertBefore(N, f), n._hideClone(), K({
        sortable: n,
        name: "clone"
      }));
    }), !i && Z(f, o.dragClass, !0), i ? (nt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (T(document, "mouseup", n._onDrop), T(document, "touchend", n._onDrop), T(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", o.setData && o.setData.call(n, r, f)), O(document, "drop", n), b(f, "transform", "translateZ(0)")), Ee = !0, n._dragStartId = Ze(n._dragStarted.bind(n, i, e)), O(document, "selectstart", n), xe = !0, window.getSelection().removeAllRanges(), Ne && b(document.body, "user-select", "none");
  },
  // Returns true - if no further action is needed (either inserted or another condition)
  _onDragOver: function(e) {
    var i = this.el, n = e.target, r, o, l, a = this.options, s = a.group, u = y.active, d = Be === s, c = a.sort, p = X || u, D, S = this, g = !1;
    if (Ct) return;
    function _(Te, bi) {
      U(Te, S, re({
        evt: e,
        isOwner: d,
        axis: D ? "vertical" : "horizontal",
        revert: l,
        dragRect: r,
        targetRect: o,
        canSort: c,
        fromSortable: p,
        target: n,
        completed: C,
        onMove: function(Vt, yi) {
          return We(k, i, f, r, Vt, L(Vt), e, yi);
        },
        changed: m
      }, bi));
    }
    function V() {
      _("dragOverAnimationCapture"), S.captureAnimationState(), S !== p && p.captureAnimationState();
    }
    function C(Te) {
      return _("dragOverCompleted", {
        insertion: Te
      }), Te && (d ? u._hideClone() : u._showClone(S), S !== p && (Z(f, X ? X.options.ghostClass : u.options.ghostClass, !1), Z(f, a.ghostClass, !0)), X !== S && S !== y.active ? X = S : S === y.active && X && (X = null), p === S && (S._ignoreWhileAnimating = n), S.animateAll(function() {
        _("dragOverAnimationComplete"), S._ignoreWhileAnimating = null;
      }), S !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (n === f && !f.animated || n === i && !n.animated) && (we = null), !a.dragoverBubble && !e.rootEl && n !== document && (f.parentNode[q]._isOutsideThisEl(e.target), !Te && ve(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), g = !0;
    }
    function m() {
      Q = ee(f), ce = ee(f, a.draggable), K({
        sortable: S,
        name: "change",
        toEl: i,
        newIndex: Q,
        newDraggableIndex: ce,
        originalEvent: e
      });
    }
    if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = ie(n, a.draggable, i, !0), _("dragOver"), y.eventCanceled) return g;
    if (f.contains(e.target) || n.animated && n.animatingX && n.animatingY || S._ignoreWhileAnimating === n)
      return C(!1);
    if (nt = !1, u && !a.disabled && (d ? c || (l = M !== k) : X === this || (this.lastPutMode = Be.checkPull(this, u, f, e)) && s.checkPut(this, u, f, e))) {
      if (D = this._getDirection(e, n) === "vertical", r = L(f), _("dragOverValid"), y.eventCanceled) return g;
      if (l)
        return M = k, V(), this._hideClone(), _("revert"), y.eventCanceled || (be ? k.insertBefore(f, be) : k.appendChild(f)), C(!0);
      var h = Nt(i, a.draggable);
      if (!h || Nn(e, D, this) && !h.animated) {
        if (h === f)
          return C(!1);
        if (h && i === e.target && (n = h), n && (o = L(n)), We(k, i, f, r, n, o, e, !!n) !== !1)
          return V(), h && h.nextSibling ? i.insertBefore(f, h.nextSibling) : i.appendChild(f), M = i, m(), C(!0);
      } else if (h && Pn(e, D, this)) {
        var x = Ie(i, 0, a, !0);
        if (x === f)
          return C(!1);
        if (n = x, o = L(n), We(k, i, f, r, n, o, e, !1) !== !1)
          return V(), i.insertBefore(f, x), M = i, m(), C(!0);
      } else if (n.parentNode === i) {
        o = L(n);
        var Y = 0, v, B = f.parentNode !== i, $ = !Cn(f.animated && f.toRect || r, n.animated && n.toRect || o, D), I = D ? "top" : "left", R = Wt(n, "top", "top") || Wt(f, "top", "top"), P = R ? R.scrollTop : void 0;
        we !== n && (v = o[I], Re = !1, Ye = !$ && a.invertSwap || B), Y = $n(e, n, o, D, $ ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Ye, we === n);
        var z;
        if (Y !== 0) {
          var J = ee(f);
          do
            J -= Y, z = M.children[J];
          while (z && (b(z, "display") === "none" || z === w));
        }
        if (Y === 0 || z === n)
          return C(!1);
        we = n, Ve = Y;
        var de = n.nextElementSibling, F = !1;
        F = Y === 1;
        var pe = We(k, i, f, r, n, o, e, F);
        if (pe !== !1)
          return (pe === 1 || pe === -1) && (F = pe === 1), Ct = !0, setTimeout(kn, 30), V(), F && !de ? i.appendChild(f) : n.parentNode.insertBefore(f, F ? de : n), R && ui(R, 0, P - R.scrollTop), M = f.parentNode, v !== void 0 && !Ye && (Je = Math.abs(v - L(n)[I])), m(), C(!0);
      }
      if (i.contains(f))
        return C(!1);
    }
    return !1;
  },
  _ignoreWhileAnimating: null,
  _offMoveEvents: function() {
    T(document, "mousemove", this._onTouchMove), T(document, "touchmove", this._onTouchMove), T(document, "pointermove", this._onTouchMove), T(document, "dragover", ve), T(document, "mousemove", ve), T(document, "touchmove", ve);
  },
  _offUpEvents: function() {
    var e = this.el.ownerDocument;
    T(e, "mouseup", this._onDrop), T(e, "touchend", this._onDrop), T(e, "pointerup", this._onDrop), T(e, "pointercancel", this._onDrop), T(e, "touchcancel", this._onDrop), T(document, "selectstart", this);
  },
  _onDrop: function(e) {
    var i = this.el, n = this.options;
    if (Q = ee(f), ce = ee(f, n.draggable), U("drop", this, {
      evt: e
    }), M = f && f.parentNode, Q = ee(f), ce = ee(f, n.draggable), y.eventCanceled) {
      this._nulling();
      return;
    }
    Ee = !1, Ye = !1, Re = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), xt(this.cloneId), xt(this._dragStartId), this.nativeDraggable && (T(document, "drop", this), T(i, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Ne && b(document.body, "user-select", ""), b(f, "transform", ""), e && (xe && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), w && w.parentNode && w.parentNode.removeChild(w), (k === M || X && X.lastPutMode !== "clone") && N && N.parentNode && N.parentNode.removeChild(N), f && (this.nativeDraggable && T(f, "dragend", this), vt(f), f.style["will-change"] = "", xe && !Ee && Z(f, X ? X.options.ghostClass : this.options.ghostClass, !1), Z(f, this.options.chosenClass, !1), K({
      sortable: this,
      name: "unchoose",
      toEl: M,
      newIndex: null,
      newDraggableIndex: null,
      originalEvent: e
    }), k !== M ? (Q >= 0 && (K({
      rootEl: M,
      name: "add",
      toEl: M,
      fromEl: k,
      originalEvent: e
    }), K({
      sortable: this,
      name: "remove",
      toEl: M,
      originalEvent: e
    }), K({
      rootEl: M,
      name: "sort",
      toEl: M,
      fromEl: k,
      originalEvent: e
    }), K({
      sortable: this,
      name: "sort",
      toEl: M,
      originalEvent: e
    })), X && X.save()) : Q !== De && Q >= 0 && (K({
      sortable: this,
      name: "update",
      toEl: M,
      originalEvent: e
    }), K({
      sortable: this,
      name: "sort",
      toEl: M,
      originalEvent: e
    })), y.active && ((Q == null || Q === -1) && (Q = De, ce = Me), K({
      sortable: this,
      name: "end",
      toEl: M,
      originalEvent: e
    }), this.save()))), this._nulling();
  },
  _nulling: function() {
    U("nulling", this), k = f = M = w = be = N = qe = fe = ge = te = xe = Q = ce = De = Me = we = Ve = X = Be = y.dragged = y.ghost = y.clone = y.active = null, ot.forEach(function(e) {
      e.checked = !0;
    }), ot.length = mt = pt = 0;
  },
  handleEvent: function(e) {
    switch (e.type) {
      case "drop":
      case "dragend":
        this._onDrop(e);
        break;
      case "dragenter":
      case "dragover":
        f && (this._onDragOver(e), An(e));
        break;
      case "selectstart":
        e.preventDefault();
        break;
    }
  },
  /**
   * Serializes the item into an array of string.
   * @returns {String[]}
   */
  toArray: function() {
    for (var e = [], i, n = this.el.children, r = 0, o = n.length, l = this.options; r < o; r++)
      i = n[r], ie(i, l.draggable, this.el, !1) && e.push(i.getAttribute(l.dataIdAttr) || Vn(i));
    return e;
  },
  /**
   * Sorts the elements according to the array.
   * @param  {String[]}  order  order of the items
   */
  sort: function(e, i) {
    var n = {}, r = this.el;
    this.toArray().forEach(function(o, l) {
      var a = r.children[l];
      ie(a, this.options.draggable, r, !1) && (n[o] = a);
    }, this), i && this.captureAnimationState(), e.forEach(function(o) {
      n[o] && (r.removeChild(n[o]), r.appendChild(n[o]));
    }), i && this.animateAll();
  },
  /**
   * Save the current sorting
   */
  save: function() {
    var e = this.options.store;
    e && e.set && e.set(this);
  },
  /**
   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
   * @param   {HTMLElement}  el
   * @param   {String}       [selector]  default: `options.draggable`
   * @returns {HTMLElement|null}
   */
  closest: function(e, i) {
    return ie(e, i || this.options.draggable, this.el, !1);
  },
  /**
   * Set/get option
   * @param   {string} name
   * @param   {*}      [value]
   * @returns {*}
   */
  option: function(e, i) {
    var n = this.options;
    if (i === void 0)
      return n[e];
    var r = He.modifyOption(this, e, i);
    typeof r < "u" ? n[e] = r : n[e] = i, e === "group" && mi(n);
  },
  /**
   * Destroy
   */
  destroy: function() {
    U("destroy", this);
    var e = this.el;
    e[q] = null, T(e, "mousedown", this._onTapStart), T(e, "touchstart", this._onTapStart), T(e, "pointerdown", this._onTapStart), this.nativeDraggable && (T(e, "dragover", this), T(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(i) {
      i.removeAttribute("draggable");
    }), this._onDrop(), this._disableDelayedDragEvents(), rt.splice(rt.indexOf(this.el), 1), this.el = e = null;
  },
  _hideClone: function() {
    if (!fe) {
      if (U("hideClone", this), y.eventCanceled) return;
      b(N, "display", "none"), this.options.removeCloneOnHide && N.parentNode && N.parentNode.removeChild(N), fe = !0;
    }
  },
  _showClone: function(e) {
    if (e.lastPutMode !== "clone") {
      this._hideClone();
      return;
    }
    if (fe) {
      if (U("showClone", this), y.eventCanceled) return;
      f.parentNode == k && !this.options.group.revertClone ? k.insertBefore(N, f) : be ? k.insertBefore(N, be) : k.appendChild(N), this.options.group.revertClone && this.animate(f, N), b(N, "display", ""), fe = !1;
    }
  }
};
function An(t) {
  t.dataTransfer && (t.dataTransfer.dropEffect = "move"), t.cancelable && t.preventDefault();
}
function We(t, e, i, n, r, o, l, a) {
  var s, u = t[q], d = u.options.onMove, c;
  return window.CustomEvent && !ue && !Fe ? s = new CustomEvent("move", {
    bubbles: !0,
    cancelable: !0
  }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = t, s.dragged = i, s.draggedRect = n, s.related = r || e, s.relatedRect = o || L(e), s.willInsertAfter = a, s.originalEvent = l, t.dispatchEvent(s), d && (c = d.call(u, s, l)), c;
}
function vt(t) {
  t.draggable = !1;
}
function kn() {
  Ct = !1;
}
function Pn(t, e, i) {
  var n = L(Ie(i.el, 0, i.options, !0)), r = ci(i.el, i.options, w), o = 10;
  return e ? t.clientX < r.left - o || t.clientY < n.top && t.clientX < n.right : t.clientY < r.top - o || t.clientY < n.bottom && t.clientX < n.left;
}
function Nn(t, e, i) {
  var n = L(Nt(i.el, i.options.draggable)), r = ci(i.el, i.options, w), o = 10;
  return e ? t.clientX > r.right + o || t.clientY > n.bottom && t.clientX > n.left : t.clientY > r.bottom + o || t.clientX > n.right && t.clientY > n.top;
}
function $n(t, e, i, n, r, o, l, a) {
  var s = n ? t.clientY : t.clientX, u = n ? i.height : i.width, d = n ? i.top : i.left, c = n ? i.bottom : i.right, p = !1;
  if (!l) {
    if (a && Je < u * r) {
      if (!Re && (Ve === 1 ? s > d + u * o / 2 : s < c - u * o / 2) && (Re = !0), Re)
        p = !0;
      else if (Ve === 1 ? s < d + Je : s > c - Je)
        return -Ve;
    } else if (s > d + u * (1 - r) / 2 && s < c - u * (1 - r) / 2)
      return Mn(e);
  }
  return p = p || l, p && (s < d + u * o / 2 || s > c - u * o / 2) ? s > d + u / 2 ? 1 : -1 : 0;
}
function Mn(t) {
  return ee(f) < ee(t) ? 1 : -1;
}
function Vn(t) {
  for (var e = t.tagName + t.className + t.src + t.href + t.textContent, i = e.length, n = 0; i--; )
    n += e.charCodeAt(i);
  return n.toString(36);
}
function Rn(t) {
  ot.length = 0;
  for (var e = t.getElementsByTagName("input"), i = e.length; i--; ) {
    var n = e[i];
    n.checked && ot.push(n);
  }
}
function Ze(t) {
  return setTimeout(t, 0);
}
function xt(t) {
  return clearTimeout(t);
}
st && O(document, "touchmove", function(t) {
  (y.active || Ee) && t.cancelable && t.preventDefault();
});
y.utils = {
  on: O,
  off: T,
  css: b,
  find: ai,
  is: function(e, i) {
    return !!ie(e, i, e, !1);
  },
  extend: wn,
  throttle: si,
  closest: ie,
  toggleClass: Z,
  clone: di,
  index: ee,
  nextTick: Ze,
  cancelNextTick: xt,
  detectDirection: hi,
  getChild: Ie,
  expando: q
};
y.get = function(t) {
  return t[q];
};
y.mount = function() {
  for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)
    e[i] = arguments[i];
  e[0].constructor === Array && (e = e[0]), e.forEach(function(n) {
    if (!n.prototype || !n.prototype.constructor)
      throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
    n.utils && (y.utils = re(re({}, y.utils), n.utils)), He.mount(n);
  });
};
y.create = function(t, e) {
  return new y(t, e);
};
y.version = bn;
var H = [], ze, zt, At = !1, bt, yt, lt, Ae;
function Fn() {
  function t() {
    this.defaults = {
      scroll: !0,
      forceAutoScrollFallback: !1,
      scrollSensitivity: 30,
      scrollSpeed: 10,
      bubbleScroll: !0
    };
    for (var e in this)
      e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
  }
  return t.prototype = {
    dragStarted: function(i) {
      var n = i.originalEvent;
      this.sortable.nativeDraggable ? O(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? O(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? O(document, "touchmove", this._handleFallbackAutoScroll) : O(document, "mousemove", this._handleFallbackAutoScroll);
    },
    dragOverCompleted: function(i) {
      var n = i.originalEvent;
      !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
    },
    drop: function() {
      this.sortable.nativeDraggable ? T(document, "dragover", this._handleAutoScroll) : (T(document, "pointermove", this._handleFallbackAutoScroll), T(document, "touchmove", this._handleFallbackAutoScroll), T(document, "mousemove", this._handleFallbackAutoScroll)), qt(), Qe(), Sn();
    },
    nulling: function() {
      lt = zt = ze = At = Ae = bt = yt = null, H.length = 0;
    },
    _handleFallbackAutoScroll: function(i) {
      this._handleAutoScroll(i, !0);
    },
    _handleAutoScroll: function(i, n) {
      var r = this, o = (i.touches ? i.touches[0] : i).clientX, l = (i.touches ? i.touches[0] : i).clientY, a = document.elementFromPoint(o, l);
      if (lt = i, n || this.options.forceAutoScrollFallback || Fe || ue || Ne) {
        wt(i, this.options, a, n);
        var s = me(a, !0);
        At && (!Ae || o !== bt || l !== yt) && (Ae && qt(), Ae = setInterval(function() {
          var u = me(document.elementFromPoint(o, l), !0);
          u !== s && (s = u, Qe()), wt(i, r.options, u, n);
        }, 10), bt = o, yt = l);
      } else {
        if (!this.options.bubbleScroll || me(a, !0) === ne()) {
          Qe();
          return;
        }
        wt(i, this.options, me(a, !1), !1);
      }
    }
  }, se(t, {
    pluginName: "scroll",
    initializeByDefault: !0
  });
}
function Qe() {
  H.forEach(function(t) {
    clearInterval(t.pid);
  }), H = [];
}
function qt() {
  clearInterval(Ae);
}
var wt = si(function(t, e, i, n) {
  if (e.scroll) {
    var r = (t.touches ? t.touches[0] : t).clientX, o = (t.touches ? t.touches[0] : t).clientY, l = e.scrollSensitivity, a = e.scrollSpeed, s = ne(), u = !1, d;
    zt !== i && (zt = i, Qe(), ze = e.scroll, d = e.scrollFn, ze === !0 && (ze = me(i, !0)));
    var c = 0, p = ze;
    do {
      var D = p, S = L(D), g = S.top, _ = S.bottom, V = S.left, C = S.right, m = S.width, h = S.height, x = void 0, Y = void 0, v = D.scrollWidth, B = D.scrollHeight, $ = b(D), I = D.scrollLeft, R = D.scrollTop;
      D === s ? (x = m < v && ($.overflowX === "auto" || $.overflowX === "scroll" || $.overflowX === "visible"), Y = h < B && ($.overflowY === "auto" || $.overflowY === "scroll" || $.overflowY === "visible")) : (x = m < v && ($.overflowX === "auto" || $.overflowX === "scroll"), Y = h < B && ($.overflowY === "auto" || $.overflowY === "scroll"));
      var P = x && (Math.abs(C - r) <= l && I + m < v) - (Math.abs(V - r) <= l && !!I), z = Y && (Math.abs(_ - o) <= l && R + h < B) - (Math.abs(g - o) <= l && !!R);
      if (!H[c])
        for (var J = 0; J <= c; J++)
          H[J] || (H[J] = {});
      (H[c].vx != P || H[c].vy != z || H[c].el !== D) && (H[c].el = D, H[c].vx = P, H[c].vy = z, clearInterval(H[c].pid), (P != 0 || z != 0) && (u = !0, H[c].pid = setInterval((function() {
        n && this.layer === 0 && y.active._onTouchMove(lt);
        var de = H[this.layer].vy ? H[this.layer].vy * a : 0, F = H[this.layer].vx ? H[this.layer].vx * a : 0;
        typeof d == "function" && d.call(y.dragged.parentNode[q], F, de, t, lt, H[this.layer].el) !== "continue" || ui(H[this.layer].el, F, de);
      }).bind({
        layer: c
      }), 24))), c++;
    } while (e.bubbleScroll && p !== s && (p = me(p, !1)));
    At = u;
  }
}, 30), vi = function(e) {
  var i = e.originalEvent, n = e.putSortable, r = e.dragEl, o = e.activeSortable, l = e.dispatchSortableEvent, a = e.hideGhostForTarget, s = e.unhideGhostForTarget;
  if (i) {
    var u = n || o;
    a();
    var d = i.changedTouches && i.changedTouches.length ? i.changedTouches[0] : i, c = document.elementFromPoint(d.clientX, d.clientY);
    s(), u && !u.el.contains(c) && (l("spill"), this.onSpill({
      dragEl: r,
      putSortable: n
    }));
  }
};
function $t() {
}
$t.prototype = {
  startIndex: null,
  dragStart: function(e) {
    var i = e.oldDraggableIndex;
    this.startIndex = i;
  },
  onSpill: function(e) {
    var i = e.dragEl, n = e.putSortable;
    this.sortable.captureAnimationState(), n && n.captureAnimationState();
    var r = Ie(this.sortable.el, this.startIndex, this.options);
    r ? this.sortable.el.insertBefore(i, r) : this.sortable.el.appendChild(i), this.sortable.animateAll(), n && n.animateAll();
  },
  drop: vi
};
se($t, {
  pluginName: "revertOnSpill"
});
function Mt() {
}
Mt.prototype = {
  onSpill: function(e) {
    var i = e.dragEl, n = e.putSortable, r = n || this.sortable;
    r.captureAnimationState(), i.parentNode && i.parentNode.removeChild(i), r.animateAll();
  },
  drop: vi
};
se(Mt, {
  pluginName: "removeOnSpill"
});
y.mount(new Fn());
y.mount(Mt, $t);
const Hn = (t, e, i, n) => {
  const r = Qt(t, "dragSort");
  let o = null, l = ke(0);
  Ft(
    r,
    (u) => {
      et(() => {
        u ? a() : s();
      });
    },
    {
      immediate: !0
    }
  ), Ft(n, (u, d) => {
    et(() => {
      r.value ? a() : s();
    });
  });
  const a = () => {
    const u = i.value;
    u.style.cursor = "move", o = y.create(u, {
      draggable: ".selected-item.enable",
      //指定样式类的元素才允许拖动
      filter: ".selected-item.disableDrag",
      animation: 300,
      //过渡动画时间
      //拖拽结束时事件
      onEnd: (d) => {
        const c = JSON.parse(JSON.stringify(n.value)), p = JSON.parse(JSON.stringify(n.value));
        p.splice(d.oldIndex, 1)[0];
        const D = c[d.oldIndex];
        p.splice(d.newIndex, 0, D), e("update:modelValue", p), l.value = Date.now(), e("sortEnd", c, p, d.oldIndex, d.newIndex);
      }
    });
  }, s = () => {
    const u = i.value;
    u.style.cursor = "default", o == null || o.option("disabled", !0);
  };
  return { timeStamp: l };
}, Ln = {
  key: 0,
  class: "selected-number-header"
}, Bn = { class: "selected-num" }, Yn = ["onClick"], Xn = { class: "name" }, Wn = ["onClick"], jn = { class: "name" }, Kn = ["infinite-scroll-disabled"], Gn = { class: "selected-group" }, Un = ["onClick"], qn = { class: "name" }, St = "var(--upf-text-secondary, var(--das-ui-color-secondary))", Jn = /* @__PURE__ */ Ni({
  __name: "Index",
  props: {
    width: { default: "100%" },
    height: { default: "100%" },
    modelValue: {},
    selectdValue: { default: "" },
    valueKey: { default: "id" },
    labelKey: { default: "name" },
    customStyle: {},
    dragSort: { type: Boolean },
    isView: { type: Boolean },
    closeable: { type: Boolean, default: !0 },
    clearable: { type: Boolean, default: !0 },
    customTitle: { default: "" },
    selectedNum: {},
    props: { default: {
      disabled: "disabled"
    } },
    virtual: { type: Boolean, default: !0 },
    itemHeight: { default: 32 },
    infiniteScroll: {},
    infiniteDisabled: { type: Boolean, default: !0 },
    hideHeader: { type: Boolean, default: !1 }
  },
  emits: ["update:modelValue", "update:selectdValue", "select-item", "item-remove", "remove-all", "sortEnd", "update:infiniteDisabled"],
  setup(t, { expose: e, emit: i }) {
    $i((h) => ({
      v16d1ef20: o.value
    }));
    const n = t, r = i, o = Pe(() => n.itemHeight + "px"), l = Pe(() => n.dragSort || n.infiniteScroll ? !1 : n.virtual), {
      selectListRef: a,
      $list: s,
      disabledFlag: u,
      disabledDrag: d,
      disableDelete: c,
      itemGroups: p,
      selectedLabel: D,
      itemRemove: S,
      removeAll: g,
      innerSelectdValue: _,
      selectItem: V,
      infiniteLoad: C
    } = mn(n, r);
    Hn(n, r, s, p);
    const m = ke(!0);
    return Zt(() => {
      m.value = !1, setTimeout(() => {
        m.value = !0;
      }, 300);
    }), e({
      infiniteLoad: C
    }), (h, x) => {
      const Y = Ei;
      return A(), W(
        "div",
        {
          ref_key: "selectListRef",
          ref: a,
          class: "das-ui-select-list",
          style: Jt({ width: t.width, height: t.height, ...t.customStyle })
        },
        [
          he(h.$slots, "header", {}, () => [
            t.hideHeader ? G("v-if", !0) : (A(), W("div", Ln, [
              Oe(
                "div",
                Bn,
                Ce(E(D)),
                1
                /* TEXT */
              ),
              !t.isView && t.clearable ? (A(), le(E(Mi), {
                key: 0,
                "btn-type": "primary-text",
                block: "",
                onClick: E(g),
                disabled: !E(p) || !E(p).length
              }, {
                default: tt(() => [
                  Le(
                    Ce(E(je)("das-select-list-removeAll").value),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              }, 8, ["onClick", "disabled"])) : G("v-if", !0)
            ]))
          ], !0),
          G(" 普通 "),
          !t.infiniteScroll && !l.value ? Se((A(), W(
            "div",
            {
              key: 0,
              ref_key: "$list",
              ref: s,
              class: oe(["selected-container", { "hide-header": t.hideHeader }])
            },
            [
              (A(!0), W(
                Et,
                null,
                Dt(E(p), (v, B) => (A(), W("div", {
                  class: oe({
                    "selected-item": !0,
                    disabled: !t.isView && E(u)(v),
                    enable: !t.isView && !E(u)(v),
                    disableDrag: !t.isView && E(d)(v),
                    active: E(_) === v[t.valueKey]
                  }),
                  key: v[t.valueKey] + B,
                  onClick: ($) => E(V)(v)
                }, [
                  t.dragSort ? (A(), le(E(Ri), {
                    key: 0,
                    class: oe({ "drag-icon": !0, "hide-drag-icon": E(d)(v) }),
                    size: "medium",
                    style: { "margin-right": "8px" }
                  }, null, 8, ["class"])) : G("v-if", !0),
                  Oe("div", Xn, [
                    he(h.$slots, "default", { item: v }, () => [
                      Se((A(), W("div", null, [
                        Le(
                          Ce(v[t.labelKey]),
                          1
                          /* TEXT */
                        )
                      ])), [
                        [E(ut)]
                      ])
                    ], !0)
                  ]),
                  !t.isView && t.closeable && !E(c)(v) ? (A(), le(E(dt), {
                    key: 1,
                    size: "small",
                    class: "close-icon",
                    "icon-color": St,
                    onClick: ($) => E(S)(v)
                  }, null, 8, ["onClick"])) : G("v-if", !0)
                ], 10, Yn))),
                128
                /* KEYED_FRAGMENT */
              ))
            ],
            2
            /* CLASS */
          )), [
            [E(Vi), { usePrevOverlay: !0 }]
          ]) : G("v-if", !0),
          G(" 虚拟滚动 "),
          !t.dragSort && l.value ? (A(), W(
            "div",
            {
              key: 1,
              ref_key: "$list",
              ref: s,
              class: oe(["selected-container", { "hide-header": t.hideHeader }])
            },
            [
              m.value && E(p).length > 0 ? (A(), le(E(kt), {
                key: E(p).length,
                items: E(p),
                "item-size": t.itemHeight,
                "key-field": t.valueKey,
                class: "virtual-list"
              }, {
                default: tt(({ item: v, index: B }) => [
                  (A(), W("div", {
                    class: oe({
                      "selected-item": !0,
                      disabled: !t.isView && E(u)(v),
                      enable: !t.isView && !E(u)(v),
                      active: E(_) === v[t.valueKey]
                    }),
                    key: v[t.valueKey],
                    onClick: ($) => E(V)(v)
                  }, [
                    Oe("div", jn, [
                      he(h.$slots, "default", { item: v }, () => [
                        Se((A(), W("div", null, [
                          Le(
                            Ce(v[t.labelKey]),
                            1
                            /* TEXT */
                          )
                        ])), [
                          [E(ut)]
                        ])
                      ], !0)
                    ]),
                    !t.isView && t.closeable && !E(c)(v) ? (A(), le(E(dt), {
                      key: 0,
                      size: "small",
                      class: "close-icon",
                      "icon-color": St,
                      onClick: ($) => E(S)(v)
                    }, null, 8, ["onClick"])) : G("v-if", !0)
                  ], 10, Wn))
                ]),
                _: 3
                /* FORWARDED */
              }, 8, ["items", "item-size", "key-field"])) : G("v-if", !0)
            ],
            2
            /* CLASS */
          )) : G("v-if", !0),
          G(" 分页加载 "),
          !t.dragSort && t.infiniteScroll ? Se((A(), W("div", {
            key: 2,
            ref_key: "$list",
            ref: s,
            class: oe(["selected-container selected-page-container", { "hide-header": t.hideHeader }]),
            "infinite-scroll-disabled": t.infiniteDisabled,
            style: { overflow: "overlay" }
          }, [
            Oe("div", Gn, [
              (A(!0), W(
                Et,
                null,
                Dt(E(p), (v) => (A(), W("div", {
                  class: oe({
                    "selected-item": !0,
                    disabled: !t.isView && E(u)(v),
                    enable: !t.isView && !E(u)(v),
                    active: E(_) === v[t.valueKey]
                  }),
                  key: v[t.valueKey],
                  onClick: (B) => E(V)(v)
                }, [
                  Oe("div", qn, [
                    he(h.$slots, "default", { item: v }, () => [
                      Se((A(), W("div", null, [
                        Le(
                          Ce(v[t.labelKey]),
                          1
                          /* TEXT */
                        )
                      ])), [
                        [E(ut)]
                      ])
                    ], !0)
                  ]),
                  !t.isView && t.closeable && !E(c)(v) ? (A(), le(E(dt), {
                    key: 0,
                    size: "small",
                    class: "close-icon",
                    "icon-color": St,
                    onClick: (B) => E(S)(v)
                  }, null, 8, ["onClick"])) : G("v-if", !0)
                ], 10, Un))),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ], 10, Kn)), [
            [Y, E(C)]
          ]) : G("v-if", !0)
        ],
        4
        /* STYLE */
      );
    };
  }
}), Zn = (t, e) => {
  const i = t.__vccOpts || t;
  for (const [n, r] of e)
    i[n] = r;
  return i;
}, Qn = /* @__PURE__ */ Zn(Jn, [["__scopeId", "data-v-5bc0f5d8"]]), er = {
  "das-select-list-removeAll": { "zh-CN": "清空", en: "Clear", "zh-MO": "清空", _appCode: "framework" },
  "das-select-list-selected": { "zh-CN": "已选", en: "Selected", "zh-MO": "已選", _appCode: "framework" },
  "das-select-list-parentheses-left": { "zh-CN": "（", en: "(", "zh-MO": "（", _appCode: "framework" },
  "das-select-list-parentheses-right": { "zh-CN": "）", en: ")", "zh-MO": "）", _appCode: "framework" }
}, vr = wi(Qn);
Si(er);
export {
  vr as DasSelectList,
  vr as default
};
