import { createElementBlock as o, openBlock as r, Fragment as d, renderList as a, withModifiers as x, normalizeStyle as i, unref as e, createBlock as k, createCommentVNode as v } from "vue";
import { useColor as p, dictRecord as c, selectedUser as C } from "./composables-BAZQlC3e.js";
import { AccountAvatar as g } from "./components.js";
const _ = { class: "flex flex-wrap gap-1 m-1" }, b = ["onClick"], $ = {
  __name: "DictLinkList",
  props: {
    links: { type: [Array, Object], default: () => [] },
    type: { type: String, default: "def" },
    avatar: Boolean
  },
  emits: ["def", "word"],
  setup(n) {
    const u = p("light"), s = p("deep");
    return (f, w) => (r(), o("div", _, [
      (r(!0), o(d, null, a(n.links, (m, t) => (r(), o("div", {
        class: "p-2 rounded-xl flex gap-1 flex-wrap",
        key: t,
        style: i({ backgroundColor: t == e(c).word || t == e(c).def ? e(s).hex(t) : e(u).hex(t) }),
        onClick: x((y) => f.$emit(n.type, t), ["stop", "prevent"])
      }, [
        (r(!0), o(d, null, a(m, (y, l) => (r(), o("div", {
          class: "p-1 rounded-full",
          key: l,
          style: i({ backgroundColor: e(s).hex(l) })
        }, [
          t == e(c).word || t == e(c).def ? (r(), k(e(g), {
            key: 0,
            pub: l,
            size: 20,
            onClick: (h) => e(C).pub = l
          }, null, 8, ["pub", "onClick"])) : v("", !0)
        ], 4))), 128))
      ], 12, b))), 128))
    ]));
  }
};
export {
  $ as default
};
//# sourceMappingURL=DictLinkList-Cb0FmXjT.js.map
