import { defineComponent as p, resolveComponent as m, openBlock as i, createElementBlock as f, createVNode as r, unref as o, withCtx as d } from "vue";
import { useUser as h, safeHash as C } from "./composables-5f691338.js";
import { AccountBadge as $ } from "./components.js";
const w = { class: "z-1000" }, z = /* @__PURE__ */ p({
  __name: "UserIcon",
  props: {
    size: { type: Number, default: 42 },
    showName: { type: Boolean, default: !0 }
  },
  emits: ["room", "user", "post", "chat"],
  setup(u) {
    const { user: s } = h();
    return (n, e) => {
      const a = m("user-home"), l = m("ui-panel");
      return i(), f("div", w, [
        r(o($), {
          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(l, {
          open: o(s).auth,
          onClose: e[6] || (e[6] = (t) => o(s).auth = !1)
        }, {
          default: d(() => [
            r(a, {
              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(C)(t)), o(s).auth = !1;
              })
            })
          ]),
          _: 1
        }, 8, ["open"])
      ]);
    };
  }
});
export {
  z as default
};
//# sourceMappingURL=UserIcon-abd1042f.js.map
