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