var W = Object.defineProperty; var P = (e) => { throw TypeError(e); }; var X = (e, t, i) => t in e ? W(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i; var y = (e, t, i) => X(e, typeof t != "symbol" ? t + "" : t, i), x = (e, t, i) => t.has(e) || P("Cannot " + i); var s = (e, t, i) => (x(e, t, "read from private field"), i ? i.call(e) : t.get(e)), c = (e, t, i) => t.has(e) ? P("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), l = (e, t, i, u) => (x(e, t, "write to private field"), u ? u.call(e, i) : t.set(e, i), i), a = (e, t, i) => (x(e, t, "access private method"), i); import { F as Y, c as M, b as q, a as D, d as B, g as U, e as j, i as G } from "./index.Dlc3VA1f.js"; import { t as C } from "./tokens.CKbL8mrq.js"; import { t as J, a7 as K } from "./index.B_XvPxIW.js"; const Q = (e) => window.innerHeight / 2 > (e.top + e.bottom) / 2, Z = (e, t) => Q(e) ? `${e.bottom + window.scrollY + 10}px` : `${e.top + window.scrollY - t - 15}px`, R = (e, t) => { const i = e.left + window.scrollX; return i + t > window.innerWidth ? `${window.innerWidth - t - 30}px` : `${i}px`; }, b = { activate: async () => { const e = await O(); e == null || e.activate(); }, deactivate: async () => { const e = await O(); e == null || e.deactivate(); } }; let v; const O = async () => { if (v) return v; const [e, t] = await J(() => import("./lazy.CblYiFgL.js"))(); return e ? (console.error("Error loading Tooltip:", e), null) : (v = t.TooltipController, v); }; var n, r, h, d, m, o, F, I, N, $, g, k, V, A; const p = class p { constructor(t) { c(this, o); c(this, n); c(this, r); c(this, h); c(this, d); c(this, m); l(this, r, t), l(this, n, a(this, o, F).call(this)), l(this, d, a(this, o, g).bind(this)), l(this, m, a(this, o, A).bind(this)), a(this, o, I).call(this), l(this, h, !0); } display(t, i) { a(this, o, $).call(this, i), a(this, o, g).call(this, t), requestAnimationFrame(() => { s(this, n).classList.add(p.classNameShow); }); } remove() { s(this, n).remove(), a(this, o, N).call(this), l(this, h, !1); } isActive() { return s(this, h); } }; n = new WeakMap(), r = new WeakMap(), h = new WeakMap(), d = new WeakMap(), m = new WeakMap(), o = new WeakSet(), F = function() { const t = document.createElement("div"); return t.setAttribute("class", p.classNameBase), document.body.appendChild(t), t; }, I = function() { s(this, r).addEventListener("mousemove", s(this, d)), document.addEventListener("keydown", s(this, m)), s(this, r).addEventListener("mouseout", () => { this.remove(); }), s(this, r).addEventListener("blur", () => { this.remove(); }); }, N = function() { s(this, r).removeEventListener("mousemove", s(this, d)), document.removeEventListener("keydown", s(this, m)); }, $ = function(t) { s(this, n).textContent = t; }, g = function(t) { if (t instanceof MouseEvent) { a(this, o, k).call(this, t); return; } a(this, o, V).call(this); }, /** * NOTE: 表示されたtooltipにhoverしないようにしてます * ※ 表示されたtooltipにhoverすると、元のサイトのhoverイベントを終了させちゃう事があるため * ※ 例えば、「hoverで開くメニュー内でtooltipがhoverを奪ってメニューが閉じちゃう」とか */ k = function(t) { const i = window.innerWidth; t.clientX > i / 2 ? s(this, n).style.right = `${i - t.pageX}px` : s(this, n).style.left = `${t.pageX + 25}px`, s(this, n).style.top = `${t.pageY + 25}px`; }, V = function() { const t = s(this, r).getBoundingClientRect(); s(this, n).style.top = Z(t, s(this, n).clientHeight), s(this, n).style.left = R(t, s(this, n).clientWidth); }, A = function(t) { t.key === "Escape" && this.remove(); }, y(p, "classNameBase", "uniweb--tooltip"), y(p, "classNameShow", "uniweb--tooltip-show"); let f = p; const _ = ` .${f.classNameBase} { opacity: 0; transition: opacity .1s ease-in-out; line-height: normal; max-width: 35%; position: absolute!important; box-sizing: border-box!important; border: solid 2px #fff!important; background: #34394d!important; color: #fff!important; font-weight: 600!important; font-size: 17px!important; border-radius: 10px; text-align: left!important; padding: 13px 18px; box-shadow: 0 0 15px rgba(66,73,96,.4); height: auto!important; white-space: pre-wrap; word-wrap: break-word; z-index: 2147483647; min-width: 150px; } .${f.classNameShow} { opacity: 1; } `, w = Y.TOOLTIP, tt = { FTOOLTIP: "FTOOLTIP" }, T = [ { titleToken: C.features.tooltip, variant: tt.FTOOLTIP, icon: B.IconTooltip } ], rt = _, et = () => (e, t, i) => ({ ...K("feature-handle-tooltip", t, (u) => { var S; const z = G(t), E = u.variant, H = (S = t()) == null ? void 0 : S.variant; return E === H ? {} : E === void 0 ? (b.deactivate(), {}) : (z ? setTimeout(() => { b.activate(); }, 1e3) : b.activate(), {}); }) }), L = D(w, [ U(w, "origin-body"), j(w, T), et() ]), it = M(L), ct = { titleToken: C.features.tooltip, icon: B.IconTooltip, steps: T, useVariant: () => L().use((e) => e.variant), useSetNextVariant: () => q(L, T) }, lt = { name: w, setVariant: it.set }; export { tt as T, Z as a, R as b, ct as c, it as d, lt as e, f, w as n, rt as s };