import '@das-fed/upf-ui/packages/components/input/style.css';
import { withInstall as ys } from "@das-fed/upf-utils/with-install/index";
import { defineComponent as To, useCssVars as xs, useAttrs as ws, computed as ct, ref as K, onMounted as $o, onBeforeMount as Ss, openBlock as ht, createBlock as Io, unref as Bt, mergeProps as En, withCtx as Dt, createVNode as io, createElementVNode as Re, normalizeClass as Pe, renderSlot as ee, createElementBlock as St, Fragment as Le, createTextVNode as Tn, toDisplayString as ze, createCommentVNode as Lt, normalizeStyle as Ve, nextTick as be, Teleport as Os, getCurrentScope as Cs, onScopeDispose as Es, getCurrentInstance as $n, watch as Gt, createSlots as Ts, withDirectives as $s } from "vue";
import "element-plus/es/components/input/style/css";
import { ElTooltip as Is, ElInput as Ls } from "element-plus";
import { currentLang as Fo, t as Hs, setI18nRule as ks } from "@das-fed/upf-web/packages/i18n/index";
import { DasScrollbar as Ms } from "@das-fed/upf-ui/packages/components/scrollbar/index";
import "element-plus/es/components/tooltip/style/css";
import { createStyle as As } from "@das-fed/upf-utils/style";
import { useZIndex as Rs } from "@das-fed/upf-utils/hooks/popup-manager/use-zindex";
const Ps = {
  key: 0,
  class: "das-tooltip-virtual-placeholder"
}, zs = ["innerHTML"], Vs = { key: 1 }, Bs = /* @__PURE__ */ To({
  __name: "index",
  props: {
    selfPopperClass: { default: "" },
    effect: { default: "light" },
    placement: { default: "top" },
    customClass: { default: "" },
    content: { default: "" },
    disabled: { type: Boolean, default: void 0 },
    text: { default: "" },
    row: { default: 1 },
    textWidth: { default: "100%" },
    textHtml: { type: Boolean, default: !1 },
    isMaxheight: { type: Boolean, default: !0 }
  },
  emits: ["show", "hide"],
  setup(t, { expose: e, emit: o }) {
    xs((m) => ({
      v65704ba4: d.value
    }));
    const n = t, s = o, r = ws(), c = ct(() => {
      const m = "virtual-triggering" in r || "virtualTriggering" in r || r["virtual-triggering"] !== void 0 || r.virtualTriggering !== void 0, E = "virtual-ref" in r || "virtualRef" in r || r["virtual-ref"] !== void 0 || r.virtualRef !== void 0;
      return m || E;
    }), l = K(), a = K(!1), d = ct(() => Number(n.row)), i = ct(() => n.disabled ?? (n.text ? !a.value : !1)), u = ct(() => n.content || n.text), f = (m) => {
      a.value = m.target.scrollHeight > m.target.clientHeight;
    }, x = (m) => {
      s("show", m), window.addEventListener("wheel", v);
    }, C = (m) => {
      s("hide", m), window.removeEventListener("wheel", v);
    }, v = (m) => {
      const E = document.querySelector('[id^="el-popper-container"]');
      if (!E) return;
      const w = E.querySelector(".das-ui-tooltip-popper");
      if (!w) return;
      const g = m.clientX, O = m.clientY, p = w == null ? void 0 : w.getBoundingClientRect();
      w && g >= p.left && g <= p.right && O >= p.top && O <= p.bottom || (w.style.display = "none", w.style.opacity = "0", be(() => {
        C();
      }));
    };
    return $o(() => {
    }), Ss(() => {
      window.removeEventListener("wheel", v);
    }), e({
      $tooltipRef: l
    }), (m, E) => (ht(), Io(Bt(Is), En({
      ref_key: "$tooltipRef",
      ref: l,
      class: "das-ui-tooltip",
      disabled: i.value,
      effect: t.effect,
      placement: t.placement,
      "popper-class": `das-ui-tooltip-popper ${t.isMaxheight ? "max-height" : ""} ${t.selfPopperClass}`,
      "hide-after": 100,
      "show-after": 100
    }, m.$attrs, {
      onShow: x,
      onHide: C
    }), {
      content: Dt(() => [
        io(Bt(Ms), null, {
          default: Dt(() => [
            Re(
              "div",
              {
                class: Pe({ "max-height": t.isMaxheight, "das-popper-content": !0 })
              },
              [
                ee(m.$slots, "content", {}, void 0, !0),
                u.value && !m.$slots.content ? (ht(), St(
                  Le,
                  { key: 0 },
                  [
                    Tn(
                      ze(u.value),
                      1
                      /* TEXT */
                    )
                  ],
                  64
                  /* STABLE_FRAGMENT */
                )) : Lt("v-if", !0)
              ],
              2
              /* CLASS */
            )
          ]),
          _: 3
          /* FORWARDED */
        })
      ]),
      default: Dt(() => [
        c.value ? (ht(), St("span", Ps, " ")) : (ht(), St(
          Le,
          { key: 1 },
          [
            Lt(" 默认 slot 内容 "),
            ee(m.$slots, "default", {}, () => [
              t.text ? (ht(), St(
                "div",
                {
                  key: 0,
                  onMouseenter: E[0] || (E[0] = (w) => f(w)),
                  class: Pe(`das-tooltip-text-wrap ${t.customClass}`),
                  style: Ve({ width: n.textWidth })
                },
                [
                  t.textHtml ? (ht(), St("div", {
                    key: 0,
                    innerHTML: t.text
                  }, null, 8, zs)) : (ht(), St(
                    "div",
                    Vs,
                    ze(t.text),
                    1
                    /* TEXT */
                  ))
                ],
                38
                /* CLASS, STYLE, NEED_HYDRATION */
              )) : (ht(), St(
                Le,
                { key: 1 },
                [
                  Lt(" 当没有 text 且没有 slot 内容时，提供一个占位元素避免 ElOnlyChild 错误 "),
                  E[1] || (E[1] = Re(
                    "span",
                    { class: "das-tooltip-virtual-placeholder" },
                    " ",
                    -1
                    /* CACHED */
                  ))
                ],
                2112
                /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
              ))
            ], !0)
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ]),
      _: 3
      /* FORWARDED */
    }, 16, ["disabled", "effect", "placement", "popper-class"]));
  }
}), In = (t, e) => {
  const o = t.__vccOpts || t;
  for (const [n, s] of e)
    o[n] = s;
  return o;
}, Ds = /* @__PURE__ */ In(Bs, [["__scopeId", "data-v-e1652f58"]]), Ws = /* @__PURE__ */ To({
  __name: "index",
  props: {
    getEl: {},
    errorLabel: { default: "" },
    errorModelZIndex: { default: 2e3 },
    errorWidth: { default: void 0 }
  },
  setup(t) {
    const e = t, o = K(null), n = K(), s = K({
      x: 0,
      y: 0
    }), r = ct(() => ({
      "box-sizing": "border-box",
      "font-size": "12px",
      // 错误浮层直接消费 upf 根变量，确保 Teleport 到 body 后仍随主题同步。
      "background-color": "var(--upf-message-error-bg, var(--upf-bg-primary))",
      "box-shadow": "var(--upf-box-shadow-elevated, 0px 4px 12px rgba(38, 38, 38, 0.12))",
      "border-radius": "var(--upf-border-radius, 4px)",
      padding: "2px 8px",
      "z-index": e.errorModelZIndex
    })), c = ct(() => {
      const d = n.value ?? "0";
      return {
        ...r.value,
        width: d + (/px$/.test(d) ? "" : "px"),
        position: "fixed",
        visibility: "visible",
        top: s.value.y + "px",
        left: s.value.x + "px"
      };
    }), l = K({
      // display: 'block',
      color: "var(--upf-message-error-text, var(--upf-color-error))",
      "white-space": "break-spaces"
    }), a = () => {
      const d = (O = 0) => {
        const p = document.createElement("div");
        for (let [V, I] of Object.entries({
          ...r.value,
          ...l.value,
          width: O + "px"
        }))
          p.style[V] = I;
        const S = document.createElement("span");
        for (let [V, I] of Object.entries(l.value))
          S.style[V] = I;
        S.textContent = e.errorLabel, p.appendChild(S), document.body.appendChild(p);
        const R = p.offsetHeight, W = S.offsetWidth;
        return document.body.removeChild(p), { height: R, textWidth: W };
      }, i = () => {
        const O = document.documentElement.clientHeight, S = document.documentElement.scrollHeight - O;
        return O - S;
      }, u = e.getEl(), f = (u == null ? void 0 : u.clientWidth) ?? 0, x = d(f), C = x.textWidth;
      e.errorWidth ? n.value = e.errorWidth : C > f ? n.value = C + 2 + 8 + "px" : n.value = f + "px";
      const { left: v = 0, bottom: m = 0, height: E = 0 } = (u == null ? void 0 : u.getBoundingClientRect()) ?? {}, w = i(), g = x.height;
      s.value.y = Math.ceil(m + g) >= w ? m - E - g : m, s.value.x = v;
    };
    return $o(async () => {
      await be(), a();
    }), (d, i) => (ht(), Io(Os, { to: "body" }, [
      Re(
        "div",
        {
          ref_key: "$errorModel",
          ref: o,
          style: Ve(c.value)
        },
        [
          Re(
            "span",
            {
              style: Ve(l.value)
            },
            ze(t.errorLabel),
            5
            /* TEXT, STYLE */
          )
        ],
        4
        /* STYLE */
      )
    ]));
  }
});
/*!
 * OverlayScrollbars
 * Version: 2.6.1
 *
 * Copyright (c) Rene Haas | KingSora.
 * https://github.com/KingSora
 *
 * Released under the MIT license.
 */
const Ct = (t, e) => {
  const { o, u: n, _: s } = t;
  let r = o, c;
  const l = (i, u) => {
    const f = r, x = i, C = u || (n ? !n(f, x) : f !== x);
    return (C || s) && (r = x, c = f), [r, C, c];
  };
  return [e ? (i) => l(e(r, c), i) : l, (i) => [r, !!i, c]];
}, Lo = typeof window < "u", yt = Lo ? window : {}, He = Math.max, _s = Math.min, ao = Math.round, Ln = yt.cancelAnimationFrame, Hn = yt.requestAnimationFrame, uo = yt.setTimeout, fo = yt.clearTimeout, Fe = (t) => typeof yt[t] < "u" ? yt[t] : void 0, Ns = Fe("MutationObserver"), Uo = Fe("IntersectionObserver"), Be = Fe("ResizeObserver"), po = Fe("ScrollTimeline"), kn = Lo && Node.ELEMENT_NODE, { toString: Fs, hasOwnProperty: oo } = Object.prototype, Us = /^\[object (.+)\]$/, we = (t) => t === void 0, Ue = (t) => t === null, js = (t) => we(t) || Ue(t) ? `${t}` : Fs.call(t).replace(Us, "$1").toLowerCase(), Ht = (t) => typeof t == "number", je = (t) => typeof t == "string", Mn = (t) => typeof t == "boolean", kt = (t) => typeof t == "function", Tt = (t) => Array.isArray(t), ye = (t) => typeof t == "object" && !Tt(t) && !Ue(t), Xe = (t) => {
  const e = !!t && t.length, o = Ht(e) && e > -1 && e % 1 == 0;
  return Tt(t) || !kt(t) && o ? e > 0 && ye(t) ? e - 1 in t : !0 : !1;
}, De = (t) => {
  if (!t || !ye(t) || js(t) !== "object")
    return !1;
  let e;
  const o = "constructor", n = t[o], s = n && n.prototype, r = oo.call(t, o), c = s && oo.call(s, "isPrototypeOf");
  if (n && !r && !c)
    return !1;
  for (e in t)
    ;
  return we(e) || oo.call(t, e);
}, me = (t) => {
  const e = HTMLElement;
  return t ? e ? t instanceof e : t.nodeType === kn : !1;
}, Ye = (t) => {
  const e = Element;
  return t ? e ? t instanceof e : t.nodeType === kn : !1;
};
function G(t, e) {
  if (Xe(t))
    for (let o = 0; o < t.length && e(t[o], o, t) !== !1; o++)
      ;
  else t && G(Object.keys(t), (o) => e(t[o], o, t));
  return t;
}
const Ze = (t, e) => t.indexOf(e) >= 0, Mt = (t, e) => t.concat(e), tt = (t, e, o) => (!je(e) && Xe(e) ? Array.prototype.push.apply(t, e) : t.push(e), t), Kt = (t) => Array.from(t || []), An = (t) => Tt(t) ? t : [t], ho = (t) => !!t && !t.length, jo = (t) => Kt(new Set(t)), xt = (t, e, o) => {
  G(t, (s) => s && s.apply(void 0, e || [])), !o && (t.length = 0);
}, Rn = "paddingTop", Pn = "paddingRight", zn = "paddingLeft", Vn = "paddingBottom", Bn = "marginLeft", Dn = "marginRight", Wn = "marginBottom", Ge = "overflowX", qe = "overflowY", ce = "width", le = "height", ie = "hidden", _n = "visible", Ho = (t, e, o, n) => {
  if (t && e) {
    let s = !0;
    return G(o, (r) => {
      const c = t[r], l = e[r];
      c !== l && (s = !1);
    }), s;
  }
  return !1;
}, Nn = (t, e) => Ho(t, e, ["w", "h"]), Fn = (t, e) => Ho(t, e, ["x", "y"]), Xs = (t, e) => Ho(t, e, ["t", "r", "b", "l"]), Et = () => {
}, D = (t, ...e) => t.bind(0, ...e), zt = (t) => {
  let e;
  const o = t ? uo : Hn, n = t ? fo : Ln;
  return [(s) => {
    n(e), e = o(s, kt(t) ? t() : t);
  }, () => n(e)];
}, Un = (t, e) => {
  let o, n, s, r = Et;
  const { v: c, p: l, S: a } = e || {}, d = function(C) {
    r(), fo(o), o = n = void 0, r = Et, t.apply(this, C);
  }, i = (x) => a && n ? a(n, x) : x, u = () => {
    r !== Et && d(i(s) || s);
  }, f = function() {
    const C = Kt(arguments), v = kt(c) ? c() : c;
    if (Ht(v) && v >= 0) {
      const E = kt(l) ? l() : l, w = Ht(E) && E >= 0, g = v > 0 ? uo : Hn, O = v > 0 ? fo : Ln, S = i(C) || C, R = d.bind(0, S);
      r();
      const W = g(R, v);
      r = () => O(W), w && !o && (o = uo(u, E)), n = s = S;
    } else
      d(C);
  };
  return f.m = u, f;
}, jn = (t, e) => Object.prototype.hasOwnProperty.call(t, e), At = (t) => t ? Object.keys(t) : [], Y = (t, e, o, n, s, r, c) => {
  const l = [e, o, n, s, r, c];
  return (typeof t != "object" || Ue(t)) && !kt(t) && (t = {}), G(l, (a) => {
    G(a, (d, i) => {
      const u = a[i];
      if (t === u)
        return !0;
      const f = Tt(u);
      if (u && De(u)) {
        const x = t[i];
        let C = x;
        f && !Tt(x) ? C = [] : !f && !De(x) && (C = {}), t[i] = Y(C, u);
      } else
        t[i] = f ? u.slice() : u;
    });
  }), t;
}, Xn = (t, e) => G(Y({}, t), (o, n, s) => {
  o === void 0 ? delete s[n] : o && De(o) && (s[n] = Xn(o));
}), ko = (t) => {
  for (const e in t)
    return !1;
  return !0;
}, vo = (t, e, o) => He(t, _s(e, o)), Yt = (t) => Kt(new Set((Tt(t) ? t : (t || "").split(" ")).filter((e) => e))), Qe = (t, e) => t && t.getAttribute(e), Ot = (t, e, o) => {
  G(Yt(e), (n) => {
    t && t.setAttribute(n, o || "");
  });
}, It = (t, e) => {
  G(Yt(e), (o) => t && t.removeAttribute(o));
}, Ke = (t, e) => {
  const o = Yt(Qe(t, e)), n = D(Ot, t, e), s = (r, c) => {
    const l = new Set(o);
    return G(Yt(r), (a) => l[c](a)), Kt(l).join(" ");
  };
  return {
    O: (r) => n(s(r, "delete")),
    $: (r) => n(s(r, "add")),
    C: (r) => {
      const c = Yt(r);
      return c.reduce((l, a) => l && o.includes(a), c.length > 0);
    }
  };
}, Yn = (t, e, o) => {
  Ke(t, e).O(o);
}, xe = (t, e, o) => (Ke(t, e).$(o), D(Yn, t, e, o)), ke = (t, e, o, n) => {
  (n ? xe : Yn)(t, e, o);
}, Ys = (t, e, o) => Ke(t, e).C(o), Zn = (t) => Ke(t, "class"), Mo = (t, e) => {
  Zn(t).O(e);
}, We = (t, e) => (Zn(t).$(e), D(Mo, t, e)), Xo = Lo && Element.prototype, Gn = (t, e) => {
  const o = [], n = e ? Ye(e) && e : document;
  return n ? tt(o, n.querySelectorAll(t)) : o;
}, Zs = (t, e) => {
  const o = e ? Ye(e) && e : document;
  return o ? o.querySelector(t) : null;
}, mo = (t, e) => Ye(t) ? (Xo.matches || Xo.msMatchesSelector).call(t, e) : !1, go = (t) => t ? Kt(t.childNodes) : [], ae = (t) => t && t.parentElement, oe = (t, e) => Ye(t) && t.closest(e), Gs = (t, e, o) => {
  const n = oe(t, e), s = t && Zs(o, n), r = oe(s, e) === n;
  return n && s ? n === t || s === t || r && oe(oe(t, o), e) !== n : !1;
}, Nt = (t) => {
  if (Xe(t))
    G(Kt(t), (e) => Nt(e));
  else if (t) {
    const e = ae(t);
    e && e.removeChild(t);
  }
}, qn = (t, e, o) => {
  if (o && t) {
    let n = e, s;
    return Xe(o) ? (s = document.createDocumentFragment(), G(o, (r) => {
      r === n && (n = r.previousSibling), s.appendChild(r);
    })) : s = o, e && (n ? n !== e && (n = n.nextSibling) : n = t.firstChild), t.insertBefore(s, n || null), () => Nt(o);
  }
  return Et;
}, bt = (t, e) => qn(t, null, e), Yo = (t, e) => qn(ae(t), t && t.nextSibling, e), ne = (t) => {
  const e = document.createElement("div");
  return Ot(e, "class", t), e;
}, Qn = (t) => {
  const e = ne();
  return e.innerHTML = t.trim(), G(go(e), (o) => Nt(o));
}, qs = /^--/, Zo = (t, e) => t.getPropertyValue(e) || t[e] || "", Ao = (t) => {
  const e = t || 0;
  return isFinite(e) ? e : 0;
}, Te = (t) => Ao(parseFloat(t || "")), Go = (t) => `${(Ao(t) * 100).toFixed(3)}%`, bo = (t) => `${Ao(t)}px`;
function ue(t, e) {
  t && G(e, (o, n) => {
    try {
      const s = t.style, r = Ht(o) ? bo(o) : (o || "") + "";
      qs.test(n) ? s.setProperty(n, r) : s[n] = r;
    } catch {
    }
  });
}
function qt(t, e, o) {
  const n = je(e);
  let s = n ? "" : {};
  if (t) {
    const r = yt.getComputedStyle(t, o) || t.style;
    s = n ? Zo(r, e) : e.reduce((c, l) => (c[l] = Zo(r, l), c), s);
  }
  return s;
}
const _t = (t) => qt(t, "direction") === "rtl", qo = (t, e, o) => {
  const n = e ? `${e}-` : "", s = o ? `-${o}` : "", r = `${n}top${s}`, c = `${n}right${s}`, l = `${n}bottom${s}`, a = `${n}left${s}`, d = qt(t, [r, c, l, a]);
  return {
    t: Te(d[r]),
    r: Te(d[c]),
    b: Te(d[l]),
    l: Te(d[a])
  };
}, no = (t, e) => `translate${ye(t) ? `(${t.x},${t.y})` : `${e ? "X" : "Y"}(${t})`}`, Qs = {
  w: 0,
  h: 0
}, Je = (t, e) => e ? {
  w: e[`${t}Width`],
  h: e[`${t}Height`]
} : Qs, Ks = (t) => Je("inner", t || yt), ge = D(Je, "offset"), Kn = D(Je, "client"), yo = D(Je, "scroll"), Ro = (t) => {
  const e = parseFloat(qt(t, ce)) || 0, o = parseFloat(qt(t, le)) || 0;
  return {
    w: e - ao(e),
    h: o - ao(o)
  };
}, se = (t) => t.getBoundingClientRect(), xo = (t) => !!(t && (t[le] || t[ce])), Jn = (t, e) => {
  const o = xo(t);
  return !xo(e) && o;
}, Qo = (t, e, o, n) => {
  G(Yt(e), (s) => {
    t.removeEventListener(s, o, n);
  });
}, st = (t, e, o, n) => {
  var s;
  const r = (s = n && n.H) != null ? s : !0, c = n && n.I || !1, l = n && n.A || !1, a = {
    passive: r,
    capture: c
  };
  return D(xt, Yt(e).map((d) => {
    const i = l ? (u) => {
      Qo(t, d, i, c), o(u);
    } : o;
    return t.addEventListener(d, i, a), D(Qo, t, d, i, c);
  }));
}, Po = (t) => t.stopPropagation(), Ko = (t) => t.preventDefault(), Js = {
  x: 0,
  y: 0
}, so = (t) => {
  const e = t && se(t);
  return e ? {
    x: e.left + yt.scrollX,
    y: e.top + yt.scrollY
  } : Js;
}, _e = (t, e, o) => o ? o.n ? -t + 0 : o.i ? e - t : t : t, Jo = (t, e) => [_e(0, t, e), _e(t, t, e)], tn = (t, e, o) => vo(0, 1, _e(t, e, o) / e || 0), Ft = (t, e) => {
  const { x: o, y: n } = Ht(e) ? {
    x: e,
    y: e
  } : e || {};
  Ht(o) && (t.scrollLeft = o), Ht(n) && (t.scrollTop = n);
}, de = (t) => ({
  x: t.scrollLeft,
  y: t.scrollTop
}), en = (t, e) => {
  G(An(e), t);
}, wo = (t) => {
  const e = /* @__PURE__ */ new Map(), o = (r, c) => {
    if (r) {
      const l = e.get(r);
      en((a) => {
        l && l[a ? "delete" : "clear"](a);
      }, c);
    } else
      e.forEach((l) => {
        l.clear();
      }), e.clear();
  }, n = (r, c) => {
    if (je(r)) {
      const d = e.get(r) || /* @__PURE__ */ new Set();
      return e.set(r, d), en((i) => {
        kt(i) && d.add(i);
      }, c), D(o, r, c);
    }
    Mn(c) && c && o();
    const l = At(r), a = [];
    return G(l, (d) => {
      const i = r[d];
      i && tt(a, n(d, i));
    }), D(xt, a);
  }, s = (r, c) => {
    G(Kt(e.get(r)), (l) => {
      c && !ho(c) ? l.apply(0, c) : l();
    });
  };
  return n(t || {}), [n, o, s];
}, on = (t) => JSON.stringify(t, (e, o) => {
  if (kt(o))
    throw 0;
  return o;
}), nn = (t, e) => t ? `${e}`.split(".").reduce((o, n) => o && jn(o, n) ? o[n] : void 0, t) : void 0, tr = {
  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"]
  }
}, ts = (t, e) => {
  const o = {}, n = Mt(At(e), At(t));
  return G(n, (s) => {
    const r = t[s], c = e[s];
    if (ye(r) && ye(c))
      Y(o[s] = {}, ts(r, c)), ko(o[s]) && delete o[s];
    else if (jn(e, s) && c !== r) {
      let l = !0;
      if (Tt(r) || Tt(c))
        try {
          on(r) === on(c) && (l = !1);
        } catch {
        }
      l && (o[s] = c);
    }
  }), o;
}, sn = (t, e, o) => (n) => [nn(t, n), o || nn(e, n) !== void 0], Se = "data-overlayscrollbars", es = "os-environment", er = `${es}-scrollbar-hidden`, ro = `${Se}-initialize`, gt = Se, os = `${gt}-overflow-x`, ns = `${gt}-overflow-y`, ss = "overflowVisible", or = "scrollbarPressed", So = "updating", nr = "body", Vt = `${Se}-viewport`, sr = "arrange", rs = "scrollbarHidden", re = ss, Oo = `${Se}-padding`, rr = re, rn = `${Se}-content`, zo = "os-size-observer", cr = `${zo}-appear`, lr = `${zo}-listener`, ir = "os-trinsic-observer", ar = "os-theme-none", vt = "os-scrollbar", ur = `${vt}-rtl`, dr = `${vt}-horizontal`, fr = `${vt}-vertical`, cs = `${vt}-track`, Vo = `${vt}-handle`, pr = `${vt}-visible`, hr = `${vt}-cornerless`, cn = `${vt}-interaction`, ln = `${vt}-unusable`, Co = `${vt}-auto-hide`, an = `${Co}-hidden`, un = `${vt}-wheel`, vr = `${cs}-interactive`, mr = `${Vo}-interactive`, ls = {}, is = {}, gr = (t) => {
  G(t, (e) => G(e, (o, n) => {
    ls[n] = e[n];
  }));
}, as = (t, e, o) => At(t).map((n) => {
  const { static: s, instance: r } = t[n], [c, l, a] = o || [], d = o ? r : s;
  if (d) {
    const i = o ? d(c, l, e) : d(e);
    return (a || is)[n] = i;
  }
}), fe = (t) => is[t], br = "__osOptionsValidationPlugin", yr = "__osSizeObserverPlugin", xr = (t, e) => {
  const { T: o } = e, [n, s] = t("showNativeOverlaidScrollbars");
  return [n && o.x && o.y, s];
}, Ne = (t) => t.indexOf(_n) === 0, us = (t, e) => {
  const { D: o } = t, n = (a) => {
    const d = qt(o, a), u = (e ? e[a] : d) === "scroll";
    return [d, u];
  }, [s, r] = n(Ge), [c, l] = n(qe);
  return {
    k: {
      x: s,
      y: c
    },
    R: {
      x: r,
      y: l
    }
  };
}, wr = (t, e, o, n) => {
  const s = e.x || e.y, r = (i, u) => {
    const f = Ne(i), x = f && s ? "hidden" : "", C = u && f && i.replace(`${_n}-`, "") || x;
    return [u && !f ? i : "", Ne(C) ? "hidden" : C];
  }, [c, l] = r(o.x, e.x), [a, d] = r(o.y, e.y);
  return n[Ge] = l && a ? l : c, n[qe] = d && c ? d : a, us(t, n);
}, Bo = "__osScrollbarsHidingPlugin", Sr = "__osClickScrollPlugin";
let co;
const Or = () => {
  const t = (g, O, p, S) => {
    bt(g, O);
    const R = Kn(O), W = ge(O), V = Ro(p);
    return S && Nt(O), {
      x: W.h - R.h + V.h,
      y: W.w - R.w + V.w
    };
  }, e = (g) => {
    let O = !1;
    const p = We(g, er);
    try {
      O = qt(g, "scrollbar-width") === "none" || qt(g, "display", "::-webkit-scrollbar") === "none";
    } catch {
    }
    return p(), O;
  }, o = (g, O) => {
    ue(g, {
      [Ge]: ie,
      [qe]: ie,
      direction: "rtl"
    }), Ft(g, {
      x: 0
    });
    const p = so(g), S = so(O);
    Ft(g, {
      x: -999
    });
    const R = so(O);
    return {
      i: p.x === S.x,
      n: S.x !== R.x
    };
  }, { body: n } = document, r = Qn(`<div class="${es}"><div></div></div>`)[0], c = r.firstChild, [l, , a] = wo(), [d, i] = Ct({
    o: t(n, r, c),
    u: Fn
  }, D(t, n, r, c, !0)), [u] = i(), f = e(r), x = {
    x: u.x === 0,
    y: u.y === 0
  }, C = {
    elements: {
      host: null,
      padding: !f,
      viewport: (g) => f && g === g.ownerDocument.body && g,
      content: !1
    },
    scrollbars: {
      slot: !0
    },
    cancel: {
      nativeScrollbarsOverlaid: !1,
      body: null
    }
  }, v = Y({}, tr), m = D(Y, {}, v), E = D(Y, {}, C), w = {
    P: u,
    T: x,
    L: f,
    J: !!po,
    K: o(r, c),
    Z: D(l, "r"),
    G: E,
    tt: (g) => Y(C, g) && E(),
    nt: m,
    ot: (g) => Y(v, g) && m(),
    st: Y({}, C),
    et: Y({}, v)
  };
  return It(r, "style"), Nt(r), yt.addEventListener("resize", () => {
    let g;
    if (!f && (!x.x || !x.y)) {
      const O = fe(Bo);
      g = !!(O ? O.Y() : Et)(w, d);
    }
    a("r", [g]);
  }), w;
}, wt = () => (co || (co = Or()), co), Do = (t, e) => kt(e) ? e.apply(0, t) : e, Cr = (t, e, o, n) => {
  const s = we(n) ? o : n;
  return Do(t, s) || e.apply(0, t);
}, ds = (t, e, o, n) => {
  const s = we(n) ? o : n, r = Do(t, s);
  return !!r && (me(r) ? r : e.apply(0, t));
}, Er = (t, e) => {
  const { nativeScrollbarsOverlaid: o, body: n } = e || {}, { T: s, L: r, G: c } = wt(), { nativeScrollbarsOverlaid: l, body: a } = c().cancel, d = o ?? l, i = we(n) ? a : n, u = (s.x || s.y) && d, f = t && (Ue(i) ? !r : i);
  return !!u || !!f;
}, Wo = /* @__PURE__ */ new WeakMap(), Tr = (t, e) => {
  Wo.set(t, e);
}, $r = (t) => {
  Wo.delete(t);
}, fs = (t) => Wo.get(t), Ir = (t, e, o) => {
  let n = !1;
  const s = o ? /* @__PURE__ */ new WeakMap() : !1, r = () => {
    n = !0;
  }, c = (l) => {
    if (s && o) {
      const a = o.map((d) => {
        const [i, u] = d || [];
        return [u && i ? (l || Gn)(i, t) : [], u];
      });
      G(a, (d) => G(d[0], (i) => {
        const u = d[1], f = s.get(i) || [];
        if (t.contains(i) && u) {
          const C = st(i, u, (v) => {
            n ? (C(), s.delete(i)) : e(v);
          });
          s.set(i, tt(f, C));
        } else
          xt(f), s.delete(i);
      }));
    }
  };
  return c(), [r, c];
}, dn = (t, e, o, n) => {
  let s = !1;
  const { ct: r, rt: c, lt: l, it: a, ut: d, ft: i } = n || {}, u = Un(() => s && o(!0), {
    v: 33,
    p: 99
  }), [f, x] = Ir(t, u, l), C = r || [], v = c || [], m = Mt(C, v), E = (g, O) => {
    if (!ho(O)) {
      const p = d || Et, S = i || Et, R = [], W = [];
      let V = !1, I = !1;
      if (G(O, ($) => {
        const { attributeName: A, target: H, type: M, oldValue: L, addedNodes: j, removedNodes: N } = $, U = M === "attributes", Z = M === "childList", _ = t === H, et = U && A, ot = et && Qe(H, A || "") || null, P = et && L !== ot, Q = Ze(v, A) && P;
        if (e && (Z || !_)) {
          const nt = U && P, ut = nt && a && mo(H, a), b = (ut ? !p(H, A, L, ot) : !U || nt) && !S($, !!ut, t, n);
          G(j, (y) => tt(R, y)), G(N, (y) => tt(R, y)), I = I || b;
        }
        !e && _ && P && !p(H, A, L, ot) && (tt(W, A), V = V || Q);
      }), x(($) => jo(R).reduce((A, H) => (tt(A, Gn($, H)), mo(H, $) ? tt(A, H) : A), [])), e)
        return !g && I && o(!1), [!1];
      if (!ho(W) || V) {
        const $ = [jo(W), V];
        return !g && o.apply(0, $), $;
      }
    }
  }, w = new Ns(D(E, !1));
  return [() => (w.observe(t, {
    attributes: !0,
    attributeOldValue: !0,
    attributeFilter: m,
    subtree: e,
    childList: e,
    characterData: e
  }), s = !0, () => {
    s && (f(), w.disconnect(), s = !1);
  }), () => {
    if (s)
      return u.m(), E(!0, w.takeRecords());
  }];
}, ps = (t, e, o) => {
  const { _t: s, dt: r } = o || {}, c = fe(yr), { K: l } = wt(), a = D(_t, t), [d] = Ct({
    o: !1,
    _: !0
  });
  return () => {
    const i = [], f = Qn(`<div class="${zo}"><div class="${lr}"></div></div>`)[0], x = f.firstChild, C = (v) => {
      const m = v instanceof ResizeObserverEntry, E = !m && Tt(v);
      let w = !1, g = !1, O = !0;
      if (m) {
        const [p, , S] = d(v.contentRect), R = xo(p), W = Jn(p, S);
        g = !S || W, w = !g && !R, O = !w;
      } else E ? [, O] = v : g = v === !0;
      if (s && O) {
        const p = E ? v[0] : _t(f);
        Ft(f, {
          x: _e(3333333, 3333333, p && l),
          y: 3333333
        });
      }
      w || e({
        vt: E ? v : void 0,
        ht: !E,
        dt: g
      });
    };
    if (Be) {
      const v = new Be((m) => C(m.pop()));
      v.observe(x), tt(i, () => {
        v.disconnect();
      });
    } else if (c) {
      const [v, m] = c(x, C, r);
      tt(i, Mt([We(f, cr), st(f, "animationstart", v)], m));
    } else
      return Et;
    if (s) {
      const [v] = Ct({
        o: void 0
      }, a);
      tt(i, st(f, "scroll", (m) => {
        const E = v(), [w, g, O] = E;
        g && (Mo(x, "ltr rtl"), We(x, w ? "rtl" : "ltr"), C([!!w, g, O])), Po(m);
      }));
    }
    return D(xt, tt(i, bt(t, f)));
  };
}, Lr = (t, e) => {
  let o;
  const n = (a) => a.h === 0 || a.isIntersecting || a.intersectionRatio > 0, s = ne(ir), [r] = Ct({
    o: !1
  }), c = (a, d) => {
    if (a) {
      const i = r(n(a)), [, u] = i;
      return u && !d && e(i) && [i];
    }
  }, l = (a, d) => c(d.pop(), a);
  return [() => {
    const a = [];
    if (Uo)
      o = new Uo(D(l, !1), {
        root: t
      }), o.observe(s), tt(a, () => {
        o.disconnect();
      });
    else {
      const d = () => {
        const i = ge(s);
        c(i);
      };
      tt(a, ps(s, d)()), d();
    }
    return D(xt, tt(a, bt(t, s)));
  }, () => o && l(!0, o.takeRecords())];
}, Hr = (t, e, o, n) => {
  let s, r, c, l, a, d;
  const { L: i } = wt(), u = `[${gt}]`, f = `[${Vt}]`, x = ["tabindex"], C = ["wrap", "cols", "rows"], v = ["id", "class", "style", "open"], { gt: m, bt: E, D: w, wt: g, St: O, V: p, yt: S, Ot: R } = t, W = {
    $t: !1,
    N: _t(m)
  }, V = wt(), I = fe(Bo), [$] = Ct({
    u: Nn,
    o: {
      w: 0,
      h: 0
    }
  }, () => {
    const h = I && I.M(t, e, W, V, o).W, b = S(re), y = !p && S(sr), T = y && de(w);
    R(re), p && R(So, !0);
    const k = y && h && h()[0], z = yo(g), B = yo(w), F = Ro(w);
    return R(re, b), p && R(So), k && k(), Ft(w, T), {
      w: B.w + z.w + F.w,
      h: B.h + z.h + F.h
    };
  }), A = O ? C : Mt(v, C), H = Un(n, {
    v: () => s,
    p: () => r,
    S(h, b) {
      const [y] = h, [T] = b;
      return [Mt(At(y), At(T)).reduce((k, z) => (k[z] = y[z] || T[z], k), {})];
    }
  }), M = (h) => {
    if (p) {
      const b = _t(m);
      Y(h, {
        Ct: d !== b
      }), Y(W, {
        N: b
      }), d = b;
    }
  }, L = (h) => {
    G(h || x, (b) => {
      if (Ze(x, b)) {
        const y = Qe(E, b);
        je(y) ? Ot(w, b, y) : It(w, b);
      }
    });
  }, j = (h, b) => {
    const [y, T] = h, k = {
      xt: T
    };
    return Y(W, {
      $t: y
    }), !b && n(k), k;
  }, N = ({ ht: h, vt: b, dt: y }) => {
    const k = !(h && !y && !b) && i ? H : n, [z, B] = b || [], F = {
      ht: h || y,
      dt: y,
      Ct: B
    };
    M(F), b && Y(W, {
      N: z
    }), k(F);
  }, U = (h, b) => {
    const [, y] = $(), T = {
      Ht: y
    };
    return M(T), y && !b && (h ? n : H)(T), T;
  }, Z = (h, b, y) => {
    const T = {
      It: b
    };
    return M(T), b && !y ? H(T) : p || L(h), T;
  }, { Z: _ } = V, [et, ot] = g ? Lr(E, j) : [], P = !p && ps(E, N, {
    dt: !0,
    _t: !0
  }), [Q, nt] = dn(E, !1, Z, {
    rt: v,
    ct: Mt(v, x)
  }), ut = p && Be && new Be((h) => {
    const b = h[h.length - 1].contentRect;
    N({
      ht: !0,
      dt: Jn(b, a)
    }), a = b;
  });
  return [() => {
    L(), ut && ut.observe(E);
    const h = P && P(), b = et && et(), y = Q(), T = _((k) => {
      const [, z] = $();
      H({
        zt: k,
        Ht: z
      });
    });
    return () => {
      ut && ut.disconnect(), h && h(), b && b(), l && l(), y(), T();
    };
  }, ({ Et: h, At: b, Tt: y }) => {
    const T = {}, [k] = h("update.ignoreMutation"), [z, B] = h("update.attributes"), [F, q] = h("update.elementEvents"), [it, dt] = h("update.debounce"), J = q || B, at = b || y, Ut = (X) => kt(k) && k(X);
    if (J) {
      c && c(), l && l();
      const [X, lt] = dn(g || w, !0, U, {
        ct: Mt(A, z || []),
        lt: F,
        it: u,
        ft: (ft, pt) => {
          const { target: rt, attributeName: mt } = ft;
          return (!pt && mt && !p ? Gs(rt, u, f) : !1) || !!oe(rt, `.${vt}`) || !!Ut(ft);
        }
      });
      l = X(), c = lt;
    }
    if (dt)
      if (H.m(), Tt(it)) {
        const X = it[0], lt = it[1];
        s = Ht(X) && X, r = Ht(lt) && lt;
      } else Ht(it) ? (s = it, r = !1) : (s = !1, r = !1);
    if (at) {
      const X = nt(), lt = ot && ot(), ft = c && c();
      X && Y(T, Z(X[0], X[1], at)), lt && Y(T, j(lt[0], at)), ft && Y(T, U(ft[0], at));
    }
    return M(T), T;
  }, W];
}, kr = (t, e, o, n) => {
  const { G: s, K: r } = wt(), { scrollbars: c } = s(), { slot: l } = c, { gt: a, bt: d, D: i, Dt: u, kt: f, Rt: x, V: C } = e, { scrollbars: v } = u ? {} : t, { slot: m } = v || {}, E = /* @__PURE__ */ new Map(), w = (h) => po && new po({
    source: f,
    axis: h
  }), g = w("x"), O = w("y"), p = ds([a, d, i], () => C && x ? a : d, l, m), S = (h, b) => {
    if (b) {
      const F = h ? ce : le, { Mt: q, Vt: it } = b, dt = se(it)[F], J = se(q)[F];
      return vo(0, 1, dt / J || 0);
    }
    const y = h ? "x" : "y", { Lt: T, Pt: k } = o, z = k[y], B = T[y];
    return vo(0, 1, z / (z + B) || 0);
  }, R = (h, b, y, T) => {
    const k = S(y, h);
    return 1 / k * (1 - k) * (T ? 1 - b : b) || 0;
  }, W = (h, b) => Y(h, b ? {
    clear: ["left"]
  } : {}), V = (h) => {
    E.forEach((b, y) => {
      (h ? Ze(An(h), y) : !0) && (G(b || [], (k) => {
        k && k.cancel();
      }), E.delete(y));
    });
  }, I = (h, b, y, T) => {
    const k = E.get(h) || [], z = k.find((B) => B && B.timeline === b);
    z ? z.effect = new KeyframeEffect(h, y, {
      composite: T
    }) : E.set(h, Mt(k, [h.animate(y, {
      timeline: b,
      composite: T
    })]));
  }, $ = (h, b, y) => {
    const T = y ? We : Mo;
    G(h, (k) => {
      T(k.Ut, b);
    });
  }, A = (h, b) => {
    G(h, (y) => {
      const [T, k] = b(y);
      ue(T, k);
    });
  }, H = (h, b) => {
    A(h, (y) => {
      const { Vt: T } = y;
      return [T, {
        [b ? ce : le]: Go(S(b))
      }];
    });
  }, M = (h, b) => {
    const { Lt: y } = o, T = b ? y.x : y.y, k = (z, B, F) => no(Go(R(z, tn(B, T, F), b, F)), b);
    if (g && O)
      G(h, (z) => {
        const { Ut: B, Vt: F } = z, q = b && _t(B) && r;
        I(F, b ? g : O, W({
          transform: Jo(T, q).map((it) => k(z, it, q))
        }, q));
      });
    else {
      const z = de(f);
      A(h, (B) => {
        const { Vt: F, Ut: q } = B;
        return [F, {
          transform: k(B, b ? z.x : z.y, b && _t(q) && r)
        }];
      });
    }
  }, L = (h) => C && !x && ae(h) === i, j = [], N = [], U = [], Z = (h, b, y) => {
    const T = Mn(y), k = T ? y : !0, z = T ? !y : !0;
    k && $(N, h, b), z && $(U, h, b);
  }, _ = () => {
    H(N, !0), H(U);
  }, et = () => {
    M(N, !0), M(U);
  }, ot = () => {
    if (C) {
      const { Lt: h } = o, b = 0.5;
      if (g && O)
        G(Mt(U, N), ({ Ut: y }) => {
          if (L(y)) {
            const T = (k, z, B) => {
              const F = B && _t(y) && r;
              I(y, k, W({
                transform: Jo(z - b, F).map((q) => no(bo(q), B))
              }, F), "add");
            };
            T(g, h.x, !0), T(O, h.y);
          } else
            V(y);
        });
      else {
        const y = de(f), T = (k) => {
          const { Ut: z } = k, B = L(z) && z, F = (q, it, dt) => {
            const J = tn(q, it, dt), at = it * J;
            return bo(dt ? -at : at);
          };
          return [B, {
            transform: B ? no({
              x: F(y.x, h.x, _t(z) && r),
              y: F(y.y, h.y)
            }) : ""
          }];
        };
        A(N, T), A(U, T);
      }
    }
  }, P = (h) => {
    const y = ne(`${vt} ${h ? dr : fr}`), T = ne(cs), k = ne(Vo), z = {
      Ut: y,
      Mt: T,
      Vt: k
    };
    return tt(h ? N : U, z), tt(j, [bt(y, T), bt(T, k), D(Nt, y), V, n(z, Z, M, h)]), z;
  }, Q = D(P, !0), nt = D(P, !1), ut = () => (bt(p, N[0].Ut), bt(p, U[0].Ut), D(xt, j));
  return Q(), nt(), [{
    Bt: _,
    Nt: et,
    jt: ot,
    Ft: Z,
    qt: {
      J: g,
      Wt: N,
      Xt: Q,
      Yt: D(A, N)
    },
    Jt: {
      J: O,
      Wt: U,
      Xt: nt,
      Yt: D(A, U)
    }
  }, ut];
}, Mr = (t, e, o) => {
  const { bt: n, kt: s, Kt: r } = e;
  return (c, l, a, d) => {
    const { Ut: i, Mt: u, Vt: f } = c, [x, C] = zt(333), [v, m] = zt(), E = D(a, [c], d), w = !!s.scrollBy, g = `client${d ? "X" : "Y"}`, O = d ? ce : le, p = d ? "left" : "top", S = d ? "w" : "h", R = d ? "x" : "y", W = ($) => $.propertyName.indexOf(O) > -1, V = () => {
      const $ = "pointerup pointerleave pointercancel lostpointercapture", A = (H, M) => (L) => {
        const { Lt: j } = o, N = ge(u)[S] - ge(f)[S], Z = M * L / N * j[R];
        Ft(s, {
          [R]: H + Z
        });
      };
      return st(u, "pointerdown", (H) => {
        const M = oe(H.target, `.${Vo}`) === f, L = M ? f : u, j = t.scrollbars, { button: N, isPrimary: U, pointerType: Z } = H, { pointers: _ } = j;
        if (N === 0 && U && j[M ? "dragScroll" : "clickScroll"] && (_ || []).includes(Z)) {
          const ot = !M && H.shiftKey, P = D(se, f), Q = D(se, u), nt = (J, at) => (J || P())[p] - (at || Q())[p], ut = ao(se(s)[O]) / ge(s)[S] || 1, h = A(de(s)[R] || 0, 1 / ut), b = H[g], y = P(), T = Q(), k = y[O], z = nt(y, T) + k / 2, B = b - T[p], F = M ? 0 : B - z, q = (J) => {
            xt(dt), L.releasePointerCapture(J.pointerId);
          }, dt = [xe(n, gt, or), st(r, $, q), st(r, "selectstart", (J) => Ko(J), {
            H: !1
          }), st(u, $, q), st(u, "pointermove", (J) => {
            const at = J[g] - b;
            (M || ot) && h(F + at);
          })];
          if (L.setPointerCapture(H.pointerId), ot)
            h(F);
          else if (!M) {
            const J = fe(Sr);
            J && tt(dt, J(h, nt, F, k, B));
          }
        }
      });
    };
    let I = !0;
    return D(xt, [st(i, "pointerenter", () => {
      l(cn, !0);
    }), st(i, "pointerleave pointercancel", () => {
      l(cn, !1);
    }), st(i, "wheel", ($) => {
      const { deltaX: A, deltaY: H, deltaMode: M } = $;
      w && I && M === 0 && ae(i) === n && s.scrollBy({
        left: A,
        top: H,
        behavior: "smooth"
      }), I = !1, l(un, !0), x(() => {
        I = !0, l(un);
      }), Ko($);
    }, {
      H: !1,
      I: !0
    }), st(f, "transitionstart", ($) => {
      if (W($)) {
        const A = () => {
          E(), v(A);
        };
        A();
      }
    }), st(f, "transitionend transitioncancel", ($) => {
      W($) && (m(), E());
    }), st(i, "mousedown", D(st, r, "click", Po, {
      A: !0,
      I: !0
    }), {
      I: !0
    }), V(), C, m]);
  };
}, Ar = (t, e, o, n, s, r) => {
  let c, l, a, d, i, u = Et, f = 0;
  const [x, C] = zt(), [v, m] = zt(), [E, w] = zt(100), [g, O] = zt(100), [p, S] = zt(100), [R, W] = zt(() => f), [V, I] = kr(t, s, n, Mr(e, s, n)), { bt: $, Zt: A, Rt: H } = s, { Ft: M, Bt: L, Nt: j, jt: N } = V, U = (P) => {
    M(Co, P, !0), M(Co, P, !1);
  }, Z = (P, Q) => {
    if (W(), P)
      M(an);
    else {
      const nt = D(M, an, !0);
      f > 0 && !Q ? R(nt) : nt();
    }
  }, _ = (P) => P.pointerType === "mouse", et = (P) => {
    _(P) && (d = l, d && Z(!0));
  }, ot = [w, W, O, S, m, C, () => u(), st($, "pointerover", et, {
    A: !0
  }), st($, "pointerenter", et), st($, "pointerleave", (P) => {
    _(P) && (d = !1, l && Z(!1));
  }), st($, "pointermove", (P) => {
    _(P) && c && x(() => {
      w(), Z(!0), g(() => {
        c && Z(!1);
      });
    });
  }), st(A, "scroll", (P) => {
    v(() => {
      j(), a && Z(!0), E(() => {
        a && !d && Z(!1);
      });
    }), r(P), N();
  })];
  return [() => D(xt, tt(ot, I())), ({ Et: P, Tt: Q, Gt: nt, Qt: ut }) => {
    const { tn: h, nn: b, sn: y } = ut || {}, { Ct: T, dt: k } = nt || {}, { N: z } = o, { T: B } = wt(), { k: F, en: q } = n, [it, dt] = P("showNativeOverlaidScrollbars"), [J, at] = P("scrollbars.theme"), [Ut, X] = P("scrollbars.visibility"), [lt, ft] = P("scrollbars.autoHide"), [pt, rt] = P("scrollbars.autoHideSuspend"), [mt] = P("scrollbars.autoHideDelay"), [jt, Jt] = P("scrollbars.dragScroll"), [$t, Xt] = P("scrollbars.clickScroll"), [Rt, to] = P("overflow"), Pt = k && !Q, eo = q.x || q.y, pe = h || b || T || Q, Ce = y || X || to, Ee = it && B.x && B.y, he = (ve, te, _o) => {
      const No = ve.includes("scroll") && (Ut === "visible" || Ut === "auto" && te === "scroll");
      return M(pr, No, _o), No;
    };
    if (f = mt, Pt && (pt && eo ? (U(!1), u(), p(() => {
      u = st(A, "scroll", D(U, !0), {
        A: !0
      });
    })) : U(!0)), dt && M(ar, Ee), at && (M(i), M(J, !0), i = J), rt && !pt && U(!0), ft && (c = lt === "move", l = lt === "leave", a = lt !== "never", Z(!a, !0)), Jt && M(mr, jt), Xt && M(vr, $t), Ce) {
      const ve = he(Rt.x, F.x, !0), te = he(Rt.y, F.y, !1);
      M(hr, !(ve && te));
    }
    pe && (L(), j(), N(), M(ln, !q.x, !0), M(ln, !q.y, !1), M(ur, z && !H));
  }, {}, V];
}, Rr = (t) => {
  const e = wt(), { G: o, L: n } = e, { elements: s } = o(), { host: r, padding: c, viewport: l, content: a } = s, d = me(t), i = d ? {} : t, { elements: u } = i, { host: f, padding: x, viewport: C, content: v } = u || {}, m = d ? t : i.target, E = mo(m, "textarea"), w = m.ownerDocument, g = w.documentElement, O = m === w.body, p = w.defaultView, S = () => w.activeElement, R = (X) => {
    X && X.focus && X.focus();
  }, W = D(Cr, [m]), V = D(ds, [m]), I = D(Do, [m]), $ = D(ne, ""), A = D(W, $, l), H = D(V, $, a), M = A(C), L = M === m, j = L && O, N = !L && H(v), U = !L && me(M) && M === N, Z = U && !!I(a), _ = Z ? A() : M, et = Z ? N : H(), P = j ? g : U ? _ : M, Q = E ? W($, r, f) : m, nt = j ? P : Q, ut = U ? et : N, h = {
    gt: m,
    bt: nt,
    D: P,
    cn: !L && V($, c, x),
    wt: ut,
    kt: j ? g : P,
    Zt: j ? w : P,
    rn: O ? g : m,
    ln: p,
    Kt: w,
    St: E,
    Rt: O,
    Dt: d,
    V: L,
    an: U,
    yt: (X) => Ys(P, L ? gt : Vt, X),
    Ot: (X, lt) => ke(P, L ? gt : Vt, X, lt)
  }, b = At(h).reduce((X, lt) => {
    const ft = h[lt];
    return tt(X, ft && me(ft) && !ae(ft) ? ft : !1);
  }, []), y = (X) => X ? Ze(b, X) : null, { gt: T, bt: k, cn: z, D: B, wt: F } = h, q = [() => {
    It(k, [gt, ro]), It(T, ro), O && It(g, [ro, gt]);
  }], it = E && y(k);
  let dt = E ? T : go([F, B, z, k, T].find((X) => y(X) === !1));
  const J = j ? T : F || B, at = D(xt, q);
  return [h, () => {
    const X = S(), lt = (rt) => {
      bt(ae(rt), go(rt)), Nt(rt);
    }, ft = (rt) => rt ? st(rt, "focusin focusout focus blur", (mt) => {
      Po(mt), mt.stopImmediatePropagation();
    }, {
      I: !0,
      H: !1
    }) : Et, pt = ft(X);
    if (Ot(k, gt, L ? "viewport" : "host"), Ot(z, Oo, ""), Ot(F, rn, ""), L || (Ot(B, Vt, ""), O && xe(g, gt, nr)), it && (Yo(T, k), tt(q, () => {
      Yo(k, T), Nt(k);
    })), bt(J, dt), bt(k, z), bt(z || k, !L && B), bt(B, F), tt(q, [pt, () => {
      const rt = S(), mt = ft(rt);
      It(z, Oo), It(F, rn), It(B, [os, ns, Vt]), y(F) && lt(F), y(B) && lt(B), y(z) && lt(z), R(rt), mt();
    }]), n && !L && (xe(B, Vt, rs), tt(q, D(It, B, Vt))), !L && p.top === p && X === m) {
      const rt = "tabindex", mt = Qe(B, rt);
      Ot(B, rt, "-1"), R(B);
      const jt = () => mt ? Ot(B, rt, mt) : It(B, rt), Jt = st(w, "pointerdown keydown", () => {
        jt(), Jt();
      });
      tt(q, [jt, Jt]);
    } else
      R(X);
    return pt(), dt = 0, at;
  }, at];
}, Pr = ({ wt: t }) => ({ Gt: e, un: o, Tt: n }) => {
  const { xt: s } = e || {}, { $t: r } = o;
  t && (s || n) && ue(t, {
    [le]: r && "100%"
  });
}, zr = ({ bt: t, cn: e, D: o, V: n }, s) => {
  const [r, c] = Ct({
    u: Xs,
    o: qo()
  }, D(qo, t, "padding", ""));
  return ({ Et: l, Gt: a, un: d, Tt: i }) => {
    let [u, f] = c(i);
    const { L: x } = wt(), { ht: C, Ht: v, Ct: m } = a || {}, { N: E } = d, [w, g] = l("paddingAbsolute");
    (C || f || (i || v)) && ([u, f] = r(i));
    const p = !n && (g || m || f);
    if (p) {
      const S = !w || !e && !x, R = u.r + u.l, W = u.t + u.b, V = {
        [Dn]: S && !E ? -R : 0,
        [Wn]: S ? -W : 0,
        [Bn]: S && E ? -R : 0,
        top: S ? -u.t : 0,
        right: S ? E ? -u.r : "auto" : 0,
        left: S ? E ? "auto" : -u.l : 0,
        [ce]: S && `calc(100% + ${R}px)`
      }, I = {
        [Rn]: S ? u.t : 0,
        [Pn]: S ? u.r : 0,
        [Vn]: S ? u.b : 0,
        [zn]: S ? u.l : 0
      };
      ue(e || o, V), ue(o, I), Y(s, {
        cn: u,
        fn: !S,
        j: e ? I : Y({}, V, I)
      });
    }
    return {
      _n: p
    };
  };
}, Vr = (t, e) => {
  const o = wt(), { bt: n, cn: s, D: r, V: c, Ot: l, Rt: a, ln: d } = t, { L: i } = o, u = a && c, f = D(He, 0), x = {
    u: Nn,
    o: {
      w: 0,
      h: 0
    }
  }, C = {
    u: Fn,
    o: {
      x: ie,
      y: ie
    }
  }, v = (I, $) => {
    const A = yt.devicePixelRatio % 1 !== 0 ? 1 : 0, H = {
      w: f(I.w - $.w),
      h: f(I.h - $.h)
    };
    return {
      w: H.w > A ? H.w : 0,
      h: H.h > A ? H.h : 0
    };
  }, [m, E] = Ct(x, D(Ro, r)), [w, g] = Ct(x, D(yo, r)), [O, p] = Ct(x), [S, R] = Ct(x), [W] = Ct(C), V = fe(Bo);
  return ({ Et: I, Gt: $, un: A, Tt: H }, { _n: M }) => {
    const { ht: L, Ht: j, Ct: N, zt: U } = $ || {}, Z = V && V.M(t, e, A, o, I), { q: _, W: et, X: ot } = Z || {}, [P, Q] = xr(I, o), [nt, ut] = I("overflow"), h = L || M || j || N || U || Q, b = Ne(nt.x), y = Ne(nt.y), T = b || y;
    let k = E(H), z = g(H), B = p(H), F = R(H), q;
    if (Q && i && l(rs, !P), h) {
      T && l(re, !1);
      const [$t, Xt] = et ? et(q) : [], [Rt, to] = k = m(H), [Pt, eo] = z = w(H), pe = Kn(r), Ce = Pt, Ee = pe;
      $t && $t(), (eo || to || Q) && Xt && !P && _ && _(Xt, Pt, Rt);
      const he = Ks(d), ve = {
        w: f(He(Pt.w, Ce.w) + Rt.w),
        h: f(He(Pt.h, Ce.h) + Rt.h)
      }, te = {
        w: f((u ? he.w : Ee.w + f(pe.w - Pt.w)) + Rt.w),
        h: f((u ? he.h : Ee.h + f(pe.h - Pt.h)) + Rt.h)
      };
      F = S(te), B = O(v(ve, te), H);
    }
    const [it, dt] = F, [J, at] = B, [Ut, X] = z, [lt, ft] = k, pt = {
      x: J.w > 0,
      y: J.h > 0
    }, rt = b && y && (pt.x || pt.y) || b && pt.x && !pt.y || y && pt.y && !pt.x;
    if (M || N || U || ft || X || dt || at || ut || Q || h) {
      const $t = {}, Xt = wr(t, pt, nt, $t);
      ot && ot(Xt, A, !!_ && _(Xt, Ut, lt), $t), c ? (Ot(n, os, $t[Ge]), Ot(n, ns, $t[qe])) : ue(r, $t);
    }
    ke(n, gt, ss, rt), ke(s, Oo, rr, rt), c || ke(r, Vt, re, T);
    const [jt, Jt] = W(us(t).k);
    return Y(e, {
      k: jt,
      Pt: {
        x: it.w,
        y: it.h
      },
      Lt: {
        x: J.w,
        y: J.h
      },
      en: pt
    }), {
      sn: Jt,
      tn: dt,
      nn: at
    };
  };
}, Br = (t) => {
  const [e, o, n] = Rr(t), s = {
    cn: {
      t: 0,
      r: 0,
      b: 0,
      l: 0
    },
    fn: !1,
    j: {
      [Dn]: 0,
      [Wn]: 0,
      [Bn]: 0,
      [Rn]: 0,
      [Pn]: 0,
      [Vn]: 0,
      [zn]: 0
    },
    Pt: {
      x: 0,
      y: 0
    },
    Lt: {
      x: 0,
      y: 0
    },
    k: {
      x: ie,
      y: ie
    },
    en: {
      x: !1,
      y: !1
    }
  }, { gt: r, D: c, V: l } = e, { L: a, T: d } = wt(), i = !a && (d.x || d.y), u = [Pr(e), zr(e, s), Vr(e, s)];
  return [o, (f) => {
    const x = {}, v = i && de(c), m = l ? xe(c, gt, So) : Et;
    return G(u, (E) => {
      Y(x, E(f, x) || {});
    }), m(), Ft(c, v), !l && Ft(r, 0), x;
  }, s, e, n];
}, Dr = (t, e, o, n) => {
  const s = sn(e, {}), [r, c, l, a, d] = Br(t), [i, u, f] = Hr(a, l, s, (w) => {
    E({}, w);
  }), [x, C, , v] = Ar(t, e, f, l, a, n), m = (w) => At(w).some((g) => !!w[g]), E = (w, g) => {
    const { dn: O, Tt: p, At: S, vn: R } = w, W = O || {}, V = !!p, I = {
      Et: sn(e, W, V),
      dn: W,
      Tt: V
    };
    if (R)
      return C(I), !1;
    const $ = g || u(Y({}, I, {
      At: S
    })), A = c(Y({}, I, {
      un: f,
      Gt: $
    }));
    C(Y({}, I, {
      Gt: $,
      Qt: A
    }));
    const H = m($), M = m(A), L = H || M || !ko(W) || V;
    return L && o(w, {
      Gt: $,
      Qt: A
    }), L;
  };
  return [() => {
    const { rn: w, D: g } = a, O = de(w), p = [i(), r(), x()];
    return Ft(g, O), D(xt, p);
  }, E, () => ({
    hn: f,
    pn: l
  }), {
    gn: a,
    bn: v
  }, d];
}, Qt = (t, e, o) => {
  const { nt: n } = wt(), s = me(t), r = s ? t : t.target, c = fs(r);
  if (e && !c) {
    let l = !1;
    const a = [], d = {}, i = (I) => {
      const $ = Xn(I), A = fe(br);
      return A ? A($, !0) : $;
    }, u = Y({}, n(), i(e)), [f, x, C] = wo(), [v, m, E] = wo(o), w = (I, $) => {
      E(I, $), C(I, $);
    }, [g, O, p, S, R] = Dr(t, u, ({ dn: I, Tt: $ }, { Gt: A, Qt: H }) => {
      const { ht: M, Ct: L, xt: j, Ht: N, It: U, dt: Z } = A, { tn: _, nn: et, sn: ot } = H;
      w("updated", [V, {
        updateHints: {
          sizeChanged: !!M,
          directionChanged: !!L,
          heightIntrinsicChanged: !!j,
          overflowEdgeChanged: !!_,
          overflowAmountChanged: !!et,
          overflowStyleChanged: !!ot,
          contentMutation: !!N,
          hostMutation: !!U,
          appear: !!Z
        },
        changedOptions: I || {},
        force: !!$
      }]);
    }, (I) => w("scroll", [V, I])), W = (I) => {
      $r(r), xt(a), l = !0, w("destroyed", [V, I]), x(), m();
    }, V = {
      options(I, $) {
        if (I) {
          const A = $ ? n() : {}, H = ts(u, Y(A, i(I)));
          ko(H) || (Y(u, H), O({
            dn: H
          }));
        }
        return Y({}, u);
      },
      on: v,
      off: (I, $) => {
        I && $ && m(I, $);
      },
      state() {
        const { hn: I, pn: $ } = p(), { N: A } = I, { Pt: H, Lt: M, k: L, en: j, cn: N, fn: U } = $;
        return Y({}, {
          overflowEdge: H,
          overflowAmount: M,
          overflowStyle: L,
          hasOverflow: j,
          padding: N,
          paddingAbsolute: U,
          directionRTL: A,
          destroyed: l
        });
      },
      elements() {
        const { gt: I, bt: $, cn: A, D: H, wt: M, kt: L, Zt: j } = S.gn, { qt: N, Jt: U } = S.bn, Z = (et) => {
          const { Vt: ot, Mt: P, Ut: Q } = et;
          return {
            scrollbar: Q,
            track: P,
            handle: ot
          };
        }, _ = (et) => {
          const { Wt: ot, Xt: P } = et, Q = Z(ot[0]);
          return Y({}, Q, {
            clone: () => {
              const nt = Z(P());
              return O({
                vn: !0
              }), nt;
            }
          });
        };
        return Y({}, {
          target: I,
          host: $,
          padding: A || H,
          viewport: H,
          content: M || H,
          scrollOffsetElement: L,
          scrollEventElement: j,
          scrollbarHorizontal: _(N),
          scrollbarVertical: _(U)
        });
      },
      update: (I) => O({
        Tt: I,
        At: !0
      }),
      destroy: D(W, !1),
      plugin: (I) => d[At(I)[0]]
    };
    return tt(a, [R]), Tr(r, V), as(ls, Qt, [V, f, d]), Er(S.gn.Rt, !s && t.cancel) ? (W(!0), V) : (tt(a, g()), w("initialized", [V]), V.update(!0), V);
  }
  return c;
};
Qt.plugin = (t) => {
  const e = Tt(t), o = e ? t : [t], n = o.map((s) => as(s, Qt)[0]);
  return gr(o), e ? n : n[0];
};
Qt.valid = (t) => {
  const e = t && t.elements, o = kt(e) && e();
  return De(o) && !!fs(o.target);
};
Qt.env = () => {
  const { P: t, T: e, L: o, K: n, J: s, st: r, et: c, G: l, tt: a, nt: d, ot: i } = wt();
  return Y({}, {
    scrollbarsSize: t,
    scrollbarsOverlaid: e,
    scrollbarsHiding: o,
    rtlScrollBehavior: n,
    scrollTimeline: s,
    staticDefaultInitialization: r,
    staticDefaultOptions: c,
    getDefaultInitialization: l,
    setDefaultInitialization: a,
    getDefaultOptions: d,
    setDefaultOptions: i
  });
};
const Me = K(999999), $e = K(380), Wr = "var(--upf-text-tooltip-text, var(--upf-text-primary, #212121))", Eo = "var(--upf-text-tooltip-bg, var(--upf-bg-elevated, #ffffff))", fn = "var(--upf-text-tooltip-border, var(--upf-border-color, #D9D9D9))", _r = "var(--upf-border-radius, 4px)", pn = "var(--upf-text-tooltip-shadow-color, rgba(38, 38, 38, 0.16))", Nr = "var(--upf-text-tooltip-scrollbar-thumb, var(--upf-text-disabled, #B2B2B2))", hn = "var(--upf-text-tooltip-scrollbar-thumb-hover, var(--upf-text-secondary, #666666))", Fr = "var(--upf-text-tooltip-scrollbar-padding, 1px)", vn = (t) => {
  const e = document.createElement("span"), o = document.createElement("span");
  return e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.pointerEvents = "none", e.style.zIndex = "2", o.style.position = "absolute", o.style.width = "0", o.style.height = "0", o.style.pointerEvents = "none", t === "top" ? (e.style.borderLeft = "7px solid transparent", e.style.borderRight = "7px solid transparent", e.style.borderBottom = `7px solid ${fn}`, e.style.top = "-7px", o.style.borderLeft = "6px solid transparent", o.style.borderRight = "6px solid transparent", o.style.borderBottom = `6px solid ${Eo}`, o.style.top = "1px", o.style.left = "-6px") : (e.style.borderLeft = "7px solid transparent", e.style.borderRight = "7px solid transparent", e.style.borderTop = `7px solid ${fn}`, e.style.bottom = "-7px", o.style.borderLeft = "6px solid transparent", o.style.borderRight = "6px solid transparent", o.style.borderTop = `6px solid ${Eo}`, o.style.bottom = "1px", o.style.left = "-6px"), e.appendChild(o), e;
}, Ur = () => {
  As("das-ui-text", [
    {
      className: ".das-ui-text-context",
      style: { position: "relative", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", "letter-spacing": "-0.1px" }
    },
    {
      className: "#das-ui-text-tooltip",
      style: {
        position: "fixed",
        "z-index": Me.value
      }
    },
    {
      className: "#das-ui-text-tooltip-context",
      style: {
        "box-sizing": "border-box",
        "max-width": "380px",
        "max-height": "114px",
        padding: "10px",
        "font-size": "12px",
        color: Wr,
        background: Eo,
        // border: `1px solid ${tooltipBorderVar}`,
        "border-radius": _r,
        "line-height": 1.5,
        "overflow-y": "hidden"
      }
    },
    {
      className: "#das-ui-text-tooltip-context *",
      style: {
        color: "inherit !important"
      }
    },
    {
      className: "#tooltip-scroll-content",
      style: {
        width: "100%",
        height: "100%"
      }
    },
    {
      className: ".das-scrollbar",
      style: {
        "--os-handle-bg": Nr,
        "--os-handle-bg-hover": hn,
        "--os-handle-bg-active": hn,
        "--os-padding-perpendicular": Fr,
        "--os-size": "10px",
        "box-sizing": "border-box",
        ":hover": {
          // 悬浮时滚动条变大
          "--os-padding-perpendicular": 0
        }
      }
    }
  ]);
}, hs = (t) => {
  window.inTextTooltip = !0, t.stopPropagation();
}, Ie = K(0);
let vs = K(null);
const Ae = () => {
  var o;
  clearTimeout(vs.value);
  const t = document.getElementById("das-ui-text-tooltip");
  t && ((o = document.body) == null || o.removeChild(t)), window.inTextTooltip = !1;
  const e = document.getElementById("das-ui-text-tooltip-context");
  e && e.removeEventListener("mouseover", hs);
}, mn = (t) => {
  let e = document.getElementById("das-ui-text-tooltip");
  const o = t.clientX, n = t.clientY, s = e == null ? void 0 : e.getBoundingClientRect();
  if (e && o >= s.left && o <= s.right && n >= s.top && n <= s.bottom)
    return !0;
  Ae();
}, jr = async (t, e) => {
  let o = t;
  return e.target && (typeof e.target == "string" && (o = e.target), typeof e.target == "function" && (o = await e.target(t))), o;
}, Xr = {
  beforeMount() {
    Ur();
  },
  async mounted(t, e, o) {
    const n = (o ? e.value : e) || {};
    let s = (n == null ? void 0 : n.deep) ?? !0;
    if ((n == null ? void 0 : n.disabled) ?? !1) {
      const i = document.querySelectorAll(".das-ui-text-context");
      i.length && (i[0].style.textOverflow = "auto", i[0].style.overflow = "visible");
      return;
    }
    let c = (n == null ? void 0 : n.customContent) || "";
    Ie.value === 0 && window.addEventListener("wheel", mn), Ie.value++;
    let l = await jr(t, n);
    const a = l.classList;
    l.dataset.customContent = c;
    let d = !0;
    a.contains("das-ui-text-context") || a.add("das-ui-text-context"), l.onmouseenter = (i) => {
      const f = i.composedPath()[0], { x, y: C, width: v, height: m, top: E, left: w, bottom: g, right: O } = f.getBoundingClientRect(), p = window.getComputedStyle(f, null), S = parseFloat(p.getPropertyValue("padding-left"));
      Me.value = Rs().nextZIndex();
      const R = document.createRange();
      R.setStart(l, 0);
      let W = s ? l.childNodes.length : 1;
      R.setEnd(l, W);
      const V = parseFloat(p.paddingRight), I = parseFloat(p.paddingLeft), $ = Math.round(R.getBoundingClientRect().width), A = Math.round(l.getBoundingClientRect().width) - V - I;
      if ($ > A) {
        const M = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) - O;
        setTimeout(async () => {
          let L = document.getElementById("das-ui-text-tooltip");
          if (!L) {
            L = document.createElement("div"), L.style.cssText = `left: ${x + S}px;`, L.style.zIndex = `${Me.value}`, L.setAttribute("id", "das-ui-text-tooltip");
            const _ = document.createElement("div");
            _.setAttribute("id", "das-ui-text-tooltip-context"), _ && (_.style.wordBreak = Fo.value == "zh-CN" ? "break-all" : "normal"), _.addEventListener("mouseover", hs);
            const et = document.createElement("div");
            et.setAttribute("id", "tooltip-scroll-content"), _.appendChild(et), L.appendChild(_), document.body.appendChild(L);
            const ot = "os-theme-dark das-scrollbar", P = document.getElementById("tooltip-scroll-content");
            if (P) {
              P.innerHTML = l.dataset.customContent || l.innerHTML;
              const Q = {
                scrollbars: {
                  autoHide: "leave",
                  autoHideDelay: 0,
                  theme: ot
                },
                overflow: { y: "scroll" }
              };
              l.dataset.customContent ? vs.value = setTimeout(() => {
                Qt(_, Q);
              }, 10) : Qt(_, Q);
            }
          }
          const j = L.querySelector('[data-tooltip-arrow="true"]');
          j == null || j.remove();
          const N = vn("bottom");
          if (N.setAttribute("data-tooltip-arrow", "true"), N.style.left = "14px", M + v <= $e.value) {
            let _ = L.offsetWidth >= $e.value ? $e.value : L.offsetWidth;
            L.style.cssText = `left: ${x + S - _ / 4}px;`, L.style.zIndex = `${Me.value}`, N.style.left = `${_ / 2}px`;
          }
          L.appendChild(N);
          let U = l.dataset.customContent && Fo.value != "zh-CN" ? L.offsetHeight - 10 : L.offsetHeight, Z = C - 10 - U;
          if (Z * 1 < 0) {
            L.style.top = `${g + 5}px`, N.remove();
            const _ = vn("top");
            _.setAttribute("data-tooltip-arrow", "true"), _.style.left = M + v <= $e.value ? N.style.left : "14px", L.appendChild(_), L.style.boxShadow = `0px -4px 10px 0px ${pn}`;
          } else
            L.style.top = `${Z}px`, L.style.boxShadow = `0px 4px 10px 0px ${pn}`;
          L.onmouseenter = (_) => {
            d = !1;
          }, L.onmouseleave = (_) => {
            d = !0, setTimeout(() => {
              Ae();
            }, 200);
          };
        }, 200);
      }
    }, l.onmouseleave = (i) => {
      setTimeout(() => {
        d && Ae();
      }, 200);
    };
  },
  // 指令与元素解绑时
  unmounted() {
    Ae(), Ie.value--, Ie.value === 0 && window.removeEventListener("wheel", mn);
  }
}, Yr = ["auto", "fit-content", "inherit", "initial", "max-content", "min-content", "revert", "unset", "-webkit-fill-available"], Zr = (t) => /^[+-]?\d+(\.\d+)?(px|em|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|%)$/.test(t), Gr = (t) => {
  if (t)
    return typeof t == "string" && Zr(t) || typeof t == "string" && Yr.includes(t) ? t : t + "px";
}, lo = {
  large: {
    height: "40px",
    fontSize: "14px",
    defaultWidth: "230px"
  },
  default: {
    height: "32px",
    fontSize: "14px",
    defaultWidth: "230px"
  },
  small: {
    height: "24px",
    fontSize: "12px",
    defaultWidth: "230px"
  },
  table: {
    height: "30px",
    fontSize: "12",
    defaultWidth: "132px"
  }
}, gn = {
  view: {
    color: "var(--upf-border-color)"
  },
  disabled: {
    color: "var(--upf-border-color)"
  },
  error: {
    color: "var(--upf-color-error)"
  }
};
var bn;
const ms = typeof window < "u", qr = (t) => typeof t == "string", Qr = () => {
};
ms && ((bn = window == null ? void 0 : window.navigator) != null && bn.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function gs(t) {
  return typeof t == "function" ? t() : Bt(t);
}
function Kr(t) {
  return t;
}
function bs(t) {
  return Cs() ? (Es(t), !0) : !1;
}
function Jr(t, e = !0) {
  $n() ? $o(t) : e ? t() : be(t);
}
function Zt(t) {
  var e;
  const o = gs(t);
  return (e = o == null ? void 0 : o.$el) != null ? e : o;
}
const Oe = ms ? window : void 0;
function Wt(...t) {
  let e, o, n, s;
  if (qr(t[0]) || Array.isArray(t[0]) ? ([o, n, s] = t, e = Oe) : [e, o, n, s] = t, !e)
    return Qr;
  Array.isArray(o) || (o = [o]), Array.isArray(n) || (n = [n]);
  const r = [], c = () => {
    r.forEach((i) => i()), r.length = 0;
  }, l = (i, u, f, x) => (i.addEventListener(u, f, x), () => i.removeEventListener(u, f, x)), a = Gt(() => [Zt(e), gs(s)], ([i, u]) => {
    c(), i && r.push(...o.flatMap((f) => n.map((x) => l(i, f, x, u))));
  }, { immediate: !0, flush: "post" }), d = () => {
    a(), c();
  };
  return bs(d), d;
}
function tc(t, e = !1) {
  const o = K(), n = () => o.value = !!t();
  return n(), Jr(n, e), o;
}
const yn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, xn = "__vueuse_ssr_handlers__";
yn[xn] = yn[xn] || {};
var wn = Object.getOwnPropertySymbols, ec = Object.prototype.hasOwnProperty, oc = Object.prototype.propertyIsEnumerable, nc = (t, e) => {
  var o = {};
  for (var n in t)
    ec.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
  if (t != null && wn)
    for (var n of wn(t))
      e.indexOf(n) < 0 && oc.call(t, n) && (o[n] = t[n]);
  return o;
};
function sc(t, e, o = {}) {
  const n = o, { window: s = Oe } = n, r = nc(n, ["window"]);
  let c;
  const l = tc(() => s && "ResizeObserver" in s), a = () => {
    c && (c.disconnect(), c = void 0);
  }, d = Gt(() => Zt(t), (u) => {
    a(), l.value && s && u && (c = new ResizeObserver(e), c.observe(u, r));
  }, { immediate: !0, flush: "post" }), i = () => {
    a(), d();
  };
  return bs(i), {
    isSupported: l,
    stop: i
  };
}
function rc(t, e = { width: 0, height: 0 }, o = {}) {
  const { window: n = Oe, box: s = "content-box" } = o, r = ct(() => {
    var a, d;
    return (d = (a = Zt(t)) == null ? void 0 : a.namespaceURI) == null ? void 0 : d.includes("svg");
  }), c = K(e.width), l = K(e.height);
  return sc(t, ([a]) => {
    const d = s === "border-box" ? a.borderBoxSize : s === "content-box" ? a.contentBoxSize : a.devicePixelContentBoxSize;
    if (n && r.value) {
      const i = Zt(t);
      if (i) {
        const u = n.getComputedStyle(i);
        c.value = parseFloat(u.width), l.value = parseFloat(u.height);
      }
    } else if (d) {
      const i = Array.isArray(d) ? d : [d];
      c.value = i.reduce((u, { inlineSize: f }) => u + f, 0), l.value = i.reduce((u, { blockSize: f }) => u + f, 0);
    } else
      c.value = a.contentRect.width, l.value = a.contentRect.height;
  }, o), Gt(() => Zt(t), (a) => {
    c.value = a ? e.width : 0, l.value = a ? e.height : 0;
  }), {
    width: c,
    height: l
  };
}
function cc(t, e = {}) {
  const { initialValue: o = !1 } = e, n = K(!1), s = ct(() => Zt(t));
  Wt(s, "focus", () => n.value = !0), Wt(s, "blur", () => n.value = !1);
  const r = ct({
    get: () => n.value,
    set(c) {
      var l, a;
      !c && n.value ? (l = s.value) == null || l.blur() : c && !n.value && ((a = s.value) == null || a.focus());
    }
  });
  return Gt(s, () => {
    r.value = o;
  }, { immediate: !0, flush: "post" }), { focused: r };
}
function lc(t = {}) {
  const {
    type: e = "page",
    touch: o = !0,
    resetOnTouchEnds: n = !1,
    initialValue: s = { x: 0, y: 0 },
    window: r = Oe,
    eventFilter: c
  } = t, l = K(s.x), a = K(s.y), d = K(null), i = (v) => {
    e === "page" ? (l.value = v.pageX, a.value = v.pageY) : e === "client" ? (l.value = v.clientX, a.value = v.clientY) : e === "movement" && (l.value = v.movementX, a.value = v.movementY), d.value = "mouse";
  }, u = () => {
    l.value = s.x, a.value = s.y;
  }, f = (v) => {
    if (v.touches.length > 0) {
      const m = v.touches[0];
      e === "page" ? (l.value = m.pageX, a.value = m.pageY) : e === "client" && (l.value = m.clientX, a.value = m.clientY), d.value = "touch";
    }
  }, x = (v) => c === void 0 ? i(v) : c(() => i(v), {}), C = (v) => c === void 0 ? f(v) : c(() => f(v), {});
  return r && (Wt(r, "mousemove", x, { passive: !0 }), Wt(r, "dragover", x, { passive: !0 }), o && e !== "movement" && (Wt(r, "touchstart", C, { passive: !0 }), Wt(r, "touchmove", C, { passive: !0 }), n && Wt(r, "touchend", u, { passive: !0 }))), {
    x: l,
    y: a,
    sourceType: d
  };
}
function ic(t, e = {}) {
  const {
    handleOutside: o = !0,
    window: n = Oe
  } = e, { x: s, y: r, sourceType: c } = lc(e), l = K(t ?? (n == null ? void 0 : n.document.body)), a = K(0), d = K(0), i = K(0), u = K(0), f = K(0), x = K(0), C = K(!0);
  let v = () => {
  };
  return n && (v = Gt([l, s, r], () => {
    const m = Zt(l);
    if (!m)
      return;
    const {
      left: E,
      top: w,
      width: g,
      height: O
    } = m.getBoundingClientRect();
    i.value = E + n.pageXOffset, u.value = w + n.pageYOffset, f.value = O, x.value = g;
    const p = s.value - i.value, S = r.value - u.value;
    C.value = g === 0 || O === 0 || p < 0 || S < 0 || p > g || S > O, (o || !C.value) && (a.value = p, d.value = S);
  }, { immediate: !0 }), Wt(document, "mouseleave", () => {
    C.value = !0;
  })), {
    x: s,
    y: r,
    sourceType: c,
    elementX: a,
    elementY: d,
    elementPositionX: i,
    elementPositionY: u,
    elementHeight: f,
    elementWidth: x,
    isOutside: C,
    stop: v
  };
}
var Sn;
(function(t) {
  t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE";
})(Sn || (Sn = {}));
var ac = Object.defineProperty, On = Object.getOwnPropertySymbols, uc = Object.prototype.hasOwnProperty, dc = Object.prototype.propertyIsEnumerable, Cn = (t, e, o) => e in t ? ac(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, fc = (t, e) => {
  for (var o in e)
    uc.call(e, o) && Cn(t, o, e[o]);
  if (On)
    for (var o of On(e))
      dc.call(e, o) && Cn(t, o, e[o]);
  return t;
};
const pc = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
fc({
  linear: Kr
}, pc);
function hc({
  elInputRef: t,
  inputValue: e,
  placeholder: o
}) {
  var i;
  const n = (i = $n()) == null ? void 0 : i.props, s = ct(() => {
    var u;
    return (u = t.value) == null ? void 0 : u.ref;
  }), { focused: r } = cc(s), c = K(!1), l = ct(() => c.value && !r.value && n.isTitle), a = ct(() => e.value ? e.value : o.value), d = async () => {
    const u = s.value;
    u && (e.value || (u.value = o.value, await be()), c.value = u.scrollWidth > u.clientWidth, u.value = e.value);
  };
  return Gt(t, () => {
    t.value && d();
  }), Gt(
    () => [e.value, o.value],
    () => {
      be(d);
    }
  ), {
    showToolTip: l,
    tooltipContent: a
  };
}
const vc = {
  key: 0,
  class: "das-input-message"
}, mc = ["title"], gc = /* @__PURE__ */ To({
  inheritAttrs: !1,
  __name: "index",
  props: {
    modelValue: { default: "" },
    type: { default: "text" },
    width: {},
    borderType: { default: "bordered" },
    placeholder: { default: "" },
    size: { default: "default" },
    disabled: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    error: { type: Boolean, default: !1 },
    errorLabel: { default: "" },
    isErrorTitle: { type: Boolean, default: !0 },
    isTitle: { type: Boolean, default: !0 },
    errorMode: { default: "default" },
    errorModelZIndex: { default: 2e3 },
    noSetDefaultVal: { type: Boolean, default: !1 },
    autosize: { type: [Boolean, Object], default: () => ({ minRows: 3 }) },
    showWordLimit: { type: Boolean, default: !0 },
    showTextWordLimit: { type: Boolean, default: !1 },
    maxlength: {},
    filterSpace: { type: Boolean, default: !0 },
    clearable: { type: Boolean }
  },
  emits: ["update:modelValue", "change"],
  setup(t, { expose: e, emit: o }) {
    const n = t, s = ct(() => n.placeholder || Hs("请输入")), r = ct(() => n.disabled ? "disabled" : n.isView ? "view" : n.error ? "error" : "default"), c = ct(() => {
      var p, S, R, W, V;
      return {
        "--das-input-width": Gr(n.width ?? ((p = lo[n.size]) == null ? void 0 : p.defaultWidth)),
        "--das-input-height": (S = lo[n.size]) == null ? void 0 : S.height,
        "--das-input-font-size": (R = lo[n.size]) == null ? void 0 : R.fontSize,
        "--das-input-border-color": (W = gn[r.value]) == null ? void 0 : W.color,
        "--das-input-message-color": (V = gn[r.value]) == null ? void 0 : V.color
      };
    }), l = ct(() => [
      "das-ui-input",
      `das-ui-input--border-type-${n.borderType}`,
      {
        "das-ui-input--view": n.isView,
        "das-ui-input--disabled": n.disabled,
        "das-ui-textarea": n.type === "textarea"
      }
    ]), a = o, d = ct({
      get: () => n.modelValue,
      set: (p) => a("update:modelValue", p)
    }), i = K(null), u = K(), { isOutside: f } = ic(ct(() => {
      var p;
      return (p = u.value) == null ? void 0 : p.$el;
    })), x = ct(() => !f.value && n.errorMode === "overlay"), C = ct(() => n.type === "textarea" ? n.showWordLimit : n.showTextWordLimit), v = ct(() => n.isView || n.disabled), m = ct(() => v.value ? n.noSetDefaultVal ? "" : "-" : s.value ?? ""), { showToolTip: E, tooltipContent: w } = hc({
      elInputRef: u,
      inputValue: d,
      placeholder: s
    }), { width: g } = rc(i), O = (p) => {
      let S = p + "";
      n.type !== "textarea" && n.filterSpace && (S = S.trim()), d.value = S, a("change", S);
    };
    return e({
      elInputRef: u
    }), (p, S) => (ht(), St(
      "div",
      {
        ref_key: "containerRef",
        ref: i,
        style: Ve(c.value),
        class: Pe(l.value)
      },
      [
        Lt(" 这里tooltip不能使用v-model:visible 有响应问题 "),
        io(Ds, {
          effect: "light",
          placement: "top",
          disabled: !Bt(E),
          content: Bt(w)
        }, {
          default: Dt(() => [
            io(Bt(Ls), En({
              ref_key: "elInputRef",
              ref: u
            }, p.$attrs, {
              modelValue: d.value,
              "onUpdate:modelValue": S[0] || (S[0] = (R) => d.value = R),
              placeholder: m.value,
              disabled: t.disabled,
              readonly: t.isView,
              type: n.type,
              autosize: n.autosize,
              showWordLimit: C.value,
              maxlength: n.maxlength,
              onChange: O
            }), Ts({
              _: 2
              /* DYNAMIC */
            }, [
              p.$slots.prepend ? {
                name: "prepend",
                fn: Dt(() => [
                  Lt(" 输入框前置内容 "),
                  ee(p.$slots, "prepend", {}, void 0, !0)
                ]),
                key: "0"
              } : void 0,
              p.$slots.append ? {
                name: "append",
                fn: Dt(() => [
                  Lt(" 输入框后置内容 "),
                  ee(p.$slots, "append", {}, void 0, !0)
                ]),
                key: "1"
              } : void 0,
              p.$slots.suffix ? {
                name: "suffix",
                fn: Dt(() => [
                  ee(p.$slots, "suffix", {}, void 0, !0)
                ]),
                key: "2"
              } : void 0,
              p.$slots.prefix ? {
                name: "prefix",
                fn: Dt(() => [
                  ee(p.$slots, "prefix", {}, void 0, !0)
                ]),
                key: "3"
              } : void 0
            ]), 1040, ["modelValue", "placeholder", "disabled", "readonly", "type", "autosize", "showWordLimit", "maxlength"])
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["disabled", "content"]),
        t.error && t.errorLabel ? (ht(), St(
          Le,
          { key: 0 },
          [
            t.errorMode === "default" ? (ht(), St("div", vc, [
              t.error ? $s((ht(), St("span", {
                key: 0,
                class: Pe(["das-input-message_content", { "is-ellipsis": t.isErrorTitle }]),
                title: t.isErrorTitle ? t.errorLabel : ""
              }, [
                Tn(
                  ze(t.errorLabel),
                  1
                  /* TEXT */
                )
              ], 10, mc)), [
                [Bt(Xr)]
              ]) : Lt("v-if", !0)
            ])) : Lt("v-if", !0),
            x.value ? (ht(), Io(Ws, {
              key: 1,
              errorLabel: t.errorLabel,
              errorWidth: `${Bt(g)}`,
              getEl: () => {
                var R;
                return (R = u.value) == null ? void 0 : R.$el;
              },
              errorModelZIndex: t.errorModelZIndex
            }, null, 8, ["errorLabel", "errorWidth", "getEl", "errorModelZIndex"])) : Lt("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : Lt("v-if", !0)
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), bc = /* @__PURE__ */ In(gc, [["__scopeId", "data-v-bcb6665b"]]), yc = {
  共: { "zh-CN": "共", en: "Total", "zh-MO": "共", _appCode: "framework" },
  项: { "zh-CN": "项", en: "Item", "zh-MO": "項", _appCode: "framework" },
  请输入: { "zh-CN": "请输入", en: "Please enter", "zh-MO": "請輸入", _appCode: "framework" }
};
ks(yc);
const Lc = ys(bc);
export {
  Lc as DasInput,
  Lc as default
};
