"use strict";
const common_vendor = require("../../../../../../common/vendor.js");
require("../../../../../adapter-vue.js");
const TUIKit_components_TUIChat_utils_convertVoiceToText = require("../../../utils/convertVoiceToText.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "convert-content",
  props: {
    message: { default: () => ({}) },
    contentVisible: { type: Boolean }
  },
  emits: ["toggleErrorStatus"],
  setup(__props, { emit: __emit }) {
    const emits = __emit;
    const props = __props;
    const convertFinished = common_vendor.ref(false);
    const convertText = common_vendor.ref("");
    common_vendor.watch(() => props.contentVisible, (newVal) => {
      if (newVal) {
        TUIKit_components_TUIChat_utils_convertVoiceToText.convertor.get(props.message).then((text) => {
          convertFinished.value = true;
          convertText.value = text;
        }).catch((err) => {
          convertFinished.value = true;
          emits("toggleErrorStatus", true);
          convertText.value = err.message;
        });
      }
    }, {
      immediate: true
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.unref(convertFinished)
      }, common_vendor.unref(convertFinished) ? {
        b: common_vendor.t(common_vendor.unref(convertText))
      } : {}, {
        c: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.转换中")),
        d: common_vendor.unref(convertFinished) ? 1 : ""
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-02f04f6f"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-list/message-elements/message-convert/convert-content.js.map
