import { resolveComponent as f, openBlock as t, createElementBlock as s, createElementVNode as u, unref as e, createBlock as _, withCtx as v, withModifiers as g, createCommentVNode as b } from "vue";
import { currentRoom as k, useRoom as x, useGun as y, useUser as h, useRoomLogo as R } from "./composables-5f691338.js";
const C = { class: "flex flex-col relative items-center justify-center" }, L = ["src"], N = { class: "text-2xl" }, B = {
  key: 0,
  class: "i-la-camera"
}, S = {
  __name: "RoomLogo",
  props: {
    pub: { type: String, default: k.pub },
    size: { type: Number, default: 120 },
    pic: { type: Number, default: 200 }
  },
  setup(l) {
    const r = l, { room: c, updateRoomProfile: j } = x();
    y();
    const { user: p } = h(), { logo: n, uploadLogo: a, removeLogo: m } = R(r.pub);
    return (w, o) => {
      const d = f("form-picture");
      return t(), s("div", C, [
        u("img", {
          src: e(n) || "https://gun-vue.js.org/media/gun-vue-logo.svg"
        }, null, 8, L),
        e(c).hosts[e(p).pub] ? (t(), _(d, {
          key: 0,
          class: "absolute",
          options: { picSize: r.pic, preserveRatio: !1 },
          onUpdate: o[1] || (o[1] = (i) => e(a)(i))
        }, {
          default: v(() => [
            u("div", N, [
              e(n) ? (t(), s("div", {
                key: 1,
                class: "i-la-trash-alt",
                onClick: o[0] || (o[0] = g((i) => e(m)(), ["stop", "prevent"]))
              })) : (t(), s("div", B))
            ])
          ]),
          _: 1
        }, 8, ["options"])) : b("", !0)
      ]);
    };
  }
};
export {
  S as default
};
//# sourceMappingURL=RoomLogo-a443dd70.js.map
