import { useColor as m, useWord as _, useDictRecordsFor as v, openBlock as l, createElementBlock as n, createBaseVNode as o, toDisplayString as b, unref as e, letterFilter as k, normalizeClass as x, dictRecord as c, withModifiers as g, Fragment as y, renderList as C, createBlock as w, createCommentVNode as D, normalizeStyle as S, pushScopeId as $, popScopeId as B } from "./composables-9e873712.js";
import { DictDefCard as I } from "./components.js";
import { _export_sfc as W } from "./_plugin-vue_export-helper-6a641814.js";
const h = (t) => ($("data-v-bb42b76c"), t = t(), B(), t), z = { class: "flex items-center rounded-lg capitalize mb-4" }, F = { class: "text-2xl font-bold" }, P = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "flex-1" }, null, -1)), N = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "i-la-times text-xl" }, null, -1)), R = [
  N
], V = { class: "flex flex-wrap gap-2" }, j = {
  __name: "DictWordPage",
  props: {
    hash: { type: String, default: "" }
  },
  emits: ["def", "close"],
  setup(t) {
    const d = t, p = m("light"), { word: f } = _(d.hash), a = v(d.hash);
    return (u, s) => (l(), n("div", {
      class: "flex flex-col p-4 rounded-xl",
      style: S({ backgroundColor: e(p).hex(t.hash) })
    }, [
      o("div", z, [
        o("div", F, b(e(k)(e(f))), 1),
        o("div", {
          class: x(["i-la-link link", { active: e(c).word == t.hash || e(a)[e(c).def] }]),
          onClick: s[0] || (s[0] = g((i) => e(c).word = e(c).word == t.hash ? null : t.hash, ["stop", "prevent"]))
        }, null, 2),
        P,
        o("button", {
          class: "cursor-pointer p-2",
          onClick: s[1] || (s[1] = (i) => u.$emit("close"))
        }, R)
      ]),
      o("div", V, [
        (l(!0), n(y, null, C(e(a), (i, r) => (l(), n("div", {
          class: "p-0",
          key: r
        }, [
          Object.keys(i).length > 0 ? (l(), w(e(I), {
            key: 0,
            class: "cursor-pointer",
            hash: r,
            onClick: (E) => u.$emit("def", r)
          }, null, 8, ["hash", "onClick"])) : D("", !0)
        ]))), 128))
      ])
    ], 4));
  }
}, q = /* @__PURE__ */ W(j, [["__scopeId", "data-v-bb42b76c"]]);
export {
  q as default
};
//# sourceMappingURL=DictWordPage-e175b772.js.map
