/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var Vue = require('vue');
var cloneDeep = require('lodash/cloneDeep');
var components_configProvider_context = require('./context.js');
require('lodash');
require('../../chunks/zh_CN.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);

const ConfigProvider = Vue__default["default"].extend({
  name: "ConfigProvider",
  provide() {
    return {
      globalConfig: this.mergedGlobalConfig
    };
  },
  props: {
    globalConfig: Object
  },
  data() {
    return {
      defaultData: cloneDeep__default["default"](components_configProvider_context.defaultGlobalConfig)
    };
  },
  computed: {
    mergedGlobalConfig() {
      const mergedGlobalConfig = components_configProvider_context.mergeWith(this.defaultData, this.globalConfig);
      return mergedGlobalConfig;
    }
  },
  render() {
    const h = arguments[0];
    if (this.$slots.default.length === 1) return this.$slots.default[0];
    return h("div", [this.$slots.default]);
  }
});

exports["default"] = ConfigProvider;
//# sourceMappingURL=config-provider.js.map
