import { defineComponent as k, inject as v, ref as y, createElementBlock as i, openBlock as a, Fragment as _, createElementVNode as t, createBlock as g, createCommentVNode as n, toDisplayString as x, unref as l, Teleport as M, createVNode as C, Transition as T, withCtx as d } from "vue";
import w from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
import "../../../hooks/useMessageDraft.js";
import "../../../hooks/useSearchModel.js";
import { useTheme as N } from "../../../hooks/useTheme.js";
/* empty css                              */
/* empty css                                              */
import { useMessageLinks as b } from "../../../hooks/messages/useMessageLinks.js";
import "../../../functions/parseMarkdown.js";
const B = ["src", "alt"], H = { class: "image-message__text-container" }, I = { key: 0 }, L = ["innerHTML"], V = ["src", "alt"], $ = /* @__PURE__ */ k({
  __name: "ReplyImageMessage",
  props: {
    message: {
      type: Object,
      required: !0
    }
  },
  setup(e) {
    const u = v("chatAppId"), { getTheme: o } = N(u), p = e, m = y(!1), { linkedHtml: f, inNewWindow: r } = b(() => p.message.text), h = () => m.value = !1;
    return (j, s) => (a(), i(_, null, [
      t("div", {
        class: "image-message__preview-button",
        onClick: s[0] || (s[0] = (c) => m.value = !0)
      }, [
        t("img", {
          class: "image-message__preview-image",
          src: e.message.url,
          alt: e.message.alt
        }, null, 8, B)
      ]),
      t("div", H, [
        e.message.header ? (a(), i("p", I, x(e.message.header), 1)) : n("", !0),
        s[2] || (s[2] = t("div", { class: "image-message__reply-description" }, [
          t("span", { class: "pi pi-camera" }),
          t("p", null, "Фотография")
        ], -1)),
        e.message.text ? (a(), i("p", {
          key: 1,
          class: "image-message__text",
          onClick: s[1] || (s[1] = //@ts-ignore
          (...c) => l(r) && l(r)(...c)),
          innerHTML: l(f)
        }, null, 8, L)) : n("", !0)
      ]),
      (a(), g(M, { to: "body" }, [
        C(T, { name: "modal-fade" }, {
          default: d(() => [
            m.value ? (a(), g(w, {
              key: 0,
              "data-theme": l(o)().theme ? l(o)().theme : "light",
              title: e.message.alt,
              onClose: h
            }, {
              default: d(() => [
                t("img", {
                  class: "image-message__modal-image",
                  src: e.message.url,
                  alt: e.message.alt
                }, null, 8, V)
              ]),
              _: 1
            }, 8, ["data-theme", "title"])) : n("", !0)
          ]),
          _: 1
        })
      ]))
    ], 64));
  }
});
export {
  $ as default
};
