var W = "top", L = "bottom", S = "right", k = "left", je = "auto", fe = [W, L, S, k], Q = "start", ae = "end", mt = "clippingParents", Ze = "viewport", re = "popper", ht = "reference", Ve = fe.reduce(function(t, e) {
  return t.concat([e + "-" + Q, e + "-" + ae]);
}, []), Ye = [].concat(fe, [je]).reduce(function(t, e) {
  return t.concat([e, e + "-" + Q, e + "-" + ae]);
}, []), vt = "beforeRead", gt = "read", yt = "afterRead", bt = "beforeMain", xt = "main", wt = "afterMain", Ot = "beforeWrite", jt = "write", Et = "afterWrite", At = [vt, gt, yt, bt, xt, wt, Ot, jt, Et];
function T(t) {
  return t ? (t.nodeName || "").toLowerCase() : null;
}
function q(t) {
  if (t == null)
    return window;
  if (t.toString() !== "[object Window]") {
    var e = t.ownerDocument;
    return e && e.defaultView || window;
  }
  return t;
}
function Z(t) {
  var e = q(t).Element;
  return t instanceof e || t instanceof Element;
}
function H(t) {
  var e = q(t).HTMLElement;
  return t instanceof e || t instanceof HTMLElement;
}
function Ee(t) {
  if (typeof ShadowRoot > "u")
    return false;
  var e = q(t).ShadowRoot;
  return t instanceof e || t instanceof ShadowRoot;
}
function Dt(t) {
  var e = t.state;
  Object.keys(e.elements).forEach(function(n) {
    var r = e.styles[n] || {}, o = e.attributes[n] || {}, i = e.elements[n];
    !H(i) || !T(i) || (Object.assign(i.style, r), Object.keys(o).forEach(function(a) {
      var s = o[a];
      s === false ? i.removeAttribute(a) : i.setAttribute(a, s === true ? "" : s);
    }));
  });
}
function Pt(t) {
  var e = t.state, n = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
    Object.keys(e.elements).forEach(function(r) {
      var o = e.elements[r], i = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]), s = a.reduce(function(f, c) {
        return f[c] = "", f;
      }, {});
      !H(o) || !T(o) || (Object.assign(o.style, s), Object.keys(i).forEach(function(f) {
        o.removeAttribute(f);
      }));
    });
  };
}
var $e = { name: "applyStyles", enabled: true, phase: "write", fn: Dt, effect: Pt, requires: ["computeStyles"] };
function N(t) {
  return t.split("-")[0];
}
var J = Math.max, ge = Math.min, Y = Math.round;
function $(t, e) {
  e === void 0 && (e = false);
  var n = t.getBoundingClientRect(), r = 1, o = 1;
  if (H(t) && e) {
    var i = t.offsetHeight, a = t.offsetWidth;
    a > 0 && (r = Y(n.width) / a || 1), i > 0 && (o = Y(n.height) / i || 1);
  }
  return { width: n.width / r, height: n.height / o, top: n.top / o, right: n.right / r, bottom: n.bottom / o, left: n.left / r, x: n.left / r, y: n.top / o };
}
function Ae(t) {
  var e = $(t), n = t.offsetWidth, r = t.offsetHeight;
  return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), { x: t.offsetLeft, y: t.offsetTop, width: n, height: r };
}
function _e(t, e) {
  var n = e.getRootNode && e.getRootNode();
  if (t.contains(e))
    return true;
  if (n && Ee(n)) {
    var r = e;
    do {
      if (r && t.isSameNode(r))
        return true;
      r = r.parentNode || r.host;
    } while (r);
  }
  return false;
}
function I(t) {
  return q(t).getComputedStyle(t);
}
function Wt(t) {
  return ["table", "td", "th"].indexOf(T(t)) >= 0;
}
function U(t) {
  return ((Z(t) ? t.ownerDocument : t.document) || window.document).documentElement;
}
function ye(t) {
  return T(t) === "html" ? t : t.assignedSlot || t.parentNode || (Ee(t) ? t.host : null) || U(t);
}
function Ie(t) {
  return !H(t) || I(t).position === "fixed" ? null : t.offsetParent;
}
function kt(t) {
  var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
  if (n && H(t)) {
    var r = I(t);
    if (r.position === "fixed")
      return null;
  }
  var o = ye(t);
  for (Ee(o) && (o = o.host); H(o) && ["html", "body"].indexOf(T(o)) < 0; ) {
    var i = I(o);
    if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none")
      return o;
    o = o.parentNode;
  }
  return null;
}
function ce(t) {
  for (var e = q(t), n = Ie(t); n && Wt(n) && I(n).position === "static"; )
    n = Ie(n);
  return n && (T(n) === "html" || T(n) === "body" && I(n).position === "static") ? e : n || kt(t) || e;
}
function De(t) {
  return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function oe(t, e, n) {
  return J(t, ge(e, n));
}
function Bt(t, e, n) {
  var r = oe(t, e, n);
  return r > n ? n : r;
}
function Fe() {
  return { top: 0, right: 0, bottom: 0, left: 0 };
}
function et(t) {
  return Object.assign({}, Fe(), t);
}
function tt(t, e) {
  return e.reduce(function(n, r) {
    return n[r] = t, n;
  }, {});
}
var Rt = function(t, e) {
  return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, et(typeof t != "number" ? t : tt(t, fe));
};
function Ht(t) {
  var e, n = t.state, r = t.name, o = t.options, i = n.elements.arrow, a = n.modifiersData.popperOffsets, s = N(n.placement), f = De(s), c = [k, S].indexOf(s) >= 0, u = c ? "height" : "width";
  if (!(!i || !a)) {
    var h = Rt(o.padding, n), v = Ae(i), l = f === "y" ? W : k, m = f === "y" ? L : S, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], w = ce(i), y = w ? f === "y" ? w.clientHeight || 0 : w.clientWidth || 0 : 0, j = p / 2 - g / 2, d = h[l], b = y - v[u] - h[m], x = y / 2 - v[u] / 2 + j, O = oe(d, x, b), E = f;
    n.modifiersData[r] = (e = {}, e[E] = O, e.centerOffset = O - x, e);
  }
}
function Lt(t) {
  var e = t.state, n = t.options, r = n.element, o = r === void 0 ? "[data-popper-arrow]" : r;
  o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !_e(e.elements.popper, o) || (e.elements.arrow = o));
}
var St = { name: "arrow", enabled: true, phase: "main", fn: Ht, effect: Lt, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function _(t) {
  return t.split("-")[1];
}
var Mt = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function Ct(t) {
  var e = t.x, n = t.y, r = window, o = r.devicePixelRatio || 1;
  return { x: Y(e * o) / o || 0, y: Y(n * o) / o || 0 };
}
function Ue(t) {
  var e, n = t.popper, r = t.popperRect, o = t.placement, i = t.variation, a = t.offsets, s = t.position, f = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, h = t.isFixed, v = a.x, l = v === void 0 ? 0 : v, m = a.y, p = m === void 0 ? 0 : m, g = typeof u == "function" ? u({ x: l, y: p }) : { x: l, y: p };
  l = g.x, p = g.y;
  var w = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), j = k, d = W, b = window;
  if (c) {
    var x = ce(n), O = "clientHeight", E = "clientWidth";
    if (x === q(n) && (x = U(n), I(x).position !== "static" && s === "absolute" && (O = "scrollHeight", E = "scrollWidth")), x = x, o === W || (o === k || o === S) && i === ae) {
      d = L;
      var D = h && x === b && b.visualViewport ? b.visualViewport.height : x[O];
      p -= D - r.height, p *= f ? 1 : -1;
    }
    if (o === k || (o === W || o === L) && i === ae) {
      j = S;
      var P = h && x === b && b.visualViewport ? b.visualViewport.width : x[E];
      l -= P - r.width, l *= f ? 1 : -1;
    }
  }
  var A = Object.assign({ position: s }, c && Mt), M = u === true ? Ct({ x: l, y: p }) : { x: l, y: p };
  if (l = M.x, p = M.y, f) {
    var B;
    return Object.assign({}, A, (B = {}, B[d] = y ? "0" : "", B[j] = w ? "0" : "", B.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + l + "px, " + p + "px)" : "translate3d(" + l + "px, " + p + "px, 0)", B));
  }
  return Object.assign({}, A, (e = {}, e[d] = y ? p + "px" : "", e[j] = w ? l + "px" : "", e.transform = "", e));
}
function qt(t) {
  var e = t.state, n = t.options, r = n.gpuAcceleration, o = r === void 0 ? true : r, i = n.adaptive, a = i === void 0 ? true : i, s = n.roundOffsets, f = s === void 0 ? true : s, c = { placement: N(e.placement), variation: _(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: o, isFixed: e.options.strategy === "fixed" };
  e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Ue(Object.assign({}, c, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: f })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Ue(Object.assign({}, c, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: f })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var nt = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: qt, data: {} }, he = { passive: true };
function Nt(t) {
  var e = t.state, n = t.instance, r = t.options, o = r.scroll, i = o === void 0 ? true : o, a = r.resize, s = a === void 0 ? true : a, f = q(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  return i && c.forEach(function(u) {
    u.addEventListener("scroll", n.update, he);
  }), s && f.addEventListener("resize", n.update, he), function() {
    i && c.forEach(function(u) {
      u.removeEventListener("scroll", n.update, he);
    }), s && f.removeEventListener("resize", n.update, he);
  };
}
var rt = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
}, effect: Nt, data: {} }, Tt = { left: "right", right: "left", bottom: "top", top: "bottom" };
function ve(t) {
  return t.replace(/left|right|bottom|top/g, function(e) {
    return Tt[e];
  });
}
var Vt = { start: "end", end: "start" };
function Xe(t) {
  return t.replace(/start|end/g, function(e) {
    return Vt[e];
  });
}
function Pe(t) {
  var e = q(t), n = e.pageXOffset, r = e.pageYOffset;
  return { scrollLeft: n, scrollTop: r };
}
function We(t) {
  return $(U(t)).left + Pe(t).scrollLeft;
}
function It(t) {
  var e = q(t), n = U(t), r = e.visualViewport, o = n.clientWidth, i = n.clientHeight, a = 0, s = 0;
  return r && (o = r.width, i = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), { width: o, height: i, x: a + We(t), y: s };
}
function Ut(t) {
  var e, n = U(t), r = Pe(t), o = (e = t.ownerDocument) == null ? void 0 : e.body, i = J(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = J(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), s = -r.scrollLeft + We(t), f = -r.scrollTop;
  return I(o || n).direction === "rtl" && (s += J(n.clientWidth, o ? o.clientWidth : 0) - i), { width: i, height: a, x: s, y: f };
}
function ke(t) {
  var e = I(t), n = e.overflow, r = e.overflowX, o = e.overflowY;
  return /auto|scroll|overlay|hidden/.test(n + o + r);
}
function ot(t) {
  return ["html", "body", "#document"].indexOf(T(t)) >= 0 ? t.ownerDocument.body : H(t) && ke(t) ? t : ot(ye(t));
}
function ie(t, e) {
  var n;
  e === void 0 && (e = []);
  var r = ot(t), o = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i = q(r), a = o ? [i].concat(i.visualViewport || [], ke(r) ? r : []) : r, s = e.concat(a);
  return o ? s : s.concat(ie(ye(a)));
}
function Oe(t) {
  return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height });
}
function Xt(t) {
  var e = $(t);
  return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e;
}
function Ge(t, e) {
  return e === Ze ? Oe(It(t)) : Z(e) ? Xt(e) : Oe(Ut(U(t)));
}
function Gt(t) {
  var e = ie(ye(t)), n = ["absolute", "fixed"].indexOf(I(t).position) >= 0, r = n && H(t) ? ce(t) : t;
  return Z(r) ? e.filter(function(o) {
    return Z(o) && _e(o, r) && T(o) !== "body";
  }) : [];
}
function zt(t, e, n) {
  var r = e === "clippingParents" ? Gt(t) : [].concat(e), o = [].concat(r, [n]), i = o[0], a = o.reduce(function(s, f) {
    var c = Ge(t, f);
    return s.top = J(c.top, s.top), s.right = ge(c.right, s.right), s.bottom = ge(c.bottom, s.bottom), s.left = J(c.left, s.left), s;
  }, Ge(t, i));
  return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
function it(t) {
  var e = t.reference, n = t.element, r = t.placement, o = r ? N(r) : null, i = r ? _(r) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, f;
  switch (o) {
    case W:
      f = { x: a, y: e.y - n.height };
      break;
    case L:
      f = { x: a, y: e.y + e.height };
      break;
    case S:
      f = { x: e.x + e.width, y: s };
      break;
    case k:
      f = { x: e.x - n.width, y: s };
      break;
    default:
      f = { x: e.x, y: e.y };
  }
  var c = o ? De(o) : null;
  if (c != null) {
    var u = c === "y" ? "height" : "width";
    switch (i) {
      case Q:
        f[c] = f[c] - (e[u] / 2 - n[u] / 2);
        break;
      case ae:
        f[c] = f[c] + (e[u] / 2 - n[u] / 2);
        break;
    }
  }
  return f;
}
function se(t, e) {
  e === void 0 && (e = {});
  var n = e, r = n.placement, o = r === void 0 ? t.placement : r, i = n.boundary, a = i === void 0 ? mt : i, s = n.rootBoundary, f = s === void 0 ? Ze : s, c = n.elementContext, u = c === void 0 ? re : c, h = n.altBoundary, v = h === void 0 ? false : h, l = n.padding, m = l === void 0 ? 0 : l, p = et(typeof m != "number" ? m : tt(m, fe)), g = u === re ? ht : re, w = t.rects.popper, y = t.elements[v ? g : u], j = zt(Z(y) ? y : y.contextElement || U(t.elements.popper), a, f), d = $(t.elements.reference), b = it({ reference: d, element: w, placement: o }), x = Oe(Object.assign({}, w, b)), O = u === re ? x : d, E = { top: j.top - O.top + p.top, bottom: O.bottom - j.bottom + p.bottom, left: j.left - O.left + p.left, right: O.right - j.right + p.right }, D = t.modifiersData.offset;
  if (u === re && D) {
    var P = D[o];
    Object.keys(E).forEach(function(A) {
      var M = [S, L].indexOf(A) >= 0 ? 1 : -1, B = [W, L].indexOf(A) >= 0 ? "y" : "x";
      E[A] += P[B] * M;
    });
  }
  return E;
}
function Jt(t, e) {
  e === void 0 && (e = {});
  var n = e, r = n.placement, o = n.boundary, i = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ye : f, u = _(r), h = u ? s ? Ve : Ve.filter(function(m) {
    return _(m) === u;
  }) : fe, v = h.filter(function(m) {
    return c.indexOf(m) >= 0;
  });
  v.length === 0 && (v = h);
  var l = v.reduce(function(m, p) {
    return m[p] = se(t, { placement: p, boundary: o, rootBoundary: i, padding: a })[N(p)], m;
  }, {});
  return Object.keys(l).sort(function(m, p) {
    return l[m] - l[p];
  });
}
function Kt(t) {
  if (N(t) === je)
    return [];
  var e = ve(t);
  return [Xe(t), e, Xe(e)];
}
function Qt(t) {
  var e = t.state, n = t.options, r = t.name;
  if (!e.modifiersData[r]._skip) {
    for (var o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, h = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, m = l === void 0 ? true : l, p = n.allowedAutoPlacements, g = e.options.placement, w = N(g), y = w === g, j = f || (y || !m ? [ve(g)] : Kt(g)), d = [g].concat(j).reduce(function(G, V) {
      return G.concat(N(V) === je ? Jt(e, { placement: V, boundary: u, rootBoundary: h, padding: c, flipVariations: m, allowedAutoPlacements: p }) : V);
    }, []), b = e.rects.reference, x = e.rects.popper, O = /* @__PURE__ */ new Map(), E = true, D = d[0], P = 0; P < d.length; P++) {
      var A = d[P], M = N(A), B = _(A) === Q, F = [W, L].indexOf(M) >= 0, ee = F ? "width" : "height", R = se(e, { placement: A, boundary: u, rootBoundary: h, altBoundary: v, padding: c }), C = F ? B ? S : k : B ? L : W;
      b[ee] > x[ee] && (C = ve(C));
      var pe = ve(C), X = [];
      if (i && X.push(R[M] <= 0), s && X.push(R[C] <= 0, R[pe] <= 0), X.every(function(G) {
        return G;
      })) {
        D = A, E = false;
        break;
      }
      O.set(A, X);
    }
    if (E)
      for (var ue = m ? 3 : 1, be = function(G) {
        var V = d.find(function(de) {
          var ne = O.get(de);
          if (ne)
            return ne.slice(0, G).every(function(K) {
              return K;
            });
        });
        if (V)
          return D = V, "break";
      }, te = ue; te > 0; te--) {
        var le = be(te);
        if (le === "break")
          break;
      }
    e.placement !== D && (e.modifiersData[r]._skip = true, e.placement = D, e.reset = true);
  }
}
var Zt = { name: "flip", enabled: true, phase: "main", fn: Qt, requiresIfExists: ["offset"], data: { _skip: false } };
function ze(t, e, n) {
  return n === void 0 && (n = { x: 0, y: 0 }), { top: t.top - e.height - n.y, right: t.right - e.width + n.x, bottom: t.bottom - e.height + n.y, left: t.left - e.width - n.x };
}
function Je(t) {
  return [W, S, L, k].some(function(e) {
    return t[e] >= 0;
  });
}
function Yt(t) {
  var e = t.state, n = t.name, r = e.rects.reference, o = e.rects.popper, i = e.modifiersData.preventOverflow, a = se(e, { elementContext: "reference" }), s = se(e, { altBoundary: true }), f = ze(a, r), c = ze(s, o, i), u = Je(f), h = Je(c);
  e.modifiersData[n] = { referenceClippingOffsets: f, popperEscapeOffsets: c, isReferenceHidden: u, hasPopperEscaped: h }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": h });
}
var $t = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Yt };
function _t(t, e, n) {
  var r = N(t), o = [k, W].indexOf(r) >= 0 ? -1 : 1, i = typeof n == "function" ? n(Object.assign({}, e, { placement: t })) : n, a = i[0], s = i[1];
  return a = a || 0, s = (s || 0) * o, [k, S].indexOf(r) >= 0 ? { x: s, y: a } : { x: a, y: s };
}
function Ft(t) {
  var e = t.state, n = t.options, r = t.name, o = n.offset, i = o === void 0 ? [0, 0] : o, a = Ye.reduce(function(u, h) {
    return u[h] = _t(h, e.rects, i), u;
  }, {}), s = a[e.placement], f = s.x, c = s.y;
  e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r] = a;
}
var en = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: Ft };
function tn(t) {
  var e = t.state, n = t.name;
  e.modifiersData[n] = it({ reference: e.rects.reference, element: e.rects.popper, placement: e.placement });
}
var at = { name: "popperOffsets", enabled: true, phase: "read", fn: tn, data: {} };
function nn(t) {
  return t === "x" ? "y" : "x";
}
function rn(t) {
  var e = t.state, n = t.options, r = t.name, o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, h = n.padding, v = n.tether, l = v === void 0 ? true : v, m = n.tetherOffset, p = m === void 0 ? 0 : m, g = se(e, { boundary: f, rootBoundary: c, padding: h, altBoundary: u }), w = N(e.placement), y = _(e.placement), j = !y, d = De(w), b = nn(d), x = e.modifiersData.popperOffsets, O = e.rects.reference, E = e.rects.popper, D = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, P = typeof D == "number" ? { mainAxis: D, altAxis: D } : Object.assign({ mainAxis: 0, altAxis: 0 }, D), A = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, M = { x: 0, y: 0 };
  if (x) {
    if (i) {
      var B, F = d === "y" ? W : k, ee = d === "y" ? L : S, R = d === "y" ? "height" : "width", C = x[d], pe = C + g[F], X = C - g[ee], ue = l ? -E[R] / 2 : 0, be = y === Q ? O[R] : E[R], te = y === Q ? -E[R] : -O[R], le = e.elements.arrow, G = l && le ? Ae(le) : { width: 0, height: 0 }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : Fe(), de = V[F], ne = V[ee], K = oe(0, O[R], G[R]), st = j ? O[R] / 2 - ue - K - de - P.mainAxis : be - K - de - P.mainAxis, ft = j ? -O[R] / 2 + ue + K + ne + P.mainAxis : te + K + ne + P.mainAxis, xe = e.elements.arrow && ce(e.elements.arrow), ct = xe ? d === "y" ? xe.clientTop || 0 : xe.clientLeft || 0 : 0, Re = (B = A == null ? void 0 : A[d]) != null ? B : 0, pt = C + st - Re - ct, ut = C + ft - Re, He = oe(l ? ge(pe, pt) : pe, C, l ? J(X, ut) : X);
      x[d] = He, M[d] = He - C;
    }
    if (s) {
      var Le, lt = d === "x" ? W : k, dt = d === "x" ? L : S, z = x[b], me = b === "y" ? "height" : "width", Se = z + g[lt], Me = z - g[dt], we = [W, k].indexOf(w) !== -1, Ce = (Le = A == null ? void 0 : A[b]) != null ? Le : 0, qe = we ? Se : z - O[me] - E[me] - Ce + P.altAxis, Ne = we ? z + O[me] + E[me] - Ce - P.altAxis : Me, Te = l && we ? Bt(qe, z, Ne) : oe(l ? qe : Se, z, l ? Ne : Me);
      x[b] = Te, M[b] = Te - z;
    }
    e.modifiersData[r] = M;
  }
}
var on = { name: "preventOverflow", enabled: true, phase: "main", fn: rn, requiresIfExists: ["offset"] };
function an(t) {
  return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
}
function sn(t) {
  return t === q(t) || !H(t) ? Pe(t) : an(t);
}
function fn(t) {
  var e = t.getBoundingClientRect(), n = Y(e.width) / t.offsetWidth || 1, r = Y(e.height) / t.offsetHeight || 1;
  return n !== 1 || r !== 1;
}
function cn(t, e, n) {
  n === void 0 && (n = false);
  var r = H(e), o = H(e) && fn(e), i = U(e), a = $(t, o), s = { scrollLeft: 0, scrollTop: 0 }, f = { x: 0, y: 0 };
  return (r || !r && !n) && ((T(e) !== "body" || ke(i)) && (s = sn(e)), H(e) ? (f = $(e, true), f.x += e.clientLeft, f.y += e.clientTop) : i && (f.x = We(i))), { x: a.left + s.scrollLeft - f.x, y: a.top + s.scrollTop - f.y, width: a.width, height: a.height };
}
function pn(t) {
  var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
  t.forEach(function(i) {
    e.set(i.name, i);
  });
  function o(i) {
    n.add(i.name);
    var a = [].concat(i.requires || [], i.requiresIfExists || []);
    a.forEach(function(s) {
      if (!n.has(s)) {
        var f = e.get(s);
        f && o(f);
      }
    }), r.push(i);
  }
  return t.forEach(function(i) {
    n.has(i.name) || o(i);
  }), r;
}
function un(t) {
  var e = pn(t);
  return At.reduce(function(n, r) {
    return n.concat(e.filter(function(o) {
      return o.phase === r;
    }));
  }, []);
}
function ln(t) {
  var e;
  return function() {
    return e || (e = new Promise(function(n) {
      Promise.resolve().then(function() {
        e = void 0, n(t());
      });
    })), e;
  };
}
function dn(t) {
  var e = t.reduce(function(n, r) {
    var o = n[r.name];
    return n[r.name] = o ? Object.assign({}, o, r, { options: Object.assign({}, o.options, r.options), data: Object.assign({}, o.data, r.data) }) : r, n;
  }, {});
  return Object.keys(e).map(function(n) {
    return e[n];
  });
}
var Ke = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Qe() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  return !e.some(function(r) {
    return !(r && typeof r.getBoundingClientRect == "function");
  });
}
function Be(t) {
  t === void 0 && (t = {});
  var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, o = e.defaultOptions, i = o === void 0 ? Ke : o;
  return function(a, s, f) {
    f === void 0 && (f = i);
    var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ke, i), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, u = [], h = false, v = { state: c, setOptions: function(p) {
      var g = typeof p == "function" ? p(c.options) : p;
      m(), c.options = Object.assign({}, i, c.options, g), c.scrollParents = { reference: Z(a) ? ie(a) : a.contextElement ? ie(a.contextElement) : [], popper: ie(s) };
      var w = un(dn([].concat(r, c.options.modifiers)));
      return c.orderedModifiers = w.filter(function(y) {
        return y.enabled;
      }), l(), v.update();
    }, forceUpdate: function() {
      if (!h) {
        var p = c.elements, g = p.reference, w = p.popper;
        if (Qe(g, w)) {
          c.rects = { reference: cn(g, ce(w), c.options.strategy === "fixed"), popper: Ae(w) }, c.reset = false, c.placement = c.options.placement, c.orderedModifiers.forEach(function(E) {
            return c.modifiersData[E.name] = Object.assign({}, E.data);
          });
          for (var y = 0; y < c.orderedModifiers.length; y++) {
            if (c.reset === true) {
              c.reset = false, y = -1;
              continue;
            }
            var j = c.orderedModifiers[y], d = j.fn, b = j.options, x = b === void 0 ? {} : b, O = j.name;
            typeof d == "function" && (c = d({ state: c, options: x, name: O, instance: v }) || c);
          }
        }
      }
    }, update: ln(function() {
      return new Promise(function(p) {
        v.forceUpdate(), p(c);
      });
    }), destroy: function() {
      m(), h = true;
    } };
    if (!Qe(a, s))
      return v;
    v.setOptions(f).then(function(p) {
      !h && f.onFirstUpdate && f.onFirstUpdate(p);
    });
    function l() {
      c.orderedModifiers.forEach(function(p) {
        var g = p.name, w = p.options, y = w === void 0 ? {} : w, j = p.effect;
        if (typeof j == "function") {
          var d = j({ state: c, name: g, instance: v, options: y }), b = function() {
          };
          u.push(d || b);
        }
      });
    }
    function m() {
      u.forEach(function(p) {
        return p();
      }), u = [];
    }
    return v;
  };
}
Be();
var mn = [rt, at, nt, $e];
Be({ defaultModifiers: mn });
var hn = [rt, at, nt, $e, en, Zt, on, St, $t], vn = Be({ defaultModifiers: hn });
export {
  wt as afterMain,
  yt as afterRead,
  Et as afterWrite,
  $e as applyStyles,
  St as arrow,
  je as auto,
  fe as basePlacements,
  bt as beforeMain,
  vt as beforeRead,
  Ot as beforeWrite,
  L as bottom,
  mt as clippingParents,
  nt as computeStyles,
  vn as createPopper,
  se as detectOverflow,
  ae as end,
  rt as eventListeners,
  Zt as flip,
  $t as hide,
  k as left,
  xt as main,
  At as modifierPhases,
  en as offset,
  Ye as placements,
  re as popper,
  Be as popperGenerator,
  at as popperOffsets,
  on as preventOverflow,
  gt as read,
  ht as reference,
  S as right,
  Q as start,
  W as top,
  Ve as variationPlacements,
  Ze as viewport,
  jt as write
};
