import { defineComponent as a, useUser as l, openBlock as m, createElementBlock as i, createVNode as r, unref as o, withCtx as p, safeHash as f } from "./composables-Ci32s3jE.js";
import { AccountBadge as d, UserHome as $, UiPanel as w } from "./components.js";
const C = { class: "z-1000" }, h = /* @__PURE__ */ a({
  __name: "UserIcon",
  props: {
    size: { type: Number, default: 42 },
    showName: { type: Boolean, default: !0 }
  },
  emits: ["room", "user", "post", "chat"],
  setup(u) {
    const { user: s } = l();
    return (n, e) => (m(), i("div", C, [
      r(o(d), {
        class: "cursor-pointer",
        size: u.size,
        showName: u.showName,
        border: 2,
        pub: o(s).pub,
        onClick: e[0] || (e[0] = (t) => o(s).auth = !0)
      }, null, 8, ["size", "showName", "pub"]),
      r(o(w), {
        open: o(s).auth,
        onClose: e[6] || (e[6] = (t) => o(s).auth = !1)
      }, {
        default: p(() => [
          r(o($), {
            class: "max-w-600px",
            onRoom: e[1] || (e[1] = (t) => {
              n.$emit("room", t), o(s).auth = !1;
            }),
            onUser: e[2] || (e[2] = (t) => {
              n.$emit("user", t), o(s).auth = !1;
            }),
            onChat: e[3] || (e[3] = (t) => {
              n.$emit("chat", t), o(s).auth = !1;
            }),
            onClose: e[4] || (e[4] = (t) => o(s).auth = !1),
            onPost: e[5] || (e[5] = (t) => {
              n.$emit("post", o(f)(t)), o(s).auth = !1;
            })
          })
        ]),
        _: 1
      }, 8, ["open"])
    ]));
  }
});
export {
  h as default
};
//# sourceMappingURL=UserIcon-KPxCa3BE.js.map
