"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.js");
const sheep_hooks_useModal = require("../../hooks/useModal.js");
require("../../url/index.js");
require("../../store/index.js");
require("../../store/app.js");
require("../../api/promotion/diy.js");
require("../../request/index.js");
require("../../config/index.js");
require("../../platform/index.js");
require("../../platform/provider/wechat/index.js");
require("../../platform/provider/wechat/miniProgram.js");
require("../../api/member/auth.js");
require("../../api/member/social.js");
require("../../api/member/user.js");
require("../../platform/provider/apple/index.js");
require("../../platform/share.js");
require("../../router/index.js");
require("../../helper/throttle.js");
require("../../platform/pay.js");
require("../../helper/index.js");
require("../../helper/test.js");
require("../../helper/digit.js");
require("../../api/pay/order.js");
require("../../store/user.js");
require("../../store/cart.js");
require("../../api/trade/cart.js");
require("../../api/pay/wallet.js");
require("../../api/trade/order.js");
require("../../api/promotion/coupon.js");
require("../../store/sys.js");
require("../../store/modal.js");
require("../../config/zIndex.js");
if (!Array) {
  const _easycom_su_popup2 = common_vendor.resolveComponent("su-popup");
  _easycom_su_popup2();
}
const _easycom_su_popup = () => "../../ui/su-popup/su-popup.js";
if (!Math) {
  (_easycom_su_popup + canvasPoster)();
}
const canvasPoster = () => "./canvas-poster/index.js";
const _sfc_main = {
  __name: "s-share-modal",
  props: {
    shareInfo: {
      type: Object,
      default() {
      }
    }
  },
  setup(__props) {
    const props = __props;
    const show = common_vendor.computed(() => sheep_index.sheep.$store("modal").share);
    const shareConfig = common_vendor.computed(() => sheep_index.sheep.$store("app").platform.share);
    const SharePosterRef = common_vendor.ref("");
    const state = common_vendor.reactive({
      showShareGuide: false,
      // H5 的指引
      showPosterModal: false
      // 海报弹窗
    });
    const onShareByPoster = () => {
      sheep_hooks_useModal.closeShareModal();
      if (!sheep_index.sheep.$store("user").isLogin) {
        sheep_hooks_useModal.showAuthModal();
        return;
      }
      common_vendor.unref(SharePosterRef).getPoster();
      state.showPosterModal = true;
    };
    const onShareByForward = () => {
      sheep_hooks_useModal.closeShareModal();
    };
    const onShareByCopyLink = () => {
      sheep_index.sheep.$helper.copyText(props.shareInfo.link);
      sheep_hooks_useModal.closeShareModal();
    };
    function onCloseGuide() {
      state.showShareGuide = false;
    }
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.o(onCloseGuide),
        b: common_vendor.p({
          show: state.showShareGuide,
          showClose: false
        }),
        c: state.showShareGuide
      }, state.showShareGuide ? {
        d: common_vendor.unref(sheep_index.sheep).$url.static("/static/img/shop/share/share_guide.png")
      } : {}, {
        e: common_vendor.unref(shareConfig).methods.includes("forward")
      }, common_vendor.unref(shareConfig).methods.includes("forward") ? {
        f: common_vendor.unref(sheep_index.sheep).$url.static("/static/img/shop/share/share_wx.png"),
        g: common_vendor.o(onShareByForward)
      } : {}, {
        h: common_vendor.unref(shareConfig).methods.includes("poster")
      }, common_vendor.unref(shareConfig).methods.includes("poster") ? {
        i: common_vendor.unref(sheep_index.sheep).$url.static("/static/img/shop/share/share_poster.png"),
        j: common_vendor.o(onShareByPoster)
      } : {}, {
        k: common_vendor.unref(shareConfig).methods.includes("link")
      }, common_vendor.unref(shareConfig).methods.includes("link") ? {
        l: common_vendor.unref(sheep_index.sheep).$url.static("/static/img/shop/share/share_link.png"),
        m: common_vendor.o(onShareByCopyLink)
      } : {}, {
        n: common_vendor.o((...args) => common_vendor.unref(sheep_hooks_useModal.closeShareModal) && common_vendor.unref(sheep_hooks_useModal.closeShareModal)(...args)),
        o: common_vendor.o(common_vendor.unref(sheep_hooks_useModal.closeShareModal)),
        p: common_vendor.p({
          show: common_vendor.unref(show),
          round: "10",
          showClose: false
        }),
        q: common_vendor.sr(SharePosterRef, "a2a58660-2", {
          "k": "SharePosterRef"
        }),
        r: common_vendor.o(($event) => state.showPosterModal = false),
        s: common_vendor.p({
          show: state.showPosterModal,
          shareInfo: __props.shareInfo
        })
      });
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a2a58660"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-share-modal/s-share-modal.vue"]]);
wx.createComponent(Component);
