import { a as e, n as t } from './chunk-BneVvdWh.js';
import { S as n, f as r, l as i, p as a } from './iframe-B-AKBcwT.js';
import { C as o, S as s, a as c, c as l, m as u } from './theming-ugaMF2e3.js';
import { i as d, r as f } from './chunk-3LY4VQVK-DmwSwDov.js';
import { t as p } from './react-dom-BMbxhwuz.js';
import { n as m, t as h } from './chunk-242VQQM5-IE3HF7eW.js';
function g(e) {
    return e ? (e.nodeName || ``).toLowerCase() : null;
}
function _(e) {
    if (e == null) return window;
    if (e.toString() !== `[object Window]`) {
        var t = e.ownerDocument;
        return (t && t.defaultView) || window;
    }
    return e;
}
function v(e) {
    return e instanceof _(e).Element || e instanceof Element;
}
function y(e) {
    return e instanceof _(e).HTMLElement || e instanceof HTMLElement;
}
function b(e) {
    return typeof ShadowRoot > `u`
        ? !1
        : e instanceof _(e).ShadowRoot || e instanceof ShadowRoot;
}
function x(e) {
    var t = e.state;
    Object.keys(t.elements).forEach(function (e) {
        var n = t.styles[e] || {},
            r = t.attributes[e] || {},
            i = t.elements[e];
        !y(i) ||
            !g(i) ||
            (Object.assign(i.style, n),
            Object.keys(r).forEach(function (e) {
                var t = r[e];
                t === !1 ? i.removeAttribute(e) : i.setAttribute(e, t === !0 ? `` : t);
            }));
    });
}
function S(e) {
    var t = e.state,
        n = {
            popper: { position: t.options.strategy, left: `0`, top: `0`, margin: `0` },
            arrow: { position: `absolute` },
            reference: {},
        };
    return (
        Object.assign(t.elements.popper.style, n.popper),
        (t.styles = n),
        t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow),
        function () {
            Object.keys(t.elements).forEach(function (e) {
                var r = t.elements[e],
                    i = t.attributes[e] || {},
                    a = Object.keys(
                        t.styles.hasOwnProperty(e) ? t.styles[e] : n[e],
                    ).reduce(function (e, t) {
                        return ((e[t] = ``), e);
                    }, {});
                !y(r) ||
                    !g(r) ||
                    (Object.assign(r.style, a),
                    Object.keys(i).forEach(function (e) {
                        r.removeAttribute(e);
                    }));
            });
        }
    );
}
function C(e) {
    return e.split(`-`)[0];
}
function w() {
    var e = navigator.userAgentData;
    return e != null && e.brands && Array.isArray(e.brands)
        ? e.brands
              .map(function (e) {
                  return e.brand + `/` + e.version;
              })
              .join(` `)
        : navigator.userAgent;
}
function T() {
    return !/^((?!chrome|android).)*safari/i.test(w());
}
function E(e, t, n) {
    (t === void 0 && (t = !1), n === void 0 && (n = !1));
    var r = e.getBoundingClientRect(),
        i = 1,
        a = 1;
    t &&
        y(e) &&
        ((i = (e.offsetWidth > 0 && Z(r.width) / e.offsetWidth) || 1),
        (a = (e.offsetHeight > 0 && Z(r.height) / e.offsetHeight) || 1));
    var o = (v(e) ? _(e) : window).visualViewport,
        s = !T() && n,
        c = (r.left + (s && o ? o.offsetLeft : 0)) / i,
        l = (r.top + (s && o ? o.offsetTop : 0)) / a,
        u = r.width / i,
        d = r.height / a;
    return {
        width: u,
        height: d,
        top: l,
        right: c + u,
        bottom: l + d,
        left: c,
        x: c,
        y: l,
    };
}
function D(e) {
    var t = E(e),
        n = e.offsetWidth,
        r = e.offsetHeight;
    return (
        Math.abs(t.width - n) <= 1 && (n = t.width),
        Math.abs(t.height - r) <= 1 && (r = t.height),
        { x: e.offsetLeft, y: e.offsetTop, width: n, height: r }
    );
}
function O(e, t) {
    var n = t.getRootNode && t.getRootNode();
    if (e.contains(t)) return !0;
    if (n && b(n)) {
        var r = t;
        do {
            if (r && e.isSameNode(r)) return !0;
            r = r.parentNode || r.host;
        } while (r);
    }
    return !1;
}
function k(e) {
    return _(e).getComputedStyle(e);
}
function A(e) {
    return [`table`, `td`, `th`].indexOf(g(e)) >= 0;
}
function j(e) {
    return ((v(e) ? e.ownerDocument : e.document) || window.document).documentElement;
}
function M(e) {
    return g(e) === `html`
        ? e
        : e.assignedSlot || e.parentNode || (b(e) ? e.host : null) || j(e);
}
function N(e) {
    return !y(e) || k(e).position === `fixed` ? null : e.offsetParent;
}
function P(e) {
    var t = /firefox/i.test(w());
    if (/Trident/i.test(w()) && y(e) && k(e).position === `fixed`) return null;
    var n = M(e);
    for (b(n) && (n = n.host); y(n) && [`html`, `body`].indexOf(g(n)) < 0; ) {
        var r = k(n);
        if (
            r.transform !== `none` ||
            r.perspective !== `none` ||
            r.contain === `paint` ||
            [`transform`, `perspective`].indexOf(r.willChange) !== -1 ||
            (t && r.willChange === `filter`) ||
            (t && r.filter && r.filter !== `none`)
        )
            return n;
        n = n.parentNode;
    }
    return null;
}
function F(e) {
    for (var t = _(e), n = N(e); n && A(n) && k(n).position === `static`; ) n = N(n);
    return n && (g(n) === `html` || (g(n) === `body` && k(n).position === `static`))
        ? t
        : n || P(e) || t;
}
function ee(e) {
    return [`top`, `bottom`].indexOf(e) >= 0 ? `x` : `y`;
}
function I(e, t, n) {
    return X(e, gt(t, n));
}
function te(e, t, n) {
    var r = I(e, t, n);
    return r > n ? n : r;
}
function ne() {
    return { top: 0, right: 0, bottom: 0, left: 0 };
}
function re(e) {
    return Object.assign({}, ne(), e);
}
function ie(e, t) {
    return t.reduce(function (t, n) {
        return ((t[n] = e), t);
    }, {});
}
function ae(e) {
    var t,
        n = e.state,
        r = e.name,
        i = e.options,
        a = n.elements.arrow,
        o = n.modifiersData.popperOffsets,
        s = C(n.placement),
        c = ee(s),
        l = [J, q].indexOf(s) >= 0 ? `height` : `width`;
    if (!(!a || !o)) {
        var u = _t(i.padding, n),
            d = D(a),
            f = c === `y` ? G : J,
            p = c === `y` ? K : q,
            m = n.rects.reference[l] + n.rects.reference[c] - o[c] - n.rects.popper[l],
            h = o[c] - n.rects.reference[c],
            g = F(a),
            _ = g ? (c === `y` ? g.clientHeight || 0 : g.clientWidth || 0) : 0,
            v = m / 2 - h / 2,
            y = u[f],
            b = _ - d[l] - u[p],
            x = _ / 2 - d[l] / 2 + v,
            S = I(y, x, b),
            w = c;
        n.modifiersData[r] = ((t = {}), (t[w] = S), (t.centerOffset = S - x), t);
    }
}
function oe(e) {
    var t = e.state,
        n = e.options.element,
        r = n === void 0 ? `[data-popper-arrow]` : n;
    r != null &&
        ((typeof r == `string` && ((r = t.elements.popper.querySelector(r)), !r)) ||
            (O(t.elements.popper, r) && (t.elements.arrow = r)));
}
function L(e) {
    return e.split(`-`)[1];
}
function se(e, t) {
    var n = e.x,
        r = e.y,
        i = t.devicePixelRatio || 1;
    return { x: Z(n * i) / i || 0, y: Z(r * i) / i || 0 };
}
function ce(e) {
    var t,
        n = e.popper,
        r = e.popperRect,
        i = e.placement,
        a = e.variation,
        o = e.offsets,
        s = e.position,
        c = e.gpuAcceleration,
        l = e.adaptive,
        u = e.roundOffsets,
        d = e.isFixed,
        f = o.x,
        p = f === void 0 ? 0 : f,
        m = o.y,
        h = m === void 0 ? 0 : m,
        g = typeof u == `function` ? u({ x: p, y: h }) : { x: p, y: h };
    ((p = g.x), (h = g.y));
    var v = o.hasOwnProperty(`x`),
        y = o.hasOwnProperty(`y`),
        b = J,
        x = G,
        S = window;
    if (l) {
        var C = F(n),
            w = `clientHeight`,
            T = `clientWidth`;
        if (
            (C === _(n) &&
                ((C = j(n)),
                k(C).position !== `static` &&
                    s === `absolute` &&
                    ((w = `scrollHeight`), (T = `scrollWidth`))),
            (C = C),
            i === G || ((i === J || i === q) && a === st))
        ) {
            x = K;
            var E = d && C === S && S.visualViewport ? S.visualViewport.height : C[w];
            ((h -= E - r.height), (h *= c ? 1 : -1));
        }
        if (i === J || ((i === G || i === K) && a === st)) {
            b = q;
            var D = d && C === S && S.visualViewport ? S.visualViewport.width : C[T];
            ((p -= D - r.width), (p *= c ? 1 : -1));
        }
    }
    var O = Object.assign({ position: s }, l && yt),
        A = u === !0 ? se({ x: p, y: h }, _(n)) : { x: p, y: h };
    if (((p = A.x), (h = A.y), c)) {
        var M;
        return Object.assign(
            {},
            O,
            ((M = {}),
            (M[x] = y ? `0` : ``),
            (M[b] = v ? `0` : ``),
            (M.transform =
                (S.devicePixelRatio || 1) <= 1
                    ? `translate(` + p + `px, ` + h + `px)`
                    : `translate3d(` + p + `px, ` + h + `px, 0)`),
            M),
        );
    }
    return Object.assign(
        {},
        O,
        ((t = {}),
        (t[x] = y ? h + `px` : ``),
        (t[b] = v ? p + `px` : ``),
        (t.transform = ``),
        t),
    );
}
function le(e) {
    var t = e.state,
        n = e.options,
        r = n.gpuAcceleration,
        i = r === void 0 ? !0 : r,
        a = n.adaptive,
        o = a === void 0 ? !0 : a,
        s = n.roundOffsets,
        c = s === void 0 ? !0 : s,
        l = {
            placement: C(t.placement),
            variation: L(t.placement),
            popper: t.elements.popper,
            popperRect: t.rects.popper,
            gpuAcceleration: i,
            isFixed: t.options.strategy === `fixed`,
        };
    (t.modifiersData.popperOffsets != null &&
        (t.styles.popper = Object.assign(
            {},
            t.styles.popper,
            ce(
                Object.assign({}, l, {
                    offsets: t.modifiersData.popperOffsets,
                    position: t.options.strategy,
                    adaptive: o,
                    roundOffsets: c,
                }),
            ),
        )),
        t.modifiersData.arrow != null &&
            (t.styles.arrow = Object.assign(
                {},
                t.styles.arrow,
                ce(
                    Object.assign({}, l, {
                        offsets: t.modifiersData.arrow,
                        position: `absolute`,
                        adaptive: !1,
                        roundOffsets: c,
                    }),
                ),
            )),
        (t.attributes.popper = Object.assign({}, t.attributes.popper, {
            'data-popper-placement': t.placement,
        })));
}
function ue(e) {
    var t = e.state,
        n = e.instance,
        r = e.options,
        i = r.scroll,
        a = i === void 0 ? !0 : i,
        o = r.resize,
        s = o === void 0 ? !0 : o,
        c = _(t.elements.popper),
        l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
    return (
        a &&
            l.forEach(function (e) {
                e.addEventListener(`scroll`, n.update, xt);
            }),
        s && c.addEventListener(`resize`, n.update, xt),
        function () {
            (a &&
                l.forEach(function (e) {
                    e.removeEventListener(`scroll`, n.update, xt);
                }),
                s && c.removeEventListener(`resize`, n.update, xt));
        }
    );
}
function R(e) {
    return e.replace(/left|right|bottom|top/g, function (e) {
        return Ct[e];
    });
}
function de(e) {
    return e.replace(/start|end/g, function (e) {
        return wt[e];
    });
}
function z(e) {
    var t = _(e);
    return { scrollLeft: t.pageXOffset, scrollTop: t.pageYOffset };
}
function fe(e) {
    return E(j(e)).left + z(e).scrollLeft;
}
function pe(e, t) {
    var n = _(e),
        r = j(e),
        i = n.visualViewport,
        a = r.clientWidth,
        o = r.clientHeight,
        s = 0,
        c = 0;
    if (i) {
        ((a = i.width), (o = i.height));
        var l = T();
        (l || (!l && t === `fixed`)) && ((s = i.offsetLeft), (c = i.offsetTop));
    }
    return { width: a, height: o, x: s + fe(e), y: c };
}
function me(e) {
    var t = j(e),
        n = z(e),
        r = e.ownerDocument?.body,
        i = X(t.scrollWidth, t.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0),
        a = X(
            t.scrollHeight,
            t.clientHeight,
            r ? r.scrollHeight : 0,
            r ? r.clientHeight : 0,
        ),
        o = -n.scrollLeft + fe(e),
        s = -n.scrollTop;
    return (
        k(r || t).direction === `rtl` &&
            (o += X(t.clientWidth, r ? r.clientWidth : 0) - i),
        { width: i, height: a, x: o, y: s }
    );
}
function he(e) {
    var t = k(e),
        n = t.overflow,
        r = t.overflowX,
        i = t.overflowY;
    return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function ge(e) {
    return [`html`, `body`, `#document`].indexOf(g(e)) >= 0
        ? e.ownerDocument.body
        : y(e) && he(e)
          ? e
          : ge(M(e));
}
function B(e, t) {
    t === void 0 && (t = []);
    var n = ge(e),
        r = n === e.ownerDocument?.body,
        i = _(n),
        a = r ? [i].concat(i.visualViewport || [], he(n) ? n : []) : n,
        o = t.concat(a);
    return r ? o : o.concat(B(M(a)));
}
function _e(e) {
    return Object.assign({}, e, {
        left: e.x,
        top: e.y,
        right: e.x + e.width,
        bottom: e.y + e.height,
    });
}
function ve(e, t) {
    var n = E(e, !1, t === `fixed`);
    return (
        (n.top += e.clientTop),
        (n.left += e.clientLeft),
        (n.bottom = n.top + e.clientHeight),
        (n.right = n.left + e.clientWidth),
        (n.width = e.clientWidth),
        (n.height = e.clientHeight),
        (n.x = n.left),
        (n.y = n.top),
        n
    );
}
function ye(e, t, n) {
    return t === lt ? _e(pe(e, n)) : v(t) ? ve(t, n) : _e(me(j(e)));
}
function be(e) {
    var t = B(M(e)),
        n = [`absolute`, `fixed`].indexOf(k(e).position) >= 0 && y(e) ? F(e) : e;
    return v(n)
        ? t.filter(function (e) {
              return v(e) && O(e, n) && g(e) !== `body`;
          })
        : [];
}
function V(e, t, n, r) {
    var i = t === `clippingParents` ? be(e) : [].concat(t),
        a = [].concat(i, [n]),
        o = a[0],
        s = a.reduce(
            function (t, n) {
                var i = ye(e, n, r);
                return (
                    (t.top = X(i.top, t.top)),
                    (t.right = gt(i.right, t.right)),
                    (t.bottom = gt(i.bottom, t.bottom)),
                    (t.left = X(i.left, t.left)),
                    t
                );
            },
            ye(e, o, r),
        );
    return (
        (s.width = s.right - s.left),
        (s.height = s.bottom - s.top),
        (s.x = s.left),
        (s.y = s.top),
        s
    );
}
function H(e) {
    var t = e.reference,
        n = e.element,
        r = e.placement,
        i = r ? C(r) : null,
        a = r ? L(r) : null,
        o = t.x + t.width / 2 - n.width / 2,
        s = t.y + t.height / 2 - n.height / 2,
        c;
    switch (i) {
        case G:
            c = { x: o, y: t.y - n.height };
            break;
        case K:
            c = { x: o, y: t.y + t.height };
            break;
        case q:
            c = { x: t.x + t.width, y: s };
            break;
        case J:
            c = { x: t.x - n.width, y: s };
            break;
        default:
            c = { x: t.x, y: t.y };
    }
    var l = i ? ee(i) : null;
    if (l != null) {
        var u = l === `y` ? `height` : `width`;
        switch (a) {
            case Y:
                c[l] = c[l] - (t[u] / 2 - n[u] / 2);
                break;
            case st:
                c[l] = c[l] + (t[u] / 2 - n[u] / 2);
                break;
            default:
        }
    }
    return c;
}
function xe(e, t) {
    t === void 0 && (t = {});
    var n = t,
        r = n.placement,
        i = r === void 0 ? e.placement : r,
        a = n.strategy,
        o = a === void 0 ? e.strategy : a,
        s = n.boundary,
        c = s === void 0 ? ct : s,
        l = n.rootBoundary,
        u = l === void 0 ? lt : l,
        d = n.elementContext,
        f = d === void 0 ? ut : d,
        p = n.altBoundary,
        m = p === void 0 ? !1 : p,
        h = n.padding,
        g = h === void 0 ? 0 : h,
        _ = re(typeof g == `number` ? ie(g, ot) : g),
        y = f === ut ? dt : ut,
        b = e.rects.popper,
        x = e.elements[m ? y : f],
        S = V(v(x) ? x : x.contextElement || j(e.elements.popper), c, u, o),
        C = E(e.elements.reference),
        w = H({ reference: C, element: b, strategy: `absolute`, placement: i }),
        T = _e(Object.assign({}, b, w)),
        D = f === ut ? T : C,
        O = {
            top: S.top - D.top + _.top,
            bottom: D.bottom - S.bottom + _.bottom,
            left: S.left - D.left + _.left,
            right: D.right - S.right + _.right,
        },
        k = e.modifiersData.offset;
    if (f === ut && k) {
        var A = k[i];
        Object.keys(O).forEach(function (e) {
            var t = [q, K].indexOf(e) >= 0 ? 1 : -1,
                n = [G, K].indexOf(e) >= 0 ? `y` : `x`;
            O[e] += A[n] * t;
        });
    }
    return O;
}
function Se(e, t) {
    t === void 0 && (t = {});
    var n = t,
        r = n.placement,
        i = n.boundary,
        a = n.rootBoundary,
        o = n.padding,
        s = n.flipVariations,
        c = n.allowedAutoPlacements,
        l = c === void 0 ? pt : c,
        u = L(r),
        d = u
            ? s
                ? ft
                : ft.filter(function (e) {
                      return L(e) === u;
                  })
            : ot,
        f = d.filter(function (e) {
            return l.indexOf(e) >= 0;
        });
    f.length === 0 && (f = d);
    var p = f.reduce(function (t, n) {
        return (
            (t[n] = xe(e, { placement: n, boundary: i, rootBoundary: a, padding: o })[
                C(n)
            ]),
            t
        );
    }, {});
    return Object.keys(p).sort(function (e, t) {
        return p[e] - p[t];
    });
}
function Ce(e) {
    if (C(e) === at) return [];
    var t = R(e);
    return [de(e), t, de(t)];
}
function we(e) {
    var t = e.state,
        n = e.options,
        r = e.name;
    if (!t.modifiersData[r]._skip) {
        for (
            var i = n.mainAxis,
                a = i === void 0 ? !0 : i,
                o = n.altAxis,
                s = o === void 0 ? !0 : o,
                c = n.fallbackPlacements,
                l = n.padding,
                u = n.boundary,
                d = n.rootBoundary,
                f = n.altBoundary,
                p = n.flipVariations,
                m = p === void 0 ? !0 : p,
                h = n.allowedAutoPlacements,
                g = t.options.placement,
                _ = C(g) === g,
                v = c || (_ || !m ? [R(g)] : Ce(g)),
                y = [g].concat(v).reduce(function (e, n) {
                    return e.concat(
                        C(n) === at
                            ? Se(t, {
                                  placement: n,
                                  boundary: u,
                                  rootBoundary: d,
                                  padding: l,
                                  flipVariations: m,
                                  allowedAutoPlacements: h,
                              })
                            : n,
                    );
                }, []),
                b = t.rects.reference,
                x = t.rects.popper,
                S = new Map(),
                w = !0,
                T = y[0],
                E = 0;
            E < y.length;
            E++
        ) {
            var D = y[E],
                O = C(D),
                k = L(D) === Y,
                A = [G, K].indexOf(O) >= 0,
                j = A ? `width` : `height`,
                M = xe(t, {
                    placement: D,
                    boundary: u,
                    rootBoundary: d,
                    altBoundary: f,
                    padding: l,
                }),
                N = A ? (k ? q : J) : k ? K : G;
            b[j] > x[j] && (N = R(N));
            var P = R(N),
                F = [];
            if (
                (a && F.push(M[O] <= 0),
                s && F.push(M[N] <= 0, M[P] <= 0),
                F.every(function (e) {
                    return e;
                }))
            ) {
                ((T = D), (w = !1));
                break;
            }
            S.set(D, F);
        }
        if (w)
            for (
                var ee = m ? 3 : 1,
                    I = function (e) {
                        var t = y.find(function (t) {
                            var n = S.get(t);
                            if (n)
                                return n.slice(0, e).every(function (e) {
                                    return e;
                                });
                        });
                        if (t) return ((T = t), `break`);
                    },
                    te = ee;
                te > 0 && I(te) !== `break`;
                te--
            );
        t.placement !== T &&
            ((t.modifiersData[r]._skip = !0), (t.placement = T), (t.reset = !0));
    }
}
function Te(e, t, n) {
    return (
        n === void 0 && (n = { x: 0, y: 0 }),
        {
            top: e.top - t.height - n.y,
            right: e.right - t.width + n.x,
            bottom: e.bottom - t.height + n.y,
            left: e.left - t.width - n.x,
        }
    );
}
function Ee(e) {
    return [G, q, K, J].some(function (t) {
        return e[t] >= 0;
    });
}
function De(e) {
    var t = e.state,
        n = e.name,
        r = t.rects.reference,
        i = t.rects.popper,
        a = t.modifiersData.preventOverflow,
        o = xe(t, { elementContext: `reference` }),
        s = xe(t, { altBoundary: !0 }),
        c = Te(o, r),
        l = Te(s, i, a),
        u = Ee(c),
        d = Ee(l);
    ((t.modifiersData[n] = {
        referenceClippingOffsets: c,
        popperEscapeOffsets: l,
        isReferenceHidden: u,
        hasPopperEscaped: d,
    }),
        (t.attributes.popper = Object.assign({}, t.attributes.popper, {
            'data-popper-reference-hidden': u,
            'data-popper-escaped': d,
        })));
}
function Oe(e, t, n) {
    var r = C(e),
        i = [J, G].indexOf(r) >= 0 ? -1 : 1,
        a = typeof n == `function` ? n(Object.assign({}, t, { placement: e })) : n,
        o = a[0],
        s = a[1];
    return (
        (o ||= 0),
        (s = (s || 0) * i),
        [J, q].indexOf(r) >= 0 ? { x: s, y: o } : { x: o, y: s }
    );
}
function ke(e) {
    var t = e.state,
        n = e.options,
        r = e.name,
        i = n.offset,
        a = i === void 0 ? [0, 0] : i,
        o = pt.reduce(function (e, n) {
            return ((e[n] = Oe(n, t.rects, a)), e);
        }, {}),
        s = o[t.placement],
        c = s.x,
        l = s.y;
    (t.modifiersData.popperOffsets != null &&
        ((t.modifiersData.popperOffsets.x += c), (t.modifiersData.popperOffsets.y += l)),
        (t.modifiersData[r] = o));
}
function Ae(e) {
    var t = e.state,
        n = e.name;
    t.modifiersData[n] = H({
        reference: t.rects.reference,
        element: t.rects.popper,
        strategy: `absolute`,
        placement: t.placement,
    });
}
function je(e) {
    return e === `x` ? `y` : `x`;
}
function Me(e) {
    var t = e.state,
        n = e.options,
        r = e.name,
        i = n.mainAxis,
        a = i === void 0 ? !0 : i,
        o = n.altAxis,
        s = o === void 0 ? !1 : o,
        c = n.boundary,
        l = n.rootBoundary,
        u = n.altBoundary,
        d = n.padding,
        f = n.tether,
        p = f === void 0 ? !0 : f,
        m = n.tetherOffset,
        h = m === void 0 ? 0 : m,
        g = xe(t, { boundary: c, rootBoundary: l, padding: d, altBoundary: u }),
        _ = C(t.placement),
        v = L(t.placement),
        y = !v,
        b = ee(_),
        x = je(b),
        S = t.modifiersData.popperOffsets,
        w = t.rects.reference,
        T = t.rects.popper,
        E =
            typeof h == `function`
                ? h(Object.assign({}, t.rects, { placement: t.placement }))
                : h,
        O =
            typeof E == `number`
                ? { mainAxis: E, altAxis: E }
                : Object.assign({ mainAxis: 0, altAxis: 0 }, E),
        k = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null,
        A = { x: 0, y: 0 };
    if (S) {
        if (a) {
            var j = b === `y` ? G : J,
                M = b === `y` ? K : q,
                N = b === `y` ? `height` : `width`,
                P = S[b],
                re = P + g[j],
                ie = P - g[M],
                ae = p ? -T[N] / 2 : 0,
                oe = v === Y ? w[N] : T[N],
                se = v === Y ? -T[N] : -w[N],
                ce = t.elements.arrow,
                le = p && ce ? D(ce) : { width: 0, height: 0 },
                ue = t.modifiersData[`arrow#persistent`]
                    ? t.modifiersData[`arrow#persistent`].padding
                    : ne(),
                R = ue[j],
                de = ue[M],
                z = I(0, w[N], le[N]),
                fe = y ? w[N] / 2 - ae - z - R - O.mainAxis : oe - z - R - O.mainAxis,
                pe = y ? -w[N] / 2 + ae + z + de + O.mainAxis : se + z + de + O.mainAxis,
                me = t.elements.arrow && F(t.elements.arrow),
                he = me ? (b === `y` ? me.clientTop || 0 : me.clientLeft || 0) : 0,
                ge = k?.[b] ?? 0,
                B = P + fe - ge - he,
                _e = P + pe - ge,
                ve = I(p ? gt(re, B) : re, P, p ? X(ie, _e) : ie);
            ((S[b] = ve), (A[b] = ve - P));
        }
        if (s) {
            var ye = b === `x` ? G : J,
                be = b === `x` ? K : q,
                V = S[x],
                H = x === `y` ? `height` : `width`,
                Se = V + g[ye],
                Ce = V - g[be],
                we = [G, J].indexOf(_) !== -1,
                Te = k?.[x] ?? 0,
                Ee = we ? Se : V - w[H] - T[H] - Te + O.altAxis,
                De = we ? V + w[H] + T[H] - Te - O.altAxis : Ce,
                Oe = p && we ? te(Ee, V, De) : I(p ? Ee : Se, V, p ? De : Ce);
            ((S[x] = Oe), (A[x] = Oe - V));
        }
        t.modifiersData[r] = A;
    }
}
function Ne(e) {
    return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop };
}
function Pe(e) {
    return e === _(e) || !y(e) ? z(e) : Ne(e);
}
function Fe(e) {
    var t = e.getBoundingClientRect(),
        n = Z(t.width) / e.offsetWidth || 1,
        r = Z(t.height) / e.offsetHeight || 1;
    return n !== 1 || r !== 1;
}
function Ie(e, t, n) {
    n === void 0 && (n = !1);
    var r = y(t),
        i = y(t) && Fe(t),
        a = j(t),
        o = E(e, i, n),
        s = { scrollLeft: 0, scrollTop: 0 },
        c = { x: 0, y: 0 };
    return (
        (r || (!r && !n)) &&
            ((g(t) !== `body` || he(a)) && (s = Pe(t)),
            y(t)
                ? ((c = E(t, !0)), (c.x += t.clientLeft), (c.y += t.clientTop))
                : a && (c.x = fe(a))),
        {
            x: o.left + s.scrollLeft - c.x,
            y: o.top + s.scrollTop - c.y,
            width: o.width,
            height: o.height,
        }
    );
}
function Le(e) {
    var t = new Map(),
        n = new Set(),
        r = [];
    e.forEach(function (e) {
        t.set(e.name, e);
    });
    function i(e) {
        (n.add(e.name),
            [].concat(e.requires || [], e.requiresIfExists || []).forEach(function (e) {
                if (!n.has(e)) {
                    var r = t.get(e);
                    r && i(r);
                }
            }),
            r.push(e));
    }
    return (
        e.forEach(function (e) {
            n.has(e.name) || i(e);
        }),
        r
    );
}
function Re(e) {
    var t = Le(e);
    return mt.reduce(function (e, n) {
        return e.concat(
            t.filter(function (e) {
                return e.phase === n;
            }),
        );
    }, []);
}
function ze(e) {
    var t;
    return function () {
        return (
            (t ||= new Promise(function (n) {
                Promise.resolve().then(function () {
                    ((t = void 0), n(e()));
                });
            })),
            t
        );
    };
}
function Be(e) {
    var t = e.reduce(function (e, t) {
        var n = e[t.name];
        return (
            (e[t.name] = n
                ? Object.assign({}, n, t, {
                      options: Object.assign({}, n.options, t.options),
                      data: Object.assign({}, n.data, t.data),
                  })
                : t),
            e
        );
    }, {});
    return Object.keys(t).map(function (e) {
        return t[e];
    });
}
function Ve() {
    return ![...arguments].some(function (e) {
        return !(e && typeof e.getBoundingClientRect == `function`);
    });
}
function He(e) {
    e === void 0 && (e = {});
    var t = e,
        n = t.defaultModifiers,
        r = n === void 0 ? [] : n,
        i = t.defaultOptions,
        a = i === void 0 ? At : i;
    return function (e, t, n) {
        n === void 0 && (n = a);
        var i = {
                placement: `bottom`,
                orderedModifiers: [],
                options: Object.assign({}, At, a),
                modifiersData: {},
                elements: { reference: e, popper: t },
                attributes: {},
                styles: {},
            },
            o = [],
            s = !1,
            c = {
                state: i,
                setOptions: function (n) {
                    var o = typeof n == `function` ? n(i.options) : n;
                    (u(),
                        (i.options = Object.assign({}, a, i.options, o)),
                        (i.scrollParents = {
                            reference: v(e)
                                ? B(e)
                                : e.contextElement
                                  ? B(e.contextElement)
                                  : [],
                            popper: B(t),
                        }));
                    var s = Re(Be([].concat(r, i.options.modifiers)));
                    return (
                        (i.orderedModifiers = s.filter(function (e) {
                            return e.enabled;
                        })),
                        l(),
                        c.update()
                    );
                },
                forceUpdate: function () {
                    if (!s) {
                        var e = i.elements,
                            t = e.reference,
                            n = e.popper;
                        if (Ve(t, n)) {
                            ((i.rects = {
                                reference: Ie(t, F(n), i.options.strategy === `fixed`),
                                popper: D(n),
                            }),
                                (i.reset = !1),
                                (i.placement = i.options.placement),
                                i.orderedModifiers.forEach(function (e) {
                                    return (i.modifiersData[e.name] = Object.assign(
                                        {},
                                        e.data,
                                    ));
                                }));
                            for (var r = 0; r < i.orderedModifiers.length; r++) {
                                if (i.reset === !0) {
                                    ((i.reset = !1), (r = -1));
                                    continue;
                                }
                                var a = i.orderedModifiers[r],
                                    o = a.fn,
                                    l = a.options,
                                    u = l === void 0 ? {} : l,
                                    d = a.name;
                                typeof o == `function` &&
                                    (i =
                                        o({
                                            state: i,
                                            options: u,
                                            name: d,
                                            instance: c,
                                        }) || i);
                            }
                        }
                    }
                },
                update: ze(function () {
                    return new Promise(function (e) {
                        (c.forceUpdate(), e(i));
                    });
                }),
                destroy: function () {
                    (u(), (s = !0));
                },
            };
        if (!Ve(e, t)) return c;
        c.setOptions(n).then(function (e) {
            !s && n.onFirstUpdate && n.onFirstUpdate(e);
        });
        function l() {
            i.orderedModifiers.forEach(function (e) {
                var t = e.name,
                    n = e.options,
                    r = n === void 0 ? {} : n,
                    a = e.effect;
                if (typeof a == `function`) {
                    var s = a({ state: i, name: t, instance: c, options: r });
                    o.push(s || function () {});
                }
            });
        }
        function u() {
            (o.forEach(function (e) {
                return e();
            }),
                (o = []));
        }
        return c;
    };
}
function Ue(e) {
    var t = W.useRef(e);
    return (
        (t.current = e),
        W.useCallback(function () {
            return t.current;
        }, [])
    );
}
function We(e) {
    var t = e.initial,
        n = e.value,
        r = e.onChange,
        i = r === void 0 ? Ft : r;
    if (t === void 0 && n === void 0)
        throw TypeError(
            `Either "value" or "initial" variable must be set. Now both are undefined`,
        );
    var a = W.useState(t),
        o = a[0],
        s = a[1],
        c = Ue(o),
        l = W.useCallback(
            function (e) {
                var t = c(),
                    n = typeof e == `function` ? e(t) : e;
                (typeof n.persist == `function` && n.persist(),
                    s(n),
                    typeof i == `function` && i(n));
            },
            [c, i],
        ),
        u = n !== void 0;
    return [u ? n : o, u ? i : l];
}
function Ge(e, t) {
    return (
        e === void 0 && (e = 0),
        t === void 0 && (t = 0),
        function () {
            return {
                width: 0,
                height: 0,
                top: t,
                right: e,
                bottom: t,
                left: e,
                x: 0,
                y: 0,
                toJSON: function () {
                    return null;
                },
            };
        }
    );
}
function Ke(e, t) {
    var n, r, i;
    (e === void 0 && (e = {}), t === void 0 && (t = {}));
    var a = Object.keys(Rt).reduce(function (e, t) {
            var n;
            return s({}, e, ((n = {}), (n[t] = e[t] === void 0 ? Rt[t] : e[t]), n));
        }, e),
        o = W.useMemo(
            function () {
                return [{ name: `offset`, options: { offset: a.offset } }];
            },
            Array.isArray(a.offset) ? a.offset : [],
        ),
        c = s({}, t, {
            placement: t.placement || a.placement,
            modifiers: t.modifiers || o,
        }),
        l = W.useState(null),
        u = l[0],
        d = l[1],
        f = W.useState(null),
        p = f[0],
        m = f[1],
        g = We({
            initial: a.defaultVisible,
            value: a.visible,
            onChange: a.onVisibleChange,
        }),
        _ = g[0],
        v = g[1],
        y = W.useRef();
    W.useEffect(function () {
        return function () {
            return clearTimeout(y.current);
        };
    }, []);
    var b = Pt(a.followCursor ? Lt : u, p, c),
        x = b.styles,
        S = b.attributes,
        C = h(b, It),
        w = C.update,
        T = Ue({ visible: _, triggerRef: u, tooltipRef: p, finalConfig: a }),
        E = W.useCallback(
            function (e) {
                return Array.isArray(a.trigger) ? a.trigger.includes(e) : a.trigger === e;
            },
            Array.isArray(a.trigger) ? a.trigger : [a.trigger],
        ),
        D = W.useCallback(
            function () {
                (clearTimeout(y.current),
                    (y.current = window.setTimeout(function () {
                        return v(!1);
                    }, a.delayHide)));
            },
            [a.delayHide, v],
        ),
        O = W.useCallback(
            function () {
                (clearTimeout(y.current),
                    (y.current = window.setTimeout(function () {
                        return v(!0);
                    }, a.delayShow)));
            },
            [a.delayShow, v],
        ),
        k = W.useCallback(
            function () {
                T().visible ? D() : O();
            },
            [T, D, O],
        );
    (W.useEffect(
        function () {
            if (T().finalConfig.closeOnOutsideClick) {
                var e = function (e) {
                    var t,
                        n = T(),
                        r = n.tooltipRef,
                        i = n.triggerRef,
                        a =
                            (e.composedPath == null || (t = e.composedPath()) == null
                                ? void 0
                                : t[0]) || e.target;
                    a instanceof Node &&
                        r != null &&
                        i != null &&
                        !r.contains(a) &&
                        !i.contains(a) &&
                        D();
                };
                return (
                    document.addEventListener(`mousedown`, e),
                    function () {
                        return document.removeEventListener(`mousedown`, e);
                    }
                );
            }
        },
        [T, D],
    ),
        W.useEffect(
            function () {
                if (!(u == null || !E(`click`)))
                    return (
                        u.addEventListener(`click`, k),
                        function () {
                            return u.removeEventListener(`click`, k);
                        }
                    );
            },
            [u, E, k],
        ),
        W.useEffect(
            function () {
                if (!(u == null || !E(`double-click`)))
                    return (
                        u.addEventListener(`dblclick`, k),
                        function () {
                            return u.removeEventListener(`dblclick`, k);
                        }
                    );
            },
            [u, E, k],
        ),
        W.useEffect(
            function () {
                if (!(u == null || !E(`right-click`))) {
                    var e = function (e) {
                        (e.preventDefault(), k());
                    };
                    return (
                        u.addEventListener(`contextmenu`, e),
                        function () {
                            return u.removeEventListener(`contextmenu`, e);
                        }
                    );
                }
            },
            [u, E, k],
        ),
        W.useEffect(
            function () {
                if (!(u == null || !E(`focus`)))
                    return (
                        u.addEventListener(`focus`, O),
                        u.addEventListener(`blur`, D),
                        function () {
                            (u.removeEventListener(`focus`, O),
                                u.removeEventListener(`blur`, D));
                        }
                    );
            },
            [u, E, O, D],
        ),
        W.useEffect(
            function () {
                if (!(u == null || !E(`hover`)))
                    return (
                        u.addEventListener(`mouseenter`, O),
                        u.addEventListener(`mouseleave`, D),
                        function () {
                            (u.removeEventListener(`mouseenter`, O),
                                u.removeEventListener(`mouseleave`, D));
                        }
                    );
            },
            [u, E, O, D],
        ),
        W.useEffect(
            function () {
                if (!(p == null || !E(`hover`) || !T().finalConfig.interactive))
                    return (
                        p.addEventListener(`mouseenter`, O),
                        p.addEventListener(`mouseleave`, D),
                        function () {
                            (p.removeEventListener(`mouseenter`, O),
                                p.removeEventListener(`mouseleave`, D));
                        }
                    );
            },
            [p, E, O, D, T],
        ));
    var A =
        C == null ||
        (n = C.state) == null ||
        (r = n.modifiersData) == null ||
        (i = r.hide) == null
            ? void 0
            : i.isReferenceHidden;
    return (
        W.useEffect(
            function () {
                a.closeOnTriggerHidden && A && D();
            },
            [a.closeOnTriggerHidden, D, A],
        ),
        W.useEffect(
            function () {
                if (!a.followCursor || u == null) return;
                function e(e) {
                    var t = e.clientX,
                        n = e.clientY;
                    ((Lt.getBoundingClientRect = Ge(t, n)), w?.());
                }
                return (
                    u.addEventListener(`mousemove`, e),
                    function () {
                        return u.removeEventListener(`mousemove`, e);
                    }
                );
            },
            [a.followCursor, u, w],
        ),
        W.useEffect(
            function () {
                if (!(p == null || w == null || a.mutationObserverOptions == null)) {
                    var e = new MutationObserver(w);
                    return (
                        e.observe(p, a.mutationObserverOptions),
                        function () {
                            return e.disconnect();
                        }
                    );
                }
            },
            [a.mutationObserverOptions, p, w],
        ),
        s(
            {
                getArrowProps: function (e) {
                    return (
                        e === void 0 && (e = {}),
                        s({}, e, S.arrow, {
                            style: s({}, e.style, x.arrow),
                            'data-popper-arrow': !0,
                        })
                    );
                },
                getTooltipProps: function (e) {
                    return (
                        e === void 0 && (e = {}),
                        s({}, e, { style: s({}, e.style, x.popper) }, S.popper, {
                            'data-popper-interactive': a.interactive,
                        })
                    );
                },
                setTooltipRef: m,
                setTriggerRef: d,
                tooltipRef: p,
                triggerRef: u,
                visible: _,
            },
            C,
        )
    );
}
var U,
    qe,
    W,
    Je,
    Ye,
    Xe,
    Ze,
    Qe,
    $e,
    et,
    tt,
    nt,
    rt,
    it,
    G,
    K,
    q,
    J,
    at,
    ot,
    Y,
    st,
    ct,
    lt,
    ut,
    dt,
    ft,
    pt,
    mt,
    ht,
    X,
    gt,
    Z,
    _t,
    vt,
    yt,
    bt,
    xt,
    St,
    Ct,
    wt,
    Tt,
    Et,
    Dt,
    Ot,
    kt,
    At,
    jt,
    Mt,
    Nt,
    Pt,
    Ft,
    It,
    Lt,
    Rt,
    zt,
    Q,
    $,
    Bt,
    Vt,
    Ht,
    Ut,
    Wt,
    Gt,
    Kt,
    qt;
t(() => {
    (m(),
        o(),
        f(),
        a(),
        (U = e(n(), 1)),
        (qe = e(p(), 1)),
        (W = e(n(), 1)),
        n(),
        (Je = e(n(), 1)),
        (Ye = e(n(), 1)),
        (Xe = e(n(), 1)),
        (Ze = e(p(), 1)),
        n(),
        c(),
        (Qe = i({
            '../../node_modules/react-fast-compare/index.js'(e, t) {
                var n = typeof Element < `u`,
                    r = typeof Map == `function`,
                    i = typeof Set == `function`,
                    a = typeof ArrayBuffer == `function` && !!ArrayBuffer.isView;
                function o(e, t) {
                    if (e === t) return !0;
                    if (e && t && typeof e == `object` && typeof t == `object`) {
                        if (e.constructor !== t.constructor) return !1;
                        var s, c, l;
                        if (Array.isArray(e)) {
                            if (((s = e.length), s != t.length)) return !1;
                            for (c = s; c-- !== 0; ) if (!o(e[c], t[c])) return !1;
                            return !0;
                        }
                        var u;
                        if (r && e instanceof Map && t instanceof Map) {
                            if (e.size !== t.size) return !1;
                            for (u = e.entries(); !(c = u.next()).done; )
                                if (!t.has(c.value[0])) return !1;
                            for (u = e.entries(); !(c = u.next()).done; )
                                if (!o(c.value[1], t.get(c.value[0]))) return !1;
                            return !0;
                        }
                        if (i && e instanceof Set && t instanceof Set) {
                            if (e.size !== t.size) return !1;
                            for (u = e.entries(); !(c = u.next()).done; )
                                if (!t.has(c.value[0])) return !1;
                            return !0;
                        }
                        if (a && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
                            if (((s = e.length), s != t.length)) return !1;
                            for (c = s; c-- !== 0; ) if (e[c] !== t[c]) return !1;
                            return !0;
                        }
                        if (e.constructor === RegExp)
                            return e.source === t.source && e.flags === t.flags;
                        if (
                            e.valueOf !== Object.prototype.valueOf &&
                            typeof e.valueOf == `function` &&
                            typeof t.valueOf == `function`
                        )
                            return e.valueOf() === t.valueOf();
                        if (
                            e.toString !== Object.prototype.toString &&
                            typeof e.toString == `function` &&
                            typeof t.toString == `function`
                        )
                            return e.toString() === t.toString();
                        if (
                            ((l = Object.keys(e)),
                            (s = l.length),
                            s !== Object.keys(t).length)
                        )
                            return !1;
                        for (c = s; c-- !== 0; )
                            if (!Object.prototype.hasOwnProperty.call(t, l[c])) return !1;
                        if (n && e instanceof Element) return !1;
                        for (c = s; c-- !== 0; )
                            if (
                                !(
                                    (l[c] === `_owner` ||
                                        l[c] === `__v` ||
                                        l[c] === `__o`) &&
                                    e.$$typeof
                                ) &&
                                !o(e[l[c]], t[l[c]])
                            )
                                return !1;
                        return !0;
                    }
                    return e !== e && t !== t;
                }
                t.exports = function (e, t) {
                    try {
                        return o(e, t);
                    } catch (e) {
                        if ((e.message || ``).match(/stack|recursion/i))
                            return (
                                console.warn(
                                    `react-fast-compare cannot handle circular refs`,
                                ),
                                !1
                            );
                        throw e;
                    }
                };
            },
        })),
        ($e = i({
            '../../node_modules/warning/warning.js'(e, t) {
                var n = !1,
                    r = function () {};
                n &&
                    ((i = function (e, t) {
                        var n = arguments.length;
                        t = Array(n > 1 ? n - 1 : 0);
                        for (var r = 1; r < n; r++) t[r - 1] = arguments[r];
                        var i = 0,
                            a =
                                `Warning: ` +
                                e.replace(/%s/g, function () {
                                    return t[i++];
                                });
                        typeof console < `u` && console.error(a);
                        try {
                            throw Error(a);
                        } catch {}
                    }),
                    (r = function (e, t, n) {
                        var r = arguments.length;
                        n = Array(r > 2 ? r - 2 : 0);
                        for (var a = 2; a < r; a++) n[a - 2] = arguments[a];
                        if (t === void 0)
                            throw Error(
                                '`warning(condition, format, ...args)` requires a warning message argument',
                            );
                        e || i.apply(null, [t].concat(n));
                    }));
                var i;
                t.exports = r;
            },
        })),
        (et = r(d(), 1)),
        ({ deprecate: tt } = __STORYBOOK_MODULE_CLIENT_LOGGER__),
        ({ global: nt } = __STORYBOOK_MODULE_GLOBAL__),
        Je.createContext(),
        Je.createContext(),
        (rt = function (e) {
            return e.reduce(function (e, t) {
                var n = t[0];
                return ((e[n] = t[1]), e);
            }, {});
        }),
        (it =
            typeof window < `u` && window.document && window.document.createElement
                ? Ye.useLayoutEffect
                : Ye.useEffect),
        (G = `top`),
        (K = `bottom`),
        (q = `right`),
        (J = `left`),
        (at = `auto`),
        (ot = [G, K, q, J]),
        (Y = `start`),
        (st = `end`),
        (ct = `clippingParents`),
        (lt = `viewport`),
        (ut = `popper`),
        (dt = `reference`),
        (ft = ot.reduce(function (e, t) {
            return e.concat([t + `-` + Y, t + `-` + st]);
        }, [])),
        (pt = [].concat(ot, [at]).reduce(function (e, t) {
            return e.concat([t, t + `-` + Y, t + `-` + st]);
        }, [])),
        (mt = [
            `beforeRead`,
            `read`,
            `afterRead`,
            `beforeMain`,
            `main`,
            `afterMain`,
            `beforeWrite`,
            `write`,
            `afterWrite`,
        ]),
        (ht = {
            name: `applyStyles`,
            enabled: !0,
            phase: `write`,
            fn: x,
            effect: S,
            requires: [`computeStyles`],
        }),
        (X = Math.max),
        (gt = Math.min),
        (Z = Math.round),
        (_t = function (e, t) {
            return (
                (e =
                    typeof e == `function`
                        ? e(Object.assign({}, t.rects, { placement: t.placement }))
                        : e),
                re(typeof e == `number` ? ie(e, ot) : e)
            );
        }),
        (vt = {
            name: `arrow`,
            enabled: !0,
            phase: `main`,
            fn: ae,
            effect: oe,
            requires: [`popperOffsets`],
            requiresIfExists: [`preventOverflow`],
        }),
        (yt = { top: `auto`, right: `auto`, bottom: `auto`, left: `auto` }),
        (bt = {
            name: `computeStyles`,
            enabled: !0,
            phase: `beforeWrite`,
            fn: le,
            data: {},
        }),
        (xt = { passive: !0 }),
        (St = {
            name: `eventListeners`,
            enabled: !0,
            phase: `write`,
            fn: function () {},
            effect: ue,
            data: {},
        }),
        (Ct = { left: `right`, right: `left`, bottom: `top`, top: `bottom` }),
        (wt = { start: `end`, end: `start` }),
        (Tt = {
            name: `flip`,
            enabled: !0,
            phase: `main`,
            fn: we,
            requiresIfExists: [`offset`],
            data: { _skip: !1 },
        }),
        (Et = {
            name: `hide`,
            enabled: !0,
            phase: `main`,
            requiresIfExists: [`preventOverflow`],
            fn: De,
        }),
        (Dt = {
            name: `offset`,
            enabled: !0,
            phase: `main`,
            requires: [`popperOffsets`],
            fn: ke,
        }),
        (Ot = { name: `popperOffsets`, enabled: !0, phase: `read`, fn: Ae, data: {} }),
        (kt = {
            name: `preventOverflow`,
            enabled: !0,
            phase: `main`,
            fn: Me,
            requiresIfExists: [`offset`],
        }),
        (At = { placement: `bottom`, modifiers: [], strategy: `absolute` }),
        He(),
        He({ defaultModifiers: [St, Ot, bt, ht] }),
        (jt = He({ defaultModifiers: [St, Ot, bt, ht, Dt, Tt, kt, vt, Et] })),
        (Mt = r(Qe())),
        (Nt = []),
        (Pt = function (e, t, n) {
            n === void 0 && (n = {});
            var r = Xe.useRef(null),
                i = {
                    onFirstUpdate: n.onFirstUpdate,
                    placement: n.placement || `bottom`,
                    strategy: n.strategy || `absolute`,
                    modifiers: n.modifiers || Nt,
                },
                a = Xe.useState({
                    styles: {
                        popper: { position: i.strategy, left: `0`, top: `0` },
                        arrow: { position: `absolute` },
                    },
                    attributes: {},
                }),
                o = a[0],
                s = a[1],
                c = Xe.useMemo(function () {
                    return {
                        name: `updateState`,
                        enabled: !0,
                        phase: `write`,
                        fn: function (e) {
                            var t = e.state,
                                n = Object.keys(t.elements);
                            Ze.flushSync(function () {
                                s({
                                    styles: rt(
                                        n.map(function (e) {
                                            return [e, t.styles[e] || {}];
                                        }),
                                    ),
                                    attributes: rt(
                                        n.map(function (e) {
                                            return [e, t.attributes[e]];
                                        }),
                                    ),
                                });
                            });
                        },
                        requires: [`computeStyles`],
                    };
                }, []),
                l = Xe.useMemo(
                    function () {
                        var e = {
                            onFirstUpdate: i.onFirstUpdate,
                            placement: i.placement,
                            strategy: i.strategy,
                            modifiers: [].concat(i.modifiers, [
                                c,
                                { name: `applyStyles`, enabled: !1 },
                            ]),
                        };
                        return (0, Mt.default)(r.current, e)
                            ? r.current || e
                            : ((r.current = e), e);
                    },
                    [i.onFirstUpdate, i.placement, i.strategy, i.modifiers, c],
                ),
                u = Xe.useRef();
            return (
                it(
                    function () {
                        u.current && u.current.setOptions(l);
                    },
                    [l],
                ),
                it(
                    function () {
                        if (!(e == null || t == null)) {
                            var r = (n.createPopper || jt)(e, t, l);
                            return (
                                (u.current = r),
                                function () {
                                    (r.destroy(), (u.current = null));
                                }
                            );
                        }
                    },
                    [e, t, n.createPopper],
                ),
                {
                    state: u.current ? u.current.state : null,
                    styles: o.styles,
                    attributes: o.attributes,
                    update: u.current ? u.current.update : null,
                    forceUpdate: u.current ? u.current.forceUpdate : null,
                }
            );
        }),
        r($e()),
        (Ft = function () {}),
        (It = [`styles`, `attributes`]),
        (Lt = { getBoundingClientRect: Ge() }),
        (Rt = {
            closeOnOutsideClick: !0,
            closeOnTriggerHidden: !1,
            defaultVisible: !1,
            delayHide: 0,
            delayShow: 0,
            followCursor: !1,
            interactive: !1,
            mutationObserverOptions: { attributes: !0, childList: !0, subtree: !0 },
            offset: [0, 6],
            trigger: `hover`,
        }),
        ({ document: zt } = nt),
        (Q = (0, et.default)(1e3)((e, t, n, r = 0) => (t.split(`-`)[0] === e ? n : r))),
        ($ = 8),
        (Bt = l.div(
            { position: `absolute`, borderStyle: `solid` },
            ({ placement: e }) => {
                let t = 0,
                    n = 0;
                switch (!0) {
                    case e.startsWith(`left`) || e.startsWith(`right`):
                        n = 8;
                        break;
                    case e.startsWith(`top`) || e.startsWith(`bottom`):
                        t = 8;
                        break;
                    default:
                }
                return { transform: `translate3d(${t}px, ${n}px, 0px)` };
            },
            ({ theme: e, color: t, placement: n }) => ({
                bottom: `${Q(`top`, n, `${$ * -1}px`, `auto`)}`,
                top: `${Q(`bottom`, n, `${$ * -1}px`, `auto`)}`,
                right: `${Q(`left`, n, `${$ * -1}px`, `auto`)}`,
                left: `${Q(`right`, n, `${$ * -1}px`, `auto`)}`,
                borderBottomWidth: `${Q(`top`, n, `0`, $)}px`,
                borderTopWidth: `${Q(`bottom`, n, `0`, $)}px`,
                borderRightWidth: `${Q(`left`, n, `0`, $)}px`,
                borderLeftWidth: `${Q(`right`, n, `0`, $)}px`,
                borderTopColor: Q(
                    `top`,
                    n,
                    e.color[t] || t || e.base === `light`
                        ? u(e.background.app)
                        : e.background.app,
                    `transparent`,
                ),
                borderBottomColor: Q(
                    `bottom`,
                    n,
                    e.color[t] || t || e.base === `light`
                        ? u(e.background.app)
                        : e.background.app,
                    `transparent`,
                ),
                borderLeftColor: Q(
                    `left`,
                    n,
                    e.color[t] || t || e.base === `light`
                        ? u(e.background.app)
                        : e.background.app,
                    `transparent`,
                ),
                borderRightColor: Q(
                    `right`,
                    n,
                    e.color[t] || t || e.base === `light`
                        ? u(e.background.app)
                        : e.background.app,
                    `transparent`,
                ),
            }),
        )),
        (Vt = l.div(
            ({ hidden: e }) => ({
                display: e ? `none` : `inline-block`,
                zIndex: 2147483647,
                colorScheme: `light dark`,
            }),
            ({ theme: e, color: t, hasChrome: n }) =>
                n
                    ? {
                          background:
                              (t && e.color[t]) || t || e.base === `light`
                                  ? u(e.background.app)
                                  : e.background.app,
                          filter: `
            drop-shadow(0px 5px 5px rgba(0,0,0,0.05))
            drop-shadow(0 1px 3px rgba(0,0,0,0.1))
          `,
                          borderRadius: e.appBorderRadius + 2,
                          fontSize: e.typography.size.s1,
                      }
                    : {},
        )),
        (Ht = U.forwardRef(
            (
                {
                    placement: e = `top`,
                    hasChrome: t = !0,
                    children: n,
                    arrowProps: r = {},
                    tooltipRef: i,
                    color: a,
                    withArrows: o,
                    ...s
                },
                c,
            ) =>
                U.createElement(
                    Vt,
                    { 'data-testid': `tooltip`, hasChrome: t, ref: c, ...s, color: a },
                    t && o && U.createElement(Bt, { placement: e, ...r, color: a }),
                    n,
                ),
        )),
        (Ht.displayName = `Tooltip`),
        (Ut = l.div`
  display: inline-block;
  cursor: ${(e) => (e.trigger === `hover` || e.trigger?.includes(`hover`) ? `default` : `pointer`)};
`),
        (Wt = l.g`
  cursor: ${(e) => (e.trigger === `hover` || e.trigger?.includes(`hover`) ? `default` : `pointer`)};
`),
        (Gt = ({
            svg: e = !1,
            trigger: t = `click`,
            closeOnOutsideClick: n = !1,
            placement: r = `top`,
            modifiers: i = [
                { name: `preventOverflow`, options: { padding: 8 } },
                { name: `offset`, options: { offset: [8, 8] } },
                { name: `arrow`, options: { padding: 8 } },
            ],
            hasChrome: a = !0,
            defaultVisible: o = !1,
            withArrows: s,
            offset: c,
            tooltip: l,
            children: u,
            closeOnTriggerHidden: d,
            mutationObserverOptions: f,
            delayHide: p = t === `hover` ? 200 : 0,
            visible: m,
            interactive: h,
            delayShow: g = t === `hover` ? 400 : 0,
            strategy: _,
            followCursor: v,
            onVisibleChange: y,
            portalContainer: b,
            ...x
        }) => {
            let S = e ? Wt : Ut,
                {
                    getArrowProps: C,
                    getTooltipProps: w,
                    setTooltipRef: T,
                    setTriggerRef: E,
                    visible: D,
                    state: O,
                } = Ke(
                    {
                        trigger: t,
                        placement: r,
                        defaultVisible: o,
                        delayHide: p,
                        interactive: h,
                        closeOnOutsideClick: n,
                        closeOnTriggerHidden: d,
                        onVisibleChange: y,
                        delayShow: g,
                        followCursor: v,
                        mutationObserverOptions: f,
                        visible: m,
                        offset: c,
                    },
                    { modifiers: i, strategy: _ },
                ),
                k = (typeof b == `string` ? zt.querySelector(b) : b) || zt.body,
                A = D
                    ? U.createElement(
                          Ht,
                          {
                              placement: O?.placement,
                              ref: T,
                              hasChrome: a,
                              arrowProps: C(),
                              withArrows: s,
                              ...w(),
                          },
                          typeof l == `function` ? l({ onHide: () => y(!1) }) : l,
                      )
                    : null;
            return U.createElement(
                U.Fragment,
                null,
                U.createElement(S, { trigger: t, ref: E, ...x }, u),
                D && qe.createPortal(A, k),
            );
        }),
        (Kt = ({ startOpen: e = !1, onVisibleChange: t, ...n }) => {
            let [r, i] = (0, U.useState)(e),
                a = (0, U.useCallback)(
                    (e) => {
                        (t && t(e) === !1) || i(e);
                    },
                    [t],
                );
            return (
                (0, U.useEffect)(() => {
                    let e = () => a(!1),
                        t = (t) => {
                            t.key === `Escape` && e();
                        };
                    zt.addEventListener(`keydown`, t, !1);
                    let n = Array.from(zt.getElementsByTagName(`iframe`)),
                        r = [];
                    return (
                        n.forEach((t) => {
                            let n = () => {
                                try {
                                    t.contentWindow.document &&
                                        (t.contentWindow.document.addEventListener(
                                            `click`,
                                            e,
                                        ),
                                        r.push(() => {
                                            try {
                                                t.contentWindow.document.removeEventListener(
                                                    `click`,
                                                    e,
                                                );
                                            } catch {}
                                        }));
                                } catch {}
                            };
                            (n(),
                                t.addEventListener(`load`, n),
                                r.push(() => {
                                    t.removeEventListener(`load`, n);
                                }));
                        }),
                        () => {
                            (zt.removeEventListener(`keydown`, t),
                                r.forEach((e) => {
                                    e();
                                }));
                        }
                    );
                }),
                U.createElement(Gt, { ...n, visible: r, onVisibleChange: a })
            );
        }),
        (qt = (e) => (
            tt(
                `WithTooltipPure is deprecated and will be removed in Storybook 11. Please use WithTooltip instead.`,
            ),
            U.createElement(Gt, { 'data-deprecated': `WithTooltipPure`, ...e })
        )));
})();
export { Kt as WithTooltip, qt as WithTooltipPure };
