import { ref } from "vue";
const d = (a, s) => {
  const o = ref(false), t = ref();
  return {
    focusStartRef: t,
    trapped: o,
    onFocusAfterReleased: (e) => {
      var n;
      ((n = e.detail) == null ? void 0 : n.focusReason) !== "pointer" && (t.value = "first", s("blur"));
    },
    onFocusAfterTrapped: () => {
      s("focus");
    },
    onFocusInTrap: (e) => {
      a.visible && !o.value && (e.target && (t.value = e.target), o.value = true);
    },
    onFocusoutPrevented: (e) => {
      a.trapping || (e.detail.focusReason === "pointer" && e.preventDefault(), o.value = false);
    },
    onReleaseRequested: () => {
      o.value = false, s("close");
    }
  };
};
export {
  d as usePopperContentFocusTrap
};
