"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = common_vendor.defineComponent({
  emits: ["close", "clickMask"],
  data() {
    return {
      isShow: false,
      isOpen: false
    };
  },
  props: {
    maskClick: {
      type: Boolean,
      default: true
    }
  },
  watch: {
    // 设置show = true 时，如果没有 open 需要设置为 open
    isShow: {
      handler(isShow = null) {
        if (isShow && this.isOpen == false) {
          this.isOpen = true;
        }
      },
      immediate: true
    },
    // 设置isOpen = true 时，如果没有 isShow 需要设置为 isShow
    isOpen: {
      handler(isOpen = null) {
        if (isOpen && this.isShow == false) {
          this.isShow = true;
        }
      },
      immediate: true
    }
  },
  methods: {
    open() {
      this.isOpen = true;
    },
    clickMask() {
      if (this.maskClick == true) {
        this.$emit("clickMask");
        this.close();
      }
    },
    close() {
      this.isOpen = false;
      this.$emit("close");
    },
    hiden() {
      this.isShow = false;
    },
    show() {
      this.isShow = true;
    }
  }
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: $data.isOpen
  }, $data.isOpen ? {
    b: common_vendor.o(() => {
    }),
    c: common_vendor.sei(_ctx.virtualHostId, "view"),
    d: $data.isShow,
    e: common_vendor.o((...args) => $options.clickMask && $options.clickMask(...args))
  } : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map
