"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Vue = require("vue");
const constants = require("../constants.js");
const utils = require("../utils.js");
const index = require("../../../../hooks/use-popper/index.js");
const isUndefined = require("../../../../../../lodash-es/isUndefined.js");
const A = 0, B = (r) => {
  const { popperInstanceRef: d, contentRef: s, triggerRef: l, role: m } = Vue.inject(constants.POPPER_INJECTION_KEY, void 0), i = Vue.ref(), R = Vue.ref(), v = Vue.computed(() => ({
    name: "eventListeners",
    enabled: !!r.visible
  })), E = Vue.computed(() => {
    var e;
    const f = Vue.unref(i), g = (e = Vue.unref(R)) != null ? e : A;
    return {
      name: "arrow",
      enabled: !isUndefined.default(f),
      options: {
        element: f,
        padding: g
      }
    };
  }), w = Vue.computed(() => ({
    onFirstUpdate: () => {
      o();
    },
    ...utils.buildPopperOptions(r, [
      Vue.unref(E),
      Vue.unref(v)
    ])
  })), a = Vue.computed(() => utils.unwrapMeasurableEl(r.referenceEl) || Vue.unref(l)), { attributes: b, state: O, styles: P, update: o, forceUpdate: _, instanceRef: c } = index.usePopper(a, s, w);
  return Vue.watch(c, (e) => d.value = e), Vue.onMounted(() => {
    Vue.watch(() => {
      var e;
      return (e = Vue.unref(a)) == null ? void 0 : e.getBoundingClientRect();
    }, () => {
      o();
    });
  }), {
    attributes: b,
    arrowRef: i,
    contentRef: s,
    instanceRef: c,
    state: O,
    styles: P,
    role: m,
    forceUpdate: _,
    update: o
  };
};
exports.usePopperContent = B;
