/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ custom_message; }
});

;// CONCATENATED MODULE: external "vue"
var external_vue_namespaceObject = require("vue");
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/custom-message/src/index.vue?vue&type=template&id=a3dda79e&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("transition", {
    attrs: {
      name: "extends"
    }
  }, [_c("div", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.visible,
      expression: "visible"
    }],
    staticClass: "messageBox el-message-box__wrapper message-width",
    attrs: {
      id: "messageBox",
      role: "dialog",
      "aria-modal": "true",
      tabindex: "-1",
      "aria-label": _vm.title || "dialog"
    },
    on: {
      click: _vm.cloceModal
    }
  }, [_c("div", {
    staticClass: "contain el-message-box"
  }, [_vm.title !== null ? _c("div", {
    staticClass: "el-message-box__header"
  }, [_c("div", {
    staticClass: "el-message-box__title"
  }, [_vm.icon && _vm.center ? _c("div", {
    class: ["el-message-box__status", _vm.icon]
  }) : _vm._e(), _c("span", [_vm._v(_vm._s(_vm.title))])]), _vm.showClose ? _c("button", {
    staticClass: "el-message-box__headerbtn",
    attrs: {
      type: "button",
      "aria-label": "Close"
    },
    on: {
      click: _vm.close
    }
  }, [_c("i", {
    staticClass: "el-message-box__close el-icon-close"
  })]) : _vm._e()]) : _vm._e(), _c("div", {
    staticClass: "el-message-box__content"
  }, [_c("div"), _c("div", {
    staticClass: "content el-message-box__container"
  }, [_c("div", {
    staticClass: "el-message-box__container"
  }, [_vm.icon && !_vm.center && _vm.message !== "" ? _c("div", {
    class: ["el-message-box__status", _vm.icon]
  }) : _vm._e(), _c("div", {
    staticClass: "el-message-box__message"
  }, [_vm._t("default", function () {
    return [_vm.message ? _c("div", [!_vm.dangerouslyUseHTMLString ? _c("p", [_vm._v(_vm._s(_vm.message))]) : _c("p", {
      domProps: {
        innerHTML: _vm._s(_vm.message)
      }
    })]) : _vm.isComponent ? _c("div", [_c("jdf-increased-form", {
      ref: "increaseForm",
      attrs: {
        configs: _vm.formConfigs,
        data: _vm.formData,
        formAttrs: _vm.formAttrs,
        rules: _vm.rules
      }
    })], 1) : _vm._e()];
  })], 2)])])]), _c("div", {
    staticClass: "el-message-box__btns"
  }, [_vm.showCancelButton ? _c("el-button", {
    class: [_vm.cancelButtonClasses],
    attrs: {
      loading: _vm.cancelButtonLoading,
      round: _vm.roundButton,
      size: "small"
    },
    on: {
      click: _vm.close
    }
  }, [_vm._v("\n          " + _vm._s(_vm.cancelButtonText || _vm.t("el.messagebox.cancel")) + "\n        ")]) : _vm._e(), _c("el-button", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.showConfirmButton,
      expression: "showConfirmButton"
    }],
    ref: "confirm",
    class: [_vm.confirmButtonClasses],
    attrs: {
      loading: _vm.confirmButtonLoading,
      round: _vm.roundButton,
      size: "small"
    },
    on: {
      click: _vm.confirm
    }
  }, [_vm._v("\n          " + _vm._s(_vm.confirmButtonText || _vm.t("el.messagebox.confirm")) + "\n        ")])], 1)])])]);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/custom-message/src/index.vue?vue&type=template&id=a3dda79e&

;// CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
var asyncToGenerator_namespaceObject = require("@babel/runtime/helpers/asyncToGenerator");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/regenerator"
var regenerator_namespaceObject = require("@babel/runtime/regenerator");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/custom-message/src/index.vue?vue&type=script&lang=js&


var typeMap = {
  success: 'success',
  info: 'info',
  warning: 'warning',
  error: 'error'
};
/* harmony default export */ var srcvue_type_script_lang_js_ = ({
  name: 'JdfCustomMessage',
  props: {
    center: {
      default: false,
      type: Boolean
    },
    roundButton: {
      default: false,
      type: Boolean
    }
  },
  data: function data() {
    return {
      visible: false,
      message: '',
      title: '',
      lockScroll: true,
      showCancelButton: true,
      dangerouslyUseHTMLString: false,
      isComponent: false,
      showClose: false,
      closeOnClickModal: false,
      confirmButtonText: '确认',
      cancelButtonText: '取消',
      confirmButtonClass: '',
      cancelButtonClass: '',
      confirmButtonLoading: false,
      cancelButtonLoading: false,
      showConfirmButton: true,
      type: 'success',
      // success、warning、error、info、question
      callback: null,
      beforeClose: null,
      value: '',
      formData: {}
    };
  },
  computed: {
    /**
     * 计算使用成功/失败/警告/错误icon
     */
    icon: function icon() {
      var type = this.type,
        iconClass = this.iconClass;
      return iconClass || (type && typeMap[type] ? "el-icon-".concat(typeMap[type]) : '');
    },
    /**
     * 确认按钮样式
     */
    confirmButtonClasses: function confirmButtonClasses() {
      return "el-button--primary ".concat(this.confirmButtonClass);
    },
    /**
     * 取消按钮样式
     */
    cancelButtonClasses: function cancelButtonClasses() {
      return "".concat(this.cancelButtonClass);
    }
  },
  created: function created() {
    var _this = this;
    // 是否在 MessageBox 出现时将 body 滚动锁定
    if (this.lockScroll) {
      // eslint-disable-next-line no-undef
      document.body.classList.add('messageBox-srcoll-hideen');
    }
    this.$nextTick(function () {
      _this.visible = true;
    });
  },
  methods: {
    /**
     * 校验表单
     */
    validate: function validate() {
      var _this$$refs$increaseF;
      return (_this$$refs$increaseF = this.$refs.increaseForm) === null || _this$$refs$increaseF === void 0 ? void 0 : _this$$refs$increaseF.validateBusinessForm();
    },
    /**
     * 关闭弹框事件
     * @param {*} flag 回调成功或者失败
     */
    closeMessage: function closeMessage(flag) {
      this.visible = false;
      this.callback && this.callback(flag);
      this.remove();
    },
    /**
     * 关闭按钮事件
     */
    close: function close() {
      var _this2 = this;
      this.beforeClose('close', this, function () {
        return _this2.closeMessage(false);
      });
    },
    /**
     * 点击蒙版是否要关闭
     */
    cloceModal: function cloceModal() {
      if (this.closeOnClickModal) {
        this.close();
      }
    },
    /**
     * 确认事件
     */
    confirm: function confirm() {
      var _this3 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.t0 = _this3.isComponent;
              if (!_context.t0) {
                _context.next = 4;
                break;
              }
              _context.next = 4;
              return _this3.validate();
            case 4:
              _this3.beforeClose('confrim', _this3, function () {
                return _this3.closeMessage(true);
              });
            case 5:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    // 组件移除事件
    remove: function remove() {
      var _this4 = this;
      // 等过渡效果结束后，再移除组件
      setTimeout(function () {
        _this4.$destroy(_this4);
        // eslint-disable-next-line no-undef
        document.body.classList.remove('messageBox-srcoll-hideen'); // 移除蒙版
        _this4.$el.remove(); // 移除组件 DOM
      }, 500);
    }
  }
});
;// CONCATENATED MODULE: ./packages/custom-message/src/index.vue?vue&type=script&lang=js&
 /* harmony default export */ var custom_message_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/custom-message/src/index.vue





/* normalize component */
;
var component = normalizeComponent(
  custom_message_srcvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var src = (component.exports);
;// CONCATENATED MODULE: ./packages/custom-message/src/main.js
/*
 * @Author: liujm
 * @Date: 2023-05-20 09:55:22
 * @Description: file content
 */



// 直接将Vue组件作为Vue.extend的参数
var MessageBox = external_vue_default().extend(src);

// eslint-disable-next-line consistent-return
var CustomMessage = function CustomMessage(message, title) {
  var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  return new Promise(function (resolve, reject) {
    var callback = function callback(ret) {
      // true时不用阻断直接返回
      if (ret) {
        resolve();
      } else {
        // 其它情况阻断
        reject();
      }
    };
    // eslint-disable-next-line no-undef
    var messageBox = document.querySelector('#messageBox'); // 查询页面现有的 messageBox
    if (messageBox) {
      // 如果已经存在 messageBox，则停止新的 messageBox 创建
      // eslint-disable-next-line no-promise-executor-return
      return false;
    }
    var instance = new MessageBox({
      data: {
        message: message,
        title: title,
        lockScroll: (config === null || config === void 0 ? void 0 : config.lockScroll) !== false,
        // 是否在 MessageBox 出现时将 body 滚动锁定
        dangerouslyUseHTMLString: (config === null || config === void 0 ? void 0 : config.dangerouslyUseHTMLString) || true,
        // 是否将 message 属性作为 HTML 片段处理, 默认为 false
        showCancelButton: (config === null || config === void 0 ? void 0 : config.showCancelButton) !== false,
        // 取消按钮显示隐藏，默认 true
        showClose: (config === null || config === void 0 ? void 0 : config.showClose) !== false,
        // 默认 true
        confirmButtonText: (config === null || config === void 0 ? void 0 : config.confirmButtonText) || '确认',
        // 未配置文本，默认‘确认’
        cancelButtonText: (config === null || config === void 0 ? void 0 : config.cancelButtonText) || '取消',
        // 未配置文本，默认‘取消’
        type: (config === null || config === void 0 ? void 0 : config.type) || 'success',
        // 弹窗类别
        callback: callback,
        isComponent: (config === null || config === void 0 ? void 0 : config.isComponent) || false,
        cancelButtonClass: (config === null || config === void 0 ? void 0 : config.cancelButtonClass) || '',
        confirmButtonClass: (config === null || config === void 0 ? void 0 : config.confirmButtonClass) || '',
        formConfigs: (config === null || config === void 0 ? void 0 : config.formConfigs) || [],
        formAttrs: (config === null || config === void 0 ? void 0 : config.formAttrs) || {},
        rules: (config === null || config === void 0 ? void 0 : config.rules) || {},
        beforeClose: config === null || config === void 0 ? void 0 : config.beforeClose
      }
    });
    instance.$mount(); // 挂载但是并未插入dom，是一个完整的Vue实例
    // eslint-disable-next-line no-undef
    document.body.appendChild(instance.$el); // 将dom插入body
  });
};

/* harmony default export */ var main = (CustomMessage);

;// CONCATENATED MODULE: ./packages/custom-message/index.js
/*
 * @Author: liujm
 * @Date: 2023-05-20 09:19:38
 * @Description: file content
 */

/* harmony default export */ var custom_message = (main);
module.exports = __webpack_exports__;
/******/ })()
;