import '@das-fed/upf-ui/packages/components/scrollbar/style.css';
import { onUnmounted as Mn, defineComponent as Cs, ref as De, computed as $s, onMounted as Es, openBlock as Ts, createBlock as As, unref as Hs, mergeProps as Ps, withCtx as ks, renderSlot as Ls } from "vue";
import { createStyle as _s } from "@das-fed/upf-utils/style";
import "@das-fed/upf-ui/packages/global/theme";
import { withInstall as Ds } from "@das-fed/upf-utils/with-install/index";
import { ElScrollbar as Is } from "element-plus";
import "element-plus/es/components/scrollbar/style/css";
import { useZIndex as Rs } from "@das-fed/upf-utils/hooks/popup-manager/use-zindex";
/*!
 * OverlayScrollbars
 * Version: 2.6.1
 *
 * Copyright (c) Rene Haas | KingSora.
 * https://github.com/KingSora
 *
 * Released under the MIT license.
 */
const wt = (t, e) => {
  const { o: n, u: s, _: o } = t;
  let c = n, r;
  const l = (a, d) => {
    const v = c, C = a, A = d || (s ? !s(v, C) : v !== C);
    return (A || o) && (c = C, r = v), [c, A, r];
  };
  return [e ? (a) => l(e(c, r), a) : l, (a) => [c, !!a, r]];
}, en = typeof window < "u", mt = en ? window : {}, be = Math.max, Vs = Math.min, ze = Math.round, Nn = mt.cancelAnimationFrame, zn = mt.requestAnimationFrame, Fe = mt.setTimeout, Ue = mt.clearTimeout, Se = (t) => typeof mt[t] < "u" ? mt[t] : void 0, Ms = Se("MutationObserver"), mn = Se("IntersectionObserver"), me = Se("ResizeObserver"), Be = Se("ScrollTimeline"), Fn = en && Node.ELEMENT_NODE, { toString: Ns, hasOwnProperty: Ie } = Object.prototype, zs = /^\[object (.+)\]$/, ae = (t) => t === void 0, xe = (t) => t === null, Fs = (t) => ae(t) || xe(t) ? `${t}` : Ns.call(t).replace(zs, "$1").toLowerCase(), $t = (t) => typeof t == "number", Oe = (t) => typeof t == "string", Un = (t) => typeof t == "boolean", Et = (t) => typeof t == "function", xt = (t) => Array.isArray(t), le = (t) => typeof t == "object" && !xt(t) && !xe(t), Ce = (t) => {
  const e = !!t && t.length, n = $t(e) && e > -1 && e % 1 == 0;
  return xt(t) || !Et(t) && n ? e > 0 && le(t) ? e - 1 in t : !0 : !1;
}, ye = (t) => {
  if (!t || !le(t) || Fs(t) !== "object")
    return !1;
  let e;
  const n = "constructor", s = t[n], o = s && s.prototype, c = Ie.call(t, n), r = o && Ie.call(o, "isPrototypeOf");
  if (s && !c && !r)
    return !1;
  for (e in t)
    ;
  return ae(e) || Ie.call(t, e);
}, ce = (t) => {
  const e = HTMLElement;
  return t ? e ? t instanceof e : t.nodeType === Fn : !1;
}, $e = (t) => {
  const e = Element;
  return t ? e ? t instanceof e : t.nodeType === Fn : !1;
};
function W(t, e) {
  if (Ce(t))
    for (let n = 0; n < t.length && e(t[n], n, t) !== !1; n++)
      ;
  else t && W(Object.keys(t), (n) => e(t[n], n, t));
  return t;
}
const Ee = (t, e) => t.indexOf(e) >= 0, Tt = (t, e) => t.concat(e), K = (t, e, n) => (!Oe(e) && Ce(e) ? Array.prototype.push.apply(t, e) : t.push(e), t), Ft = (t) => Array.from(t || []), Bn = (t) => xt(t) ? t : [t], je = (t) => !!t && !t.length, yn = (t) => Ft(new Set(t)), yt = (t, e, n) => {
  W(t, (o) => o && o.apply(void 0, e || [])), !n && (t.length = 0);
}, jn = "paddingTop", Gn = "paddingRight", Wn = "paddingLeft", Xn = "paddingBottom", Yn = "marginLeft", Zn = "marginRight", qn = "marginBottom", Te = "overflowX", Ae = "overflowY", Yt = "width", Zt = "height", qt = "hidden", Kn = "visible", nn = (t, e, n, s) => {
  if (t && e) {
    let o = !0;
    return W(n, (c) => {
      const r = t[c], l = e[c];
      r !== l && (o = !1);
    }), o;
  }
  return !1;
}, Jn = (t, e) => nn(t, e, ["w", "h"]), Qn = (t, e) => nn(t, e, ["x", "y"]), Us = (t, e) => nn(t, e, ["t", "r", "b", "l"]), St = () => {
}, R = (t, ...e) => t.bind(0, ...e), kt = (t) => {
  let e;
  const n = t ? Fe : zn, s = t ? Ue : Nn;
  return [(o) => {
    s(e), e = n(o, Et(t) ? t() : t);
  }, () => s(e)];
}, ts = (t, e) => {
  let n, s, o, c = St;
  const { v: r, p: l, S: i } = e || {}, u = function(A) {
    c(), Ue(n), n = s = void 0, c = St, t.apply(this, A);
  }, a = (C) => i && s ? i(s, C) : C, d = () => {
    c !== St && u(a(o) || o);
  }, v = function() {
    const A = Ft(arguments), H = Et(r) ? r() : r;
    if ($t(H) && H >= 0) {
      const P = Et(l) ? l() : l, S = $t(P) && P >= 0, y = H > 0 ? Fe : zn, O = H > 0 ? Ue : Nn, L = a(A) || A, z = u.bind(0, L);
      c();
      const F = y(z, H);
      c = () => O(F), S && !n && (n = Fe(d, P)), s = o = L;
    } else
      u(A);
  };
  return v.m = d, v;
}, es = (t, e) => Object.prototype.hasOwnProperty.call(t, e), At = (t) => t ? Object.keys(t) : [], G = (t, e, n, s, o, c, r) => {
  const l = [e, n, s, o, c, r];
  return (typeof t != "object" || xe(t)) && !Et(t) && (t = {}), W(l, (i) => {
    W(i, (u, a) => {
      const d = i[a];
      if (t === d)
        return !0;
      const v = xt(d);
      if (d && ye(d)) {
        const C = t[a];
        let A = C;
        v && !xt(C) ? A = [] : !v && !ye(C) && (A = {}), t[a] = G(A, d);
      } else
        t[a] = v ? d.slice() : d;
    });
  }), t;
}, ns = (t, e) => W(G({}, t), (n, s, o) => {
  n === void 0 ? delete o[s] : n && ye(n) && (o[s] = ns(n));
}), sn = (t) => {
  for (const e in t)
    return !1;
  return !0;
}, Ge = (t, e, n) => be(t, Vs(e, n)), Nt = (t) => Ft(new Set((xt(t) ? t : (t || "").split(" ")).filter((e) => e))), He = (t, e) => t && t.getAttribute(e), ht = (t, e, n) => {
  W(Nt(e), (s) => {
    t && t.setAttribute(s, n || "");
  });
}, Ct = (t, e) => {
  W(Nt(e), (n) => t && t.removeAttribute(n));
}, Pe = (t, e) => {
  const n = Nt(He(t, e)), s = R(ht, t, e), o = (c, r) => {
    const l = new Set(n);
    return W(Nt(c), (i) => l[r](i)), Ft(l).join(" ");
  };
  return {
    O: (c) => s(o(c, "delete")),
    $: (c) => s(o(c, "add")),
    C: (c) => {
      const r = Nt(c);
      return r.reduce((l, i) => l && n.includes(i), r.length > 0);
    }
  };
}, ss = (t, e, n) => {
  Pe(t, e).O(n);
}, ie = (t, e, n) => (Pe(t, e).$(n), R(ss, t, e, n)), ve = (t, e, n, s) => {
  (s ? ie : ss)(t, e, n);
}, Bs = (t, e, n) => Pe(t, e).C(n), os = (t) => Pe(t, "class"), on = (t, e) => {
  os(t).O(e);
}, ge = (t, e) => (os(t).$(e), R(on, t, e)), gn = en && Element.prototype, cs = (t, e) => {
  const n = [], s = e ? $e(e) && e : document;
  return s ? K(n, s.querySelectorAll(t)) : n;
}, js = (t, e) => {
  const n = e ? $e(e) && e : document;
  return n ? n.querySelector(t) : null;
}, We = (t, e) => $e(t) ? (gn.matches || gn.msMatchesSelector).call(t, e) : !1, Xe = (t) => t ? Ft(t.childNodes) : [], Kt = (t) => t && t.parentElement, jt = (t, e) => $e(t) && t.closest(e), Gs = (t, e, n) => {
  const s = jt(t, e), o = t && js(n, s), c = jt(o, e) === s;
  return s && o ? s === t || o === t || c && jt(jt(t, n), e) !== s : !1;
}, Dt = (t) => {
  if (Ce(t))
    W(Ft(t), (e) => Dt(e));
  else if (t) {
    const e = Kt(t);
    e && e.removeChild(t);
  }
}, rs = (t, e, n) => {
  if (n && t) {
    let s = e, o;
    return Ce(n) ? (o = document.createDocumentFragment(), W(n, (c) => {
      c === s && (s = c.previousSibling), o.appendChild(c);
    })) : o = n, e && (s ? s !== e && (s = s.nextSibling) : s = t.firstChild), t.insertBefore(o, s || null), () => Dt(n);
  }
  return St;
}, vt = (t, e) => rs(t, null, e), hn = (t, e) => rs(Kt(t), t && t.nextSibling, e), Gt = (t) => {
  const e = document.createElement("div");
  return ht(e, "class", t), e;
}, ls = (t) => {
  const e = Gt();
  return e.innerHTML = t.trim(), W(Xe(e), (n) => Dt(n));
}, Ws = /^--/, wn = (t, e) => t.getPropertyValue(e) || t[e] || "", cn = (t) => {
  const e = t || 0;
  return isFinite(e) ? e : 0;
}, pe = (t) => cn(parseFloat(t || "")), Sn = (t) => `${(cn(t) * 100).toFixed(3)}%`, Ye = (t) => `${cn(t)}px`;
function Jt(t, e) {
  t && W(e, (n, s) => {
    try {
      const o = t.style, c = $t(n) ? Ye(n) : (n || "") + "";
      Ws.test(s) ? o.setProperty(s, c) : o[s] = c;
    } catch {
    }
  });
}
function zt(t, e, n) {
  const s = Oe(e);
  let o = s ? "" : {};
  if (t) {
    const c = mt.getComputedStyle(t, n) || t.style;
    o = s ? wn(c, e) : e.reduce((r, l) => (r[l] = wn(c, l), r), o);
  }
  return o;
}
const _t = (t) => zt(t, "direction") === "rtl", xn = (t, e, n) => {
  const s = e ? `${e}-` : "", o = n ? `-${n}` : "", c = `${s}top${o}`, r = `${s}right${o}`, l = `${s}bottom${o}`, i = `${s}left${o}`, u = zt(t, [c, r, l, i]);
  return {
    t: pe(u[c]),
    r: pe(u[r]),
    b: pe(u[l]),
    l: pe(u[i])
  };
}, Re = (t, e) => `translate${le(t) ? `(${t.x},${t.y})` : `${e ? "X" : "Y"}(${t})`}`, Xs = {
  w: 0,
  h: 0
}, ke = (t, e) => e ? {
  w: e[`${t}Width`],
  h: e[`${t}Height`]
} : Xs, Ys = (t) => ke("inner", t || mt), re = R(ke, "offset"), is = R(ke, "client"), Ze = R(ke, "scroll"), rn = (t) => {
  const e = parseFloat(zt(t, Yt)) || 0, n = parseFloat(zt(t, Zt)) || 0;
  return {
    w: e - ze(e),
    h: n - ze(n)
  };
}, Wt = (t) => t.getBoundingClientRect(), qe = (t) => !!(t && (t[Zt] || t[Yt])), as = (t, e) => {
  const n = qe(t);
  return !qe(e) && n;
}, On = (t, e, n, s) => {
  W(Nt(e), (o) => {
    t.removeEventListener(o, n, s);
  });
}, nt = (t, e, n, s) => {
  var o;
  const c = (o = s && s.H) != null ? o : !0, r = s && s.I || !1, l = s && s.A || !1, i = {
    passive: c,
    capture: r
  };
  return R(yt, Nt(e).map((u) => {
    const a = l ? (d) => {
      On(t, u, a, r), n(d);
    } : n;
    return t.addEventListener(u, a, i), R(On, t, u, a, r);
  }));
}, ln = (t) => t.stopPropagation(), Cn = (t) => t.preventDefault(), Zs = {
  x: 0,
  y: 0
}, Ve = (t) => {
  const e = t && Wt(t);
  return e ? {
    x: e.left + mt.scrollX,
    y: e.top + mt.scrollY
  } : Zs;
}, he = (t, e, n) => n ? n.n ? -t + 0 : n.i ? e - t : t : t, $n = (t, e) => [he(0, t, e), he(t, t, e)], En = (t, e, n) => Ge(0, 1, he(t, e, n) / e || 0), It = (t, e) => {
  const { x: n, y: s } = $t(e) ? {
    x: e,
    y: e
  } : e || {};
  $t(n) && (t.scrollLeft = n), $t(s) && (t.scrollTop = s);
}, Qt = (t) => ({
  x: t.scrollLeft,
  y: t.scrollTop
}), Tn = (t, e) => {
  W(Bn(e), t);
}, Ke = (t) => {
  const e = /* @__PURE__ */ new Map(), n = (c, r) => {
    if (c) {
      const l = e.get(c);
      Tn((i) => {
        l && l[i ? "delete" : "clear"](i);
      }, r);
    } else
      e.forEach((l) => {
        l.clear();
      }), e.clear();
  }, s = (c, r) => {
    if (Oe(c)) {
      const u = e.get(c) || /* @__PURE__ */ new Set();
      return e.set(c, u), Tn((a) => {
        Et(a) && u.add(a);
      }, r), R(n, c, r);
    }
    Un(r) && r && n();
    const l = At(c), i = [];
    return W(l, (u) => {
      const a = c[u];
      a && K(i, s(u, a));
    }), R(yt, i);
  }, o = (c, r) => {
    W(Ft(e.get(c)), (l) => {
      r && !je(r) ? l.apply(0, r) : l();
    });
  };
  return s(t || {}), [s, n, o];
}, An = (t) => JSON.stringify(t, (e, n) => {
  if (Et(n))
    throw 0;
  return n;
}), Hn = (t, e) => t ? `${e}`.split(".").reduce((n, s) => n && es(n, s) ? n[s] : void 0, t) : void 0, qs = {
  paddingAbsolute: !1,
  showNativeOverlaidScrollbars: !1,
  update: {
    elementEvents: [["img", "load"]],
    debounce: [0, 33],
    attributes: null,
    ignoreMutation: null
  },
  overflow: {
    x: "scroll",
    y: "scroll"
  },
  scrollbars: {
    theme: "os-theme-dark",
    visibility: "auto",
    autoHide: "never",
    autoHideDelay: 1300,
    autoHideSuspend: !1,
    dragScroll: !0,
    clickScroll: !1,
    pointers: ["mouse", "touch", "pen"]
  }
}, us = (t, e) => {
  const n = {}, s = Tt(At(e), At(t));
  return W(s, (o) => {
    const c = t[o], r = e[o];
    if (le(c) && le(r))
      G(n[o] = {}, us(c, r)), sn(n[o]) && delete n[o];
    else if (es(e, o) && r !== c) {
      let l = !0;
      if (xt(c) || xt(r))
        try {
          An(c) === An(r) && (l = !1);
        } catch {
        }
      l && (n[o] = r);
    }
  }), n;
}, Pn = (t, e, n) => (s) => [Hn(t, s), n || Hn(e, s) !== void 0], ue = "data-overlayscrollbars", fs = "os-environment", Ks = `${fs}-scrollbar-hidden`, Me = `${ue}-initialize`, bt = ue, ds = `${bt}-overflow-x`, ps = `${bt}-overflow-y`, bs = "overflowVisible", Js = "scrollbarPressed", Je = "updating", Qs = "body", Lt = `${ue}-viewport`, to = "arrange", vs = "scrollbarHidden", Xt = bs, Qe = `${ue}-padding`, eo = Xt, kn = `${ue}-content`, an = "os-size-observer", no = `${an}-appear`, so = `${an}-listener`, oo = "os-trinsic-observer", co = "os-theme-none", dt = "os-scrollbar", ro = `${dt}-rtl`, lo = `${dt}-horizontal`, io = `${dt}-vertical`, ms = `${dt}-track`, un = `${dt}-handle`, ao = `${dt}-visible`, uo = `${dt}-cornerless`, Ln = `${dt}-interaction`, _n = `${dt}-unusable`, tn = `${dt}-auto-hide`, Dn = `${tn}-hidden`, In = `${dt}-wheel`, fo = `${ms}-interactive`, po = `${un}-interactive`, ys = {}, gs = {}, bo = (t) => {
  W(t, (e) => W(e, (n, s) => {
    ys[s] = e[s];
  }));
}, hs = (t, e, n) => At(t).map((s) => {
  const { static: o, instance: c } = t[s], [r, l, i] = n || [], u = n ? c : o;
  if (u) {
    const a = n ? u(r, l, e) : u(e);
    return (i || gs)[s] = a;
  }
}), ee = (t) => gs[t], vo = "__osOptionsValidationPlugin", mo = "__osSizeObserverPlugin", yo = (t, e) => {
  const { T: n } = e, [s, o] = t("showNativeOverlaidScrollbars");
  return [s && n.x && n.y, o];
}, we = (t) => t.indexOf(Kn) === 0, ws = (t, e) => {
  const { D: n } = t, s = (i) => {
    const u = zt(n, i), d = (e ? e[i] : u) === "scroll";
    return [u, d];
  }, [o, c] = s(Te), [r, l] = s(Ae);
  return {
    k: {
      x: o,
      y: r
    },
    R: {
      x: c,
      y: l
    }
  };
}, go = (t, e, n, s) => {
  const o = e.x || e.y, c = (a, d) => {
    const v = we(a), C = v && o ? "hidden" : "", A = d && v && a.replace(`${Kn}-`, "") || C;
    return [d && !v ? a : "", we(A) ? "hidden" : A];
  }, [r, l] = c(n.x, e.x), [i, u] = c(n.y, e.y);
  return s[Te] = l && i ? l : r, s[Ae] = u && r ? u : i, ws(t, s);
}, fn = "__osScrollbarsHidingPlugin", ho = "__osClickScrollPlugin";
let Ne;
const wo = () => {
  const t = (y, O, I, L) => {
    vt(y, O);
    const z = is(O), F = re(O), V = rn(I);
    return L && Dt(O), {
      x: F.h - z.h + V.h,
      y: F.w - z.w + V.w
    };
  }, e = (y) => {
    let O = !1;
    const I = ge(y, Ks);
    try {
      O = zt(y, "scrollbar-width") === "none" || zt(y, "display", "::-webkit-scrollbar") === "none";
    } catch {
    }
    return I(), O;
  }, n = (y, O) => {
    Jt(y, {
      [Te]: qt,
      [Ae]: qt,
      direction: "rtl"
    }), It(y, {
      x: 0
    });
    const I = Ve(y), L = Ve(O);
    It(y, {
      x: -999
    });
    const z = Ve(O);
    return {
      i: I.x === L.x,
      n: L.x !== z.x
    };
  }, { body: s } = document, c = ls(`<div class="${fs}"><div></div></div>`)[0], r = c.firstChild, [l, , i] = Ke(), [u, a] = wt({
    o: t(s, c, r),
    u: Qn
  }, R(t, s, c, r, !0)), [d] = a(), v = e(c), C = {
    x: d.x === 0,
    y: d.y === 0
  }, A = {
    elements: {
      host: null,
      padding: !v,
      viewport: (y) => v && y === y.ownerDocument.body && y,
      content: !1
    },
    scrollbars: {
      slot: !0
    },
    cancel: {
      nativeScrollbarsOverlaid: !1,
      body: null
    }
  }, H = G({}, qs), D = R(G, {}, H), P = R(G, {}, A), S = {
    P: d,
    T: C,
    L: v,
    J: !!Be,
    K: n(c, r),
    Z: R(l, "r"),
    G: P,
    tt: (y) => G(A, y) && P(),
    nt: D,
    ot: (y) => G(H, y) && D(),
    st: G({}, A),
    et: G({}, H)
  };
  return Ct(c, "style"), Dt(c), mt.addEventListener("resize", () => {
    let y;
    if (!v && (!C.x || !C.y)) {
      const O = ee(fn);
      y = !!(O ? O.Y() : St)(S, u);
    }
    i("r", [y]);
  }), S;
}, gt = () => (Ne || (Ne = wo()), Ne), dn = (t, e) => Et(e) ? e.apply(0, t) : e, So = (t, e, n, s) => {
  const o = ae(s) ? n : s;
  return dn(t, o) || e.apply(0, t);
}, Ss = (t, e, n, s) => {
  const o = ae(s) ? n : s, c = dn(t, o);
  return !!c && (ce(c) ? c : e.apply(0, t));
}, xo = (t, e) => {
  const { nativeScrollbarsOverlaid: n, body: s } = e || {}, { T: o, L: c, G: r } = gt(), { nativeScrollbarsOverlaid: l, body: i } = r().cancel, u = n ?? l, a = ae(s) ? i : s, d = (o.x || o.y) && u, v = t && (xe(a) ? !c : a);
  return !!d || !!v;
}, pn = /* @__PURE__ */ new WeakMap(), Oo = (t, e) => {
  pn.set(t, e);
}, Co = (t) => {
  pn.delete(t);
}, xs = (t) => pn.get(t), $o = (t, e, n) => {
  let s = !1;
  const o = n ? /* @__PURE__ */ new WeakMap() : !1, c = () => {
    s = !0;
  }, r = (l) => {
    if (o && n) {
      const i = n.map((u) => {
        const [a, d] = u || [];
        return [d && a ? (l || cs)(a, t) : [], d];
      });
      W(i, (u) => W(u[0], (a) => {
        const d = u[1], v = o.get(a) || [];
        if (t.contains(a) && d) {
          const A = nt(a, d, (H) => {
            s ? (A(), o.delete(a)) : e(H);
          });
          o.set(a, K(v, A));
        } else
          yt(v), o.delete(a);
      }));
    }
  };
  return r(), [c, r];
}, Rn = (t, e, n, s) => {
  let o = !1;
  const { ct: c, rt: r, lt: l, it: i, ut: u, ft: a } = s || {}, d = ts(() => o && n(!0), {
    v: 33,
    p: 99
  }), [v, C] = $o(t, d, l), A = c || [], H = r || [], D = Tt(A, H), P = (y, O) => {
    if (!je(O)) {
      const I = u || St, L = a || St, z = [], F = [];
      let V = !1, x = !1;
      if (W(O, (g) => {
        const { attributeName: E, target: w, type: $, oldValue: N, addedNodes: X, removedNodes: B } = g, U = $ === "attributes", Y = $ === "childList", Q = t === w, st = U && E, tt = st && He(w, E || "") || null, k = st && N !== tt, J = Ee(H, E) && k;
        if (e && (Y || !Q)) {
          const et = U && k, it = et && i && We(w, i), p = (it ? !I(w, E, N, tt) : !U || et) && !L(g, !!it, t, s);
          W(X, (b) => K(z, b)), W(B, (b) => K(z, b)), x = x || p;
        }
        !e && Q && k && !I(w, E, N, tt) && (K(F, E), V = V || J);
      }), C((g) => yn(z).reduce((E, w) => (K(E, cs(g, w)), We(w, g) ? K(E, w) : E), [])), e)
        return !y && x && n(!1), [!1];
      if (!je(F) || V) {
        const g = [yn(F), V];
        return !y && n.apply(0, g), g;
      }
    }
  }, S = new Ms(R(P, !1));
  return [() => (S.observe(t, {
    attributes: !0,
    attributeOldValue: !0,
    attributeFilter: D,
    subtree: e,
    childList: e,
    characterData: e
  }), o = !0, () => {
    o && (v(), S.disconnect(), o = !1);
  }), () => {
    if (o)
      return d.m(), P(!0, S.takeRecords());
  }];
}, Os = (t, e, n) => {
  const { _t: o, dt: c } = n || {}, r = ee(mo), { K: l } = gt(), i = R(_t, t), [u] = wt({
    o: !1,
    _: !0
  });
  return () => {
    const a = [], v = ls(`<div class="${an}"><div class="${so}"></div></div>`)[0], C = v.firstChild, A = (H) => {
      const D = H instanceof ResizeObserverEntry, P = !D && xt(H);
      let S = !1, y = !1, O = !0;
      if (D) {
        const [I, , L] = u(H.contentRect), z = qe(I), F = as(I, L);
        y = !L || F, S = !y && !z, O = !S;
      } else P ? [, O] = H : y = H === !0;
      if (o && O) {
        const I = P ? H[0] : _t(v);
        It(v, {
          x: he(3333333, 3333333, I && l),
          y: 3333333
        });
      }
      S || e({
        vt: P ? H : void 0,
        ht: !P,
        dt: y
      });
    };
    if (me) {
      const H = new me((D) => A(D.pop()));
      H.observe(C), K(a, () => {
        H.disconnect();
      });
    } else if (r) {
      const [H, D] = r(C, A, c);
      K(a, Tt([ge(v, no), nt(v, "animationstart", H)], D));
    } else
      return St;
    if (o) {
      const [H] = wt({
        o: void 0
      }, i);
      K(a, nt(v, "scroll", (D) => {
        const P = H(), [S, y, O] = P;
        y && (on(C, "ltr rtl"), ge(C, S ? "rtl" : "ltr"), A([!!S, y, O])), ln(D);
      }));
    }
    return R(yt, K(a, vt(t, v)));
  };
}, Eo = (t, e) => {
  let n;
  const s = (i) => i.h === 0 || i.isIntersecting || i.intersectionRatio > 0, o = Gt(oo), [c] = wt({
    o: !1
  }), r = (i, u) => {
    if (i) {
      const a = c(s(i)), [, d] = a;
      return d && !u && e(a) && [a];
    }
  }, l = (i, u) => r(u.pop(), i);
  return [() => {
    const i = [];
    if (mn)
      n = new mn(R(l, !1), {
        root: t
      }), n.observe(o), K(i, () => {
        n.disconnect();
      });
    else {
      const u = () => {
        const a = re(o);
        r(a);
      };
      K(i, Os(o, u)()), u();
    }
    return R(yt, K(i, vt(t, o)));
  }, () => n && l(!0, n.takeRecords())];
}, To = (t, e, n, s) => {
  let o, c, r, l, i, u;
  const { L: a } = gt(), d = `[${bt}]`, v = `[${Lt}]`, C = ["tabindex"], A = ["wrap", "cols", "rows"], H = ["id", "class", "style", "open"], { gt: D, bt: P, D: S, wt: y, St: O, V: I, yt: L, Ot: z } = t, F = {
    $t: !1,
    N: _t(D)
  }, V = gt(), x = ee(fn), [g] = wt({
    u: Jn,
    o: {
      w: 0,
      h: 0
    }
  }, () => {
    const f = x && x.M(t, e, F, V, n).W, p = L(Xt), b = !I && L(to), m = b && Qt(S);
    z(Xt), I && z(Je, !0);
    const h = b && f && f()[0], T = Ze(y), _ = Ze(S), M = rn(S);
    return z(Xt, p), I && z(Je), h && h(), It(S, m), {
      w: _.w + T.w + M.w,
      h: _.h + T.h + M.h
    };
  }), E = O ? A : Tt(H, A), w = ts(s, {
    v: () => o,
    p: () => c,
    S(f, p) {
      const [b] = f, [m] = p;
      return [Tt(At(b), At(m)).reduce((h, T) => (h[T] = b[T] || m[T], h), {})];
    }
  }), $ = (f) => {
    if (I) {
      const p = _t(D);
      G(f, {
        Ct: u !== p
      }), G(F, {
        N: p
      }), u = p;
    }
  }, N = (f) => {
    W(f || C, (p) => {
      if (Ee(C, p)) {
        const b = He(P, p);
        Oe(b) ? ht(S, p, b) : Ct(S, p);
      }
    });
  }, X = (f, p) => {
    const [b, m] = f, h = {
      xt: m
    };
    return G(F, {
      $t: b
    }), !p && s(h), h;
  }, B = ({ ht: f, vt: p, dt: b }) => {
    const h = !(f && !b && !p) && a ? w : s, [T, _] = p || [], M = {
      ht: f || b,
      dt: b,
      Ct: _
    };
    $(M), p && G(F, {
      N: T
    }), h(M);
  }, U = (f, p) => {
    const [, b] = g(), m = {
      Ht: b
    };
    return $(m), b && !p && (f ? s : w)(m), m;
  }, Y = (f, p, b) => {
    const m = {
      It: p
    };
    return $(m), p && !b ? w(m) : I || N(f), m;
  }, { Z: Q } = V, [st, tt] = y ? Eo(P, X) : [], k = !I && Os(P, B, {
    dt: !0,
    _t: !0
  }), [J, et] = Rn(P, !1, Y, {
    rt: H,
    ct: Tt(H, C)
  }), it = I && me && new me((f) => {
    const p = f[f.length - 1].contentRect;
    B({
      ht: !0,
      dt: as(p, i)
    }), i = p;
  });
  return [() => {
    N(), it && it.observe(P);
    const f = k && k(), p = st && st(), b = J(), m = Q((h) => {
      const [, T] = g();
      w({
        zt: h,
        Ht: T
      });
    });
    return () => {
      it && it.disconnect(), f && f(), p && p(), l && l(), b(), m();
    };
  }, ({ Et: f, At: p, Tt: b }) => {
    const m = {}, [h] = f("update.ignoreMutation"), [T, _] = f("update.attributes"), [M, Z] = f("update.elementEvents"), [rt, at] = f("update.debounce"), q = Z || _, lt = p || b, Rt = (j) => Et(h) && h(j);
    if (q) {
      r && r(), l && l();
      const [j, ct] = Rn(y || S, !0, U, {
        ct: Tt(E, T || []),
        lt: M,
        it: d,
        ft: (ut, ft) => {
          const { target: ot, attributeName: pt } = ut;
          return (!ft && pt && !I ? Gs(ot, d, v) : !1) || !!jt(ot, `.${dt}`) || !!Rt(ut);
        }
      });
      l = j(), r = ct;
    }
    if (at)
      if (w.m(), xt(rt)) {
        const j = rt[0], ct = rt[1];
        o = $t(j) && j, c = $t(ct) && ct;
      } else $t(rt) ? (o = rt, c = !1) : (o = !1, c = !1);
    if (lt) {
      const j = et(), ct = tt && tt(), ut = r && r();
      j && G(m, Y(j[0], j[1], lt)), ct && G(m, X(ct[0], lt)), ut && G(m, U(ut[0], lt));
    }
    return $(m), m;
  }, F];
}, Ao = (t, e, n, s) => {
  const { G: o, K: c } = gt(), { scrollbars: r } = o(), { slot: l } = r, { gt: i, bt: u, D: a, Dt: d, kt: v, Rt: C, V: A } = e, { scrollbars: H } = d ? {} : t, { slot: D } = H || {}, P = /* @__PURE__ */ new Map(), S = (f) => Be && new Be({
    source: v,
    axis: f
  }), y = S("x"), O = S("y"), I = Ss([i, u, a], () => A && C ? i : u, l, D), L = (f, p) => {
    if (p) {
      const M = f ? Yt : Zt, { Mt: Z, Vt: rt } = p, at = Wt(rt)[M], q = Wt(Z)[M];
      return Ge(0, 1, at / q || 0);
    }
    const b = f ? "x" : "y", { Lt: m, Pt: h } = n, T = h[b], _ = m[b];
    return Ge(0, 1, T / (T + _) || 0);
  }, z = (f, p, b, m) => {
    const h = L(b, f);
    return 1 / h * (1 - h) * (m ? 1 - p : p) || 0;
  }, F = (f, p) => G(f, p ? {
    clear: ["left"]
  } : {}), V = (f) => {
    P.forEach((p, b) => {
      (f ? Ee(Bn(f), b) : !0) && (W(p || [], (h) => {
        h && h.cancel();
      }), P.delete(b));
    });
  }, x = (f, p, b, m) => {
    const h = P.get(f) || [], T = h.find((_) => _ && _.timeline === p);
    T ? T.effect = new KeyframeEffect(f, b, {
      composite: m
    }) : P.set(f, Tt(h, [f.animate(b, {
      timeline: p,
      composite: m
    })]));
  }, g = (f, p, b) => {
    const m = b ? ge : on;
    W(f, (h) => {
      m(h.Ut, p);
    });
  }, E = (f, p) => {
    W(f, (b) => {
      const [m, h] = p(b);
      Jt(m, h);
    });
  }, w = (f, p) => {
    E(f, (b) => {
      const { Vt: m } = b;
      return [m, {
        [p ? Yt : Zt]: Sn(L(p))
      }];
    });
  }, $ = (f, p) => {
    const { Lt: b } = n, m = p ? b.x : b.y, h = (T, _, M) => Re(Sn(z(T, En(_, m, M), p, M)), p);
    if (y && O)
      W(f, (T) => {
        const { Ut: _, Vt: M } = T, Z = p && _t(_) && c;
        x(M, p ? y : O, F({
          transform: $n(m, Z).map((rt) => h(T, rt, Z))
        }, Z));
      });
    else {
      const T = Qt(v);
      E(f, (_) => {
        const { Vt: M, Ut: Z } = _;
        return [M, {
          transform: h(_, p ? T.x : T.y, p && _t(Z) && c)
        }];
      });
    }
  }, N = (f) => A && !C && Kt(f) === a, X = [], B = [], U = [], Y = (f, p, b) => {
    const m = Un(b), h = m ? b : !0, T = m ? !b : !0;
    h && g(B, f, p), T && g(U, f, p);
  }, Q = () => {
    w(B, !0), w(U);
  }, st = () => {
    $(B, !0), $(U);
  }, tt = () => {
    if (A) {
      const { Lt: f } = n, p = 0.5;
      if (y && O)
        W(Tt(U, B), ({ Ut: b }) => {
          if (N(b)) {
            const m = (h, T, _) => {
              const M = _ && _t(b) && c;
              x(b, h, F({
                transform: $n(T - p, M).map((Z) => Re(Ye(Z), _))
              }, M), "add");
            };
            m(y, f.x, !0), m(O, f.y);
          } else
            V(b);
        });
      else {
        const b = Qt(v), m = (h) => {
          const { Ut: T } = h, _ = N(T) && T, M = (Z, rt, at) => {
            const q = En(Z, rt, at), lt = rt * q;
            return Ye(at ? -lt : lt);
          };
          return [_, {
            transform: _ ? Re({
              x: M(b.x, f.x, _t(T) && c),
              y: M(b.y, f.y)
            }) : ""
          }];
        };
        E(B, m), E(U, m);
      }
    }
  }, k = (f) => {
    const b = Gt(`${dt} ${f ? lo : io}`), m = Gt(ms), h = Gt(un), T = {
      Ut: b,
      Mt: m,
      Vt: h
    };
    return K(f ? B : U, T), K(X, [vt(b, m), vt(m, h), R(Dt, b), V, s(T, Y, $, f)]), T;
  }, J = R(k, !0), et = R(k, !1), it = () => (vt(I, B[0].Ut), vt(I, U[0].Ut), R(yt, X));
  return J(), et(), [{
    Bt: Q,
    Nt: st,
    jt: tt,
    Ft: Y,
    qt: {
      J: y,
      Wt: B,
      Xt: J,
      Yt: R(E, B)
    },
    Jt: {
      J: O,
      Wt: U,
      Xt: et,
      Yt: R(E, U)
    }
  }, it];
}, Ho = (t, e, n) => {
  const { bt: s, kt: o, Kt: c } = e;
  return (r, l, i, u) => {
    const { Ut: a, Mt: d, Vt: v } = r, [C, A] = kt(333), [H, D] = kt(), P = R(i, [r], u), S = !!o.scrollBy, y = `client${u ? "X" : "Y"}`, O = u ? Yt : Zt, I = u ? "left" : "top", L = u ? "w" : "h", z = u ? "x" : "y", F = (g) => g.propertyName.indexOf(O) > -1, V = () => {
      const g = "pointerup pointerleave pointercancel lostpointercapture", E = (w, $) => (N) => {
        const { Lt: X } = n, B = re(d)[L] - re(v)[L], Y = $ * N / B * X[z];
        It(o, {
          [z]: w + Y
        });
      };
      return nt(d, "pointerdown", (w) => {
        const $ = jt(w.target, `.${un}`) === v, N = $ ? v : d, X = t.scrollbars, { button: B, isPrimary: U, pointerType: Y } = w, { pointers: Q } = X;
        if (B === 0 && U && X[$ ? "dragScroll" : "clickScroll"] && (Q || []).includes(Y)) {
          const tt = !$ && w.shiftKey, k = R(Wt, v), J = R(Wt, d), et = (q, lt) => (q || k())[I] - (lt || J())[I], it = ze(Wt(o)[O]) / re(o)[L] || 1, f = E(Qt(o)[z] || 0, 1 / it), p = w[y], b = k(), m = J(), h = b[O], T = et(b, m) + h / 2, _ = p - m[I], M = $ ? 0 : _ - T, Z = (q) => {
            yt(at), N.releasePointerCapture(q.pointerId);
          }, at = [ie(s, bt, Js), nt(c, g, Z), nt(c, "selectstart", (q) => Cn(q), {
            H: !1
          }), nt(d, g, Z), nt(d, "pointermove", (q) => {
            const lt = q[y] - p;
            ($ || tt) && f(M + lt);
          })];
          if (N.setPointerCapture(w.pointerId), tt)
            f(M);
          else if (!$) {
            const q = ee(ho);
            q && K(at, q(f, et, M, h, _));
          }
        }
      });
    };
    let x = !0;
    return R(yt, [nt(a, "pointerenter", () => {
      l(Ln, !0);
    }), nt(a, "pointerleave pointercancel", () => {
      l(Ln, !1);
    }), nt(a, "wheel", (g) => {
      const { deltaX: E, deltaY: w, deltaMode: $ } = g;
      S && x && $ === 0 && Kt(a) === s && o.scrollBy({
        left: E,
        top: w,
        behavior: "smooth"
      }), x = !1, l(In, !0), C(() => {
        x = !0, l(In);
      }), Cn(g);
    }, {
      H: !1,
      I: !0
    }), nt(v, "transitionstart", (g) => {
      if (F(g)) {
        const E = () => {
          P(), H(E);
        };
        E();
      }
    }), nt(v, "transitionend transitioncancel", (g) => {
      F(g) && (D(), P());
    }), nt(a, "mousedown", R(nt, c, "click", ln, {
      A: !0,
      I: !0
    }), {
      I: !0
    }), V(), A, D]);
  };
}, Po = (t, e, n, s, o, c) => {
  let r, l, i, u, a, d = St, v = 0;
  const [C, A] = kt(), [H, D] = kt(), [P, S] = kt(100), [y, O] = kt(100), [I, L] = kt(100), [z, F] = kt(() => v), [V, x] = Ao(t, o, s, Ho(e, o, s)), { bt: g, Zt: E, Rt: w } = o, { Ft: $, Bt: N, Nt: X, jt: B } = V, U = (k) => {
    $(tn, k, !0), $(tn, k, !1);
  }, Y = (k, J) => {
    if (F(), k)
      $(Dn);
    else {
      const et = R($, Dn, !0);
      v > 0 && !J ? z(et) : et();
    }
  }, Q = (k) => k.pointerType === "mouse", st = (k) => {
    Q(k) && (u = l, u && Y(!0));
  }, tt = [S, F, O, L, D, A, () => d(), nt(g, "pointerover", st, {
    A: !0
  }), nt(g, "pointerenter", st), nt(g, "pointerleave", (k) => {
    Q(k) && (u = !1, l && Y(!1));
  }), nt(g, "pointermove", (k) => {
    Q(k) && r && C(() => {
      S(), Y(!0), y(() => {
        r && Y(!1);
      });
    });
  }), nt(E, "scroll", (k) => {
    H(() => {
      X(), i && Y(!0), P(() => {
        i && !u && Y(!1);
      });
    }), c(k), B();
  })];
  return [() => R(yt, K(tt, x())), ({ Et: k, Tt: J, Gt: et, Qt: it }) => {
    const { tn: f, nn: p, sn: b } = it || {}, { Ct: m, dt: h } = et || {}, { N: T } = n, { T: _ } = gt(), { k: M, en: Z } = s, [rt, at] = k("showNativeOverlaidScrollbars"), [q, lt] = k("scrollbars.theme"), [Rt, j] = k("scrollbars.visibility"), [ct, ut] = k("scrollbars.autoHide"), [ft, ot] = k("scrollbars.autoHideSuspend"), [pt] = k("scrollbars.autoHideDelay"), [Vt, Ut] = k("scrollbars.dragScroll"), [Ot, Mt] = k("scrollbars.clickScroll"), [Ht, Le] = k("overflow"), Pt = h && !J, _e = Z.x || Z.y, ne = f || p || m || J, fe = b || j || Le, de = rt && _.x && _.y, se = (oe, Bt, bn) => {
      const vn = oe.includes("scroll") && (Rt === "visible" || Rt === "auto" && Bt === "scroll");
      return $(ao, vn, bn), vn;
    };
    if (v = pt, Pt && (ft && _e ? (U(!1), d(), I(() => {
      d = nt(E, "scroll", R(U, !0), {
        A: !0
      });
    })) : U(!0)), at && $(co, de), lt && ($(a), $(q, !0), a = q), ot && !ft && U(!0), ut && (r = ct === "move", l = ct === "leave", i = ct !== "never", Y(!i, !0)), Ut && $(po, Vt), Mt && $(fo, Ot), fe) {
      const oe = se(Ht.x, M.x, !0), Bt = se(Ht.y, M.y, !1);
      $(uo, !(oe && Bt));
    }
    ne && (N(), X(), B(), $(_n, !Z.x, !0), $(_n, !Z.y, !1), $(ro, T && !w));
  }, {}, V];
}, ko = (t) => {
  const e = gt(), { G: n, L: s } = e, { elements: o } = n(), { host: c, padding: r, viewport: l, content: i } = o, u = ce(t), a = u ? {} : t, { elements: d } = a, { host: v, padding: C, viewport: A, content: H } = d || {}, D = u ? t : a.target, P = We(D, "textarea"), S = D.ownerDocument, y = S.documentElement, O = D === S.body, I = S.defaultView, L = () => S.activeElement, z = (j) => {
    j && j.focus && j.focus();
  }, F = R(So, [D]), V = R(Ss, [D]), x = R(dn, [D]), g = R(Gt, ""), E = R(F, g, l), w = R(V, g, i), $ = E(A), N = $ === D, X = N && O, B = !N && w(H), U = !N && ce($) && $ === B, Y = U && !!x(i), Q = Y ? E() : $, st = Y ? B : w(), k = X ? y : U ? Q : $, J = P ? F(g, c, v) : D, et = X ? k : J, it = U ? st : B, f = {
    gt: D,
    bt: et,
    D: k,
    cn: !N && V(g, r, C),
    wt: it,
    kt: X ? y : k,
    Zt: X ? S : k,
    rn: O ? y : D,
    ln: I,
    Kt: S,
    St: P,
    Rt: O,
    Dt: u,
    V: N,
    an: U,
    yt: (j) => Bs(k, N ? bt : Lt, j),
    Ot: (j, ct) => ve(k, N ? bt : Lt, j, ct)
  }, p = At(f).reduce((j, ct) => {
    const ut = f[ct];
    return K(j, ut && ce(ut) && !Kt(ut) ? ut : !1);
  }, []), b = (j) => j ? Ee(p, j) : null, { gt: m, bt: h, cn: T, D: _, wt: M } = f, Z = [() => {
    Ct(h, [bt, Me]), Ct(m, Me), O && Ct(y, [Me, bt]);
  }], rt = P && b(h);
  let at = P ? m : Xe([M, _, T, h, m].find((j) => b(j) === !1));
  const q = X ? m : M || _, lt = R(yt, Z);
  return [f, () => {
    const j = L(), ct = (ot) => {
      vt(Kt(ot), Xe(ot)), Dt(ot);
    }, ut = (ot) => ot ? nt(ot, "focusin focusout focus blur", (pt) => {
      ln(pt), pt.stopImmediatePropagation();
    }, {
      I: !0,
      H: !1
    }) : St, ft = ut(j);
    if (ht(h, bt, N ? "viewport" : "host"), ht(T, Qe, ""), ht(M, kn, ""), N || (ht(_, Lt, ""), O && ie(y, bt, Qs)), rt && (hn(m, h), K(Z, () => {
      hn(h, m), Dt(h);
    })), vt(q, at), vt(h, T), vt(T || h, !N && _), vt(_, M), K(Z, [ft, () => {
      const ot = L(), pt = ut(ot);
      Ct(T, Qe), Ct(M, kn), Ct(_, [ds, ps, Lt]), b(M) && ct(M), b(_) && ct(_), b(T) && ct(T), z(ot), pt();
    }]), s && !N && (ie(_, Lt, vs), K(Z, R(Ct, _, Lt))), !N && I.top === I && j === D) {
      const ot = "tabindex", pt = He(_, ot);
      ht(_, ot, "-1"), z(_);
      const Vt = () => pt ? ht(_, ot, pt) : Ct(_, ot), Ut = nt(S, "pointerdown keydown", () => {
        Vt(), Ut();
      });
      K(Z, [Vt, Ut]);
    } else
      z(j);
    return ft(), at = 0, lt;
  }, lt];
}, Lo = ({ wt: t }) => ({ Gt: e, un: n, Tt: s }) => {
  const { xt: o } = e || {}, { $t: c } = n;
  t && (o || s) && Jt(t, {
    [Zt]: c && "100%"
  });
}, _o = ({ bt: t, cn: e, D: n, V: s }, o) => {
  const [c, r] = wt({
    u: Us,
    o: xn()
  }, R(xn, t, "padding", ""));
  return ({ Et: l, Gt: i, un: u, Tt: a }) => {
    let [d, v] = r(a);
    const { L: C } = gt(), { ht: A, Ht: H, Ct: D } = i || {}, { N: P } = u, [S, y] = l("paddingAbsolute");
    (A || v || (a || H)) && ([d, v] = c(a));
    const I = !s && (y || D || v);
    if (I) {
      const L = !S || !e && !C, z = d.r + d.l, F = d.t + d.b, V = {
        [Zn]: L && !P ? -z : 0,
        [qn]: L ? -F : 0,
        [Yn]: L && P ? -z : 0,
        top: L ? -d.t : 0,
        right: L ? P ? -d.r : "auto" : 0,
        left: L ? P ? "auto" : -d.l : 0,
        [Yt]: L && `calc(100% + ${z}px)`
      }, x = {
        [jn]: L ? d.t : 0,
        [Gn]: L ? d.r : 0,
        [Xn]: L ? d.b : 0,
        [Wn]: L ? d.l : 0
      };
      Jt(e || n, V), Jt(n, x), G(o, {
        cn: d,
        fn: !L,
        j: e ? x : G({}, V, x)
      });
    }
    return {
      _n: I
    };
  };
}, Do = (t, e) => {
  const n = gt(), { bt: s, cn: o, D: c, V: r, Ot: l, Rt: i, ln: u } = t, { L: a } = n, d = i && r, v = R(be, 0), C = {
    u: Jn,
    o: {
      w: 0,
      h: 0
    }
  }, A = {
    u: Qn,
    o: {
      x: qt,
      y: qt
    }
  }, H = (x, g) => {
    const E = mt.devicePixelRatio % 1 !== 0 ? 1 : 0, w = {
      w: v(x.w - g.w),
      h: v(x.h - g.h)
    };
    return {
      w: w.w > E ? w.w : 0,
      h: w.h > E ? w.h : 0
    };
  }, [D, P] = wt(C, R(rn, c)), [S, y] = wt(C, R(Ze, c)), [O, I] = wt(C), [L, z] = wt(C), [F] = wt(A), V = ee(fn);
  return ({ Et: x, Gt: g, un: E, Tt: w }, { _n: $ }) => {
    const { ht: N, Ht: X, Ct: B, zt: U } = g || {}, Y = V && V.M(t, e, E, n, x), { q: Q, W: st, X: tt } = Y || {}, [k, J] = yo(x, n), [et, it] = x("overflow"), f = N || $ || X || B || U || J, p = we(et.x), b = we(et.y), m = p || b;
    let h = P(w), T = y(w), _ = I(w), M = z(w), Z;
    if (J && a && l(vs, !k), f) {
      m && l(Xt, !1);
      const [Ot, Mt] = st ? st(Z) : [], [Ht, Le] = h = D(w), [Pt, _e] = T = S(w), ne = is(c), fe = Pt, de = ne;
      Ot && Ot(), (_e || Le || J) && Mt && !k && Q && Q(Mt, Pt, Ht);
      const se = Ys(u), oe = {
        w: v(be(Pt.w, fe.w) + Ht.w),
        h: v(be(Pt.h, fe.h) + Ht.h)
      }, Bt = {
        w: v((d ? se.w : de.w + v(ne.w - Pt.w)) + Ht.w),
        h: v((d ? se.h : de.h + v(ne.h - Pt.h)) + Ht.h)
      };
      M = L(Bt), _ = O(H(oe, Bt), w);
    }
    const [rt, at] = M, [q, lt] = _, [Rt, j] = T, [ct, ut] = h, ft = {
      x: q.w > 0,
      y: q.h > 0
    }, ot = p && b && (ft.x || ft.y) || p && ft.x && !ft.y || b && ft.y && !ft.x;
    if ($ || B || U || ut || j || at || lt || it || J || f) {
      const Ot = {}, Mt = go(t, ft, et, Ot);
      tt && tt(Mt, E, !!Q && Q(Mt, Rt, ct), Ot), r ? (ht(s, ds, Ot[Te]), ht(s, ps, Ot[Ae])) : Jt(c, Ot);
    }
    ve(s, bt, bs, ot), ve(o, Qe, eo, ot), r || ve(c, Lt, Xt, m);
    const [Vt, Ut] = F(ws(t).k);
    return G(e, {
      k: Vt,
      Pt: {
        x: rt.w,
        y: rt.h
      },
      Lt: {
        x: q.w,
        y: q.h
      },
      en: ft
    }), {
      sn: Ut,
      tn: at,
      nn: lt
    };
  };
}, Io = (t) => {
  const [e, n, s] = ko(t), o = {
    cn: {
      t: 0,
      r: 0,
      b: 0,
      l: 0
    },
    fn: !1,
    j: {
      [Zn]: 0,
      [qn]: 0,
      [Yn]: 0,
      [jn]: 0,
      [Gn]: 0,
      [Xn]: 0,
      [Wn]: 0
    },
    Pt: {
      x: 0,
      y: 0
    },
    Lt: {
      x: 0,
      y: 0
    },
    k: {
      x: qt,
      y: qt
    },
    en: {
      x: !1,
      y: !1
    }
  }, { gt: c, D: r, V: l } = e, { L: i, T: u } = gt(), a = !i && (u.x || u.y), d = [Lo(e), _o(e, o), Do(e, o)];
  return [n, (v) => {
    const C = {}, H = a && Qt(r), D = l ? ie(r, bt, Je) : St;
    return W(d, (P) => {
      G(C, P(v, C) || {});
    }), D(), It(r, H), !l && It(c, 0), C;
  }, o, e, s];
}, Ro = (t, e, n, s) => {
  const o = Pn(e, {}), [c, r, l, i, u] = Io(t), [a, d, v] = To(i, l, o, (S) => {
    P({}, S);
  }), [C, A, , H] = Po(t, e, v, l, i, s), D = (S) => At(S).some((y) => !!S[y]), P = (S, y) => {
    const { dn: O, Tt: I, At: L, vn: z } = S, F = O || {}, V = !!I, x = {
      Et: Pn(e, F, V),
      dn: F,
      Tt: V
    };
    if (z)
      return A(x), !1;
    const g = y || d(G({}, x, {
      At: L
    })), E = r(G({}, x, {
      un: v,
      Gt: g
    }));
    A(G({}, x, {
      Gt: g,
      Qt: E
    }));
    const w = D(g), $ = D(E), N = w || $ || !sn(F) || V;
    return N && n(S, {
      Gt: g,
      Qt: E
    }), N;
  };
  return [() => {
    const { rn: S, D: y } = i, O = Qt(S), I = [a(), c(), C()];
    return It(y, O), R(yt, I);
  }, P, () => ({
    hn: v,
    pn: l
  }), {
    gn: i,
    bn: H
  }, u];
}, te = (t, e, n) => {
  const { nt: s } = gt(), o = ce(t), c = o ? t : t.target, r = xs(c);
  if (e && !r) {
    let l = !1;
    const i = [], u = {}, a = (x) => {
      const g = ns(x), E = ee(vo);
      return E ? E(g, !0) : g;
    }, d = G({}, s(), a(e)), [v, C, A] = Ke(), [H, D, P] = Ke(n), S = (x, g) => {
      P(x, g), A(x, g);
    }, [y, O, I, L, z] = Ro(t, d, ({ dn: x, Tt: g }, { Gt: E, Qt: w }) => {
      const { ht: $, Ct: N, xt: X, Ht: B, It: U, dt: Y } = E, { tn: Q, nn: st, sn: tt } = w;
      S("updated", [V, {
        updateHints: {
          sizeChanged: !!$,
          directionChanged: !!N,
          heightIntrinsicChanged: !!X,
          overflowEdgeChanged: !!Q,
          overflowAmountChanged: !!st,
          overflowStyleChanged: !!tt,
          contentMutation: !!B,
          hostMutation: !!U,
          appear: !!Y
        },
        changedOptions: x || {},
        force: !!g
      }]);
    }, (x) => S("scroll", [V, x])), F = (x) => {
      Co(c), yt(i), l = !0, S("destroyed", [V, x]), C(), D();
    }, V = {
      options(x, g) {
        if (x) {
          const E = g ? s() : {}, w = us(d, G(E, a(x)));
          sn(w) || (G(d, w), O({
            dn: w
          }));
        }
        return G({}, d);
      },
      on: H,
      off: (x, g) => {
        x && g && D(x, g);
      },
      state() {
        const { hn: x, pn: g } = I(), { N: E } = x, { Pt: w, Lt: $, k: N, en: X, cn: B, fn: U } = g;
        return G({}, {
          overflowEdge: w,
          overflowAmount: $,
          overflowStyle: N,
          hasOverflow: X,
          padding: B,
          paddingAbsolute: U,
          directionRTL: E,
          destroyed: l
        });
      },
      elements() {
        const { gt: x, bt: g, cn: E, D: w, wt: $, kt: N, Zt: X } = L.gn, { qt: B, Jt: U } = L.bn, Y = (st) => {
          const { Vt: tt, Mt: k, Ut: J } = st;
          return {
            scrollbar: J,
            track: k,
            handle: tt
          };
        }, Q = (st) => {
          const { Wt: tt, Xt: k } = st, J = Y(tt[0]);
          return G({}, J, {
            clone: () => {
              const et = Y(k());
              return O({
                vn: !0
              }), et;
            }
          });
        };
        return G({}, {
          target: x,
          host: g,
          padding: E || w,
          viewport: w,
          content: $ || w,
          scrollOffsetElement: N,
          scrollEventElement: X,
          scrollbarHorizontal: Q(B),
          scrollbarVertical: Q(U)
        });
      },
      update: (x) => O({
        Tt: x,
        At: !0
      }),
      destroy: R(F, !1),
      plugin: (x) => u[At(x)[0]]
    };
    return K(i, [z]), Oo(c, V), hs(ys, te, [V, v, u]), xo(L.gn.Rt, !o && t.cancel) ? (F(!0), V) : (K(i, y()), S("initialized", [V]), V.update(!0), V);
  }
  return r;
};
te.plugin = (t) => {
  const e = xt(t), n = e ? t : [t], s = n.map((o) => hs(o, te)[0]);
  return bo(n), e ? s : s[0];
};
te.valid = (t) => {
  const e = t && t.elements, n = Et(e) && e();
  return ye(n) && !!xs(n.target);
};
te.env = () => {
  const { P: t, T: e, L: n, K: s, J: o, st: c, et: r, G: l, tt: i, nt: u, ot: a } = gt();
  return G({}, {
    scrollbarsSize: t,
    scrollbarsOverlaid: e,
    scrollbarsHiding: n,
    rtlScrollBehavior: s,
    scrollTimeline: o,
    staticDefaultInitialization: c,
    staticDefaultOptions: r,
    getDefaultInitialization: l,
    setDefaultInitialization: i,
    getDefaultOptions: u,
    setDefaultOptions: a
  });
};
const Vo = async (t, e) => {
  let n = t;
  return e.target && (typeof e.target == "string" && (n = e.target), typeof e.target == "function" && (n = await e.target(t))), n;
}, Mo = (t, e) => {
  let n = !0;
  if (e.visible !== void 0 && (typeof e.visible == "function" ? n = e.visible(t) : n = e.visible), n === !1) return { x: "hidden", y: "hidden" };
  let s = !0, o = !0;
  return e.x !== void 0 && (typeof e.x == "function" ? s = e.x(t) : s = e.x), e.y !== void 0 && (typeof e.y == "function" ? o = e.y(t) : o = e.y), { x: s ? "scroll" : "hidden", y: o ? "scroll" : "hidden" };
}, Ko = {
  mounted: async (t, e, n) => {
    const s = (n ? e.value : e) || {}, o = await Vo(t, s);
    if (!o) return;
    const c = Mo(o, s), r = "os-theme-dark das-scrollbar", l = s != null && s.className ? `${r} ${s == null ? void 0 : s.className}` : r, i = te(o, {
      scrollbars: {
        autoHide: "leave",
        // 鼠标移开自动隐藏
        autoHideDelay: 0,
        theme: l
      },
      overflow: c
    }, {
      scroll: (u, a) => {
        s.scroll && typeof s.scroll == "function" && s.scroll(u, a);
      }
    });
    s.scrollReady && s.scrollReady(i);
  }
};
function No(t, e) {
  if (!t || !e.value) return;
  let n = null, s = null;
  n = new MutationObserver((c) => {
    var r, l;
    for (let i = 0; i < c.length; i++)
      if (c[i].type === "attributes" && c[i].attributeName === "style" && /zoom|scale/g.test((l = (r = c[i].target) == null ? void 0 : r.style) == null ? void 0 : l.cssText)) {
        s && clearTimeout(s), s = setTimeout(() => {
          var u;
          (u = e.value) == null || u.update();
        }, 200);
        break;
      }
  });
  const o = { attributes: !0 };
  for (let c = 0; c < t.children[0].children.length; c++)
    n && n.observe(t.children[0].children[c], o);
  Mn(() => {
    n && n.disconnect();
  });
}
let Vn = 0;
function zo(t, e) {
  if (!t || !e.value) return;
  let n = null, s = null;
  n = new MutationObserver((c) => {
    for (let r = 0; r < c.length; r++)
      if (c[r].type === "childList") {
        s && clearTimeout(s), s = setTimeout(() => {
          var l;
          (l = e.value) == null || l.update();
        }, 200);
        break;
      } else if (c[r].type === "attributes" && (t == null ? void 0 : t.scrollHeight) !== Vn) {
        Vn = t == null ? void 0 : t.scrollHeight, s && clearTimeout(s), s = setTimeout(() => {
          var l;
          (l = e.value) == null || l.update();
        }, 200);
        break;
      }
  });
  const o = { childList: !0, subtree: !0, attributes: !0 };
  n && n.observe(t, o), Mn(() => {
    n && n.disconnect();
  });
}
const Fo = /* @__PURE__ */ Cs({
  __name: "scrollbar",
  props: {
    wrapClass: { default: "" },
    viewClass: { default: "" }
  },
  setup(t) {
    const e = De(null);
    function n(r) {
      var l = window.getComputedStyle(r), i = {
        display: l.display,
        "flex-direction": l.getPropertyValue("flex-direction"),
        "flex-wrap": l.getPropertyValue("flex-wrap"),
        "flex-flow": l.getPropertyValue("flex-flow"),
        "justify-content": l.getPropertyValue("justify-content"),
        "align-items": l.getPropertyValue("align-items"),
        "align-content": l.getPropertyValue("align-content"),
        "flex-grow": l.getPropertyValue("flex-grow"),
        "flex-shrink": l.getPropertyValue("flex-shrink"),
        "flex-basis": l.getPropertyValue("flex-basis"),
        flex: l.flex,
        order: l.order
      };
      return i.display === "flex" ? i : {};
    }
    const s = De(1), o = $s(() => ({
      "--das-ui-scrollbar-z-index": s.value
    })), c = De("");
    return Es(() => {
      c.value = `das-scrollbar-pro-${Math.trunc(Math.random() * 1e8)}`, _s(c.value, [
        {
          className: `.${c.value} .das-scrollbar-pro-wrap .inherit-scrollbar-parent-flex`,
          style: n(e.value.wrapRef.parentNode.parentNode)
        }
      ]), s.value = Rs().nextZIndex();
      const r = e.value.wrapRef;
      zo(r, e), No(r, e);
    }), (r, l) => (Ts(), As(Hs(Is), Ps({
      ref_key: "scrollbarRef",
      ref: e,
      class: "das-scrollbar-pro " + c.value
    }, r.$attrs, {
      "wrap-class": "das-scrollbar-pro-wrap " + t.wrapClass,
      "view-class": "das-scrollbar-pro-view inherit-scrollbar-parent-flex" + t.viewClass,
      style: o.value
    }), {
      default: ks(() => [
        Ls(r.$slots, "default", {}, void 0, !0)
      ]),
      _: 3
      /* FORWARDED */
    }, 16, ["class", "wrap-class", "view-class", "style"]));
  }
}), Uo = (t, e) => {
  const n = t.__vccOpts || t;
  for (const [s, o] of e)
    n[s] = o;
  return n;
}, Bo = /* @__PURE__ */ Uo(Fo, [["__scopeId", "data-v-42955df3"]]), Jo = Ds(Bo);
export {
  Jo as DasScrollbar,
  Ko as vScrollbar
};
