import { ref as n } from "vue";
function C({
  panelRef: c,
  selectedChannelType: i,
  frozenAttribute: t
}) {
  const l = n(null), v = n(null), u = n(!1), a = n(!1), s = () => {
    u.value = !1, l.value = null, t.value = null, a.value = !1;
  };
  return {
    activeChannelType: l,
    hoveredChannel: v,
    showMenu: u,
    showSubMenu: a,
    handleChannelClick: (e) => {
      if (i.value === e && l.value === e) {
        s();
        return;
      }
      l.value = e, u.value = !0, a.value = !1, t.value = null;
    },
    closeMenu: s,
    handleClickOutside: (e) => {
      const o = c.value;
      o && !o.contains(e.target) && s();
    }
  };
}
export {
  C as useCommunicationMenu
};
