import { defineComponent as b, computed as s, ref as y, openBlock as g, createElementBlock as h, unref as a, createElementVNode as i, normalizeStyle as k } from "vue";
import { useColor as _, gunAvatar as c, useGun as v } from "./composables-5f691338.js";
const x = ["opacity"], z = ["fill", "stroke"], w = ["xlink:href"], O = /* @__PURE__ */ b({
  __name: "SpaceGuest",
  props: {
    pub: { type: String, default: "" },
    pos: { type: Object, default: () => ({ x: 0, y: 0 }) },
    mouse: { type: Object, default: () => ({ x: 0, y: 0 }) },
    pulse: { type: Number, default: 0 },
    blink: { type: Boolean, default: !1 },
    size: { type: Number, default: 100 }
  },
  setup(l) {
    const e = l, p = 1e4, f = s(() => Date.now() - Number(e.pulse)), d = s(() => f.value > p), m = _(), n = s(() => m.hex(e.pub)), t = y(c({ pub: e.pub, size: e.size * 4 })), u = v();
    return u.user(e.pub).get("avatar").on((o) => {
      o ? u.get("#avatars").get(o).once((r) => {
        t.value = r;
      }) : t.value = c({ pub: e.pub, size: e.size * 4 });
    }), (o, r) => (g(), h("g", {
      class: "guest",
      opacity: a(d) ? 0.1 : 1
    }, [
      i("circle", {
        class: "transition duration-1000 ease-out",
        style: k({ filter: "url(#shadowButton)" }),
        r: 26,
        fill: a(n),
        "stroke-width": "8",
        "stroke-opacity": "0.5",
        stroke: l.blink ? a(n) : "transparent"
      }, null, 12, z),
      i("image", {
        "xlink:href": t.value,
        x: "-25",
        y: "-25",
        height: "50",
        width: "50",
        "clip-path": "url(#mask)"
      }, null, 8, w)
    ], 8, x));
  }
});
export {
  O as default
};
//# sourceMappingURL=SpaceGuest-5321982b.js.map
