"use strict";
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
const common_assets = require("../../../common/assets.js");
const common_vendor = require("../../../common/vendor.js");
const Icon = () => "./customer-icon.js";
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
const _sfc_main = {
  components: {
    Icon
  },
  props: {
    payload: {
      type: Object,
      default: () => ({})
    }
  },
  emits: ["sendMessage"],
  setup(props, { emit }) {
    const content = computed(() => {
      var _a;
      return ((_a = props == null ? void 0 : props.payload) == null ? void 0 : _a.content) || {
        header: void 0,
        items: []
      };
    });
    const handleContentListItemClick = (branch) => {
      emit("sendMessage", { text: branch.content });
    };
    return {
      content,
      handleContentListItemClick,
      iconRight: common_assets.iconRight
    };
  }
};
if (!Array) {
  const _component_Icon = common_vendor.resolveComponent("Icon");
  _component_Icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: $setup.content.header || $setup.content.title
  }, $setup.content.header || $setup.content.title ? {
    b: common_vendor.t($setup.content.header || $setup.content.title)
  } : {}, {
    c: common_vendor.f($setup.content.items, (item, index, i0) => {
      return {
        a: common_vendor.t(item.content),
        b: "00f6aa80-0-" + i0,
        c: index,
        d: common_vendor.o$1(($event) => $setup.handleContentListItemClick(item), index)
      };
    }),
    d: common_vendor.p({
      src: $setup.iconRight
    }),
    e: $setup.content.header ? "1px 0 0px 0" : "0px 0 1px 0"
  });
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/components/message-branch.js.map
